diff --git a/larpe/tags/release-1.0/debian/changelog b/larpe/tags/release-1.0/debian/changelog index 96298e2..5acdd39 100644 --- a/larpe/tags/release-1.0/debian/changelog +++ b/larpe/tags/release-1.0/debian/changelog @@ -7,7 +7,8 @@ larpe (1.0-1) unstable; urgency=low - Fully tested for several sites with very different behaviours - Plugin system to handle specific behaviour of some sites - Automatic Apache 2 configuration - - Automatic creation of Apache python filters to transform authentication boxes on the sites + - Automatic creation of Apache python filters to transform authentication + boxes on the sites - Support for proxies - Logging and debug options diff --git a/larpe/tags/release-1.0/debian/control b/larpe/tags/release-1.0/debian/control index 20f26b5..068df8a 100644 --- a/larpe/tags/release-1.0/debian/control +++ b/larpe/tags/release-1.0/debian/control @@ -3,13 +3,13 @@ Section: web Priority: optional Maintainer: Damien Laniel Build-Depends: debhelper (>= 5.0.37.2), python, python-central (>= 0.5), gettext -Standards-Version: 3.7.2.0 +Standards-Version: 3.8.0 XS-Python-Version: current Package: larpe Architecture: any XB-Python-Version: ${python:Versions} -Depends: ${python:Depends}, python-quixote | quixote (>= 2.0), python-lasso (>= 0.6.5), python-scgi, python-libxml2, apache2, libapache2-mod-scgi, libapache2-mod-python, libapache2-mod-proxy-html +Depends: ${shlibs:Depends}, ${python:Depends}, python-quixote | quixote (>= 2.0), python-lasso (>= 0.6.5), python-scgi, python-libxml2, apache2, libapache2-mod-scgi, libapache2-mod-python, libapache2-mod-proxy-html Description: Liberty Alliance Reverse Proxy Larpe allows any service provider (that is a website) to use Liberty Alliance identity management and Single Sign On features without changing the code of diff --git a/larpe/tags/release-1.0/debian/rules b/larpe/tags/release-1.0/debian/rules index 2ff8134..3a237ee 100755 --- a/larpe/tags/release-1.0/debian/rules +++ b/larpe/tags/release-1.0/debian/rules @@ -65,6 +65,7 @@ binary-arch: build install dh_fixperms -X /var/lib/larpe -X /usr/sbin/larpe-reload-apache2 dh_pycentral dh_installdeb + dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb diff --git a/larpe/tags/release-1.0/debian/templates b/larpe/tags/release-1.0/debian/templates deleted file mode 100644 index 9a6cc43..0000000 --- a/larpe/tags/release-1.0/debian/templates +++ /dev/null @@ -1,37 +0,0 @@ -Template: larpe/hostname -Type: string -Default: localhost -Description: Hostname : - This is the name by which this reverse-proxy will be known on the network. - Your DNS server must have been configured accordingly. - -Template: larpe/enable_vhost -Type: boolean -Default: false -Description: Enable this vhost : - A new virtual host for Larpe will be created with the hostname you chose. It may break - your Apache2 configuration. - . - If you didn't tweak your Apache2 configuration a lot - and you don't have vital websites on the same server, you can safely say "yes" here - to enable it, and fix it later if needed. - . - If you prefer checking this vhost will fit well with your Apache2 configuration first, - and enable it by yourself later, say "no". - -Template: larpe/admin_username -Type: string -Default: admin -Description: Administrator login : - This is the login which will be used to connect to the administrator interface - -Template: larpe/admin_password -Type: password -Description: Administrator password : - This is the password which will be used to connect to the administrator interface - -Template: larpe/admin_email -Type: string -Default: root@localhost -Description: Administrator email address : - This is the email address to which problem reports will be sent diff --git a/larpe/tags/release-1.0/larpe/filter/larpe-filter.py b/larpe/tags/release-1.0/larpe/filter/larpe-filter.py deleted file mode 100755 index 2d9973b..0000000 --- a/larpe/tags/release-1.0/larpe/filter/larpe-filter.py +++ /dev/null @@ -1,164 +0,0 @@ -import os -import re - -from mod_python import apache - -#import larpe.hosts - -app_dir = '/var/lib/larpe' - -def outputfilter(filter): - # Only filter html code - if filter.req.content_type is not None: - is_html = re.search('text/html', filter.req.content_type) - if filter.req.content_type is not None and not is_html: - filter.pass_on() - else: - if not hasattr(filter.req, 'temp_doc'): # the start - filter.req.temp_doc = [] # create new attribute to hold document - # If content-length ended up wrong, Gecko browsers truncated data, so - if 'Content-Length' in filter.req.headers_out: - del filter.req.headers_out['Content-Length'] - -# filter.write(filter.req.headers_in['Cookie']) -# delete_cookies(filter) - #filter.req.headers_out['Set-Cookie'] = 'dc_admin="deleted"; max-age=0; expires=Thu, 01-Jan-1970 00:00:00 GMT; path=/' - - temp_doc = filter.req.temp_doc - s = filter.read() - while s: # could get '' at any point, but only get None at end - temp_doc.append(s) - s = filter.read() - - if s is None: # the end - page = ''.join(temp_doc) - - page = filter_dispatch(filter, page) - - filter.write(page) - filter.close() - -def filter_dispatch(filter, page): -# host = get_host_from_url(filter) -# if host is None: -# apache.log_error('Host not found') -# return page - try: -# function_name = 'filter_' + host.label.lowercase() - host_name = filter.req.hostname.split('.')[-3] - function_name = 'filter_' + host_name - return eval(function_name + '(filter, page)') - except: - return page -# return filter_default(filter, page) - - -def filter_default(filter, page): -# host = get_host_from_url(filter) -# if host is None: -# apache.log_error('Host not found') -# return page -# if host.auth_url is not None or host.auth_form is None: -# return page - form = find_auth_form(page) - if form is not None: - try: - host_name = filter.req.hostname.split('.')[-3] - return page.replace(form, """ -
- -
""" % host_name) - except: - pass - return page - -def find_auth_form(page): - regexp = re.compile("""""", re.DOTALL | re.IGNORECASE) - found_forms = regexp.findall(page) - - for found_form in found_forms: - regexp = re.compile("""]*?type="password"[^>]*?>""", re.DOTALL | re.IGNORECASE) - if regexp.search(found_form) is not None: - return found_form - return None - -#def get_host_from_url(filter): -# try: -# return list(Host.select(lambda x: x.reversed_hostname == filter.req.hostname \ -# and x.reversed_directory == get_proxied_site_name(filter)))[0] -# except: -# return None - - -def filter_linuxfr(filter, page): - str_to_replace = re.compile(str('
.*?
'), re.DOTALL) - return str_to_replace.sub(str(r"""
- -
""" - ), page) - -def filter_dotclear(filter, page): - if filter.req.uri == '/dot/ecrire/redac_list.php': - str_to_replace = re.compile(str('(\[[^\?]+\?id=)([^"]+)(">[^\]]*)\]'), re.DOTALL) - return str_to_replace.sub(str(r'\1\2\3 - token ]'), page) - if filter.req.uri == '/dot/ecrire/redacteur.php': - str_to_replace = re.compile(str('(