Skip to content

Commit

Permalink
Initial commit of v0.4.2 as fetched from Google Code Archive
Browse files Browse the repository at this point in the history
  • Loading branch information
macbre committed Mar 29, 2017
1 parent 945ef2d commit afa940c
Show file tree
Hide file tree
Showing 36 changed files with 11,365 additions and 11 deletions.
22 changes: 11 additions & 11 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991

Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

Preamble
Preamble

The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Expand Down Expand Up @@ -56,7 +56,7 @@ patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.

GNU GENERAL PUBLIC LICENSE
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. This License applies to any program or other work which contains
Expand Down Expand Up @@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.

NO WARRANTY
NO WARRANTY

11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
Expand All @@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.

END OF TERMS AND CONDITIONS
END OF TERMS AND CONDITIONS

How to Apply These Terms to Your New Programs
How to Apply These Terms to Your New Programs

If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
Expand All @@ -290,8 +290,8 @@ to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

{description}
Copyright (C) {year} {fullname}
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -329,7 +329,7 @@ necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.

{signature of Ty Coon}, 1 April 1989
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice

This General Public License does not permit incorporating your program into
Expand Down
77 changes: 77 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#!/usr/bin/env python
# CirruxCache provides dynamic HTTP caching on AppEngine (CDN like)
# Copyright (C) 2009 Samuel Alba <[email protected]>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#

"""CirruxCache provides dynamic HTTP caching on AppEngine (CDN like)
http://cirrux.org/cache/
http://code.google.com/p/cirruxcache/
"""

__version__ = '0.4.2'
__author__ = [
'Samuel Alba <[email protected]>'
]
__license__ = 'GNU Public License version 2'

import sys, os
root = os.path.dirname(os.environ['PATH_TRANSLATED'])
sys.path.append(os.path.join(root, 'lib'))
sys.path.append(os.path.join(root, 'contrib'))

import logging
import web

import config
from services.cron import Cron
from services.admin import Admin
from services.store import Store
from services.debug import Debug


class Root(object):

def GET(self, request):
web.header('Content-Type', 'text/plain')
content = 'CirruxCache (%s) / http://code.google.com/p/cirruxcache/\n' % __version__
if request:
raise web.HTTPError(status='404 Not Found', data=content)
return content

class VhostMapper(object):

def __iter__(self):
base = (
'/_admin/(.*)', 'Admin',
'/_store/(.*)', 'Store',
'/_cron/(.*)', 'Cron'
)
url = ()
urls = config.urls
if 'HTTP_HOST' in web.ctx.environ:
vhost = web.ctx.environ['HTTP_HOST']
if vhost in urls:
url = urls[vhost]
elif 'default' in urls:
url = urls['default']
return iter(base + url + ('/(.*)', 'Root'))

if __name__ == '__main__':
# logging.getLogger().setLevel(logging.DEBUG)
app = web.application(VhostMapper(), globals())
app.cgirun()
38 changes: 38 additions & 0 deletions app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# CirruxCache provides dynamic HTTP caching on AppEngine (CDN like)
# Copyright (C) 2009 Samuel Alba <[email protected]>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#

application: appname
version: 1
runtime: python
api_version: 1

handlers:
# Uncomment theses 3 lignes below to serve a static crossdomain.xml file
#- url: /crossdomain\.xml
# static_files: static/crossdomain.xml
# upload: static/crossdomain.xml

- url: /_static/((admin|jquery\.form|wtooltip)\.(js|css))
static_files: static/\1
upload: static/(admin|jquery\.form|wtooltip)\.(js|css)

- url: /.*
script: app.py

derived_file_type:
- python_precompiled
47 changes: 47 additions & 0 deletions config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# CirruxCache provides dynamic HTTP caching on AppEngine (CDN like)
# Copyright (C) 2009 Samuel Alba <[email protected]>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#

"""CirruxCache configuration file
"""

from lib import cache, redirect, forward, image
urls = {}


# EDIT BELOW

urls['default'] = (
#'(/debug/.*)', 'Debug',
'(/data/.*)', 'config.Static',
'/www(/.*)', 'config.Www'
)

# POP definition
# You can define and configure your Point Of Presence

class Static(cache.Service):
origin = 'http://static.mydomain.tld'
maxTTL = 2592000 # 1 month
ignoreQueryString = True

class Www(cache.Service):
origin = 'http://www.mydomain.tld'
allowFlushFrom = ['127.0.0.1']
forceTTL = 3600 # 1 hour
ignoreQueryString = True
forwardPost = False
34 changes: 34 additions & 0 deletions contrib/web/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env python
"""web.py: makes web apps (http://webpy.org)"""

from __future__ import generators

__version__ = "0.34"
__author__ = [
"Aaron Swartz <[email protected]>",
"Anand Chitipothu <[email protected]>"
]
__license__ = "public domain"
__contributors__ = "see http://webpy.org/changes"

import utils, db, net, wsgi, http, webapi, httpserver, debugerror
import template, form

import session

from utils import *
from db import *
from net import *
from wsgi import *
from http import *
from webapi import *
from httpserver import *
from debugerror import *
from application import *
from browser import *
import test
try:
import webopenid as openid
except ImportError:
pass # requires openid module

Loading

0 comments on commit afa940c

Please sign in to comment.