[Flarum] A lightweight forum

Flarum for YunoHost

Maintenance status Status Integration level

Hello all,

I’ve packaged Flarum, a forum software. It’s nice, modern, à la Discourse, without the need for docker (cf. this thread).

Sources are there : GitHub - YunoHost-Apps/flarum_ynh: Flarum, an open-source forum software, packaged for YunoHost

Enjoy ! :slight_smile:


Features

Installation

This Flarum package can be installed through:

  • Install Flarum with YunoHost
  • YunoHost’s webadmin, in the Community listing
  • YunoHost’s CLI: yunohost app install https://github.com/YunoHost-Apps/flarum_ynh.

Required parameters are:

  • domain
  • path
  • admin, among the YunoHost’s users
  • public, true by default, for guests to read the forum
  • title of the forum
  • language can be English en (by default), French fr, and German de. Other languages are installable after installation like any other extensions

After installation, simply open your browser to Flarum’s page. First loading may be a bit longer as assets are generated.

Upgrading

Note that all third-party extensions are removed upon upgrading, you simply need to require them again from Composer. Their settings and data are kept.

Adding extensions after installation

Replace flarum with your app ID in case of multiple installation.
Replace vendor/extension with the appropriate names. Read the extension documentation if it requires additional steps.

sudo yunohost app shell flarum
# Will load Flarum's environment in a new shell
php composer.phar require vendor/extension
exit

Troubleshooting

Click here to see common issues

Low memory errors

The app now ensures that enough memory is available by adding a swap file upon installation.

Commands for swap are no longer necessary.

A swapfile will enable your system to extend its limited memory through its disk capacity. The following commands will create a 1 GB swapfile.

sudo dd if=/dev/zero of=/swapfile bs=1024 count=1024000
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

Then add this line in /etc/fstab:

/swapfile none swap sw 0 0

Reboot the system and try the installation again.

Timeout errors

Some users have reported a successful installation, but get a blank page due to a timeout on a PHP script that prepares the forum assests (Minify.php, notably).

