Commit Graph

4 Commits (41ff22b0cc432543594992fc3ee390179e2b47b0)

Author SHA1 Message Date
boojack 3a55edd917 fix(scripts): prevent entrypoint restart loop when MEMOS_UID=0
The root-drop guard only checked `id -u = 0`, so when the target user was
also root (MEMOS_UID=0, common under rootless Docker with userns-remap)
su-exec re-execed back into root, re-entered the block, and looped forever
without ever reaching the memos binary — the container hung with no logs.

Add a MEMOS_ENTRYPOINT_SWITCHED marker (preserved across the su-exec
re-exec) so the privilege drop runs at most once, and log the resolved
UID:GID on startup so this path is never silent again.

Closes #6061
1 week ago
Johnny d14cfa1c4f fix: auto-fix permission issues when upgrading from 0.25.3 to 0.26.0
Fixes #5551

The Docker image now runs as non-root (UID 10001) for security, but this
breaks upgrades from 0.25.3 where data files were owned by root.

Changes:
- Dockerfile: Keep USER as root, install su-exec
- entrypoint.sh: Fix ownership of /var/opt/memos, then drop to non-root
- Supports custom MEMOS_UID/MEMOS_GID env vars for flexibility

This allows seamless upgrades without manual chown on the host.
5 months ago
lif 86013d6c2a
fix(scripts): add file existence check in file_env (#5424)
Signed-off-by: majiayu000 <1835304752@qq.com>
6 months ago
Johnny 9dde9f332f chore: move dockerfile 1 year ago