Conversation
HumHub 1.20 anchors these three directories on the installation root. Uploads
and themes used to hang off the document root, which this image relocates to
/app/public and which therefore already put them on the volume - under 1.20
they resolve to /opt/humhub/{uploads,themes} inside the container layer, so
uploads are lost when the container is recreated and custom themes are not
found. The configuration directory additionally moved out of protected/.
All three are now linked into /data, which also fixes a case that was broken
before 1.20: the configuration directory is read through the real path of the
installation, not through the @config alias, so /data/config was created,
seeded and backed up but never loaded. HUMHUB_ALIASES__CONFIG only ever
redirected what goes through the alias.
Both directory layouts are linked, so the image keeps working against 1.19.
Contributor
Author
|
Built and ran locally against the core branch ( Image layout: First start against an empty volume seeds Resolution inside the running image, with a Note on the build: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prepares the image for HumHub 1.20. Not urgent for 1.19, but two of the three cases below mean data loss the moment the image is built against 1.20, so this should land before that happens.
What 1.20 changes
1.20 serves from a
public/directory and anchors paths on the installation root instead of on the document root (humhub/humhub#8459). This image relocates the document root to/app/publicviaHUMHUB_ALIASES__WEBROOT, which is exactly why uploads and themes were on the volume at all:@webroot/uploads@root/uploads/app/public/uploads→/opt/humhub/uploads@webroot/themes<root>/themes/app/public/themes→/opt/humhub/themes@webroot/assets@webroot/assets/app/public/assets— unchangedprotected/config<root>/configSo under 1.20 uploads are written into the container layer and vanish when the container is recreated, and custom themes in
/data/themesare no longer found. The configuration directory additionally moved out ofprotected/(humhub/humhub#8483).The configuration directory was already broken
Independent of 1.20:
/data/configis created by the entrypoint, seeded from the image and included inhumhub-backup.sh— but HumHub never read it.BootstrapServiceloadscommon.php,web.php,console.phpanddynamic.phpthrough the real path of the installation, not through@config, soHUMHUB_ALIASES__CONFIG=/data/configonly ever redirected what actually goes through the alias (@config/messages,@config/views, and thedynamicConfigFileparameter). Anything an operator put in/data/config/common.phpwas silently ignored.That is why this is a link and not another environment override.
The change
/opt/humhub/{config,uploads,themes}become links into/data, and what the release ships in them is kept as/opt/humhub-defaults/— the template the entrypoint seeds/datafrom, exactly as it did before.The config link is resolved at build time and covers both layouts (
/opt/humhub/configon 1.20,/opt/humhub/protected/configbefore), so the image keeps working against 1.19 and this can sit ondevelopwhileHUMHUB_GIT_BRANCHstill defaults todevelop.HUMHUB_ALIASES__CONFIG=/data/configis kept. It is redundant now that the real path leads there, but it is the explicit statement of intent and it keeps the alias correct if the link is ever absent.Behaviour change to be aware of
On 1.19 an operator may have a
/data/config/common.phpthat has been sitting there with no effect — seeded asreturn [];, possibly edited. After this change it is loaded. The seeded file is empty and the path is undocumented, so the practical risk is small, but it is a real change.Testing
enh/root-config-directoryis the core branch of humhub/humhub#8483; usenextonce it is merged. Verify that/opt/humhub/{config,uploads,themes}are links into/data, that a fresh start seeds/data/configwith the*.example.phpfiles 1.20 ships, and that an upload survivesdocker compose down && up.Not covered here
ln -s /opt/humhub/static/ /app/public/staticis a dangling link —static/moved intoprotected/humhub/back in 1.19 (humhub/humhub#8102). Pre-existing and unrelated to the directories above, so it is left for its own change.