Control Panel Location And 0.4.x Changes

Packaging/Compiling/Client Information Forums, including Author's chit chat forum and soon others.

Postby Ugly_Monkey » Mon Dec 15, 2008 2:28 am

I have got my extended control panel up and running on 0.4.0 box, however I am curious as to what would be the proper way to install this package and where? I basically just delete the wwa folder and set a new link for it in my rc file. I am also curious of any major changes to file locations accessed by the standerd control panel. I wanted to keep 0.3.x compatability but may decide to make it 0.4.x only. not shure currently it works on both ( i believe ) hence the reason Im asking about this stuff.
<a href='http://www.northwestmodder.com' target='_blank'><img src='http://bfoclan.northwestmodder.com/images/sigs/umsig.jpg' border='0' alt='user posted image' /></a>
User avatar
Ugly_Monkey
Newbie
 
Posts: 15
Joined: Fri Dec 29, 2006 5:13 am

Postby Lightning » Mon Dec 15, 2008 7:50 pm

I think it will be difficult to make a web control panel both 03x and 04x compatible without some extended scripting. There are a number of major issues not the least of which is the fact that the entire 04x OS uses language conversion files for all printed text and therefor no script contains the actual text. This also aplies to the new 04x packages as well and there control panel addons. The main thing that makes it a bit more difficult at this point is that there aren't very many packages with any language files other than English and the main system currently only has an English translation. But if you really want to see what the language file does to the system you can play with the "censored.tgz" file and convert the LANGUAGE=english to LANGUAGE=censored in the ssyslinux.cfg file on a new floppy. Which I don't really recommend doing this to your main system, but it is fun to play with and can make your system much MUCH harder for anyone to mess with (even you).

So I guess what I am saying is that any control panel will work because it is just a web server and most of the files are in a very similar if not the same format. But the system it's self is VERY much changed as to how it works and the package format is a LOT different.

As for adding things to the web control panel or even changing it, all that is required is to place your files in the /boot/cpc directory. That directory is copied to /wwa/ at boot time. So even sub directories can be included under /boot/cpc/
and any file with the same name as the original files will overwrite the defaults.
Although be aware that those files end up being in the ramdisk. So size is of some interest unless they are just symlinks.

From a personal standpoint I would have to see the 03x version to really say how much work doing the conversion to the 04x packaging would be. But if you download the new "Pack" command there is a lot of information included in the base scripts. <a href='http://lewys-spot.dyndns.org/packages/0.4.x/non-package/' target='_blank'>http://lewys-spot.dyndns.org/packages/0.4.x/non-package/</a>

Dingetje also posted a small howto that I wrote to help a bit with the new package system, although I suspect it needs to be several more pages.
<a href='http://dingetje.homeip.net/dokuwiki/freesco/howtos/repack03xto04x' target='_blank'>http://dingetje.homeip.net/dokuwiki/freesc.../repack03xto04x</a>
If you are afraid that you might make a mistake. The chances are high that you will never learn anything.
User avatar
Lightning
FREESCO GURU !!
 
Posts: 3006
Joined: Wed Nov 14, 2001 6:50 am
Location: Oregon, USA

Postby Ugly_Monkey » Mon Dec 15, 2008 11:24 pm

Well I have decided to ditch the 0.3.x ver just because its not really worth the hassle of backwards compatability. but ive got the 0.4.x version working fairly good now. there are a few bugs. but overall it works good. I am not going to takcle the language stuff for the main control panel yet, im just going to leave it english only for now but i have converted my control panael addons to work properly across languages. also I have devised a way in wich my custom cp addons can be cross compatible with the original CP, unfortunatly addons for the original CP will havta be slightly modified to work with my new cp.

I have no idea how to make a package so ill look into that info.

by using my del wwa and symlink to my dir. it leaves the ability for someone to flip flop the CPs without loosing settings for either.

as soon as i can figure out how to package this up i will try to get a beta out.

Im sure this will be an awsome adition to freesco.

my favorite thing is i added DHCP lease migration! man it makes complex net setups a snap.
<a href='http://www.northwestmodder.com' target='_blank'><img src='http://bfoclan.northwestmodder.com/images/sigs/umsig.jpg' border='0' alt='user posted image' /></a>
User avatar
Ugly_Monkey
Newbie
 
Posts: 15
Joined: Fri Dec 29, 2006 5:13 am

Postby Lightning » Tue Dec 16, 2008 1:07 am

