Polling re-downloaded the whole store, photos included, every five
seconds. The app now checks a tiny version endpoint and only fetches the
payload when it actually moved, and the server gained request logging,
graceful shutdown, and self-hosting docs so it can run on a VPS instead
of only on localhost.
💘 Generated with Crush
Assisted-by: Crush:kimi-k3
23 lines
651 B
Desktop File
23 lines
651 B
Desktop File
[Unit]
|
|
Description=Prompt sync server
|
|
Documentation=https://gitea.tzgyn.dev/TZGyn/prompt
|
|
After=network-online.target postgresql.service
|
|
Wants=network-online.target
|
|
|
|
[Service]
|
|
# The binary is built on a Mac with:
|
|
# GOOS=linux GOARCH=arm64 go build -o prompt-sync .
|
|
ExecStart=/usr/local/bin/prompt-sync
|
|
Environment=PROMPT_SYNC_ADDR=:8080
|
|
Environment=PROMPT_SYNC_DATABASE_URL=postgres://prompt:CHANGE_ME@localhost:5432/prompt_sync?sslmode=disable
|
|
Restart=on-failure
|
|
RestartSec=2
|
|
# The server only needs to talk to Postgres and bind :8080.
|
|
NoNewPrivileges=true
|
|
PrivateTmp=true
|
|
ProtectSystem=strict
|
|
ProtectHome=true
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|