Skip to content

Building the server

xNifty edited this page Sep 11, 2026 · 1 revision

Admin Site version and the in-app changelog come from the running binary. If you go build without stamping a git tag, the process reports "dev" and the changelog is empty.

The git tag is the version. Nothing in source is bumped for a release.

GitHub Release binaries (no compile)

Download the Linux or Windows server artifact from Releases. CI stamps -ldflags from the release tag. Those binaries do not need a .git directory.

You still need a built Vue UI for full mode (npm run build:web, or the web-dist-*.zip attached to the same release).

Recommended: make build from a tagged checkout

cd /path/to/ordryn
git fetch --tags          # or: git fetch <remote> --tags
git describe --tags --abbrev=0   # must print vX.Y.Z

npm run build:web
make build

That writes GoTodo (or GoTodo.exe on Windows) with -ldflags "-X GoTodo/internal/version.Version=…". Point your process manager at that file, or copy it wherever you keep the binary.

make run stamps the same way. Plain go run . does not; it then tries git describe from the process working directory.

Direct go build (systemd / separate bin dir)

Use this when you build as another user and write the binary out of the tree. Fetch tags before this command; a later git fetch does not change an already-built binary.

cd /path/to/ordryn
git fetch todo --tags     # use your remote name
VERSION=$(git describe --tags --abbrev=0)

sudo -u webusr -H nice -n 19 /usr/local/go/bin/go build \
  -buildvcs=false -p 1 \
  -ldflags "-X GoTodo/internal/version.Version=${VERSION}" \
  -o /var/www/gotodo-bin/gotodo-server \
  .

sudo systemctl restart your-unit

-buildvcs=false is fine if you pass -ldflags. Without -ldflags, Go leaves the default "dev". Runtime git describe only runs if the process working directory is a git checkout with tags; a systemd unit whose WorkingDirectory is /var/www/gotodo-bin will not see .git.

Stamp at compile time whenever the binary is copied away from the repo.

If Admin shows dev

  1. In the source tree, git describe --tags --abbrev=0 prints vX.Y.Z (not empty, not fatal: No names found).
  2. The build command includes -ldflags "-X GoTodo/internal/version.Version=…".
  3. systemd (or whatever runs the server) is using the binary you just built (ExecStart matches -o).
  4. You restarted the unit after the rebuild.

Forks report their tags, not new tags from upstream, until you fetch or create tags on that clone.

Clone this wiki locally