Skip to content

Commit

Permalink
Update deploy.sh and server.go
Browse files Browse the repository at this point in the history
  • Loading branch information
arloor committed Mar 18, 2024
1 parent d7ff59e commit 0e4ba68
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
24 changes: 13 additions & 11 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
hosts="di.arloor.dev us.arloor.dev ti.arloor.dev hk.arloor.dev sg.arloor.dev gg.arloor.dev bwg.arloor.dev"
for i in $hosts;do
ssh root@$i '
hostname
systemctl restart proxy
'
#! /bin/bash
hosts="hk.arloor.dev sg.arloor.dev di.arloor.dev us.arloor.dev gg.arloor.dev"
# echo "" > ~/.ssh/known_hosts
# for i in ${hosts}; do
# ssh-keyscan -H ${i} >> ~/.ssh/known_hosts
# done
for i in ${hosts}; do
ssh -o StrictHostKeyChecking=no root@${i} '
hostname;
systemctl restart proxygo;
podman image prune -f 2>/dev/null
podman images --digests |grep arloor/go_web_server|awk "{print \$4\" \"\$3}";
'
done

ssh [email protected] '
hostname
systemctl restart guest
'
9 changes: 5 additions & 4 deletions internal/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"go_web_server/internal/config"
"log"
"net/http"
_ "net/http/pprof"
"time"

"github.com/prometheus/client_golang/prometheus"
Expand Down Expand Up @@ -41,10 +42,10 @@ func Serve() error {
srv := &http.Server{
Addr: addr,
Handler: handler,
IdleTimeout: 30 * time.Second,
ReadHeaderTimeout: 30 * time.Second,
ReadTimeout: 30 * time.Second,
WriteTimeout: 30 * time.Second, // Set idle timeout
IdleTimeout: 31 * time.Second,
ReadHeaderTimeout: 31 * time.Second,
ReadTimeout: 31 * time.Second,
WriteTimeout: 31 * time.Second, // Set idle timeout
TLSConfig: &tls.Config{
GetCertificate: func(*tls.ClientHelloInfo) (*tls.Certificate, error) {
return load_new_cert_if_need(globalConfig.Cert,globalConfig.PrivKey)
Expand Down

0 comments on commit 0e4ba68

Please sign in to comment.