-
Hi,
Since our Ghost apps were updated to 6.68 (now 6.69, package 4.200.0), adding /edit to a post URL (e.g. https://site.com/my-post/edit/) returns a 404 instead of redirecting to the editor. It happens on all our Ghost apps, on two different Cloudron servers. Standard Ghost installs and Ghost(Pro) on the same version work fine (Ghost forum thread: https://forum.ghost.org/t/edit-is-not-redirecting-toward-backoffice-anymore/63947).
Root cause, as far as I can tell from the sources:
-
start.sh rewrites the config on every boot with:
json -I -f /app/data/config.production.json -e "this.admin = '${CLOUDRON_APP_ORIGIN}'"so
adminis a string. Ghost expects an object:"admin": { "url": "..." }. Its defaults.json ships"admin": { "redirects": true, "sessionMaxAgeMs": 15552000000 }. -
Ghost only redirects /edit to the admin when
config.get('admin:redirects')is truthy. Otherwise the entry controller calls next() and you get a 404 (core/frontend/services/routing/controllers/entry.ts). -
Up to 6.67 this was harmless: nconf looked up
admin:redirectsstore by store and fell back to defaults.json. Since 6.68, Ghost builds one merged, frozen config tree (createConfig(nconf.get())in core/shared/config/loader.ts). In that merge the string replaces the whole defaultadminobject, soadmin:redirects(and probablyadmin:sessionMaxAgeMs) end up undefined.
Editing config.production.json by hand doesn't help, because start.sh overwrites it on the next restart.
Suggested fix: write
adminas an object, and convert the old string format for existing installs, e.g.json -I -f /app/data/config.production.json \ -e "this.admin = { url: '${CLOUDRON_APP_ORIGIN}' }"The "url follows admin" check above it (line ~27) would then need to compare
admin.url, or the string value forinstalls not yet migrated, againsturl.Possible workaround in the meantime (not tested yet): env vars take priority over the config file in Ghost's nconf setup, so this should restore the default:
cloudron env set --app <app> admin__redirects=true admin__sessionMaxAgeMs=15552000000Happy to test a package build if that helps.
Thanks!
-
-
J joseph moved this topic from Support on
-
-
Hello @jrl-abstract27
The update https://forum.cloudron.io/post/130902 should have resolved this issue.
Marking the topic as solved for now, but please give feedback if you can confirm the fix as well. -
J james has marked this topic as solved on
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login