adding gitignore and better service file
This commit is contained in:
parent
65e87129a6
commit
5547e8373e
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
bin/
|
||||||
4
Makefile
4
Makefile
@ -1,6 +1,6 @@
|
|||||||
svn_revision = $(shell svn info --show-item revision)
|
svn_revision = $(shell svn info --show-item revision)
|
||||||
|
|
||||||
#LDFLAGS = "-X main.version=$(svn_revision)"
|
LDFLAGS = "-X main.version=$(svn_revision)"
|
||||||
|
|
||||||
build:
|
build:
|
||||||
@echo "Building the website..."
|
@echo "Building the website..."
|
||||||
@ -22,7 +22,7 @@ run:
|
|||||||
production/deploy:
|
production/deploy:
|
||||||
rsync -rP --delete bin/linux_amd64 alfheim@alfheimgame.com:/home/alfheim
|
rsync -rP --delete bin/linux_amd64 alfheim@alfheimgame.com:/home/alfheim
|
||||||
rsync -P remote/production/alfheim-website.service 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
|
.PHONY: production/connect
|
||||||
production/connect:
|
production/connect:
|
||||||
|
|||||||
@ -66,30 +66,6 @@ func main() {
|
|||||||
|
|
||||||
mux := http.NewServeMux()
|
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.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("ui/static"))))
|
||||||
|
|
||||||
mux.HandleFunc("/favicon.ico", favicon)
|
mux.HandleFunc("/favicon.ico", favicon)
|
||||||
|
|||||||
@ -4,7 +4,7 @@ Description=alfheimgame.com website service
|
|||||||
After=network-online.target
|
After=network-online.target
|
||||||
Wants=network-online.target
|
Wants=network-online.target
|
||||||
|
|
||||||
StartLimitIntervalSec=600
|
StartLimitIntervalSec=60
|
||||||
StartLimitBurst=5
|
StartLimitBurst=5
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
@ -15,8 +15,8 @@ CapabilityBoundingSet=CAP_NET_BIND_SERVICE
|
|||||||
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
||||||
EnvironmentFile=/etc/environment
|
EnvironmentFile=/etc/environment
|
||||||
WorkingDirectory=/home/alfheim/linux_amd64
|
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/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/linux_amd64/alfheim-website -production
|
||||||
|
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user