Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Govo

Pages: [1] 2 3 ... 10
1
Developers / Re: PHP to execute sudo command
« on: August 31, 2015, 07:34:49 pm »
Hi Posde

Nothing out of normal shown in the DansGuardian log, expect the site is denied. see log here http://pastebin.com/nXTWtJgp

Here's a 4 minute video to review if you have the time. nothing better then a video to explain stuff.
https://www.dropbox.com/s/jkh3b710hmqhl69/Exception%20IP%20error.mp4?dl=0

Basically I have purged the DansGuardian and reinstalled it.

I change the /etc/DansGuardian/Lists  to chown www-data:root /etc/dansguardian/lists/*

Edited  bannedsitelist via nano  and added grabone.ie as a blocked site.

Restarted DansGuardian visited the site and its blocked.

Edited the exceptioniplist via nano, added my IP restarted, revisited the site and site was allowed.

I then go to my scripts to update DansGuardian to remove the IP, revisit the site and its blocked.

I enter my IP, update DansGuardian, revisit the site and it's still blocked.

As you can see I in the video, when I edited under nano  it works, and when I execute my php scripts it doesn't.

I see you are on the IRC ...are you availabe to chat.


Cheers
Gov!

2
Developers / Re: PHP to execute sudo command
« on: August 31, 2015, 10:49:12 am »
Hi Posde

Current file permissions shows  http://pastebin.com/HEz97MuQ  and when changed to  www-data for /etc/dansguardian/lists shown here http://pastebin.com/cFvWFDT0

the files get the same write permissions as root, if change www-data for /etc/dansguardian/lists/* all files have the same write permissions.

Even if you  change  it back to chown root:root /etc/dansguardian/lists/* and edit the file via nano and restart, the list does not execute.

Because you have made changes you can't undo  unless you --purge it from the system.


It's head wrecking, checking the file permissions  on the  files that worked, under Bitvise SSH, I see  they have a group ID 0 & owner ID 0 and are set to 644.

I cannot understand why DNG won't allow this file to be executed when written by www-data, www-data is in the same group as root, them only difference I see is the owner ID is 33  not  0

But as stated above, if you change it back it still doesn't work, crazy tough that the bannedsitelist executes without any issues.

Please advise if I am checking the commands right

compgen -u (shows list of users)
compgen -g (shows list of groups)
ls -la  (shows current owner of directory and file permissions)
getent group www-data (returns the below in bold)
www-data:x:33:gov,root

Is there something I am missing ???


Cheers
Gov!

3
Developers / Re: PHP to execute sudo command
« on: August 31, 2015, 12:57:09 am »
Hi Folks

I need a big  help Please :)
 
I have hit a brick wall with this project. I have spent 10 hours googling and try difference access types but have failed to understand why the exception IP List does not  execute.

Basically, the Exception IP file updates with the correct IP address and DNG restarts no errors, but if you visit the blocked website  you have no access even if you are in the exception list.

These are the options I have tried

sudo apt-get remove dansguardian --purge

reinstalled
sudo apt-get install dansguardian

Edited nano /etc/dansguardian/dansguardian.conf

Restarted, added a domain to block via nano under sudo, restarted, domain blocked, edit the exception ip list via nano under sudo, restarted  website allow.

On clean install it works, but if I run my php scripts it creates the file perfectly, but DNG does execute it.

So I decided to  add www-data to sudo group  as the files are owned by root and then made a change using chown www-data:root /etc/dansguardian/lists/exceptioniplist

restart, website still blocked. everything else works fine so far.

So I purge again for 100 hundred time,  this time  I told the dansguardian.conf to pull from /var/www/lmce-admin/dansguardian/exceptioniplist. restarted still blocked.

So I  cp  -r /etc/dansguardian/lists/exceptioniplist /var/www/lmce-admin/dansguardian restarted and it worked.

It seems to be a permission error, if you cp the from /etc/ the permissions are copied across to the /var  allowing the file to be execute.

I  have even tried  adding  it to the sudoers

%sudo ALL=NOPASSWD: /etc/dansguardian/lists/*
%www-data ALL=(root) NOPASSWD: /etc/dansguardian/lists/*

Still no Joy.

Maybe I am doing something,,,, Any help would be great as the wife is doing her nut in with no access to certain sites.

Once this  has the correct file permissions then I can move on.

So Please  Please help!   


Cheers
Gov!

4
Developers / Re: PHP to execute sudo command
« on: August 30, 2015, 02:29:05 pm »
Sneak preview of DansGuardian config file,  https://www.dropbox.com/s/ve728b7qvlfyefs/dnsg%20config%20file.mp4?dl=0

You will be able to update the configuration file in a nice rich PHP format, instead of having use  VI OR Nano  the terminal.

Cheers
Gov!

5
Developers / Re: PHP to execute sudo command
« on: August 30, 2015, 12:32:38 pm »
Hi Folks

Just given a quick update.

Quote
In the video I didn't update DansGurdian on the categories section as some of the blacklist files are missing, and in return DansGurdian won't restart as it cannot include the files.

I have updated the blacklist folder from the below url  this even and after extracting more files and folders  are missing.
http://urlblacklist.com/cgi-bin/commercialdownload.pl?type=download&file=bigblacklist

Update,  I have put in check  to see if the folder exist, if the folder doesn't highlight in RED warning else give a green tick that every is OK to enable

see screen shot here https://www.dropbox.com/s/3dolzlwtweh6520/category%20warning%20.png?dl=0

Update 2
I have now added in a new section to add categories to the database, so if you are updating from http://urlblacklist.com ensure to check their live list taken from the category description file in the last build of the blacklist, if you missing some just add the name  of  the one missing, it will create it and save it as disabled by default.

screen shot here  https://www.dropbox.com/s/5er1oao9k8sv4rc/addcategory.png?dl=0


Update 3
Quote
Import MD IP address to the exception IP address from the pluto_main database.

I have now got this to import MD IP address on first setup.



Cheers
Gov!

6
Developers / Re: PHP to execute sudo command
« on: August 30, 2015, 12:11:35 am »
Hi Folks

First, I would like to say to Alblasco well done on working on the web-filter and proxy, I had a look at your php scripts and to be honest, they are way to complicated for my PHP skills, but great work tough,  I really need to understand global php verbs.!

I have done great progress in my own project, have fully understood how to execute  sudo commands in PHP, Phenigma, /usr/pluto/bin  is the correct place for .sh files, thanks for the advice.

On that Note..let me get to were  it is.

I can now disable & enable categories .ie blacklist folder,  I can disable and enable the filtering on & off for the system at the click of button, great for when you are web designing and stuff.

So the project is going so good,  with a click of a button I can

Blocked & delete websites 
Add & delete exception IP address
Add & delete exceptional file types
Add & delete  allowed websites
Enabled & disable Categories  .ie blacklist

Check out the this short video clip to  see it in action. https://www.dropbox.com/s/scxmtf8datd2t1m/enable%20and%20disable%20filters%20%20plus%20categories.mp4?dl=0


In the video I didn't update DansGurdian on the categories section as some of the blacklist files are missing, and in return DansGurdian won't restart as it cannot include the files.

I have updated the blacklist folder from the below url  this even and after extracting more files and folders  are missing.
http://urlblacklist.com/cgi-bin/commercialdownload.pl?type=download&file=bigblacklist

When testing this morning I was only missing the below list , but after updating some of them are back and some of them are gone.

Adult
childcare
forums
Publicite
redirector
ringtones
Violence
virus Infected

So if anyone has a full list/backup please zip it and give me a link to download them so I can fully test it, I would be great full.


To do
Allow time access
Import MD IP address to the exception IP address from the pluto_main database.
Create an Android app for access to the site, for now the browser works well
Add login and password box.

Overall its going good and thanks for reading ...!

Gov





7
Developers / Re: PHP to execute sudo command
« on: August 27, 2015, 11:13:31 pm »
Hi phenigma

No problem at all, I will try and hook up in IRC, it would great if the LMCE users went this, I am offer this for free when I am finish.

What I got done to day is added in the categories to database  and then allow them to be enabled through buttons,  tomorrow I will finish this section off so that it updates the DSG. this was  huge file to get in!

Check this short video clip.

https://www.dropbox.com/s/fdu4cakckxp5hrx/categories.mp4?dl=0

I have also found away to disable filtering and enable it again, but it brings me back visudo to get the command to executed, I go at that tomorrow.

Time to call it night for now  !


Cheers Gov




8
Developers / Re: PHP to execute sudo command
« on: August 27, 2015, 01:30:18 am »
Hi Posde & Phenigma

Thanks for the replies.

The problem wasn't the PHP script, you had to allow access in the visudo  ( Posde thanks for pointing me in right the direction ), according to a topic on the the internet the permission is


# Cmnd alias specification
Cmnd_Alias DANSGUARDIAN = /etc/init.d/dansguardian, /usr/sbin/dansguardian

# User privilege specification
root ALL=(ALL) ALL
www-data ALL=NOPASSWD: DANSGUARDIAN
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
%www-data ALL=NOPASSWD: DANSGUARDIAN

This allowed PHP to executed the command to restart DansGuardian.

You can see it working in this quick video, to get around the error of no response received from the server after submitting the command,  I put in a 10 second delay, and  then a finish button to bring you back home.

https://www.dropbox.com/s/mv2m300lhf0rjf8/videoclip2%20DansGuardian%20restart.mp4?dl=0


In order for the PHP scripts to work,  visudo has to be edited with the above code, writes access given to the dansguardian LISTS folder.

I have written a  PHP script to check if the database exists, if not, create the database and import the tables.

Here's a short video of it creating the database and then importing the sql file

https://www.dropbox.com/s/vh83kyopg86sxkl/databaseimportandcreate.mp4?dl=0

I am working on this as a plugin, it has its own folder inside  the /var/www/lmce-admin, this allows me to move it to any version of LMCE, the only cache is, DansGuardian and squid3 have to be installed first and some editing done to the IP-tables.


On that note, thanks for the replies I will keep you posted!


Gov.

9
Developers / Re: PHP to execute sudo command
« on: August 25, 2015, 01:57:49 pm »
Ah spot on, done some research last night and got it to work, just need to figure out why the page returns an error of no response back from server.

other than that, the project goes. on.

I can now update  blocked sites, added exceptional Ip address and allow  exceptional file types such as .mp3 .zip.

Thanks for the advice Posde much appreciated

Gov.

10
Developers / PHP to execute sudo command
« on: August 24, 2015, 10:38:21 pm »
Hi Folks

Working on a little project for dansguardian and squid3, mostly dansguardian,  but have ran into a problem,  is there away for PHP to execute sudo command.

I need to execute  /etc/init.d/dansguardian restart using PHP, I have seen the command in some php files in lmce-admin, but I just  can't get it to work. do I need to include some files belonging to LMCE?

Once I get pass this part my project will rolling, here is a quick video of what I have achieved so far

https://www.dropbox.com/sh/b4kwchpa153e6sr/AADbS964eH9DpuBLFCEKSON6a?dl=0

I have made some changes since this video..etc added in a delete button to remove blocked sites.

Any help would be great,
Govo

11
Installation issues / Re: Issue with 12.4 video play back of mp4
« on: August 17, 2015, 09:18:41 pm »
I never had an issue with the play back of these files on 8.10, I'll do some home work,

Do you know of any other sites other then yifi !

cheers
Gov

12
Installation issues / Re: Volume levels drop on MD
« on: August 02, 2015, 06:59:03 pm »
Hi

This seems to have resolved itself on the last update,

the command was ssh DCErouter  - ssh moon(DEVICE) - alsamixer  --then increase volume.

but its working now .


13
Installation issues / Re: Issue with 12.4 video play back of mp4
« on: August 02, 2015, 06:15:23 pm »
Hi

This is the best I can do, 50MB

https://www.dropbox.com/s/k8qoykqjxv59b08/My%20Video.mp4?dl=0

I you wanted hole film you can grab a copy at yifi movies .


Cheers
Gov

14
Installation issues / Re: Volume levels drop on MD
« on: July 26, 2015, 02:27:46 pm »
My apologizes, just trying to keep track of my issues in one place. I see the topic you raised


Kind regards
Gov

15
Hi Alblasco1702

Completed the upgrade.

There is  no option to port_forward and the only boxes that allow input is  source port, Limit to IP*

Destination Port and Destination IP are not editable and do not allow you input your data, such as the Ip address .

Please advise

Kind regards
Gov


Pages: [1] 2 3 ... 10