diff --git a/Makefile b/Makefile index fef4c3f..b5fc211 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,22 @@ build: @echo "Building the website..." - go build -o bin/alfheimgame + rm -rf bin + mkdir bin + mkdir bin/static + mkdir bin/ui + go build -o bin/alfheim-website cp -r ui bin cp -r static bin cp favicon.ico bin - GOOS=linux GOARCH=amd64 go build -o bin/linux_amd64/alfheimgame + cp Caddyfile bin + mkdir bin/linux_amd64 + mkdir bin/linux_amd64/static + mkdir bin/linux_amd64/ui + GOOS=linux GOARCH=amd64 go build -o bin/linux_amd64/alfheim-website cp -r ui bin/linux_amd64 cp -r static bin/linux_amd64 cp favicon.ico bin/linux_amd64 + cp Caddyfile bin/linux_amd64 run: @echo "Running the website..." @@ -19,5 +28,5 @@ deploy: .PHONY: service service: - rsync -P alfheimgame.service alfheim@alfheimgame.com:/home/alfheim - ssh -t root@alfheimgame.com 'mv /home/alfheim/alfheimgame.service /etc/systemd/system && systemctl enable alfheimgame && systemctl restart alfheimgame' + rsync -P 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' diff --git a/alfheimgame.service b/alfheim-website.service similarity index 79% rename from alfheimgame.service rename to alfheim-website.service index a13a567..c1ae528 100644 --- a/alfheimgame.service +++ b/alfheim-website.service @@ -15,8 +15,8 @@ CapabilityBoundingSet=CAP_NET_BIND_SERVICE AmbientCapabilities=CAP_NET_BIND_SERVICE EnvironmentFile=/etc/environment WorkingDirectory=/home/alfheim/linux_amd64 -#ExecStart=/go/bin/dlv --listen=:4321 --headless=true --log=true exec /home/alfheim/linux_amd64/alfheimgame -- -production -ExecStart=/home/alfheim/linux_amd64/alfheimgame -production +#ExecStart=/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 diff --git a/alfheimgame b/bin/alfheim-website similarity index 54% rename from alfheimgame rename to bin/alfheim-website index 0706ab2..4427ae2 100755 Binary files a/alfheimgame and b/bin/alfheim-website differ diff --git a/bin/linux_amd64/alfheim-website b/bin/linux_amd64/alfheim-website new file mode 100755 index 0000000..c1bd5fb Binary files /dev/null and b/bin/linux_amd64/alfheim-website differ diff --git a/bin/linux_amd64/static/style.css b/bin/linux_amd64/static/style.css index 151d90d..8044bd1 100644 --- a/bin/linux_amd64/static/style.css +++ b/bin/linux_amd64/static/style.css @@ -1,29 +1,29 @@ html { - height: 100%; - padding: 8px; /*background: no-repeat url(/static/image.png); background-size: cover; background-position: center;*/ + height: 100vh; background-color: black; box-sizing: border-box; } body { + display: flex; + flex-direction: column; + justify-content: space-between; background-color: #3475CB; font-family: "Vollkorn"; color: white; margin-top: 0px; + margin-bottom: 0px; margin-left: auto; margin-right: auto; - margin-bottom: 0px; - display: flex; - flex-direction: column; - min-height: 100%; max-width: 900px; + min-height: 100%; } header { - max-width: 100%; + } nav { @@ -65,7 +65,8 @@ nav { } main { - padding: 5px; + padding: 8px; + flex: 1; display: flex; flex-direction: column; justify-content: center; diff --git a/bin/static/style.css b/bin/static/style.css index 151d90d..8044bd1 100644 --- a/bin/static/style.css +++ b/bin/static/style.css @@ -1,29 +1,29 @@ html { - height: 100%; - padding: 8px; /*background: no-repeat url(/static/image.png); background-size: cover; background-position: center;*/ + height: 100vh; background-color: black; box-sizing: border-box; } body { + display: flex; + flex-direction: column; + justify-content: space-between; background-color: #3475CB; font-family: "Vollkorn"; color: white; margin-top: 0px; + margin-bottom: 0px; margin-left: auto; margin-right: auto; - margin-bottom: 0px; - display: flex; - flex-direction: column; - min-height: 100%; max-width: 900px; + min-height: 100%; } header { - max-width: 100%; + } nav { @@ -65,7 +65,8 @@ nav { } main { - padding: 5px; + padding: 8px; + flex: 1; display: flex; flex-direction: column; justify-content: center; diff --git a/setup.sh b/setup.sh index 505873b..ccc60f5 100644 --- a/setup.sh +++ b/setup.sh @@ -55,11 +55,11 @@ ufw --force enable apt --yes install fail2ban apt --yes install certbot -sudo apt install caddy +apt --yes install caddy # Add a DSN for connecting to the database to the system-wide environment # variables in the /etc/environment file. -echo "ALFHEIM_DB_DSN='postgres://elves_database:${DB_PASSWORD}@vicenteferrari.com/elves_database'" >> /etc/environment +echo "ALFHEIM_DB_DSN='postgres://alfheim:${DB_PASSWORD}@alfheimgame.com/alfheim'" >> /etc/environment echo "Script complete! Rebooting..." reboot