Firewall status tray icon - firewallstate-2.1

Configuration wizards, scanners, remote desktop, etc.
Message
Author
User avatar
tasmod
Posts: 1460
Joined: Thu 04 Dec 2008, 13:53
Location: North Lincolnshire. UK
Contact:

#31 Post by tasmod »

Version 1.0 and also Luci specific Version 0.4 released.
Rob
-
The moment after you press "Post" is the moment you actually see the typso 8)

big_bass
Posts: 1740
Joined: Mon 13 Aug 2007, 12:21

#32 Post by big_bass »

Hey tasmond
thanks for posting the C source because you did I was able to locate
an error I had
line 109 had a string compare for /etc/rc.d/rc.local
and since I had a comment I wrote in that file the compare failed


that was a unique problem to slaxer_pup and TXZ_pup that is now fixed
since I use TXZ formatted packages and slack-desc for my build this is the official "your official"
http://www.puppy2.org/slaxer/firewallst ... 3_SLXR.txz



easy fix I just cleaned the file back to the default

Code: Select all

echo '#this file called from rc.sysinit
#you can edit this file
#When firewall is installed, will append lines to this file...
#--------------------------------------------------------------'>/etc/rc.d/rc.local

and your latest Version 1.0 is confirmed to work now with that small patch

can we get the new state to refresh without restarting X ?
I tried a small app that I used many times called refresh X
but it doesnt update jwm I'll keep at that refreshing part till I figure out how

P.S firewallstate-1.0 you should put a "-" symbol in the package name to maintain the package standard

nice app 8)
Joe

User avatar
tasmod
Posts: 1460
Joined: Thu 04 Dec 2008, 13:53
Location: North Lincolnshire. UK
Contact:

#33 Post by tasmod »

Hi Joe,

I'm somewhat confused as to what is happening re X for you.

Are you saying any firewall state change is not reflected immediately by the icon?

It should be virtually instant to the user. The check routine runs every few milliseconds. I thought originally the routine would hog any processor but it doesn't go above 1% and it's probably less as that's the lowest figure htop can report.

I checked for the line in rc.local as that is appended / removed depending on the firewall install and if my original on/off pet is used.
(I wrote it a while ago to turn firewall on/off when testing)

I borked my Slaxerpup install and need to install it again to check -1's operation with it.

Sorry re the naming convention, it only takes one slip when making the pet and it's in there!

I'm working on 1.1 as I've realised I've only a wired connection here and a wireless connection is not catered for in network address report, it uses ifconfig. I need iwconfig checking as well.
I need my garage laptop back in to check the wireless setup, I use it in there on wireless when I'm playing with my car ecu.

I also need to add more file 'not exist' error checking. It's OK making it work on my machine but I have loads installed on here that can affect the running of firewallstate. What works for me may not for others.
I have the devx and other libraries loaded, so I'm now checking it all out on a fresh frugal install on another laptop.

My next learning step is separate c and h files with 'make' but I'm not sure where to go just yet. I don't know what can be hived off and what is needed left in the 'interval' routine. Or even how to deal with them in code as I'm still unsure of 'static' 'void' etc uses.

I'm looking for a good online primer, I have some which are good on some features of C and others that are good on different features.
It's tiring going back and forth between them and trying to understand.

I'm on the steep part of the learning curve right now and as computers are a lone hobby there's only the net to ask.
Rob
-
The moment after you press "Post" is the moment you actually see the typso 8)

big_bass
Posts: 1740
Joined: Mon 13 Aug 2007, 12:21

#34 Post by big_bass »

Hey Rob (tasmond)
Are you saying any firewall state change is not reflected immediately by the icon?
yes

X has to be restarted to show the change state from on to off

*side note : there was a problem with a mouse cursor program that trio wrote that
x refresh fixed instead of restart X its a small bin I made a pet a while ago



Joe

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#35 Post by 01micko »

Hi Rob

Using your luci version 0.4 in luci-213 I get this error in /tmp/xerrs.log

Code: Select all

