Skip to content

feat(server): seed device settings from env vars, fix admin page top padding and version - #17

Open
berglh wants to merge 1 commit into
loyalpartner:masterfrom
berglh:admin-envs
Open

berglh wants to merge 1 commit into
loyalpartner:masterfrom
berglh:admin-envs

Conversation

@berglh

@berglh berglh commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

feat(server): seed device settings from env vars, fix admin page top padding and version

  • Add SELFSYNC_ADMIN_DEVICE_LIMIT (1-1000) and SELFSYNC_ADMIN_DEVICE_APPROVAL (0/1). When set, they are written to the settings table on startup and logged at INFO; when unset, the stored value is left untouched.
  • Document both variables in README.md and README.zh-CN.md.
  • admin.html: .wrap padding overrode main padding, leaving the first card flush against the header. Use main.wrap so the top/bottom padding applies.
  • Add selfsync version to Admin UI"
  • Emit server version in INFO on startup
  • Bump version to v0.2.1

Hi @loyalpartner Lee 👋,

New feature testing

I did some testing of #16. Things seem to be working more or less as you described. There is only so much I can do locally until you publish #16 to a tag so that the ghcr.io/loyalpartner/selfsync image is published for this version.

Important

In this commit I have pushed version tags to v0.2.1 and added an INFO logging message to print selfsync version on startup as well as display in the Admin UI. Please note to update your package versions in Cargo.toml files and LazyCat package.yml so correct version is emitted.

If you are happy with this commit, you can just tag it with v0.2.1 and hopefully it will publish to the GitHub container registry/repository. I will upgrade my production server once complete.

  1. I was able to confirm automatic device and sync chain blocking as described.
  2. I was able to delete devices manually by block and the additional button to remove the device.
  3. I was not able to test from another device with distinct device ID due to limitations with sync URL support in Brave browser.
  4. Testing with another profile on the same device registered a new device, but it wasn't working - I assume because device ID is generated from the host computer the browser is running on. My guess this is fine if the device ID is distinct.

Admin configuration via env variables

Given I deploy my selfsync server in Kubernetes, configuring the server settings via ENV variables is convenient. I've added SELFSYNC_ADMIN_DEVICE_LIMIT and SELFSYNC_ADMIN_DEVICE_APPROVAL to override the settings on startup to the desired values. Updated README files to reflect behavior.

Version logging and UI

Setting values via environment will emit log events that it has occurred:

Attaching to selfsync-1
selfsync-1  | 2026-11-06T04:44:36.171353Z  INFO selfsync_server: selfsync server starting version="0.2.1"
selfsync-1  | 2026-11-06T04:44:36.172738Z  INFO selfsync_server: database connected db_path=/data/selfsync.db
selfsync-1  | 2026-11-06T04:44:36.172929Z  INFO selfsync_server: device limit set from environment limit=2
selfsync-1  | 2026-11-06T04:44:36.172998Z  INFO selfsync_server: device approval set from environment required=false
selfsync-1  | 2026-11-06T04:44:36.173125Z  WARN selfsync_server: admin page is not on loopback; protect it with an authenticating reverse proxy bind_addr=0.0.0.0:8081
selfsync-1  | 2026-11-06T04:44:36.173130Z  INFO selfsync_server: admin page listening bind_addr=0.0.0.0:8081
selfsync-1  | 2026-11-06T04:44:36.173144Z  INFO selfsync_server: selfsync server listening bind_addr=0.0.0.0:8080

The selfsync version is rendered in the header, I also standardised div spacing for the top segment:
image

Please review let me know if you want me to change anything in the commit or feel free to change by yourself.

Kind regards,
Berg

…padding and version

- Add SELFSYNC_ADMIN_DEVICE_LIMIT (1-1000) and SELFSYNC_ADMIN_DEVICE_APPROVAL
  (0/1). When set, they are written to the settings table on startup and
  logged at INFO; when unset, the stored value is left untouched.
- Document both variables in README.md and README.zh-CN.md.
- admin.html: `.wrap` padding overrode `main` padding, leaving the first card
  flush against the header. Use `main.wrap` so the top/bottom padding applies.
- admin.html: Add selfsync version to Admin UI
- Emit server version in INFO on startup
- Bump versions to v0.2.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant