Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyRespondek committed May 22, 2012
0 parents commit ea70ea6
Show file tree
Hide file tree
Showing 819 changed files with 99,692 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
*.py[co]
*.sw[po]
*.bak
*.orig
.project
.pydevproject
.DS_Store

# Packages
*.egg
*.egg-info
dist
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg

# Installer logs
pip-log.txt

# Unit test / coverage reports
.coverage
.tox

#Translations
*.mo

#Mr Developer
.mr.developer.cfg
29 changes: 29 additions & 0 deletions .openshift/action_hooks/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash
# This is a simple build script and will be executed on your CI system if
# available. Otherwise it will execute while your application is stopped
# before the deploy step. This script gets executed directly, so it
# could be python, php, ruby, etc.

# Activate VirtualEnv in order to use the correct libraries
source $OPENSHIFT_GEAR_DIR/virtenv/bin/activate

DATA_DIR="${OPENSHIFT_DATA_DIR}data"
UNDERLAY_DIR="${OPENSHIFT_DATA_DIR}underlay"
PLUGIN_DIR="${DATA_DIR}/plugin"
REPO_PLUGIN_DIR="${OPENSHIFT_REPO_DIR}wsgi/plugin"

MOIN_SHARE="${OPENSHIFT_GEAR_DIR}virtenv/lib/python*/site-packages/moin-*-py*.egg/share/moin"

if [ ! -d $DATA_DIR ]; then
echo "Copying ${MOIN_SHARE}/data to ${OPENSHIFT_DATA_DIR}"
cp -rf $MOIN_SHARE/data $OPENSHIFT_DATA_DIR
fi

if [ ! -d $UNDERLAY_DIR ]; then
echo "Copying ${MOIN_SHARE}/underlay to ${OPENSHIFT_DATA_DIR}"
cp -rf $MOIN_SHARE/underlay $OPENSHIFT_DATA_DIR
fi

echo "Replacing ${PLUGIN_DIR} contents"
rm -rf $PLUGIN_DIR
mv -f $REPO_PLUGIN_DIR $DATA_DIR
54 changes: 54 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
Feel free to change or remove this file, it is informational only.

Repo layout
===========
wsgi/ - Externally exposed wsgi code goes
wsgi/static/ - Public static content gets served here
libs/ - Additional libraries
data/ - For not-externally exposed wsgi code
setup.py - Standard setup.py, specify deps here
../data - For persistent data (also env var: OPENSHIFT_DATA_DIR)
.openshift/action_hooks/pre_build - Script that gets run every git push before the build
.openshift/action_hooks/build - Script that gets run every git push as part of the build process (on the CI system if available)
.openshift/action_hooks/deploy - Script that gets run every git push after build but before the app is restarted
.openshift/action_hooks/post_deploy - Script that gets run every git push after the app is restarted


Environment Variables
=====================

OpenShift Express provides several environment variables to reference for ease
of use. The following list are some common variables but far from exhaustive:

os.environ['OPENSHIFT_GEAR_NAME'] - Application name
os.environ['OPENSHIFT_GEAR_DIR'] - Application dir
os.environ['OPENSHIFT_DATA_DIR'] - For persistent storage (between pushes)
os.environ['OPENSHIFT_TMP_DIR'] - Temp storage (unmodified files deleted after 10 days)

When embedding a database using 'rhc app cartridge add', you can reference environment
variables for username, host and password:

os.environ['OPENSHIFT_DB_HOST'] - DB host
os.environ['OPENSHIFT_DB_PORT'] - DB Port
os.environ['OPENSHIFT_DB_USERNAME'] - DB Username
os.environ['OPENSHIFT_DB_PASSWORD'] - DB Password

To get a full list of environment variables, simply add a line in your
.openshift/action_hooks/build script that says "export" and push.


Notes about layout
==================
Please leave wsgi, libs and data directories but feel free to create additional
directories if needed.

Note: Every time you push, everything in your remote repo dir gets recreated
please store long term items (like an sqlite database) in ../data which will
persist between pushes of your repo.


Notes about setup.py
====================