rxvt: "report-video": malformed option.
rxvt-unicode (urxvt) v9.05 - released: 2008-06-15
options: xft,styles,combining,blink,encodings=eu+vn,transparent,tint,XIM,frills,
selectionscrolling,wheel,slipwheel,smart-resize,cursorBlink,pointerBlank,scrollbars=plain+rxvt
Usage: rxvt [-help] [--help]
 [-display string] [-tn string] [-geometry geometry] [-C] [-iconic]
 [-cd string] [-/+rv] [-/+ls] [-/+j] [-/+ss] [-/+ptab] [-/+sb] [-/+sr] [-/+st]
 [-sbt number] [-/+si] [-/+sk] [-/+sw] [-/+ip] [-/+tr] [-tint color]
 [-sh number] [-/+ut] [-/+vb] [-/+tcw] [-/+insecure] [-/+uc] [-/+bc] [-/+pb]
 [-bg color] [-fg color] [-hc color] [-cr color] [-pr color] [-pr2 color]
 [-bd color] [-fn fontname] [-fb fontname] [-fi fontname] [-fbi fontname]
 [-/+is] [-im name] [-pt style] [-imlocale string] [-imfont fontname]
 [-name string] [-title string] [-n string] [-sl number] [-embed windowid]
 [-depth number] [-/+override-redirect] [-pty-fd fileno] [-/+hold] [-w number]
 [-b number] [-/+bl] [-lsp number] [-/+sbg] [-mod modifier] [-/+ssc] [-/+ssr]
 [-e command arg ...]
If I use Icewm I get it twice! (this is because for icewm, it needs to be killed and restarted to display correctly in the tray, it's an ice thing :wink: )

"report-video" is working though.. I'm just wondering why it's trying to execute (as I understand it, could be wrong) at the initiation of firewallstate.

If the error is nothing, I can suppress it, however I believe it's harmless but not nothing.

Cheers

Mick
Puppy Linux Blog - contact me for access

User avatar
tasmod
Posts: 1460
Joined: Thu 04 Dec 2008, 13:53
Location: North Lincolnshire. UK
Contact:

#36 Post by tasmod »

Version 0.5 should fix that.

I have both ready for pets, they now have icons in the menu.
Rob
-
The moment after you press "Post" is the moment you actually see the typso 8)

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

Disappears from the tray

#37 Post by bigpup »

Disappears from the tray after about 10 to 15 minutes.
Is it suppose to do that?

Installed in Lucid Puppy.

User avatar
tasmod
Posts: 1460
Joined: Thu 04 Dec 2008, 13:53
Location: North Lincolnshire. UK
Contact:

#38 Post by tasmod »

Hmmm, no. I don't know why that is, there's no timer involved. I've not had that, will monitor on spare PC.

Try version 1.1 it looks nicer on menu anyway and has some code changes in background.

I've dropped the Luci only version as there may be changes in way they want to get video.
Rob
-
The moment after you press "Post" is the moment you actually see the typso 8)

User avatar
tasmod
Posts: 1460
Joined: Thu 04 Dec 2008, 13:53
Location: North Lincolnshire. UK
Contact:

#39 Post by tasmod »

'Information' in Lighthouse Pup Mariner 5 with XFCE window manager.
Attachments
lhp5xfce.png
(19.6 KiB) Downloaded 2188 times
Rob
-
The moment after you press "Post" is the moment you actually see the typso 8)

User avatar
chrome307
Posts: 708
Joined: Thu 15 Jan 2009, 11:00

#40 Post by chrome307 »

Image

Thanks for this :)

It works for me using Browserlinux 3.54.

I have also noticed that it disappears after a short period of time but will reappear if you select it via the menu. ( firewallstate-1.1 )

I would have like it to remain as a permanent fixture to remind me that the firewall is activated.
Last edited by chrome307 on Tue 27 Jul 2010, 09:28, edited 1 time in total.

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#41 Post by bigpup »

chrome307 wrote:Thanks for this :)

I have also noticed that it disappears after a short period of time but will reappear if you select it via the menu. ( firewallstate-1.1 )

I would have like it to remain as a permanent fixture to remind me that the firewall is activated.
Same for me with version1.1 installed in Lucid Puppy.
After select it via the menu. Appears in tray for 10 to 15 minutes and again disappears.
Not a big deal. Just wanted you to know about it.

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#42 Post by jpeps »

Great script! Working nicely in Quirky.

