adding gitignore and better service file

This commit is contained in:
Vicente Ferrari Smith 2025-10-04 11:36:40 +02:00
parent 65e87129a6
commit 5547e8373e
4 changed files with 6 additions and 29 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
bin/

View File

@ -1,6 +1,6 @@
svn_revision = $(shell svn info --show-item revision)
#LDFLAGS = "-X main.version=$(svn_revision)"
LDFLAGS = "-X main.version=$(svn_revision)"
build:
@echo "Building the website..."
@ -22,7 +22,7 @@ run:
production/deploy:
rsync -rP --delete bin/linux_amd64 alfheim@alfheimgame.com:/home/alfheim
rsync -P remote/production/alfheim-website.service alfheim@alfheimgame.com:/home/alfheim
ssh -t root@alfheimgame.com 'mv /home/alfheim/alfheim-website.service /etc/systemd/system && systemctl enable alfheim-website && systemctl restart alfheim-website'
ssh -t root@alfheimgame.com 'systemctl daemon-reload && systemctl stop alfheim-website.service && mv /home/alfheim/alfheim-website.service /etc/systemd/system && systemctl enable alfheim-website && systemctl restart alfheim-website'
.PHONY: production/connect
production/connect:

View File

@ -66,30 +66,6 @@ func main() {
mux := http.NewServeMux()
//rows, err := db.Query("SELECT * FROM accounts")
//if err != nil {
// log.Fatal(err)
//}
//defer rows.Close()
//accounts := make([]*Account, 0)
//for rows.Next() {
// acc := new(Account)
// err := rows.Scan(&acc.id, &acc.Username, &acc.password, &acc.Colour)
// if err != nil {
// log.Fatal(err)
// }
// accounts = append(accounts, acc)
//}
//if err = rows.Err() err != nil {
// log.Fatal(err)
//}
//for _, acc := range accounts {
// log.Println(acc)
//}
mux.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("ui/static"))))
mux.HandleFunc("/favicon.ico", favicon)

View File

@ -4,7 +4,7 @@ Description=alfheimgame.com website service
After=network-online.target
Wants=network-online.target
StartLimitIntervalSec=600
StartLimitIntervalSec=60
StartLimitBurst=5
[Service]
@ -15,8 +15,8 @@ CapabilityBoundingSet=CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_BIND_SERVICE
EnvironmentFile=/etc/environment
WorkingDirectory=/home/alfheim/linux_amd64
ExecStart=/home/alfheim/go/bin/dlv --listen=:4321 --headless=true --log=true exec /home/alfheim/linux_amd64/alfheim-website -- -production
#ExecStart=/home/alfheim/linux_amd64/alfheim-website -production
#ExecStart=/home/alfheim/go/bin/dlv --listen=:4321 --headless=true --log=true exec /home/alfheim/linux_amd64/alfheim-website -- -production
ExecStart=/home/alfheim/linux_amd64/alfheim-website -production
Restart=on-failure
RestartSec=5