Author Topic: DansGuardian Web module + Android APP (Enable & Disable filtering)  (Read 3105 times)


  • Guru
  • ****
  • Posts: 204
    • View Profile
Hi All
I started a little project for DansGuardian back several weeks ago to allow editing of configuration files such banned site list, exception ip list, etc.

I am looking for some testers and suggestion from the community.

The basic functions of the module is to allow editing of the configuration files without having to SSH into Linuxmce console.

The layout of the module is as followed.

A new folder called dansguardian is created inside the lmce-admin folder.

Inside of this folder contains several PHP scripts folders & two .sh files and one exported mysql  file.

On the initial setup the main index.php file checks the database to see if we have a database called dansgaurdian, If the database doesn’t exist, it will create it, and then import the exported mysql file.

Next, it checks to see if there is any IP address belonging to the MD’s in the pluto_main/ Device table and if there is any IP address, then export and import them into dansguardian/ exceptioniplist.

This check allows our entire MD’S to have full access to the internet.

The android app is just a font end to the module and allows you to easy  add and edit blocked/exceptional  ips and websites,  also  any changes made to the scripts in the back end, the app is updated on the next re-opening.

If you’re interested in testing or have any suggestion then follow the below.

You a can also see screen shots and video clips here

**Please note, I can't be held responsible if this back your system**.

I have  tested this on my live machine of 10.4 and it should work with 8 & 12 system, but I haven't tested it on 8.10 system.

Sudo commands maybe different on different systems.

To get started follow these instructions.
*** You must have DansGuardian & Squid3(transparent)installed first ***

Before we start, lets create a back up
SSH into your LMCE
mkdir /etc/dansguardianBACKUP
cp -r /etc/dansguardian/* /etc/dansguardianBACKUP
Check to see  if the backup is OK
cd /etc/dansguardianBACKUP
type dir  you should the files and folder then
continue to install below

1.   SSH into your LMCE
2.   chown your username -R /var/www/lmce-admin
3.   cd /var/www/lmce-admin/
4.   wget
5.   tar -xzf dansguardian.tar
6.   Check to see if the folder was extracted and created type dir
7.   you will see a folder called dansguardian in the lmce-admin folder.
8.   Type cd
9.   To ensure the folder and files is writable type
10.   chown your username -R /var/www/lmce-admin/dansguardian/
11.   type cd
12.   The Below command copies the scripts to enable and disable filtering
13.   cp /var/www/lmce-admin/dansguardian/setupfiles/*.sh /usr/pluto/bin/
14.   visit OR  http://dcerouter/lmce-admin/dansguardian/
15.   You should get all systems good to go if the install went correctly
16.   Download the android app from here

Warning Note:
if you are testing the filter by categories do not enable the categories that have a red warning.

If you have installed the blacklist correctly you will have a green tick against the each category.
This green tick tells you are good to enable.

If you enable a red warning dansguardian won't restart  and all internet will be down and you will have to edit the file manually and then  remove the all of the categories that were  enabled.

I use nano you may be using VI

nano /etc/dansguardian/lists/bannedsitelist

scroll down to the to the categories list  and crtl + k to cut the text  (ie nano) crtl + o to save and crtl+x to exit

restart Dans
/etc/init.d/dansguardian start or /etc/init.d/dansguardian reload

Then revisit filter by categories in the drop down menu. disable all and update Dans Guardian, other wise every time you update the file, it will hang the system because the database was not told to disable the category, and you will have to repeat the above steps.

You can see it in action by disabling the filter  and watching the log using this command  tail -f /var/log/squid3/access.log

Once disabled the log does not move or update.

any issues let me know in real time or in this topic.