Adding deps to the install_requires will have the openshift server actually
install those deps at git push time.
53 changes: 53 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
MoinMoin on OpenShift
=====================

This git repository helps you get up and running quickly with a single Wiki
installation of MoinMoin on OpenShift.


Quickstart
----------------------------

Create an account at http://openshift.redhat.com/

Create a python-2.6 application

rhc app create -a moinmoin -t python-2.6

Add this upstream repo

cd moinmoin
git remote add upstream -m master git://github.com/EddyRespondek/moinmoin-openshift-example.git
git pull -s recursive -X theirs upstream master

Then push the repo upstream

git push

That's it, you can now checkout your application at:

http://moinmoin-$yournamespace.rhcloud.com


What's going on?
----------------------------

MoinMoin uses a file-system based data storage backend rather than a
tradition SQL database. When you push this application up for the first
time the base data files are copied to Openshift's data directory for
persistent storage.

A quirk of MoinMoin is that plugins are also kept in the same data
directory mentioned previously, which isn't very handy since you'll
more than likely want to modify these files to create custom themes, etc.
A copy of the plugins directory has been placed in
~/moinmoin/repo/wsgi/plugin and will overwrite the plugin folder in the
data directory everytime the application is pushed up.

All of MoinMoin's default static files have been moved to
~/moinmoin/repo/wsgi/static.

An example MoinMoin logging configuration file has also been added and can
be found in ~/moinmoin/repo/wsgi/logging. The resulting log file is
located in Openshifts log directory and can be viewed using Openshift's rhc
client using the tail command.
Empty file added data/.gitkeep
Empty file.
Empty file added libs/.gitkeep
Empty file.
13 changes: 13 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env python

from setuptools import setup

setup(
name='YourAppName',
version='1.0',
description='OpenShift App',
author='Your Name',
author_email='[email protected]',
url='http://www.python.org/sigs/distutils-sig/',
install_requires=['moin>=1.9'],
)
21 changes: 21 additions & 0 deletions wsgi/application
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env python

import os
import sys

here = os.path.dirname(os.path.abspath(__file__))
sys.path.append(here)

virtenv = os.environ['OPENSHIFT_GEAR_DIR'] + '/virtenv/'
os.environ['PYTHON_EGG_CACHE'] = os.path.join(virtenv, 'lib/python2.6/site-packages')
virtualenv = os.path.join(virtenv, 'bin/activate_this.py')
try:
execfile(virtualenv, dict(__file__=virtualenv))
except:
pass

from MoinMoin import log
log.load_config(os.environ['OPENSHIFT_REPO_DIR'] + '/wsgi/logging/logfile')

from MoinMoin import wsgiapp
application = wsgiapp.Application()
29 changes: 29 additions & 0 deletions wsgi/logging/logfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[DEFAULT]
# Default loglevel, to adjust verbosity: DEBUG, INFO, WARNING, ERROR, CRITICAL
loglevel=INFO

[loggers]
keys=root

[handlers]
keys=logfile

[formatters]
keys=logfile

[logger_root]
level=%(loglevel)s
handlers=logfile

[handler_logfile]
class=logging.handlers.TimedRotatingFileHandler
class.suffix = "-%Y%m%d-%H%M%S"
formatter=logfile
level=%(loglevel)s
args=(os.environ['OPENSHIFT_LOG_DIR'] + '/moin.log', 'midnight', 1)

[formatter_logfile]
format=%(levelname)s %(asctime)s %(name)s:%(lineno)d %(message)s
datefmt=
class=logging.Formatter

4 changes: 4 additions & 0 deletions wsgi/plugin/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# *** Do not remove this! ***
# Although being empty, the presence of this file is important for plugins
# working correctly.

5 changes: 5 additions & 0 deletions wsgi/plugin/action/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: iso-8859-1 -*-

from MoinMoin.util import pysupport

modules = pysupport.getPackageModules(__file__)
5 changes: 5 additions & 0 deletions wsgi/plugin/converter/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: iso-8859-1 -*-

from MoinMoin.util import pysupport

modules = pysupport.getPackageModules(__file__)
5 changes: 5 additions & 0 deletions wsgi/plugin/events/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: iso-8859-1 -*-