my favorite thing is i added DHCP lease migration!

Just so you understand that I am not above stealing and modifying code for the next version of FREESCO. :rolleyes:

Also to be a mirrored 04x package it must be created multilingual compatible. But it is really not that difficult to convert once you have a working English version and I am more than willing to help in any way possible.
If you are afraid that you might make a mistake. The chances are high that you will never learn anything.
User avatar
Lightning
FREESCO GURU !!
 
Posts: 3006
Joined: Wed Nov 14, 2001 6:50 am
Location: Oregon, USA

Postby Ugly_Monkey » Tue Dec 16, 2008 3:15 am

HeHe! Well hopefully that wont be the only code youll want to steal! Lol

I have a question:
what are the permisions for the control panel folders and addon folder?
i am a windows guy so some of this stuff boggles me. here the situation, i made an addon for my CP but it doesnt have permission to run ie it fails the admin check. but if i copy the --linux---.-- or whatever file from say the pciutils english folder to mine then after a bit of renameing my cp addon works fine. im trying to figure out the proper way to set the folders and .htpasswd files for my CP.

does this make sense? Help!
<a href='http://www.northwestmodder.com' target='_blank'><img src='http://bfoclan.northwestmodder.com/images/sigs/umsig.jpg' border='0' alt='user posted image' /></a>
User avatar
Ugly_Monkey
Newbie
 
Posts: 15
Joined: Fri Dec 29, 2006 5:13 am

Postby Lightning » Tue Dec 16, 2008 7:43 pm

The thing to understand is that FREESCO uses UMSDOS which is based on plain DOS and the 8.3 format naming of files. So every file on the disk on a FAT disk will never exceed 8 characters and a three character extension. It also only has a single set of basic file permissions. To get around this problem the UMSDOS format uses a translation file called --linux-.--- in every directory and in that file is the conversion long file names of every file and each files permissions. Which there are three sets of permissions for every file and directory. The first digit of permissions relates to some extended functions that really don't have meaning here. The second digit is the owners permission. The third digit is the group permission and the final digit is the general permissions.

7 read/write/execute and search
6 read/write
5 read/execute and search
4 read
2 write
1 execute and search

1, 2. and 4 are ther only real numbers and you add them together to get the various combinations. Each of these digits apliy to all three categories of users. So if you use

chmod 0755 file

Then the file will have read/write/execute and search privileges to the owner of that file or directory. But the group and the general permissions will not be allowed to write it.

Every file and directory also has an owner and a group that it is defined to belong to. Most files in FREESCO belong to the root group and are owned by root. Which applies to the /wwa directory with permissions of 755. But the /wwa/cgi directory is set as 711, which makes it possible to execute a file in that directory but unable to read the files in that directory. There are multiple layers of various permissions throughout the control panel directory structure.

If you happen to be working on Linux files from within a Windows environment then you will continue to have a LOT of various issues with ownership and with permissions as well. I STRONGLY recommend loading the "mc" package and doing most if not all of your modifications using it from within FREESCO. At that point you should never need to mess with the --linux-.--- file again. Which when used properly you should never even be able to see that file other than when FREESCO is shut down from a Windows machine and in any case you should never just copy that file from one directory to another because it will have the wrong information inside it.

Special note : the --linux-.--- file ONLY applies to a FAT floppy or hard drive install and NOT an ext2 hard drive install.
If you are afraid that you might make a mistake. The chances are high that you will never learn anything.
User avatar
Lightning
FREESCO GURU !!
 
Posts: 3006
Joined: Wed Nov 14, 2001 6:50 am
Location: Oregon, USA

Postby Ugly_Monkey » Wed Dec 17, 2008 9:40 pm

Code: Select all
ADMIN="`cat /wwa/cgi/.htpasswd |sed -n '1P' |sed 's/:.*//'`"
if [ ! "$REMOTE_USER" ]
then echo "You must provide a user name to use this script."; exit 1
elif [ "$REMOTE_USER" != $ADMIN ]
then echo "$REMOTE_USER is not authorized to use this script."; exit 1
fi


So what permissions need to be set exactly for this chunk of script to validate?
<a href='http://www.northwestmodder.com' target='_blank'><img src='http://bfoclan.northwestmodder.com/images/sigs/umsig.jpg' border='0' alt='user posted image' /></a>
User avatar
Ugly_Monkey
Newbie
 
Posts: 15
Joined: Fri Dec 29, 2006 5:13 am

