dunglas / frankenphp

🧟 The modern PHP app server
https://frankenphp.dev
MIT License
6.88k stars 235 forks source link

Change the location for config autosave #924

Closed jduan00 closed 3 months ago

jduan00 commented 3 months ago

Describe you feature request

I am running frankenphp in a docker built with our own Dockerfile (Ubuntu 22.04).

Since frankenphp is running as nobody, it is trying to write files to nobdy's home directory: /nonexistent. Is there a way to change this location in Caddyfile? Thanks!

{"level":"error","ts":1721023388.1792881,"msg":"unable to create folder for config autosave","dir":"/nonexistent/.config/caddy","error":"mkdir /nonexistent: permission denied"}
{"level":"info","ts":1721023388.1792912,"msg":"serving initial configuration"}
{"level":"error","ts":1721023388.1792943,"logger":"tls","msg":"could not clean default/global storage","error":"unable to acquire storage_clean lock: creating lock file: open /nonexistent/.local/share/caddy/locks/storage_clean.lock: no such file or directory"}
{"level":"info","ts":1721023388.1793005,"logger":"tls","msg":"finished cleaning storage units"}
withinboredom commented 3 months ago

Why not just change nobody's home folder?

env HOME=/my/home/folder

or

RUN usermod -d /new/home/directory nobody && chown -R nobody /new/home/directory
jduan00 commented 3 months ago

I have tried this workaround and got the Caddyfile autosave config. It helps greatly to know the setting snapshot. Thanks!