from MoinMoin.util import pysupport

modules = pysupport.getPackageModules(__file__)
5 changes: 5 additions & 0 deletions wsgi/plugin/filter/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: iso-8859-1 -*-

from MoinMoin.util import pysupport

modules = pysupport.getPackageModules(__file__)
5 changes: 5 additions & 0 deletions wsgi/plugin/formatter/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: iso-8859-1 -*-

from MoinMoin.util import pysupport

modules = pysupport.getPackageModules(__file__)
5 changes: 5 additions & 0 deletions wsgi/plugin/macro/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: iso-8859-1 -*-

from MoinMoin.util import pysupport

modules = pysupport.getPackageModules(__file__)
5 changes: 5 additions & 0 deletions wsgi/plugin/parser/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: iso-8859-1 -*-

from MoinMoin.util import pysupport

modules = pysupport.getPackageModules(__file__)
5 changes: 5 additions & 0 deletions wsgi/plugin/theme/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: iso-8859-1 -*-

from MoinMoin.util import pysupport

modules = pysupport.getPackageModules(__file__)
5 changes: 5 additions & 0 deletions wsgi/plugin/userprefs/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: iso-8859-1 -*-

from MoinMoin.util import pysupport

modules = pysupport.getPackageModules(__file__)
5 changes: 5 additions & 0 deletions wsgi/plugin/xmlrpc/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: iso-8859-1 -*-

from MoinMoin.util import pysupport

modules = pysupport.getPackageModules(__file__)
12 changes: 12 additions & 0 deletions wsgi/static/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Public, static content goes here. Users can create rewrite rules to link to
content in the static dir. For example, django commonly uses /media/
directories for static content. For example in a .htaccess file in a
wsgi/.htaccess location, developers could put:

RewriteEngine On
RewriteRule ^application/media/(.+)$ /static/media/$1 [L]

Then copy the media/* content to yourapp/wsgi/static/media/ and it should
just work.

Note: The ^application/ part of the URI match is required.
38 changes: 38 additions & 0 deletions wsgi/static/applets/FCKeditor/_documentation.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2010 Frederico Caldeira Knabben
*
* == BEGIN LICENSE ==
*
* Licensed under the terms of any of the following licenses at your
* choice:
*
* - GNU General Public License Version 2 or later (the "GPL")
* http://www.gnu.org/licenses/gpl.html
*
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
* http://www.gnu.org/licenses/lgpl.html
*
* - Mozilla Public License Version 1.1 or later (the "MPL")
* http://www.mozilla.org/MPL/MPL-1.1.html
*
* == END LICENSE ==
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>FCKeditor - Documentation</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
body { font-family: arial, verdana, sans-serif }
p { margin-left: 20px }
</style>
</head>
<body>
<h1>
FCKeditor Documentation</h1>
<p>
You can find the official documentation for FCKeditor online, at <a href="http://docs.fckeditor.net/">
http://docs.fckeditor.net/</a>.</p>
</body>
</html>
39 changes: 39 additions & 0 deletions wsgi/static/applets/FCKeditor/_upgrade.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2010 Frederico Caldeira Knabben
*
* == BEGIN LICENSE ==
*
* Licensed under the terms of any of the following licenses at your
* choice:
*
* - GNU General Public License Version 2 or later (the "GPL")
* http://www.gnu.org/licenses/gpl.html
*
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
* http://www.gnu.org/licenses/lgpl.html
*
* - Mozilla Public License Version 1.1 or later (the "MPL")
* http://www.mozilla.org/MPL/MPL-1.1.html
*
* == END LICENSE ==
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>FCKeditor - Upgrade</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
body { font-family: arial, verdana, sans-serif }
p { margin-left: 20px }
</style>
</head>
<body>
<h1>
FCKeditor Upgrade</h1>
<p>
Please check the following URL for notes regarding upgrade:<br />
<a href="http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Installation/Upgrading">
http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Installation/Upgrading</a></p>
</body>
</html>
Loading

0 comments on commit ea70ea6

Please sign in to comment.