Hi, I'm working (much slower than what I'd like because of Real World 
issues) in the packaging of web2py.
Most of the work is done, excepting for a recurrent problem:
permissions

Trying to fullfil the FHS (
http://wiki.debian.org/FilesystemHierarchyStandard ) , I've moved the gluon 
libraries to its python place (no problem at all, it works perfectly), 
prepared a web2py launcher in /usr/bin [1] , and move some things to 
/usr/share/web2py/ :
applications  deposit  logs  site-packages  VERSION  web2py.py  welcome.w2p

 
making a directory applications at any place at the computer directory, an 
user can execute "web2py" to launch it all.
The application directory will be created by the web2py launcher, adding the 
folder option to the gluon.widget.start option.
The application contains a symbolic link to 
/usr/share/web2py/applications/admin and another 
to /usr/share/web2py/application/welcome.

But I'm fighting against permissions in the admin folder all the time. First 
for cron (I don't see why starting with cron=True needs to open the file 
with wb permissions, if not new cron is created), but this issue is solved 
using cron=False when launching the process.

Next step is with permissions in the welcome application (appart of creating 
the databases, errors, sessions, private, uploads and cache directories). 
It's clear that this application database directory must be in the user 
homeland to be able to administrate the applications he adds or creates . 
So, I'm thinking of doing a complete copy (better rsync for future updates) 
of the welcome application directory to the directory where web2py is 
launched. Anyway, I don't like this approach  as it's not very clean from my 
point of view, so I wonder if it would be possible to use a database 
directory for an application (I only need the welcome application, but maybe 
it makes sense for other cases) in a place different from 
application_name/databases.

Also, maybe I should explain the rationale behind this directories 
movements: keeping the FHS design in linux, but giving to the user the 
possibility of creating where he wants (and has permissions) the structure 
of the applications. Also, when the debian package is updated (updating the 
/usr/share/web2py, gluon libraries and web2py launcher) , the user must be 
using the latest web2py version installed, not a previous one. If anyone has 
better ideas they're welcome, as well as any help in the modification of the 
web2py routes. I'd prefer not to patch any code in the original web2py 
sources, to follow totally the web2py development, but if I have to patch 
the welcome application I'll do it. Anyway I know  I'll have to patch the 
admin application in order to remove the remote upgrade of web2py as this 
option is not allowed in Debian packages (it's removed from firefox or 
openoffice too).

Regards
José L.





[1] /usr/bin/web2py script:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys

try:
    path = '/usr/share/web2py'
    os.chdir(path)
except NameError:
    path = os.getcwd() # Seems necessary for py2exe    
try:
    sys.path.remove(path)
except ValueError:
    pass
sys.path.insert(0, path)
# import gluon.import_all ##### This should be uncommented for py2exe.py
import gluon.widget

# Start Web2py and Web2py cron service!
gluon.widget.start(cron=False)

Reply via email to