Merged
Conversation
Three root causes addressed: 1. Service never started: workflow did not ship moon.service, so systemd had no unit to enable/reload. Now moon.service is included in the SCP upload and installed to /etc/systemd/system/ on every deploy, followed by daemon-reload + enable. 2. Missing environment file: /usr/local/bin/moon-env is required by the service EnvironmentFile directive. If absent systemd refuses to start. The server-side script now creates a placeholder on first run with a clear warning to set GOOGLE_MAPS_API_KEY. 3. Brittle inline sudo commands replaced by /usr/local/bin/deploy-moon: a single root-owned script installed by server-setup.sh. The sudoers entry shrinks to one line; the SSH step becomes a single call to sudo /usr/local/bin/deploy-moon. Also added proper failure output (systemctl status --lines=30) so future errors are visible in logs. Also disabled actions/setup-go cache (cache: false) to fix the intermittent tar exit-code-2 cache restore error. https://claude.ai/code/session_01SvqeKxC2hJbDnDAViSJSDk
The installed moon.service on the server differs from the repo copy: ExecStart=/var/www/moon/moon (not /usr/local/bin/moon) EnvironmentFile=/var/www/moon/.env (not /usr/local/bin/moon-env) User=james (not www-data) Changes: - deploy.yml: remove moon.service from SCP source — the installed service file is already correct and must not be overwritten - deploy-moon script: install binary to /var/www/moon/moon and web assets to /var/www/moon/; read User/Group dynamically from 'systemctl show moon' so no username is hardcoded - deploy-moon script: do not create or modify .env — it already exists at /var/www/moon/.env with the real API key https://claude.ai/code/session_01SvqeKxC2hJbDnDAViSJSDk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.