Skip to content

Provision logi-owned W2MO DB folders on managed hosts - #1

Draft
jplapp wants to merge 1 commit into
mainfrom
provision-logi-db-ownership
Draft

Provision logi-owned W2MO DB folders on managed hosts#1
jplapp wants to merge 1 commit into
mainfrom
provision-logi-db-ownership

Conversation

@jplapp

@jplapp jplapp commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

What

On managed hosts that have /data/mysql_data (i.e. W2MO hosts), deploy.sh now:

  • re-owns /data/mysql_data and /data/mysql_backup to logi:logi with setgid, group-writable dirs (2775/g+rwX) — a find ! -user logi probe keeps the recursive pass a no-op on already-migrated hosts;
  • creates/normalizes the w2mo_autoupdate state dir and makes w2mo_autoupdate.conf / server.settings group-writable;
  • touches only the top level of /data/appconfig_static (setgid + group) — certs/ and everything else inside stay untouched.

No sudoers changes: this replaces the need for root in the W2MO update scripts entirely.

Why

whdb containers now run as the logi host user (logivations/deploy#358 + logivations/w2mo#27824), so DB files land logi-owned and group-writable. This is the one-time host-side migration + ongoing enforcement that lets every logi-group member update/back up/restore/prune W2MO setups with plain file operations instead of sudo.

Testing

  • Remote-body heredoc extracted and bash -n clean.
  • New block executed as root against a mock /data (root-owned 0700/0600 DB tree, config files, certs/): first run migrates to logi:logi 2775/0660, second run is a silent no-op, certs/ untouched (root:root 755).
  • Rollout note: run this before users rely on root-free updates; on hosts with a live root-mode whdb the running container keeps working (the update scripts re-own again after each update).

🤖 Generated with Claude Code

On hosts with /data/mysql_data, re-own the DB tree (and mysql_backup) to
logi:logi with setgid group-writable dirs, and make the w2mo_autoupdate
state dir and autoupdate/server config files group-writable. Together
with deploy/linux/update_w2mo.sh starting whdb as the logi user, every
logi-group member can run W2MO updates without root -- no sudoers
changes needed. A find probe keeps the recursive migration a no-op on
already-migrated hosts; /data/appconfig_static/certs stays untouched.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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