HELP : Packaging CodeX Docs for Cloudron
-
I'm making a custom package for Codex Docs https://github.com/codex-team/codex.docs
BUT ... I can't fix an issue.
I've stared at it and taken different approaches, but not getting anywhere.
So putting it out for someone to take a look if they want.My repo is at https://git.cloudron.io/timconsidine/codexdocs-cloudron.
Problems are listed in DEV-STATUS file, but repeated here.
It may be a stupid simple mistake by me but I can't see it.
There may be a more fundamental problem.So I am calling in the cavalry, and maybe someone else can see the issue.
STATUS : * App builds installs and runs PROBLEM : * Creating pages fails, with local storage and with mongodb database. * User logs in with Cloudron username/password * Empty app displayed with button to `Add a Page` * App has an extra password for editing : set for now as `codex` * App accepts edit password, but returns user to same initial page * App does not create a new page This behaviour is present both when using local file storage for pages, and when using mongodb connection. Current setup is to use mongodb The `start.sh` file should create an environment variable with db connection. The connection string is correct. But the env variable is empty. Even populating the env variable manually in Terminal when the app is running does not then allow to create a page. There may be other errors not yet discovered because user cannot get beyond adding a page.
-
@robi good question
I've separated out /app/code and /app/data
I've checked this (what feels like) a million times but may have missed something.
And using the database connection should mitigate the need for filesystem access.The logs don't show anything significant, which I would expect if there was an attempt but a failure to write something.
I have installed CodeX Docs on Easypanel and tried to compare what happens there.
Logs are very similar.Browser Dev Tools says there is a problem with cookie values, but the same is said when running the Easypanel deployment, which succeeds in creating and editing pages, so I don't think it is down to that.
-
Update :
After lots of debugging and trying different approaches, I am fairly confident that the packaging is correct.
BUT ... it seems the source repo doesn't actually create a DB or tables when the config says use mongodb.
But I might be wrong, as it doesn't work when using local storage either.
Going to have to look further in the source repo ...EDIT : correction, the DB code is there it is just not built automatically, so need to work out how to package it
-
So ... I am fairly sure that the problem in getting this working are due to the storage creation not working at runtime.
This is whether it is set tomongodb
orlocal
.
I have tried to build a script which "re-runs" the storage creation as part ofstart.sh
but it's not working, and I am not a node developer.It may be a fault of the packaging approach I have taken, but I followed the instructions closely (I Think!).
So with a heavy heart, I am parking this packaging for now.
Shame, as I really want it on Cloudron.
But I have it working in a native Docker/Traefik deployment and on Easypanel, so the RoE (return on effort) is diminishing fast.If anyone want to take over the package and fix it, whether my errors or the post-install storage building, do feel free !