|
From: Joe z. <jz...@at...> - 2002-06-24 04:18:44
|
I think I've got the ./configure and 'make install' working pretty good. I'm changing permissions and ownership only on the files and directories that need it. Everything else will be owned by root, assuming you run 'make install' as root. I plan to create a 'make install_cron'. I don't know if I've already said this, I'm very impressed with the way you use frames, and with the directory tree written in php, and I think the menu tabs look very professional. You do good work. I don't plan to get much more done on bobs this week because I'm preparing for next week's vacation. |
|
From: Rene R. <re...@gr...> - 2002-07-04 14:33:04
|
I think the settings system will have to be reimplemented. I need some additional settings and options. Cleartext passwords are needed for smb access. Security must be enabled using .htaccess files to prevent password from being read. Files must be chmodded to 0600 to prevent shell users from reading the files. I'll begin working on the SMB access method. Also an nfs only method would be nice. Rsync is not strictly nessecary to make backups. But it is a nicer way of doing it since it will (I think) use less processor power and consume less bandwidth. Basically this can be split into two tasks. A new configuration editing system and a new backup class. (I think I'll rename function.php to class_backup.php) A more generic configuration editor would be nice. If you want to help break things please let me know. I'll not commit my work to cvs until it works to avoid breaking the cvs tree. Please comment on these ideas. I've tried to descripe how I think the new settings should be created. When clicking on "create new server" the following questions are asked - choose backup method: Smb / Nfs / Rsync - choose restore method: Smb / Nfs - choose network address type: Dns / static Ip Based on the above answer the appropriate settings below are shown. - Login name: Login name for this server (the login needed for eg. smb access) - Password: Password (stored as clear text. Needed for smb access.) - Server name: The servers network name - Server IP address: The servers Static IP address - Rsync share name: Rsync share name - NFS share path: NFS share path - NFS share name: Descriptive name for the share (unique name for this server) - SMB share name: SMB share name - Active: Is this server active (do I need to make backups?) - Backup days: Which weekdays to make backups. -- options not implemented yet -- - Incrementals: How many incremental backups should there be. - Compress: Should incremental files be compressed? -Rene |
|
From: Rene R. <re...@gr...> - 2002-07-05 19:07:25
|
So far, so good.. I've got smb backup and restore working. Still need to do nfs backup (should be a walk in the park) Server ini file changes include: "smb_share" The name of the remote smb share "backup_method" The method used for making backup. (rsync/smb/nfs) "restore_method" Method used for restoring files (smb/nfs) "server_ip" is optional. If used I assume its a static IP. "share" is now used as a descriptive label for the backup. (eg. /backupdir/bobsdata/server/share) "rsync_share" is the name of the remote rsync share "password" is now cleartext. I found what seems to be a bug in filename handling when restoring files. I still haven't isolated the precise cause. The admin interface is broken in regards to creating correct ini files. Some things to think about: I've got a share which contains several projects. These files are all "linked" together on a project basis. Making backups of individual files does not make that much sense since they depend on each other. I was thinking something in the line of making a manual "do backup now" button. Maybe creating a list of the projects and being able to select one (or more) of them for a backup. A set of rules for the list could be an option. eg. each dir in the root of the share is a project. Only make full backup of each project. Any good ideas? An editor for the exclude lists and the linked files list is needed. Maybe someone has already made one we can use. I'll post news as I go along. I'll do a cvs commit of the changes soon. -Rene Rene Rask wrote: > > I think the settings system will have to be reimplemented. > I need some additional settings and options. > Cleartext passwords are needed for smb access. > Security must be enabled using .htaccess files to prevent password from > being read. > Files must be chmodded to 0600 to prevent shell users from reading the > files. > > I'll begin working on the SMB access method. > Also an nfs only method would be nice. Rsync is not strictly nessecary > to make backups. But it is a nicer way of doing it since it will (I > think) use less processor power and consume less bandwidth. > > Basically this can be split into two tasks. A new configuration editing > system and a new backup class. (I think I'll rename function.php to > class_backup.php) > A more generic configuration editor would be nice. > If you want to help break things please let me know. I'll not commit my > work to cvs until it works to avoid breaking the cvs tree. > > Please comment on these ideas. > > I've tried to descripe how I think the new settings should be created. > > When clicking on "create new server" the following questions are asked > - choose backup method: Smb / Nfs / Rsync > - choose restore method: Smb / Nfs > - choose network address type: Dns / static Ip > > Based on the above answer the appropriate settings below are shown. > - Login name: Login name for this server (the login needed for > eg. smb access) > - Password: Password (stored as clear text. Needed for smb access.) > - Server name: The servers network name > - Server IP address: The servers Static IP address > - Rsync share name: Rsync share name > - NFS share path: NFS share path > - NFS share name: Descriptive name for the share (unique name for > this server) > - SMB share name: SMB share name > - Active: Is this server active (do I need to make backups?) > - Backup days: Which weekdays to make backups. > > -- options not implemented yet -- > - Incrementals: How many incremental backups should there be. > - Compress: Should incremental files be compressed? > > > > -Rene > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Caffeinated soap. No kidding. > http://thinkgeek.com/sf > _______________________________________________ > Bobs-devel mailing list > Bob...@li... > https://lists.sourceforge.net/lists/listinfo/bobs-devel |
|
From: Rene R. <re...@gr...> - 2002-07-10 13:48:40
|
I've been looking into the filename problems. It seems to me that escaping filenames in PHP will ony lead to a constant headache (which is not what I need right now ;) I've found a few Bash tricks that look really promising but I haven't cracked the problem yet. I'm able to make Bash escape a filename with weird characters in it. But I'm still not able to do it with input from a list. When (if?) I get this working we should be able to stop worrying about filenames. If you know any Bash experts please ask if they can help. -Rene |
|
From: Rene R. <re...@gr...> - 2002-07-11 21:53:25
|
Project based backup proposal. Definition of a project: - each root directory in a share is a project. Needed changes: - To restore a project we need to be able to select an entire project easily. - Full backups. Project files are treated as one file. Incremental backups must make an increment of the entire project every time. This will take up a lot more space on the disk. Only keeping one copy of files that have not changed would be a good idea. This requires a way of checking this. A simple "compare" or an MD5 checksum. This will require a way of tracking these files and what backups they belong to. Either using a database or a seperate index of these files. - The ability to manually start a backup from bobs would be a good idea. Design Issues: I was originally thinking of backup methods as a sort of plugins to bobs. Bobs would be the controller and the plugins would handle the actual code in respect to making backup and restoring files. This still seems to be the way to do it. I think some of the functions in class_backup and class_restore should be extracted to something like backup_smb.php, backup_nfs.php and restore_nfs.php. A clean and well defined data structure should be used to pass data to the plugins. This would make it easier to make stuff like "backup_smb_project.php" Rene |
|
From: Joe z. <jz...@at...> - 2002-07-12 05:26:39
|
Rene Rask wrote: > I've been looking into the filename problems. > > It seems to me that escaping filenames in PHP will ony lead to a > constant headache (which is not what I need right now ;) > > I've found a few Bash tricks that look really promising but I haven't > cracked the problem yet. I'm able to make Bash escape a filename with > weird characters in it. But I'm still not able to do it with input > from a list. > When (if?) I get this working we should be able to stop worrying about > filenames. > If you know any Bash experts please ask if they can help. > > -Rene > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Two, two, TWO treats in one. > http://thinkgeek.com/sf > _______________________________________________ > Bobs-devel mailing list > Bob...@li... > https://lists.sourceforge.net/lists/listinfo/bobs-devel > Have you tried "quoting the filenames?" That also works in bash. |
|
From: Rene R. <re...@gr...> - 2002-07-12 07:30:14
|
The names are quoted. I've tried both double and single quoting. If I can get bash to accept the names as "literal" instead of "glob" it should solve the problem. A name like "some name^Mtest" does not behave well. Only working solution I've found was this way: $'some name^Mtest' But I can't figure out how that is useful in a script. I'll keep trying. -Rene On Fri, 2002-07-12 at 07:26, Joe zacky wrote: > Rene Rask wrote: > > > I've been looking into the filename problems. > > > > It seems to me that escaping filenames in PHP will ony lead to a > > constant headache (which is not what I need right now ;) > > > > I've found a few Bash tricks that look really promising but I haven't > > cracked the problem yet. I'm able to make Bash escape a filename with > > weird characters in it. But I'm still not able to do it with input > > from a list. > > When (if?) I get this working we should be able to stop worrying about > > filenames. > > If you know any Bash experts please ask if they can help. > > > > -Rene > > > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by:ThinkGeek > > Two, two, TWO treats in one. > > http://thinkgeek.com/sf > > _______________________________________________ > > Bobs-devel mailing list > > Bob...@li... > > https://lists.sourceforge.net/lists/listinfo/bobs-devel > > > Have you tried "quoting the filenames?" That also works in bash. > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Gadgets, caffeine, t-shirts, fun stuff. > http://thinkgeek.com/sf > _______________________________________________ > Bobs-devel mailing list > Bob...@li... > https://lists.sourceforge.net/lists/listinfo/bobs-devel |
|
From: Joe z. <jz...@at...> - 2002-07-13 04:32:34
|
Have you tried escaping single quotes like this, where $filename is the
variable containing the name of the file:
\'$filename\'
Joe
Rene Rask wrote:
>The names are quoted. I've tried both double and single quoting.
>If I can get bash to accept the names as "literal" instead of "glob" it
>should solve the problem.
>
>A name like "some name^Mtest" does not behave well.
>Only working solution I've found was this way:
>$'some name^Mtest'
>But I can't figure out how that is useful in a script.
>
>
>I'll keep trying.
>
>-Rene
>
>
>On Fri, 2002-07-12 at 07:26, Joe zacky wrote:
>
>
>>Rene Rask wrote:
>>
>>
>>
>>>I've been looking into the filename problems.
>>>
>>>It seems to me that escaping filenames in PHP will ony lead to a
>>>constant headache (which is not what I need right now ;)
>>>
>>>I've found a few Bash tricks that look really promising but I haven't
>>>cracked the problem yet. I'm able to make Bash escape a filename with
>>>weird characters in it. But I'm still not able to do it with input
>>>from a list.
>>>When (if?) I get this working we should be able to stop worrying about
>>>filenames.
>>>If you know any Bash experts please ask if they can help.
>>>
>>>-Rene
>>>
>>>
>>>
>>>-------------------------------------------------------
>>>This sf.net email is sponsored by:ThinkGeek
>>>Two, two, TWO treats in one.
>>>http://thinkgeek.com/sf
>>>_______________________________________________
>>>Bobs-devel mailing list
>>>Bob...@li...
>>>https://lists.sourceforge.net/lists/listinfo/bobs-devel
>>>
>>>
>>>
>>Have you tried "quoting the filenames?" That also works in bash.
>>
>>
>>
>>-------------------------------------------------------
>>This sf.net email is sponsored by:ThinkGeek
>>Gadgets, caffeine, t-shirts, fun stuff.
>>http://thinkgeek.com/sf
>>_______________________________________________
>>Bobs-devel mailing list
>>Bob...@li...
>>https://lists.sourceforge.net/lists/listinfo/bobs-devel
>>
>>
>
>
>
>
>-------------------------------------------------------
>This sf.net email is sponsored by:ThinkGeek
>Gadgets, caffeine, t-shirts, fun stuff.
>http://thinkgeek.com/sf
>_______________________________________________
>Bobs-devel mailing list
>Bob...@li...
>https://lists.sourceforge.net/lists/listinfo/bobs-devel
>
>
>
|
|
From: Rene R. <re...@gr...> - 2002-07-13 16:19:02
|
I've finally been able to get some useful results. This is not a perfect solution as far as I can see. Basically it involves changing the $IFS value in bash to be a newline. And changing it to the original value after use. The problem is (or will be) that filenames cannot contain newlines. I might be able to escape newlines in filenames. Anyway. This solution is better than the old one so I'm going to update the cvs with it. I'll see if I can test the newline problem and find a solution. Rene Joe zacky wrote: > Have you tried escaping single quotes like this, where $filename is the > variable containing the name of the file: > \'$filename\' > > Joe > > Rene Rask wrote: > >>The names are quoted. I've tried both double and single quoting. >>If I can get bash to accept the names as "literal" instead of "glob" it >>should solve the problem. >> >>A name like "some name^Mtest" does not behave well. >>Only working solution I've found was this way: >>$'some name^Mtest' >>But I can't figure out how that is useful in a script. >> >> >>I'll keep trying. >> >>-Rene >> >> >>On Fri, 2002-07-12 at 07:26, Joe zacky wrote: >> >> >>>Rene Rask wrote: >>> >>> >>> >>>>I've been looking into the filename problems. >>>> >>>>It seems to me that escaping filenames in PHP will ony lead to a >>>>constant headache (which is not what I need right now ;) >>>> >>>>I've found a few Bash tricks that look really promising but I haven't >>>>cracked the problem yet. I'm able to make Bash escape a filename with >>>>weird characters in it. But I'm still not able to do it with input >>>>from a list. >>>>When (if?) I get this working we should be able to stop worrying about >>>>filenames. >>>>If you know any Bash experts please ask if they can help. >>>> >>>>-Rene >>>> >>>> >>>> >>>>------------------------------------------------------- >>>>This sf.net email is sponsored by:ThinkGeek >>>>Two, two, TWO treats in one. >>>>http://thinkgeek.com/sf >>>>_______________________________________________ >>>>Bobs-devel mailing list >>>>Bob...@li... >>>>https://lists.sourceforge.net/lists/listinfo/bobs-devel >>>> >>>> >>>> >>>Have you tried "quoting the filenames?" That also works in bash. >>> >>> >>> >>>------------------------------------------------------- >>>This sf.net email is sponsored by:ThinkGeek >>>Gadgets, caffeine, t-shirts, fun stuff. >>>http://thinkgeek.com/sf >>>_______________________________________________ >>>Bobs-devel mailing list >>>Bob...@li... >>>https://lists.sourceforge.net/lists/listinfo/bobs-devel >>> >>> >> >> >> >> >>------------------------------------------------------- >>This sf.net email is sponsored by:ThinkGeek >>Gadgets, caffeine, t-shirts, fun stuff. >>http://thinkgeek.com/sf >>_______________________________________________ >>Bobs-devel mailing list >>Bob...@li... >>https://lists.sourceforge.net/lists/listinfo/bobs-devel >> >> >> > |
|
From: Rene <re...@gr...> - 2002-07-13 20:33:23
|
Damn filenames... Filenames including newlines will not work properly. That much is sure. I'm going examine possible solutions, like use a NULL as an end-of-line seperator. I read somewhere that NULL's aren't accepted by shell programs like grep so that might be a problem. Maybe maybe an end-of-line marker like "///FF" would work if NULL is not usefull. What is your opinion about using flat text files instead of databases? Any suggestion on better ways to do it? Rene On Sat, 2002-07-13 at 18:11, Rene Rask wrote: > > I've finally been able to get some useful results. > > This is not a perfect solution as far as I can see. > > Basically it involves changing the $IFS value in bash to be a newline. > And changing it to the original value after use. > > The problem is (or will be) that filenames cannot contain newlines. > I might be able to escape newlines in filenames. > > Anyway. This solution is better than the old one so I'm going to update > the cvs with it. > > I'll see if I can test the newline problem and find a solution. > > > Rene > > > > Joe zacky wrote: > > Have you tried escaping single quotes like this, where $filename is the > > variable containing the name of the file: > > \'$filename\' > > > > Joe > > > > Rene Rask wrote: > > > >>The names are quoted. I've tried both double and single quoting. > >>If I can get bash to accept the names as "literal" instead of "glob" it > >>should solve the problem. > >> > >>A name like "some name^Mtest" does not behave well. > >>Only working solution I've found was this way: > >>$'some name^Mtest' > >>But I can't figure out how that is useful in a script. > >> > >> > >>I'll keep trying. > >> > >>-Rene > >> > >> > >>On Fri, 2002-07-12 at 07:26, Joe zacky wrote: > >> > >> > >>>Rene Rask wrote: > >>> > >>> > >>> > >>>>I've been looking into the filename problems. > >>>> > >>>>It seems to me that escaping filenames in PHP will ony lead to a > >>>>constant headache (which is not what I need right now ;) > >>>> > >>>>I've found a few Bash tricks that look really promising but I haven't > >>>>cracked the problem yet. I'm able to make Bash escape a filename with > >>>>weird characters in it. But I'm still not able to do it with input > >>>>from a list. > >>>>When (if?) I get this working we should be able to stop worrying about > >>>>filenames. > >>>>If you know any Bash experts please ask if they can help. > >>>> > >>>>-Rene > >>>> > >>>> > >>>> > >>>>------------------------------------------------------- > >>>>This sf.net email is sponsored by:ThinkGeek > >>>>Two, two, TWO treats in one. > >>>>http://thinkgeek.com/sf > >>>>_______________________________________________ > >>>>Bobs-devel mailing list > >>>>Bob...@li... > >>>>https://lists.sourceforge.net/lists/listinfo/bobs-devel > >>>> > >>>> > >>>> > >>>Have you tried "quoting the filenames?" That also works in bash. > >>> > >>> > >>> > >>>------------------------------------------------------- > >>>This sf.net email is sponsored by:ThinkGeek > >>>Gadgets, caffeine, t-shirts, fun stuff. > >>>http://thinkgeek.com/sf > >>>_______________________________________________ > >>>Bobs-devel mailing list > >>>Bob...@li... > >>>https://lists.sourceforge.net/lists/listinfo/bobs-devel > >>> > >>> > >> > >> > >> > >> > >>------------------------------------------------------- > >>This sf.net email is sponsored by:ThinkGeek > >>Gadgets, caffeine, t-shirts, fun stuff. > >>http://thinkgeek.com/sf > >>_______________________________________________ > >>Bobs-devel mailing list > >>Bob...@li... > >>https://lists.sourceforge.net/lists/listinfo/bobs-devel > >> > >> > >> > > > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Bobs-devel mailing list > Bob...@li... > https://lists.sourceforge.net/lists/listinfo/bobs-devel |
|
From: Joe z. <jz...@at...> - 2002-07-14 02:10:34
|
I don't understand where these filenames with embedded newlines are coming from? I haven't ever seen a filename with an embedded newline. Is this a problem in class_restore.php? I'm planning to look at the configuration editor admin.php tonight to see if I can figure out what needs to be reworked. Please keep in mind I'm not familiar with the functioning of the php pages and classes you've written, so it takes me a while to get my head into it. More specifics on what I should work on would help, like which files or classes, what should change on admin.php, etc. I hope I can get some stuff done this weekend. It's over 100 degrees here (37.7 celsius), and I'm still lazy from vacationing. Joe Rene wrote: >Damn filenames... > >Filenames including newlines will not work properly. That much is sure. > >I'm going examine possible solutions, like use a NULL as an end-of-line >seperator. I read somewhere that NULL's aren't accepted by shell >programs like grep so that might be a problem. >Maybe maybe an end-of-line marker like "///FF" would work if NULL is not >usefull. > >What is your opinion about using flat text files instead of databases? >Any suggestion on better ways to do it? > >Rene > > >On Sat, 2002-07-13 at 18:11, Rene Rask wrote: > > >>I've finally been able to get some useful results. >> >>This is not a perfect solution as far as I can see. >> >>Basically it involves changing the $IFS value in bash to be a newline. >>And changing it to the original value after use. >> >>The problem is (or will be) that filenames cannot contain newlines. >>I might be able to escape newlines in filenames. >> >>Anyway. This solution is better than the old one so I'm going to update >>the cvs with it. >> >>I'll see if I can test the newline problem and find a solution. >> >> >>Rene >> >> >> >>Joe zacky wrote: >> >> >>>Have you tried escaping single quotes like this, where $filename is the >>>variable containing the name of the file: >>> \'$filename\' >>> >>>Joe >>> >>>Rene Rask wrote: >>> >>> >>> >>>>The names are quoted. I've tried both double and single quoting. >>>>If I can get bash to accept the names as "literal" instead of "glob" it >>>>should solve the problem. >>>> >>>>A name like "some name^Mtest" does not behave well. >>>>Only working solution I've found was this way: >>>>$'some name^Mtest' >>>>But I can't figure out how that is useful in a script. >>>> >>>> >>>>I'll keep trying. >>>> >>>>-Rene >>>> >>>> >>>>On Fri, 2002-07-12 at 07:26, Joe zacky wrote: >>>> >>>> >>>> >>>> >>>>>Rene Rask wrote: >>>>> >>>>> >>>>> >>>>> >>>>> >>>>>>I've been looking into the filename problems. >>>>>> >>>>>>It seems to me that escaping filenames in PHP will ony lead to a >>>>>>constant headache (which is not what I need right now ;) >>>>>> >>>>>>I've found a few Bash tricks that look really promising but I haven't >>>>>>cracked the problem yet. I'm able to make Bash escape a filename with >>>>>>weird characters in it. But I'm still not able to do it with input >>>>>> >>>>>> >>>>>>from a list. >>>>> >>>>> >>>>>>When (if?) I get this working we should be able to stop worrying about >>>>>>filenames. >>>>>>If you know any Bash experts please ask if they can help. >>>>>> >>>>>>-Rene >>>>>> >>>>>> >>>>>> >>>>>>------------------------------------------------------- >>>>>>This sf.net email is sponsored by:ThinkGeek >>>>>>Two, two, TWO treats in one. >>>>>>http://thinkgeek.com/sf >>>>>>_______________________________________________ >>>>>>Bobs-devel mailing list >>>>>>Bob...@li... >>>>>>https://lists.sourceforge.net/lists/listinfo/bobs-devel >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>Have you tried "quoting the filenames?" That also works in bash. >>>>> >>>>> >>>>> >>>>>------------------------------------------------------- >>>>>This sf.net email is sponsored by:ThinkGeek >>>>>Gadgets, caffeine, t-shirts, fun stuff. >>>>>http://thinkgeek.com/sf >>>>>_______________________________________________ >>>>>Bobs-devel mailing list >>>>>Bob...@li... >>>>>https://lists.sourceforge.net/lists/listinfo/bobs-devel >>>>> >>>>> >>>>> >>>>> >>>> >>>> >>>>------------------------------------------------------- >>>>This sf.net email is sponsored by:ThinkGeek >>>>Gadgets, caffeine, t-shirts, fun stuff. >>>>http://thinkgeek.com/sf >>>>_______________________________________________ >>>>Bobs-devel mailing list >>>>Bob...@li... >>>>https://lists.sourceforge.net/lists/listinfo/bobs-devel >>>> >>>> >>>> >>>> >>>> >> >> >> >>------------------------------------------------------- >>This sf.net email is sponsored by:ThinkGeek >>Welcome to geek heaven. >>http://thinkgeek.com/sf >>_______________________________________________ >>Bobs-devel mailing list >>Bob...@li... >>https://lists.sourceforge.net/lists/listinfo/bobs-devel >> >> > > > > >------------------------------------------------------- >This sf.net email is sponsored by:ThinkGeek >Welcome to geek heaven. >http://thinkgeek.com/sf >_______________________________________________ >Bobs-devel mailing list >Bob...@li... >https://lists.sourceforge.net/lists/listinfo/bobs-devel > > > |
|
From: Rene <re...@gr...> - 2002-07-14 18:59:13
|
On Sun, 2002-07-14 at 04:10, Joe zacky wrote: > I don't understand where these filenames with embedded newlines are > coming from? I haven't ever seen a filename with an embedded newline. Is > this a problem in class_restore.php? It breaks some things. And I know that it is not an illegal filename. I'm just trying to make sure that bobs does not break. But right now there should only be _very_ few names that will break bobs. > > I'm planning to look at the configuration editor admin.php tonight to > see if I can figure out what needs to be reworked. Please keep in mind > I'm not familiar with the functioning of the php pages and classes > you've written, so it takes me a while to get my head into it. More > specifics on what I should work on would help, like which files or > classes, what should change on admin.php, etc. > Well. I don't really know what to do with admin.php. I would probably tear it apart and start over. It's not as good as I would like it. Basically it needs to handle several types of configuration setups. A better way to do it would be to introduce configuration options as needed. eg. a user selects "smb share" and "static ip" as options. Then the following options show up: "servername" "ip address" Smb share name" "login" "password". 1. Handling and checking of options. 2. A way of linking options. eg. smb_share depends on backup_type=smb admin.php and class_config are the only php related to configuration so don't be afraid of breaking stuff. I looked at the server.definitions.ini and been trying to figure out how to make a better editor. I think we should drop the file and go with a php file instead. That way we could use arrays to hold the information we need. Like type, name, descriptions, selection lists and what depends on what. example definitions array [smb_share][type] = text [smb_share][desc] = "name of smb share" [smb_share][help] = "more detail about this option ......" [smb_share][depend][name][0] = "backup_method" [smb_share][depend][name][1] = "restore_method" [smb_share][depend][value][0] = "smb" [smb_share][depend][value][1] = "smb" so if $backup_method or $restore_method has a value of "smb" we should display this option. In case of options depending on more than on value we could add something like this. [smb_share][depend][rule][0] = "0|TRUE:1|TRUE" where the "0" refers to "[smb_share][depend][name][0]" which is "backup_method" and TRUE means that this dependency must be satisfied multiple rules could be made that way and if one of them match a configuration then the options will be displayed. So most of class_config could be redone in a much nicer way than the hacks I put in there. Another thing people might want is a user login list which is not the same as the server/share login.. Hope I'm making sense here.. Rene > I hope I can get some stuff done this weekend. It's over 100 degrees > here (37.7 celsius), and I'm still lazy from vacationing. > > Joe > > Rene wrote: > > >Damn filenames... > > > >Filenames including newlines will not work properly. That much is sure. > > > >I'm going examine possible solutions, like use a NULL as an end-of-line > >seperator. I read somewhere that NULL's aren't accepted by shell > >programs like grep so that might be a problem. > >Maybe maybe an end-of-line marker like "///FF" would work if NULL is not > >usefull. > > > >What is your opinion about using flat text files instead of databases? > >Any suggestion on better ways to do it? > > > >Rene > > > > > >On Sat, 2002-07-13 at 18:11, Rene Rask wrote: > > > > > >>I've finally been able to get some useful results. > >> > >>This is not a perfect solution as far as I can see. > >> > >>Basically it involves changing the $IFS value in bash to be a newline. > >>And changing it to the original value after use. > >> > >>The problem is (or will be) that filenames cannot contain newlines. > >>I might be able to escape newlines in filenames. > >> > >>Anyway. This solution is better than the old one so I'm going to update > >>the cvs with it. > >> > >>I'll see if I can test the newline problem and find a solution. > >> > >> > >>Rene > >> > >> > >> > >>Joe zacky wrote: > >> > >> > >>>Have you tried escaping single quotes like this, where $filename is the > >>>variable containing the name of the file: > >>> \'$filename\' > >>> > >>>Joe > >>> > >>>Rene Rask wrote: > >>> > >>> > >>> > >>>>The names are quoted. I've tried both double and single quoting. > >>>>If I can get bash to accept the names as "literal" instead of "glob" it > >>>>should solve the problem. > >>>> > >>>>A name like "some name^Mtest" does not behave well. > >>>>Only working solution I've found was this way: > >>>>$'some name^Mtest' > >>>>But I can't figure out how that is useful in a script. > >>>> > >>>> > >>>>I'll keep trying. > >>>> > >>>>-Rene > >>>> > >>>> > >>>>On Fri, 2002-07-12 at 07:26, Joe zacky wrote: > >>>> > >>>> > >>>> > >>>> > >>>>>Rene Rask wrote: > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>>>I've been looking into the filename problems. > >>>>>> > >>>>>>It seems to me that escaping filenames in PHP will ony lead to a > >>>>>>constant headache (which is not what I need right now ;) > >>>>>> > >>>>>>I've found a few Bash tricks that look really promising but I haven't > >>>>>>cracked the problem yet. I'm able to make Bash escape a filename with > >>>>>>weird characters in it. But I'm still not able to do it with input > >>>>>> > >>>>>> > >>>>>>from a list. > >>>>> > >>>>> > >>>>>>When (if?) I get this working we should be able to stop worrying about > >>>>>>filenames. > >>>>>>If you know any Bash experts please ask if they can help. > >>>>>> > >>>>>>-Rene > >>>>>> > >>>>>> > >>>>>> > >>>>>>------------------------------------------------------- > >>>>>>This sf.net email is sponsored by:ThinkGeek > >>>>>>Two, two, TWO treats in one. > >>>>>>http://thinkgeek.com/sf > >>>>>>_______________________________________________ > >>>>>>Bobs-devel mailing list > >>>>>>Bob...@li... > >>>>>>https://lists.sourceforge.net/lists/listinfo/bobs-devel > >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>Have you tried "quoting the filenames?" That also works in bash. > >>>>> > >>>>> > >>>>> > >>>>>------------------------------------------------------- > >>>>>This sf.net email is sponsored by:ThinkGeek > >>>>>Gadgets, caffeine, t-shirts, fun stuff. > >>>>>http://thinkgeek.com/sf > >>>>>_______________________________________________ > >>>>>Bobs-devel mailing list > >>>>>Bob...@li... > >>>>>https://lists.sourceforge.net/lists/listinfo/bobs-devel > >>>>> > >>>>> > >>>>> > >>>>> > >>>> > >>>> > >>>>------------------------------------------------------- > >>>>This sf.net email is sponsored by:ThinkGeek > >>>>Gadgets, caffeine, t-shirts, fun stuff. > >>>>http://thinkgeek.com/sf > >>>>_______________________________________________ > >>>>Bobs-devel mailing list > >>>>Bob...@li... > >>>>https://lists.sourceforge.net/lists/listinfo/bobs-devel > >>>> > >>>> > >>>> > >>>> > >>>> > >> > >> > >> > >>------------------------------------------------------- > >>This sf.net email is sponsored by:ThinkGeek > >>Welcome to geek heaven. > >>http://thinkgeek.com/sf > >>_______________________________________________ > >>Bobs-devel mailing list > >>Bob...@li... > >>https://lists.sourceforge.net/lists/listinfo/bobs-devel > >> > >> > > > > > > > > > >------------------------------------------------------- > >This sf.net email is sponsored by:ThinkGeek > >Welcome to geek heaven. > >http://thinkgeek.com/sf > >_______________________________________________ > >Bobs-devel mailing list > >Bob...@li... > >https://lists.sourceforge.net/lists/listinfo/bobs-devel > > > > > > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Bobs-devel mailing list > Bob...@li... > https://lists.sourceforge.net/lists/listinfo/bobs-devel |
|
From: Rene <re...@gr...> - 2002-07-14 21:23:28
|
Hi Joe. This is my suggestion to a new configuration editor. This should ensure that options that are not used are not displayed. eg. nfs_share should not be display if backup_method and restore_method are "smb" Feel free to change, disregard or extend it. The changes to admin.php looked nice. -Rene New functions in class_config (a lot of the old stuff could then be removed): make_server($server_defs) creates the basic empty configuration for a new server store the result in "$this->config" in class_config stores$server_defs in $this->server_defs for use in other functions. (like check_rules) check_rules ($name) check option "$name" to see if if passes the rules. returns TRUE or FALSE edit_server ($config_from_admin.pgp) for each option in $this->config (also empty ones) it calls check_rules() If TRUE it passes the option to html_parse_option($name) returns html html_parse_option ($name) checks the type of the option and parses it into an html format for editing. returns hmtl -- sample of added lines to config.php ---- $server_defs["backup_method"]["name"] = "backup_method"; $server_defs["backup_method"]["type"] = "list"; $server_defs["backup_method"]["desc"] = "What method do you wish to use for making backups"; $server_defs["backup_method"]["list"]["0"] = "rsync"; $server_defs["backup_method"]["list"]["1"] = "nfs"; $server_defs["backup_method"]["list"]["2"] = "smb"; $server_defs["restore_method"]["name"] = "restore_method"; $server_defs["restore_method"]["type"] = "list"; $server_defs["restore_method"]["desc"] = "What method do you wish to use for restoring files"; $server_defs["restore_method"]["list"]["0"] = "nfs"; $server_defs["restore_method"]["list"]["1"] = "smb"; $server_defs["smb_share"]["name"] = "smb_share"; $server_defs["smb_share"]["type"] = "text"; $server_defs["smb_share"]["desc"] = "Name of the smb share to use"; $server_defs["smb_share"]["depends"]["name"]["0"] = "backup_method"; $server_defs["smb_share"]["depends"]["name"]["1"] = "restore_method"; $server_defs["smb_share"]["depends"]["value"]["0"] = "smb"; $server_defs["smb_share"]["depends"]["value"]["1"] = "smb"; $server_defs["smb_share"]["depends"]["rule"]["0"] = "0:TRUE"; $server_defs["smb_share"]["depends"]["rule"]["1"] = "1:TRUE"; $server_defs["smb_share"]["name"] = "nfs_share"; $server_defs["nfs_share"]["type"] = "path"; $server_defs["nfs_share"]["desc"] = "Path of the nfs share to use"; $server_defs["nfs_share"]["depends"]["name"]["0"] = "backup_method"; $server_defs["nfs_share"]["depends"]["name"]["1"] = "restore_method"; $server_defs["nfs_share"]["depends"]["value"]["0"] = "nfs"; $server_defs["nfs_share"]["depends"]["value"]["1"] = "nfs"; $server_defs["nfs_share"]["depends"]["rule"]["0"] = "0:TRUE"; $server_defs["nfs_share"]["depends"]["rule"]["1"] = "1:TRUE"; |