remote-helper
Many commands in this project only make sense on one of the two machines. Production install, systemctl, /etc/contact-form/secrets.env, and journalctl -u contact-form only run on the server. go run ./cmd/server, curl against 127.0.0.1:8080, and edits inside 07_Customers only make sense locally. Running the wrong one on the wrong host wastes time at best and breaks the live service at worst. Before any host-specific command, confirm where you are.
Detect the current machine
hostname
Match the output:
javPc— local dev machine.mail.zetunweb.com— the production server, informally called "g12".- anything else — neither dev nor prod. Stop and ask the user before running host-specific commands.
That single command is the whole check. There is no fancier signal needed: the hostnames are stable and unambiguous.
When to run the check
Run it once at the start of any task that includes commands like:
systemctl,journalctl, edits under/opt/zetun/or/etc/contact-form/— server-only.go run ./cmd/server,curl 127.0.0.1:8080, edits inside the07_Customersworking copy — local-only.ssh g12 ...— only makes sense from local; running it on the server is a no-op or worse.
If the task is purely repo-local (reading code, editing source files, running go build or go test), the host does not matter and the check can be skipped.
Cross-references
- Setup guide: the production install/deploy workflow that assumes
hostnamereturnsmail.zetunweb.com. - Local testing: the local dev workflow that assumes
hostnamereturnsjavPc, including the SSH tunnel fallback if port 587 is blocked.