Postby Lightning » Wed Dec 17, 2008 11:01 pm

chmod 755 file_name

will work fine for most CGI scripts.
If you are afraid that you might make a mistake. The chances are high that you will never learn anything.
User avatar
Lightning
FREESCO GURU !!
 
Posts: 3006
Joined: Wed Nov 14, 2001 6:50 am
Location: Oregon, USA

Postby dingetje » Thu Dec 18, 2008 1:54 am

As you may know the web control panel is protected via the .htpasswd file that contains username/password combinations for the web users that are allowed access to the control panel. This code verifies that a user is actually logged in by checking the $REMOTE_USER environment variable (i.e. see <a href='http://members.tripod.com/DarrenCGI/env_var.html)' target='_blank'>http://members.tripod.com/DarrenCGI/env_var.html)</a>
GreetZ
http://dingetje.homeip.net

"Software is like sex: it's better when it's free." - LINUS TORVALDS
User avatar
dingetje
FREESCO Crazed !!
 
Posts: 1001
Joined: Wed Nov 14, 2001 12:13 pm
Location: The Netherlands

Postby Ugly_Monkey » Wed Dec 24, 2008 9:19 am

Would either of you guys be willing to throw together an alpha package for me? I can send you all necissary files, and directory structer and what not. heck i could proly send u a vmware img of it workin if need be. You guys are way more familiar with the guts of freesco. you might know a better way for my RC file to ioperate and what not. let me know! and if so let me know how/where to send files or i can host and send link. whatever.
<a href='http://www.northwestmodder.com' target='_blank'><img src='http://bfoclan.northwestmodder.com/images/sigs/umsig.jpg' border='0' alt='user posted image' /></a>
User avatar
Ugly_Monkey
Newbie
 
Posts: 15
Joined: Fri Dec 29, 2006 5:13 am

Postby Lightning » Wed Dec 24, 2008 3:12 pm

Sure, you can PM me a link or if you want to tar.gz them you can email them to me using the board link. Or I can even use a VMware image file if you like as well. The format or method is not of any importance to me.
If you are afraid that you might make a mistake. The chances are high that you will never learn anything.
User avatar
Lightning
FREESCO GURU !!
 
Posts: 3006
Joined: Wed Nov 14, 2001 6:50 am
Location: Oregon, USA

Postby Ugly_Monkey » Mon Dec 29, 2008 4:06 pm

OK, well after a bit of tweaking I got the package working.

fixed so far:
download report
dns management

however when ever i reboot the router i lose my changes to /etc/dns.cfg
should I be saving this file somewhere else?

I will be tackling the ban list stuff tonight, hopefully.
<a href='http://www.northwestmodder.com' target='_blank'><img src='http://bfoclan.northwestmodder.com/images/sigs/umsig.jpg' border='0' alt='user posted image' /></a>
User avatar
Ugly_Monkey
Newbie
 
Posts: 15
Joined: Fri Dec 29, 2006 5:13 am

Postby Lightning » Mon Dec 29, 2008 7:44 pm

/etc/dns.cfg
should I be saving this file somewhere else?
Yes, the /etc/dns.cfg file is the live file that is being used by the system. But the hard copy of that file is stored in /boot/etc/dns.cfg
So modify the /etc/ file and then copy it to /boot/etc/ to survive a reboot. This same procedure does NOT apply to the /etc/passwd or /etc/restrict.cfg files because they are copied to /boot/etc/ by the system any time the /etc/ version is changed in any way. But the procedure does apply to some other files like the /etc/cron/root is copied to /boot/etc/cron.cfg and /etc/dhcp.cfg is copied to /boot/etc/dhcp.cfg and /etc/dyndns.cfg is copied to /boot/etc/dyndns.cfg and /etc/portfw.cfg is copied to /boot/etc/

Those are probably the primary files you may be dealing with. Just remember the /etc/ is the ram disk and /boot/etc/ is always the hard copy that is copied to /etc/ at boot time. One of the reasons for doing this is that the system runs a LOT faster because all of the files needed are directly in memory rather than having to spin the disk to read them for every operation.
If you are afraid that you might make a mistake. The chances are high that you will never learn anything.
User avatar
Lightning
FREESCO GURU !!
 
Posts: 3006
Joined: Wed Nov 14, 2001 6:50 am
Location: Oregon, USA


Return to Packaging/Compiling/Client Information Forums

Who is online

Users browsing this forum: No registered users and 0 guests

cron