HumHub - social network software
-
@doodlemania2 Yeah for sure, I'm going to make use of those.
-
I got permission from @Sam_uk to make the repo public:
https://git.atrilahiji.dev/Alt-Ron/cloudron-humhub-appTodo:
- Properly address the update process
- See if its possible to config LDAP and SMTP automatically (this is the part I am really struggling with right now.
-
@atrilahiji said in HumHub - social network software:
this is the part I am really struggling with right now
Did you already have a look at https://github.com/humhub/docker/blob/master/docker-entrypoint.sh ?
-
@fbartels Wowee nope. Good catch lol
EDIT: You know, I have no clue why it never occurred to me that I can look for a docker version of the app.
-
I have finished getting things automated (sort of). The DB is set up on the first install, and the LDAP and SMTP configuration is set up after a re-start (and is updated after every restart).
-
Encountering a snag:
The ONLYOFFICE integration seems to fail to send the JWT token to an ONLYOFFICE instance. My best guess rn is its an issue with apache -> nginx -> ONLYOFFICE. Is anyone else more familiar with this sort of reverse proxy issue?
Edit: Fixed it. Testing and pushing a new release.
Edit 2: I am tempted to leave updating to the app, similar to Wordpress Developer Edition. I auto install the Updater module. If @staff want to take a look at this let me know. Repo is here: https://git.atridad.dev/CTPR/cloudron-humhub-app. It was a sponsored app. If you need an instance to take a look at it let me know via a direct message and I can let you in @staff.
-
@atrilahiji ah, great stuff! Ideally, the app shouldn't update itself and the code should be readonly. Is that possible? It's best to keep updates consistent i.e from Cloudron dashboard.
-
@girish I can definitely try. Much like Moodle, it has a lot of plugins or "modules" people use. I think in this instance they are all in a single directory though. I'll take a look.
-
@atrilahiji thanks! let me know if you hit any bumps and I can take a look as well.
-
@girish Sure, thanks! I'll shuffle some things around in the package and see what I can do. My hope is I can just symlink everything that is needed in a migration to /app/data, which will also make updates a lot easier.
-
@girish Actually, I just thought of something. If the modules folder is symlinked and the app is expecting to write to the modules folder in /app/code, it will error right? I imagine it wouldn't just look at the actual folder in /app/data. The trouble here is there is a "module store" of sorts built right into the app.
-
@atrilahiji maybe you can symlink /app/code/modules to /app/data/modules and that way it will become writable.
To give a high level idea, let's say humhub app comes with some default modules. Then, in Dockerfile, you would move them to some other location like:
RUN mv /app/code/modules /app/code/modules_orig && ln -s /app/data/modules /app/code/modules
Then in start.sh:
mkdir -p /app/code/modules cp -r /app/code/modules_orig/* /app/data/modules
In many apps, instead of the blind copy above, we try to symlink each "module". So, there will be a symlink from /app/data/modules/x to /app/code/modules_orig/x . This sometimes works or not depending on the app. But hopefully you get the idea!
-
@girish my confusion here is if the app still tries to write to /app/code/modules it would hit permissions issues no?
-
@girish Running into issues here: https://docs.humhub.org/docs/admin/installation/#file-permissions
There appears to be no way to configure where Hubhub looks for those files, so it will just keep trying to write to the symlink in /app/code and fail. In fact, you cant even get the site to load after installation without having the assets directory writable. This is something it has to do on startup. I can still make an update script for this, but I think it will have to sit in /app/data just based on how this was written. Unless I'm missing something?
-
@atrilahiji said in HumHub - social network software:
if the app still tries to write to /app/code/modules it would hit permissions issues no?
no, that should not be the case (at least when the symlinked dir has proper permissions for this).
-
@fbartels Weird... it seemed to think it didn't have permission to write...
-
-
@atrilahiji Never stop never stopping! You're doing great!
-
@atrilahiji can you push your current wip? I'd like to give the code a look.
-
@fbartels Sure thing: https://git.atridad.dev/alt-ron/cloudron-humhub-app/-/tree/harden-app-code
Thanks! I'm convinced this is 1) impossible or 2) something so simple yet I have not noticed it somehow
-
@atrilahiji for me this works with
β cloudron-humhub-app git:(harden-app-code) git rev-parse --short HEAD 0b5df1c
Steps I tried:
- Install app (in debug mode, but only so that i could override and start the
start.sh
manually) - finished Humhub installation
- went into admin and selected modules
- installed a module
- activated a module
- no php error can be seen
- Install app (in debug mode, but only so that i could override and start the
-
-
@atrilahiji no, no changes at all. maybe some leftovers from a previous installation of yours?
Yes, you can run
cloudron install --debug
where then the init script is not run. you then need to exec into the app and run it manually. -
@fbartels ahhh I see what you mean. I'll try that.
-
@fbartels Oh weird yeah that works... no clue why it wouldn't work if the start.sh is run normally during an install...
IDK if you saw the same error but if I don't start in debug mode and switch to Recovery Mode, running start.sh results in a permission error for PHP again.
EDIT: Nvm I think I figured it out... -
@atrilahiji ah nevermind, i forgot that part of debug is that the container is not read-only. Looking at the code now a bit closer.
-
@atrilahiji the modules directory does not exist at all in
/app/code
and then it fails at creating it in the first place. You have to prepare this in a similar way to https://git.atridad.dev/alt-ron/cloudron-humhub-app/-/blob/harden-app-code/Dockerfile#L78-80 where the folder symlink needs to already be created during docker build and then in start.sh you need to make sure that the folder and its default contents exist. -
@fbartels I think I got it working finally. I'll test it one more time and then push the code up.
-
This should work now: https://git.atridad.dev/alt-ron/cloudron-humhub-app/-/releases/0.8.0
Now to tackle updates. With everything we need in /app/data now it should be a piece of cake. Thanks for the help @fbartels !
-
@atrilahiji yes, now it also starts in normal (non debug) mode. A nice addition would be auto configuration of ldap.
-
@fbartels I thought I had that set up, but I might have broken it. I'll look into it.
-
@fbartels AH so it does, but on restart. The reason being is it does not let me configure LDAP until the app is installed in the ui on first boot.
Testing both new installs and updates right now for a 1.0.0 release.
-
Had a few dumb bugs, and here we are at 1.0.3. But hey it works. Now I know never to work on windows. The line endings being wrong fucked the package.
-
@atridad I'm getting a cert error on your repo.
-
@sam_uk I think https://git.atridad.dev/CTPR/cloudron-humhub-app is the new location
-
@sam_uk Whoops yeah, I had not mentioned in an email that I moved things to a new org on my gitlab. Mostly because I didn't like how Altron just sounded like the marvel villain
-
I've also been getting in the habit of storing my containers I built over on my gitlab registry. So that project should now have an image built for 1.1.0 of the package.
-
@girish Great thanks. What are the next steps for getting this in the app store, please?
-
@sam_uk @girish Just pushed a new release that fixes a huge issue. The DB credentials never got updated when you clone from backup, so you'd end up with 2 instances connected to the same DB.
1.1.1 is pushed now.
Repo: https://git.atridad.dev/CTPR/cloudron-humhub-app
Container: docker.atridad.dev:443/ctpr/cloudron-humhub-app:1.1.1 -
@atridad @girish I'm looking forward to having this in the app store... I'm guessing that might happen sometime soon?
-
Wonderfully promising - thanks a kazillion @atridad
Really looking forward to this. Any news on when this might land in the app store @girish?
-
@toja I'll throw my vote in here for that as well. The fewer production apps that depend on my docker instance the better
-
@atridad @girish is there a timeline for getting this in the app store?
I've been using it for a while and it seems to work OK.
-
-
-
@atridad what's the location?
-
@atridad yeah, it seems the git repo is a broken link now. What's the new location ?
-
@girish AFAIK the latest is here: https://github.com/atridadl/cloudron-humhub-app
-
@Sam_uk itβs mirrored to the cloudron gitlab just to make it easier to get to as well.
-
I have just given it a spin and it seems to work ok.
So far as I can tell, it could make use of a pre-setup admin account, like we have in other apps to skip the "install" wizard, especially since it comes with LDAP setup already.
Further it will need tests (looks like currently those are only copied over from the LAMP app)
Is there anything else I may have missed?
@atridad do you think the admin account pre-setup is doable?
-
@nebulon I can add some proper tests for sure. As for initial account setup, this is problematic since it seems humhub requires manual setup to get the DB set up to allow accounts to be made at all. This is why LDAP and email are only working after the first re-start post setup.
-
@atridad Tried too but got something about a "base table doesn't exist"
-
@doodlemania2 O_O where in the process did you encounter this issue? The flow for this app is a bit odd.
- Install app
- Go to the app and follow the setup
- Restart the app
- Use the app
Also make sure the admin user does not have the same login as any users on your cloudron.
-
@atridad No worries - wasn't able to get to the initial setup, this was on first run - looks like it was missing a .schema file or something.
Cloned from GitHub and not git.cloudron - should I try git.cloudron instead? -
@doodlemania2 GitHub is where I update things and I have a workflow running to push commits over to Git.cloudron. If that ever fails technically GitHub would be the proper source of truth. But on to that issue, I am doing some updates for @Sam_uk tonight on his instances so if I encounter this I will let you know. If not, perhaps debugging 1-on-1 would be a good next step
-
@doodlemania2 So I didn't encounter any issues this time around. I pushed a new version with some misc fixes regardless. Could you give it one more try with this new version? It adds optional SSO.
-
@atridad 100% doing so now and will capture a full log if it goes boom!
Did you push to github or cloudron? GH still shows Mar 24
-
@doodlemania2 HAH so good catch. I legitimately forgot to PUSH my commit. Rookie move. Its pushed and a new release is up.
-
@atridad Did a git pull, cloudron build, no other changes, then on initial startup of app, things start up great. When I hit the app the first time, here's what goes boom:
2022-04-27 21:51:34,544 INFO success: apache2 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Apr 27 14:51:40 - - - [27/Apr/2022:21:51:40 +0000] "GET / HTTP/1.1" 302 - "-" "Mozilla (CloudronHealth)"
Apr 27 14:51:50 - - - [27/Apr/2022:21:51:50 +0000] "GET / HTTP/1.1" 302 - "-" "Mozilla (CloudronHealth)"
Apr 27 14:52:00 - - - [27/Apr/2022:21:52:00 +0000] "GET / HTTP/1.1" 302 - "-" "Mozilla (CloudronHealth)"
Apr 27 14:52:10 - - - [27/Apr/2022:21:52:10 +0000] "GET / HTTP/1.1" 302 - "-" "Mozilla (CloudronHealth)"
Apr 27 14:52:20 - - - [27/Apr/2022:21:52:20 +0000] "GET / HTTP/1.1" 302 - "-" "Mozilla (CloudronHealth)"
Apr 27 14:52:30 - - - [27/Apr/2022:21:52:30 +0000] "GET / HTTP/1.1" 302 - "-" "Mozilla (CloudronHealth)"
Apr 27 14:52:32 Exception 'yii\db\Exception' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table '6e6072eed5097268.setting' doesn't exist
Apr 27 14:52:32 The SQL being executed was: SELECT * FROMsetting
WHERE (module_id
='base') AND (name
='cronLastHourlyRun')'
Apr 27 14:52:32 in /app/code/protected/vendor/yiisoft/yii2/db/Schema.php:676
Apr 27 14:52:32 Error Info:
Apr 27 14:52:32 Array
Apr 27 14:52:32 (
Apr 27 14:52:32 [0] => 42S02
Apr 27 14:52:32 [1] => 1146
Apr 27 14:52:32 [2] => Table '6e6072eed5097268.setting' doesn't exist
Apr 27 14:52:32 )
Apr 27 14:52:32 Caused by: Exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table '6e6072eed5097268.setting' doesn't exist'
Apr 27 14:52:32 in /app/code/protected/vendor/yiisoft/yii2/db/Command.php:1302
Apr 27 14:52:32 Stack trace:
Apr 27 14:52:32 #0 /app/code/protected/vendor/yiisoft/yii2/db/Command.php(1302): PDOStatement->execute()
Apr 27 14:52:32 #1 /app/code/protected/vendor/yiisoft/yii2/db/Command.php(1168): yii\db\Command->internalExecute()
Apr 27 14:52:32 #2 /app/code/protected/vendor/yiisoft/yii2/db/Command.php(424): yii\db\Command->queryInternal()
Apr 27 14:52:32 #3 /app/code/protected/vendor/yiisoft/yii2/db/Query.php(287): yii\db\Command->queryOne()
Apr 27 14:52:32 #4 /app/code/protected/vendor/yiisoft/yii2/db/ActiveQuery.php(304): yii\db\Query->one()
Apr 27 14:52:32 #5 /app/code/protected/humhub/libs/BaseSettingsManager.php(139): yii\db\ActiveQuery->one()
Apr 27 14:52:32 #6 /app/code/protected/humhub/commands/CronController.php(93): humhub\libs\BaseSettingsManager->getUncached()
Apr 27 14:52:32 #7 /app/code/protected/humhub/commands/CronController.php(54): humhub\commands\CronController->runHourly()
Apr 27 14:52:32 #8 [internal function]: humhub\commands\CronController->actionRun()
Apr 27 14:52:32 #9 /app/code/protected/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array()
Apr 27 14:52:32 #10 /app/code/protected/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams()
Apr 27 14:52:32 #11 /app/code/protected/vendor/yiisoft/yii2/console/Controller.php(182): yii\base\Controller->runAction()
Apr 27 14:52:32 #12 /app/code/protected/vendor/yiisoft/yii2/base/Module.php(552): yii\console\Controller->runAction()
Apr 27 14:52:32 #13 /app/code/protected/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction()
Apr 27 14:52:32 #14 /app/code/protected/vendor/yiisoft/yii2/console/Application.php(147): yii\console\Application->runAction()
Apr 27 14:52:32 #15 /app/code/protected/vendor/yiisoft/yii2/base/Application.php(384): yii\console\Application->handleRequest()
Apr 27 14:52:32 #16 /app/code/protected/yii(29): yii\base\Application->run()
Apr 27 14:52:32 #17 {main}
Apr 27 14:52:40 - - - [27/Apr/2022:21:52:40 +0000] "GET / HTTP/1.1" 302 - "-" "Mozilla (CloudronHealth)" -
@doodlemania2 Weird... I'll test it again. What this looks like to me is the second start where it thinks it has initialized, and it tries to edit DB values before the DB is initialized...
You're certain you didn't restart it after installing? I don't think you're dumb I'm just making absolutely sure because this is something I haven't encountered yet.