fix: set MC_CONFIG_DIR to /tmp/.mc so mc can write config as non-root #20

Merged
greg merged 1 commits from klaatu/nixos:fix/mc-config-dir into main 2026-04-04 18:23:42 +00:00
Collaborator

Problem

The upload-to-s3 container in the gitea-dump CronJob runs as UID 1000 (non-root), and mc tries to write its config to $HOME/.mc. Because HOME is unset (or /) in the container, it falls back to /.mc — which is not writable by a non-root user, causing:

mc: <ERROR> Unable to save new mc config. mkdir /.mc: permission denied.

Fix

Add MC_CONFIG_DIR: /tmp/.mc to the upload-to-s3 container env. /tmp is always writable in a container context. This is the minimal targeted fix — no logic changes.

Alternatively HOME: /tmp would work too, but MC_CONFIG_DIR is more explicit about intent.

## Problem The `upload-to-s3` container in the gitea-dump CronJob runs as UID 1000 (non-root), and `mc` tries to write its config to `$HOME/.mc`. Because `HOME` is unset (or `/`) in the container, it falls back to `/.mc` — which is not writable by a non-root user, causing: ``` mc: <ERROR> Unable to save new mc config. mkdir /.mc: permission denied. ``` ## Fix Add `MC_CONFIG_DIR: /tmp/.mc` to the `upload-to-s3` container env. `/tmp` is always writable in a container context. This is the minimal targeted fix — no logic changes. Alternatively `HOME: /tmp` would work too, but `MC_CONFIG_DIR` is more explicit about intent.
klaatu added 1 commit 2026-04-04 18:18:56 +00:00
fix: set MC_CONFIG_DIR to /tmp/.mc so mc can write config as non-root
buildbot/nix-eval Build done. (1 warning)
buildbot/nix-build Build done.
67f12856e1
greg approved these changes 2026-04-04 18:23:22 +00:00
greg merged commit 75278cdb6a into main 2026-04-04 18:23:42 +00:00
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: greg/nixos#20