In /etc/php/*php_version*/fpm/pool.d/*app_id*.conf, you can increase the max_execution_time and max_input_time limits (both values are in seconds if nothing is specified).

Reload PHP-FPM with sudo service php*php_version*-fpm reload.

Upload limit

If you are facing an error while uploading large files into the forum, PHP may be limiting file upload.

In /etc/php/*php_version*/fpm/pool.d/*app_id*.conf, you can uncomment (remove ; at the beginning of the line) and increase the values of upload_max_filesize and post_max_size (both values are in bytes).

Reload PHP-FPM with sudo service php*php_version*-fpm reload.

Your issue is not listed here ?

Feel free to post about it in this thread or on Github (preferred). Remember to post your logs to help me help you help us all. :robot:

12 Likes

The package is functional and well integrated within YunoHost. It supports

Feel free to test it, then propose improvements and report issues on Github.

Package updated.

Fully works !

1 Like

Hi @tituspijean, thank you very much for this package - and by the way for the Flarum discovery! I like the without the need for docker and will try it as soon as possible…

Hi, and thanks for this package :heart_eyes_cat:

  • Could you send (if you want) the ownership (on settings) of the package to YunoHost-Apps organization.
  • That way colaborators could easily works on same package .
  • I sent you a request to join YunoHost-Apps organization.
  • Then, when you think the package is publishable, could you send a pull request to add the package on community list?
  • That way your version will be displayed on community apps list

Thanks for the initiative and the good work!

However I cannot manage to install the package. I tried from both the YunoHost UI or via command line. With --debug and --verbose options in command line, I end up with:

114469 DEBUG action [29007.1] ended after 114.336s 114469 DEBUG lock has been released 114469 ERROR Installation failed

I uploaded the full log here (zerobin.net).

Note that, prior to that, I had to manually create directory /var/www/.cache/composer and subdirectories to avoid warnings such as:

17305 WARNING Installing flarum/flarum (v0.1.0-beta.5) 17306 WARNING Cannot create cache directory /var/www/.cache/composer/files/, or directory is not writable. Proceeding without cache 17318 WARNING - Installing flarum/flarum (v0.1.0-beta.5) 18294 WARNING Downloading: 100% 18341 WARNING 18391 WARNING Created project in . 18438 WARNING Cannot create cache directory /var/www/.cache/composer/repo/https---packagist.org/, or directory is not writable. Proceeding without cache 18439 WARNING Cannot create cache directory /var/www/.cache/composer/files/, or directory is not writable. Proceeding without cache 18635 WARNING Loading composer repositories with package information 18717 WARNING Updating dependencies (including require-dev)
Thanks for your help.

@jellium Thank you for trying the package !

I think I was not cautious enough and I did not correctly clean my server before testing the package. Therefore it did not yell at me as it did to you.

I’ve created this issue, and I’m currently working on patching the problem, hopefully.

Updated. Can you test it @jellium ?

@Moul I would gladly send the package to YunoHost-Apps. Is it by forking it, or is there another way to do so ?

You could send ownership on on setting of the repository.

Pro-Tip : you shoul avoid working on package on your production server ! Try to use a developement environnement (by using GitHub - YunoHost/ynh-dev: Dev environement wrapper, based on LXD, to develop on YunoHost or other solution). By doing that you can test your package on a fresh & clean server.

Thanks for working on Flarum, this is a really valueable app ! Do you manage to get a working ldap connection for members ?

Yeah, I’ve been lazy… It won’t happen again ! :smile: I will take time this weekend to setup such a dev environment.

Not yet ! I’m learning to code as I go, so I may need some time to handle PHP.
@opi, could you have a look to this issue ? I tried to implement your automatic postinstall solution, but I got a missing class error.

Hi there,
The installation worked, the issue seems to be fixed!
Post-installation worked too, I can test the forum now (-:

Thanks.

1 Like

Updated : automatic post-installation is implemented.
Now your forum is fully functional as soon as installation is finished.

Next step, SSOWat and LDAP integration. So far it felt like tinkering, but I sense that it requires more knowledge than I have. So don’t hesitate to help !

Great Work. I’ve discover Flarum when I was searching for a software which can create a forum. I’ve tried to install manually but many errors appear. So this package is an opportunity for me and it works !
I’ve just a question about Flarum : Can Admin create users ? And how can admin do this ?
And is it normal that when a user signs in(after signing up), nothing appears (just the name of the forum) ?

Thanks.

frju365

Hi @frju365, thank you for testing the package !

It seems that the feature to add users from the admin panel is not implemented yet. Here is the open issue about it. I’m learning about SSOwat, LDAP and HTTP auth to implement automatic user creation with YNH’s login : you can create a new user with an API call and an admin token. See here, but I’ve yet to find the correct syntax of such a call.

About your empty forum after signing up and signing in, can you take a screenshot ? That’s definitely weird. Can you check that you’re still in https ? What about signing out, refresh, or signin in with admin account ? Don’t hesitate to open an issue on github with such information, I will try to reproduce the issue.

Hello TitusPiJean,
Thanks for your answer.
To answer your questions :

  • I’m still in https:// when I sign in as user.
  • Nothing appears :
  • When I sign in with my admin account, Flarum appears. And as guest too. Only if I’m a member(user) nothing appears.

Thanks.
frju365

Hi @frju365, I cannot reproduce the issue.
Can you remove and install the package again ?
If you can run the installation by command line sudo yunohost app install https://github.com/YunoHost-Apps/flarum_ynh --verbose, I would like to see the logs (don’t forget to remove any password, notably at the beginning of the log).

Hi

I’m trying to install flarum in ynh beta 2.5 and installation failed.

I’m doing :
sudo yunohost app install https://github.com/YunoHost-Apps/flarum_ynh --verbose

I just notice a strange warning (to me) :
+ sudo mkdir /var/www/flarum
+ sudo mv /tmp/flaruminstall/flarum /var/www/flarum/..
Warning: mv: cannot create directory ‘/var/www/flarum/../flarum’: No such file or directory

And at the end :
Error: Installation failed

But no explicit error message during install…

Any idea where I should have a look to find a reason ?

Thx

@tituspijean, Sorry… I’m a bit late… (3 months)
I’ve reinstalled Flarum on a new installation and now it works fine. That was surely a problem which come from the settings of nginx.

Thanks.

@nimch, a issue is opened on github for your problem.
https://github.com/YunoHost-Apps/flarum_ynh/issues/14#issuecomment-272830702

@frju365, thanks for your answer. Without being able to replicate your issue, I confess I had put it aside. I’m glad it was solved !

@nimch, I indeed opened an issue. I will look into it tonight. Can you confirm that everything is up-to-date on your server, with the latest beta for YNH ?