[How-to] CSF Support in Hestia CP

Make sure to add some access control. Otherwise “non” admin users will get access to CSF…

What is state of play here? Is this install working with latest version?
Thanks

@martineliascz has tested it multiple times and it worked.

1 Like

For info tried this on Debian 11 with the Latest control panel as of today and whilst the CSF installs “Hestia” version correctly and CSF is showing in the control panel menu, clicking on it leads to a blank page without anything loading so i presume currently it does not work

debian 11 is quiet new, probaly needs some adjustments. This integration isnt provided or maintained from hestia, so we will need to wait probaly for @martineliascz.

Hi

Thanks for the reply but it was the result of 8 hours of 10’s reinstalls of OS and control panel and doing it whilst the exorcist is on

I just remembered i Deleted a closing Div flag when i copied the text in. It just came to me after a strong coffee and now its there

Hi guys, I’m currently working on 3 projects at the same time.

Haven’t yet even had time to upgrade Hestia to the latest version.

Once you find solution for Debian 11, please let me know, I’ll update the tutorial accordingly.

@martineliascz Hi, it works fine as is, i made a mistake in deleting a closing div tag, why i did it is beyound me, but i twigged and put it back and all is good

Hello @martineliascz ,thanks for this tutorial and the add on !

Your tutorial was clear and precise I 've been able to add CSF to my Hestia panel in no time !

I know this topic is old, and my question may be stupid (I am totally new to Hestia, I used to work with goPanel but as it is mac only I would rather use a cPanel like Hestia for my new servers …) ,

following your instruction I have been able to add several custom link and widget to the header nav bar (now the nav bar is totally something else than what is default haha) to have a quick access to my favorite tab (pretty much same stuff than you did by adding the CSF tab)

My question : how can I make it that it will “survive” the updates of Hestia, because I am guessing when Hestia will update it will erase those html changes …

i am running Hestia v1.4.17 on ubuntu 20.04
thanks in advance !

1 Like

No it will not …

Somebody need to develop something like this…

1 Like

@gaetan-x Hi, thanks for the comment. Could you please show us how your nav bar looks like? I’m curious… love inspiration :slightly_smiling_face:

@eris
@martineliascz

For preserve CSF button with HestiaCP updates, next code can be placed to /etc/hestiacp/hooks/post_install.sh

#!/usr/bin/env bash

# panel template update
cd /usr/local/hestia/web/templates/includes
[[ -n $(grep '<!-- Customized -->' panel.html) ]] && exit 1
cp panel.html panel.html-bkp-script
sed -z -i -E 's#<!-- *Statistics tab *-->#<!-- Customized -->\n<div class="l-menu__item <?php if($TAB == "CSF" ) echo "l-menu__item--active" ?>"><a href="/list/csf/"><i class="fas fa-shield-alt"></i>\&nbsp;<?=_("CSF");?></a></div>\n<!-- Statistics tab -->#' panel.html
2 Likes

@ww7 Thanks for this tuto!

Anyway, calling sed twice is not needed, you could just use regex replace, such as simple “.”.

Thanks and take care!

Martin

Instead '.' updated with ' *' (also can be '[ ]*'), means any number of whitespaces

@martineliascz Thank you for great threads for HestiaCP!

@ww7 You’re welcome!

Hestia CP is still the best CP out there. I’m using it on all of my Debian servers…

I’m now working on many projects in parallel, so hopefully I’ll find some time in the future to contribute once again…

Martin

Hello Martin ! I have no experience with CSF, can you tell me a couple of advantages of CSF over firewallD and Fail2ban?
I would like to know and try CSF.
Thanks !

Hi @Eduardo - please check my previous post why I do prefer the CSF over stock firewall.

Anyway, @Lupu and others did a very great job with implementing some of the CSF features, such as the ipset blocking to the Hestia CP while preserving the simplicity of stock firewall.

Thanks and take care!

Martin

3 Likes

Hello,

In the newer version the template path which needs to be edited is /usr/local/hestia/web/templates/includes/panel.html instead.

Also, to make it look consistent with the Hestia CP design, a little fa icon wouldn’t hurt -

<div class="l-menu__item <?php if($TAB == 'CSF' ) echo 'l-menu__item--active' ?>"><a href="/list/csf/"><i class="fas fa-shield-alt panel-icon"></i><?=_('CSF')?></a></div>

Thanks

2 Likes

Hi @indianets and welcome to the forum!

I’ll soon install the latest Hestia CP and update the tutorial accordingly as I will have some free time this year.

Thanks too!

5 Likes

I’m a fan of CSF and it should come as standard on HestiaCP!!!

I’ve been using CSF and Fail2ban for a long time without problems.

To do this, just disable the SSH protection in Fail2ban so as not to conflict with the CSF.

sed -i -e 's/port    = ssh/enable  = false\nport    = ssh/' /etc/fail2ban/jail.conf;
service fail2ban restart;
service fail2ban status

In these links you have a good read on this subject:
https://www.digitalfaq.com/guides/webhosting/install-fail2ban-cpanel-pt1.htm
https://www.digitalfaq.com/guides/webhosting/install-fail2ban-cpanel-pt2.htm

1 Like