Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flarum support #3242

Closed
wants to merge 13 commits into from
Closed

Flarum support #3242

wants to merge 13 commits into from

Conversation

Steveorevo
Copy link
Contributor

A Quick Install App for Hestia Control Panel that allows you to easily install Flarum, a modern, fast, open source, website forum software.

@gOOvER
Copy link
Contributor

gOOvER commented Feb 2, 2023

ohh nice. Thank you for this :) <3 Flarum is really nice

@jaapmarcus
Copy link
Member

Just ran Prettier to do the linting / code clean up

I assume we need an Nginx template for Flarum

@Steveorevo
Copy link
Contributor Author

Steveorevo commented Feb 2, 2023

Yes, when currently run there is a suggested .nginx.conf file that appears in the install root per Flarum's suggestion. Not quite sure how/what to integrate with (which existing Nginx template should be used). Help wanted. I believe it will function without; but poses security risk as storage folder should not be viewable, etc. I will try to look at it (time allowing); but please feel free to create/review one. Thanks.

parent::setup($options);
$result = null;

// Move public folder content (https://docs.flarum.org/install/#customizing-paths)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From a Flarum POV, this type of install should be avoided if at all possible.

As mentioned in a comment, we have an nginx config available which can handle path rewriting automatically so this shouldn't be needed.

@Steveorevo
Copy link
Contributor Author

Steveorevo commented Feb 6, 2023 via email

@davwheat
Copy link

davwheat commented Feb 6, 2023

The idea of subdirectory installs is specifically that — for subdirectories (e.g., example.com/forum) OR if it's physically impossible for one to control the web root.

It's meant as a backup if the normal method doesn't work.

If the normal method can work here (e.g., use that if a subdir is not desired, otherwise the subdir install), it should be preferred. I can't stop you from using it this way, though.

@jaapmarcus
Copy link
Member

Good points, I will update the logo. Thank you for your feedback! Can you please clarify “should be avoided” as I’m unable to find a related sentiment in Flarum’s official install documentation. In contrast, Flarum currently, specifically states, “…with something like public_html or htdocs), you can set up Flarum without the public directory…”. (You may wish to submit a pull request to Flarum’s documentation to correct this?). We do indeed have a “public_html” folder present; although I would agree with their assessment “public directory…is a security best practice”, this Quick Installer does accommodate the “…wish to host Flarum in a subdirectory” option which again, does away with the public folder and negates it’s necessity per their own documentation. For example, often times users may wish to create a WordPress or other installation in root, and use Quick Installer to create a forum in a subdirectory. According to the documentation, .htaccess rules are specific for Apache and is a hard requirement to “…protect sensitive resources….” (per Flarum’s documentation). While it is true that Hestia users are leveraging Nginx in a reverse proxy capacity; I would still err with the default, to include .htaccess restrictions (even if redundant). This may become especially true of when users mix installations (as mentioned with WordPress in root and Flarum in a subfolder); which Nginx rules apply? Perhaps @jaapmarcus can clarify as I’m not understanding how Hestia’s Quick Installer accommodates multiple installations in a single web domain. In my Hestia v1.6.1, multi-PHP, Nginx+Apache, I am not seeing the WordPress.stpl being utilized in a default Quick Install App in a web domain’s root, and again, how it is resolved when doing another Quick Install App of Flarum in a subfolder. Is there a location I can validate this? (Ie /etc/php/8.1/… pool or conf …?) Should I see multiple nginx.conf_* files in the user’s own conf/web/nginx folder? (I am currently not but maybe wrong?).

For Nginx only setup it is almost impractical. It doesn't even work for Wordpress. Unless you have a separate template working for it. Yes that is one of the downsides of Nginx setup..

@Steveorevo
Copy link
Contributor Author

For Nginx only setup it is almost impractical. It doesn't even work for Wordpress. Unless you have a separate template working for it. Yes that is one of the downsides of Nginx setup..

I do have Nginx rules for WordPress that do work, for both permalinks and multisite (subfolder) mode. I can share those in a separate thread. Probably be best to utilize the default include for nginx.conf_* feature for these as it can allow Hestia to accommodate more than one set of Nginx configurations.

@jaapmarcus
Copy link
Member

jaapmarcus commented Feb 6, 2023

For Nginx only setup it is almost impractical. It doesn't even work for Wordpress. Unless you have a separate template working for it. Yes that is one of the downsides of Nginx setup..

I do have Nginx rules for WordPress that do work, for both permalinks and multisite (subfolder) mode. I can share those in a separate thread. Probably be best to utilize the default include for nginx.conf_* feature for these as it can allow Hestia to accommodate more than one set of Nginx configurations.

Impossible to delete for the normal user unless he deletes the web domain first. That is a major downsite

@Steveorevo
Copy link
Contributor Author

Ahh, yes... that is a definite problem. Sounds like we could use a UI to manage such conf files (disable or delete checkbox list). I hadn't thought of that. I may have to prototype that.

@jaapmarcus
Copy link
Member

Ahh, yes... that is a definite problem. Sounds like we could use a UI to manage such conf files (disable or delete checkbox list). I hadn't thought of that. I may have to prototype that.

It may cause major security if it is done by the "user" and can directly control them. For example:

https://huntr.dev/bounties/357c0390-631c-4684-b6e1-a6d8b2453d66/

@Steveorevo
Copy link
Contributor Author

Steveorevo commented Feb 7, 2023

Noted. However, that is for an arbitrary input field that definitely needs validation. A "disable" or "delete" option on the other hand, furnishes the user with the ability to remove (or rename/move to disable folder) a nginx.conf_* file, but not alter its content (to introduce a syntax or other crash).

Steveorevo and others added 5 commits February 17, 2023 18:29
Merge with latest main
Removes pesky "You are running phpPgAdmin without session security." warning and accommodates CSRF security measures
Removes pesky "You are running phpPgAdmin without session security." warning and accommodates CSRF security measures
@ScIT-Raphael ScIT-Raphael requested review from davwheat and jaapmarcus and removed request for davwheat February 22, 2023 11:37
Copy link
Member

@jaapmarcus jaapmarcus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is still lacking support for Nginx only setups

install/deb/pga/config.inc.php Outdated Show resolved Hide resolved
install/rpm/pga/config.inc.php Outdated Show resolved Hide resolved
Copy link

@davwheat davwheat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good to me from a Flarum perspective!

This reverts commit b0fbee3.
@Steveorevo Steveorevo closed this Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants