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

Allow for optional domain directory write permissions #4109

Merged
merged 5 commits into from
Oct 27, 2023

Conversation

ev0net
Copy link
Contributor

@ev0net ev0net commented Oct 26, 2023

For security reasons, my applications require writeable storage at /home/user/web/domain.tld/. I've been hacking hestia on install/upgrade to achieve this. I'd like to see it integrated.

/home/user/web/domain.tld/ writability will only occur when the user adds optional: DOMAINDIR_WRITABLE='yes' to /usr/local/hestia/conf/hestia.conf. Additionally, the user will have to modify their open_basedir in their php templates.

The way I've changed the hestia code does not impact default functionality of non-writable /home/user/web/domain.tld/ at all and does not require a new hestia.conf key=value to maintain this default functionality.

Allowing a writable /home/user/web/domain.tld/ is common for panels and providers. While I understand hestia allows for a sub directory under public_html and setting that directory to docroot, this is unnecessary hassle with negligible security benefits.

@jaapmarcus
Copy link
Member

Why not use /home/user/web/domain.tld/private ?

@jaapmarcus
Copy link
Member

jaapmarcus commented Oct 26, 2023

Just checked the commit History ... And it was since the start already like this..

I would personally have an option added to hestia.conf at least

See Example:

hestiacp/func/syshealth.sh

Lines 537 to 540 in 8951bde

if [[ -z $(check_key_exists 'ROOT_USER') ]]; then
echo "[ ! ] Adding missing variable to hestia.conf: ROOT_USER ('admin')"
$BIN/v-change-sys-config-value "ROOT_USER" "admin"
fi

Just add it to the list ...

@ev0net
Copy link
Contributor Author

ev0net commented Oct 26, 2023

While I understand hestia allows for a sub directory under public_html and setting that directory to docroot, this is unnecessary hassle with negligible security benefits.

Why not use /home/user/web/domain.tld/private ?

I choose not to speak to that in the sentence above. I understand that is an option also.

I would like to maintain more standard compatible infrastructure and write to the domain dir and not need to maintain different application directories differences for different systems. Again Allowing a writable /home/user/web/domain.tld/ is common for panels and providers. I haven't run across this restriction before.

Just checked the commit History ... And it was since the start already like this..

The history of vesta/hestia? The domaindir used to writable?

Just add it to the list ...

Will do. Not adding it was my attempt to have a minimal impact.

@jaapmarcus
Copy link
Member

It was made like this 11 years ago. I have zero ideas why with the only exception to prevent users renaming public_html and other folders

@ev0net
Copy link
Contributor Author

ev0net commented Oct 26, 2023

prevent users renaming public_html and other folders

Yes. I remember finding that strange when I first was exploring hestia... But given the way subdomains work in hestia, keeping public_html non-changable works fine for me.

@ev0net
Copy link
Contributor Author

ev0net commented Oct 27, 2023

@jaapmarcus Do you think you will approve this? If not, I need to include this as a hack in my workflow. Thanks!

@jaapmarcus
Copy link
Member

Please allow a few hours/days before we merge things?

@ev0net
Copy link
Contributor Author

ev0net commented Oct 27, 2023

Great! I just wanted to know if it was going to be included at all. Thanks!

@jaapmarcus jaapmarcus merged commit ca40d98 into hestiacp:main Oct 27, 2023
6 checks passed
jaapmarcus added a commit that referenced this pull request Nov 8, 2023
* evonet-domaindir-writable: rebuild.sh

* evonet-domaindir-writable: v-add-web-domain

* evonet-domaindir-writable: syshealth.sh

* evonet-domaindir-writable: v-add-web-domain: update comment

* evonet-domaindir-writable: rebuild.sh: update comment
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

2 participants