edit: also disappears from tray, as noted.

User avatar
tasmod
Posts: 1460
Joined: Thu 04 Dec 2008, 13:53
Location: North Lincolnshire. UK
Contact:

#43 Post by tasmod »

OK I've just been away a few days, now I'll work on it.

Bit difficult for me as it doesn't do it !

It appears to be an X related problem, not a code problem so I'm a bit stumped.

I'll post up the code that I have for now. It has not been tidied up and could be done differently.

EDIT: Removed code as changed yet again.
Rob
-
The moment after you press "Post" is the moment you actually see the typso 8)

User avatar
tasmod
Posts: 1460
Joined: Thu 04 Dec 2008, 13:53
Location: North Lincolnshire. UK
Contact:

#44 Post by tasmod »

OK, I think I have a slight clue as to what is happening, why though I'm just guessing.

The 'interval' loop routine is returning a FALSE at some point and exiting. It shouldn't, it should always be TRUE but I think my information routine changes result at some point. So it would return a different value, maybe causing the FALSE return.

I've changed the code and just checking it out. If it works it will be a few cycles quicker.

I moved the info routine out of the repeating loop and made a separate entry for it.
Rob
-
The moment after you press "Post" is the moment you actually see the typso 8)

User avatar
tasmod
Posts: 1460
Joined: Thu 04 Dec 2008, 13:53
Location: North Lincolnshire. UK
Contact:

#45 Post by tasmod »

Version 1.2

OK, had this version running since last post on a new fresh install of Luci 506. It didn't vanish.
Rob
-
The moment after you press "Post" is the moment you actually see the typso 8)

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#46 Post by jpeps »

It looks like the script posts "Firewall On" if rc.firewall is present, even if $MODULE has been removed, or am I missing something?

edit: If so, one way would be to check the presence of iptable in loaded mods.

User avatar
tasmod
Posts: 1460
Joined: Thu 04 Dec 2008, 13:53
Location: North Lincolnshire. UK
Contact:

#47 Post by tasmod »

No, quite simple really.

It was meant for a first run tray applet for new Puplets. Just to remind you to turn on the firewall by running the wizard.

So a new Puppy install would show as 'firewall off' and the option to run the wizard as a reminder in the tooltip. That's why I added the quit and remove.

Now, when you have a clean install the rc.local file has no entry for firewall. When you run the wizard it appends the 'firewall start' script instruction there. I just check for that script. i don't check for the rc.firewall.

In effect once the firewall wizard is run it should not need changing. However, if you wish to turn it off then alter the script to show 'firewall stop' not 'firewall start'
Rob
-
The moment after you press "Post" is the moment you actually see the typso 8)

User avatar
tasmod
Posts: 1460
Joined: Thu 04 Dec 2008, 13:53
Location: North Lincolnshire. UK
Contact:

#48 Post by tasmod »

OK, I see your point.

But the tray applets first intention wasn't to be a full time app, however i did change it subject to requests, so i suppose it had better be accurate in it's reporting.

I've just done a couple of experiments both loading and unloading modules.

My simple method will change state if the text is changed but not reflect an accurate actual change until rebooted.

Unloading the module has no effect on the script so firewallstate will be inaccurate.

I will experiment with code to look at running the lsmod output to a file and parse that checking for iptables.
Rob
-
The moment after you press "Post" is the moment you actually see the typso 8)

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#49 Post by jpeps »

I'd be happy with a simple entry on the info page, along with the other cats.

edit: firewall start/stop switch?

User avatar
tasmod
Posts: 1460
Joined: Thu 04 Dec 2008, 13:53
Location: North Lincolnshire. UK
Contact:

#50 Post by tasmod »

Hmmm, I've carried out further tests.

The only way to turn the firewall off easily is to change the text in rc.local to 'firewall stop' and reboot. Otherwise delete the rc.firewall and reboot again.
All require a reboot and the rc.local changes, so I can't see a reason to change the code at the moment. Unless anyone knows otherwise.

I have changed the code and tested but it is easier the original way as this seems to be universal in operation.

I wrote a pet to turn firewall on and off a while back, it's on here somewhere.
Rob
-
The moment after you press "Post" is the moment you actually see the typso 8)

Post Reply