Web message block (Custom)

To customize the web page blocking.

we have the following:

In my case

Filezilla to enter NethServer via SFTP and so download the modules to edit

Download from the following path: /var/www/cgi-bin

 - nethserver-block.cgi
 - ns-babel.en

Edit (ns-babel.en) to (ns-babel.xx) where (xx = es or pt etc)

Keeping this begin editing modules.

Modification (nethserver-block.cgi):

#
# CONFIGURABLE OPTIONS:
#
# (Currently: "en", "fr", "de", "es", "nl", "no")
@supported   = (
                "en (English), ",
                "it (Italiano)."
               );

By

#
# CONFIGURABLE OPTIONS:
#
# (Currently: "en", "fr", "de", "es", "nl", "no")
@supported   = (
                "en (English), ",
                "it (Italiano).",
                "es (Spanish)."
               );

In this step we are already indicating the new language to use.

I edit the following lines of “# template of SQUIDGUARD”:

print '<hr><div style="float:right;">Administrado por <a href="http://hardsofttecnologia.com.ve">Hard & Soft TecnologĂ­a C.A.</a></div></body></html>';

Save the changes.

Now modify (ns-babel.xx)

In this file parameters are displayed in the block page.

Unknown=
Title=403 Forbidden
Msg=The access to this site is blocked.
Tabclientname=Client name
Tabcaption=Additional information:
TabIP=Client address
Tabclientuser=Client user
Tabclientgroup=Category
Taburl=URL
Tabtargetgroup=Target group
msginaddr=Surfing on plain <U>IP addresses</U> is denied from this client due to network access policies.
msgalternatives=The following possible alternatives were found:
msgnoalternatives=No alternative domainname were found for the server
msgwebmaster=Please ask the <U>webmaster</U> of that server for the correct <EM>domainname</EM>.
Origin=Origin
ReqURL=The requested URL
User=User

TitleVirus=SquidClamAv: Virus detected!
TitleBrowseUnsafe=SquidClamAv: Unsafe Browsing detected
subtitle=Virus name
subtitleUnsafe=Malware / pishing type
errorreturn = This file cannot be downloaded.
errorreturnUnsafe = This page can not be displayed
urlerror = contains a virus
urlerrorUnsafe = is listed as suspicious

Currently the module (nethserver-block.cgi) has prefinished show the following:

Modifying it would look like:

I created in ns-babel.es “Msg1” will have a custom message

Msg1=Por PolĂ­ticas de Seguridad no esta permitido el acceso a este tipo de pagina. 

to display customized messages ns-babel.xx must write a new line following the program.

right way to Modification in (nethserver-block.cgi):

print "$Babel{Msg1}";

Wrong way to Modification in (nethserver-block.cgi):

print "$Babel{Msg1};"

print "$Babel{Msg1};

If it is written incorrectly blocking page will not open correctly.

They should always be aware of how programming.

Regards

4 Likes

Great howto man! @davidep could we add those labels into transifex?

1 Like

after 2 years when I made this how-to, I have already created the file and added the Spanish translations of the messages in github.

@giacomo can you check them for modifications?

Regards

Of course, but I can’t find it out. Could you point me to the right link?

Thanks friend, I created in github the changes in GitHub - NethServer/nethserver-squidguard: NethServer configuration for a filtering web proxy

Regards

I think the links are:

But I don’t know which one is the right one. You should click on “New pull request” to request the merge.
See official Github doc: https://help.github.com/articles/about-pull-requests/

Of course, if you have any problem, just ask here :slight_smile:

Oh, my God, I’m forgotten, hahahaha.

I’ll do it. Thanks, buddy.

Ready @giacomo

1 Like

Packages are in testing, just try it and report back! :wink:

1 Like

Thanks Brother. I’ll run the tests over the course of the day and inform you.

Regards

1 Like

Sorry for asking but, I can’t found on github the part to change "Powered by SquidGuard ", when i try with the how to of this topic, the block message shows a error message, with a white background.

Everything else is done, and it’s works perfectly.

How are you @geofxgt ?

is part of the nethserver-block.cgi and if I make any changes here it will be done for everyone, however I am running some tests to place it inside babel.

just today I’m working with my laptop, I’ve been serving several clients and I was stopped for testing. I will check if there are any errors in displaying a red box with the message.

nothing has changed in the css

Thank you for reporting

1 Like

Hi Jose, did you have some time to test the package?