[Unit] Description=aligned.click OAuth sidecar (the only process that holds a credential) After=network.target [Service] User=aligned Group=aligned WorkingDirectory=/opt/aligned.click/auth/oauth EnvironmentFile=/opt/aligned.click/.env # The sidecar's session/state/key store must live under the one writable # subtree — its built-in default resolves to auth/private/oauth, which # ProtectSystem=strict makes read-only (every login would fail on the write). Environment=OAUTH_STORE_DIR=/opt/aligned.click/private/oauth ExecStartPre=/usr/bin/git -C /opt/aligned.click fetch origin main ExecStartPre=/usr/bin/git -C /opt/aligned.click reset --hard origin/main ExecStart=/usr/bin/node /opt/aligned.click/auth/oauth/server.mjs Restart=on-failure RestartSec=5 NoNewPrivileges=true PrivateTmp=true ProtectSystem=strict ReadWritePaths=/opt/aligned.click/private [Install] WantedBy=multi-user.target