moved some more stuff around
This commit is contained in:
parent
112979b3af
commit
7741c87fb8
|
@ -1,8 +1,11 @@
|
|||
include README
|
||||
include LICENSE
|
||||
include CHANGELOG
|
||||
graft doc
|
||||
graft conf-examples
|
||||
graft event-scripts
|
||||
graft www-data
|
||||
#graft www-data/screenshots
|
||||
graft templates
|
||||
graft lang
|
||||
graft plugins
|
||||
prune commit.log
|
||||
prune package.exclude
|
||||
|
|
70
Makefile
70
Makefile
|
@ -1,70 +0,0 @@
|
|||
#
|
||||
# Makefile for the cryptobox web-interface
|
||||
#
|
||||
# Copyright (c) 02006 senselab
|
||||
#
|
||||
|
||||
CRYPTOBOX_ROOT = .
|
||||
|
||||
PREFIX = /usr/local
|
||||
SHARE_DIR = $(PREFIX)/share/cryptobox
|
||||
LIB_DIR = $(PREFIX)/lib/cryptobox
|
||||
DOC_DIR = $(PREFIX)/share/doc/cryptobox
|
||||
BUILD_DIR = build_dir
|
||||
INSTALL = install
|
||||
|
||||
OS_TYPE=$(shell uname -o | tr [:upper:] [:lower:] | sed s/[^a-z0-9\._\-]/_/g)
|
||||
|
||||
.PHONY: install clean build
|
||||
|
||||
build:
|
||||
$(INSTALL) -d -m 755 $(BUILD_DIR)/etc
|
||||
$(INSTALL) -c -m 644 bin/cryptobox.conf $(BUILD_DIR)/etc/
|
||||
@sed -i 's#^HTML_TEMPLATE_DIR=.*$$#HTML_TEMPLATE_DIR=$(SHARE_DIR)/templates#' $(BUILD_DIR)/etc/cryptobox.conf
|
||||
@sed -i 's#^LANGUAGE_DIR=.*$$#LANGUAGE_DIR=$(SHARE_DIR)/lang#' $(BUILD_DIR)/etc/cryptobox.conf
|
||||
@sed -i 's#^DOC_DIR=.*$$#DOC_DIR=$(DOC_DIR)/html#' $(BUILD_DIR)/etc/cryptobox.conf
|
||||
@sed -i 's#^CONFIG_DEFAULTS_DIR=.*$$#CONFIG_DEFAULTS_DIR=$(SHARE_DIR)/defaults#' $(BUILD_DIR)/etc/cryptobox.conf
|
||||
|
||||
@touch $(BUILD_DIR)-stamp
|
||||
|
||||
|
||||
install: $(BUILD_DIR)-stamp
|
||||
## programs
|
||||
$(INSTALL) -d -m 755 $(LIB_DIR)
|
||||
$(INSTALL) -c -m 755 bin/*.py $(LIB_DIR)/
|
||||
$(INSTALL) -c -m 755 bin/*.sh $(LIB_DIR)/
|
||||
## language files
|
||||
$(INSTALL) -d -m 755 $(SHARE_DIR)/lang
|
||||
$(INSTALL) -c -m 644 lang/* $(SHARE_DIR)/lang/
|
||||
## template files
|
||||
$(INSTALL) -d -m 755 $(SHARE_DIR)/templates
|
||||
$(INSTALL) -c -m 644 templates/*.cs $(SHARE_DIR)/templates
|
||||
## html data
|
||||
$(INSTALL) -d -m 755 $(SHARE_DIR)/html
|
||||
$(INSTALL) -c -m 644 www-data/*.css $(SHARE_DIR)/html/
|
||||
$(INSTALL) -c -m 644 www-data/*.png $(SHARE_DIR)/html/
|
||||
$(INSTALL) -c -m 644 www-data/*.gif $(SHARE_DIR)/html/
|
||||
## screenshots
|
||||
$(INSTALL) -d -m 755 $(SHARE_DIR)/html/screenshots
|
||||
$(INSTALL) -c -m 644 www-data/screenshots/*.png $(SHARE_DIR)/html/screenshots/
|
||||
## documentation files (html)
|
||||
ls doc/html | while read lang ;\
|
||||
do test -d "doc/html/$$lang" && \
|
||||
$(INSTALL) -d -m 755 "$(DOC_DIR)/html/$$lang" && \
|
||||
$(INSTALL) -c -m 644 "doc/html/$$lang"/* "$(DOC_DIR)/html/$$lang/" ;\
|
||||
done; true
|
||||
## configuration examples
|
||||
$(INSTALL) -d -m 755 $(DOC_DIR)/conf-examples
|
||||
$(INSTALL) -c -m 644 conf-examples/* $(DOC_DIR)/conf-examples/
|
||||
## plugins
|
||||
$(INSTALL) -d -m 755 $(SHARE_DIR)/plugins
|
||||
for e in plugins/*; do cp -r "$$e" "$(SHARE_DIR)/plugins"; done
|
||||
## event scripts
|
||||
$(INSTALL) -c -m 644 hook-scripts/README $(DOC_DIR)/README.events
|
||||
|
||||
|
||||
clean:
|
||||
#$(MAKE) -C bin clean
|
||||
-rm -rf $(BUILD_DIR)
|
||||
-rm -f $(BUILD_DIR)-stamp
|
||||
|
25
README
25
README
|
@ -1 +1,24 @@
|
|||
link cbox-tree.d/usr/share/doc/cryptobox/README
|
||||
$Id$
|
||||
CryptoBox version 0.3
|
||||
|
||||
1) Documentation
|
||||
The documentation is available at https://systemausfall.org/trac/cryptobox/wiki/CryptoBoxUser
|
||||
|
||||
2) Building a LiveCD
|
||||
try: "scripts/cbox-build.sh release"
|
||||
or look at the developer's documentation: https://systemausfall.org/trac/cryptobox/wiki/CryptoBoxDev
|
||||
|
||||
3) Bug reporting
|
||||
Use our issue tracker at https://systemausfall.org/trac/cryptobox/newticket
|
||||
|
||||
4) Licence
|
||||
All scripts are GPL code (v2.0 or above).
|
||||
The documentation is licenced under "Creative Commons 2.5 share-alike" (http://creativecommons.org/licenses/by-sa/2.5/).
|
||||
|
||||
5) Contributors
|
||||
Clavdia Horvat, Tadej Brce & Dušan Rebolj - slovenian translation
|
||||
|
||||
6) Contact
|
||||
email: cryptobox@systemausfall.org
|
||||
|
||||
The CryptoBox project is mainly driven by sense.lab (https://systemausfall.org/senselab).
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
#!/usr/bin/python2.4
|
||||
#
|
||||
# The daemon script to run the CryptoBox webserver.
|
||||
#
|
||||
# run the script with "--help" to see all possible paramters
|
||||
#
|
||||
|
||||
import os, sys
|
||||
import cryptobox.web.sites
|
||||
|
@ -115,7 +120,7 @@ def parseOptions():
|
|||
parser.set_defaults(conffile="/etc/cryptobox/webserver.conf",
|
||||
pidfile="/var/run/cryptobox/webserver.pid",
|
||||
background=False,
|
||||
datadir="/usr/share/cryptobox/html",
|
||||
datadir="/usr/share/cryptobox/www-data",
|
||||
logfile="/var/log/cryptobox/webserver.log",
|
||||
port="8080",
|
||||
host="",
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#
|
||||
# example start script to run a local cryptobox webserver
|
||||
#
|
||||
# we set some en
|
||||
# we set some parameters to make it possible to run it without an existing cryptobox installation
|
||||
#
|
||||
|
||||
BIN_DIR=$(dirname "$0")
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
[global]
|
||||
server.socketPort = 8080
|
||||
#server.environment = "production"
|
||||
server.environment = "development"
|
||||
server.logToScreen = False
|
||||
server.log_tracebacks = True
|
||||
server.threadPool = 1
|
||||
server.reverseDNS = False
|
||||
server.logFile = "/var/log/cryptoboxwebserver.log"
|
||||
|
||||
[/favicon.ico]
|
||||
static_filter.on = True
|
||||
# TODO: use live-cd/live-cd-tree.d/var/www/favicon.ico
|
||||
static_filter.file = "/usr/share/doc/python-cherrypy/cherrypy/favicon.ico"
|
||||
|
||||
[/test_stream]
|
||||
stream_response = True
|
|
@ -0,0 +1,7 @@
|
|||
README
|
||||
copyright
|
||||
changelog
|
||||
doc/html
|
||||
LICENSE
|
||||
event-scripts
|
||||
conf-examples
|
|
@ -32,7 +32,7 @@ CONF_FILE=/etc/cryptobox/cryptobox.conf
|
|||
# quit if NO_START is 1 (see /etc/default/cryptobox)
|
||||
[ "$NO_START" = "1" ] && exit 0
|
||||
|
||||
DAEMON=/usr/bin/CryptoBoxWebserver
|
||||
DAEMON=/usr/sbin/CryptoBoxWebserver
|
||||
PIDFILE=/var/run/cryptobox/webserver.pid
|
||||
DESC="CryptoBox Daemon (webinterface)"
|
||||
OPTIONS="-B --pidfile=$PIDFILE --config=$CONF_FILE $SERVER_OPTS"
|
||||
|
|
|
@ -2,5 +2,5 @@ etc/cryptobox
|
|||
etc/cryptobox/events.d
|
||||
etc/default
|
||||
etc/init.d
|
||||
usr/lib/cryptobox
|
||||
usr/share/cryptobox
|
||||
usr/sbin
|
||||
|
|
|
@ -1,12 +1,18 @@
|
|||
#!/bin/sh
|
||||
|
||||
LOG_FILE=/var/log/cryptobox.log
|
||||
WEBLOG_FILE=/var/log/cryptoboxwebserver.log
|
||||
LOG_FILE=/var/log/cryptobox/cryptobox.log
|
||||
WEBLOG_FILE=/var/log/cryptobox/webserver.log
|
||||
PID_DIR=/var/run/cryptobox
|
||||
CRYPTOBOX_USER=cryptobox
|
||||
USER_HOME=/var/cache/cryptobox
|
||||
SUPER_FILE=/etc/super.tab
|
||||
|
||||
# check the current cryptobox user - maybe it was changed
|
||||
if test -r /etc/default/cryptobox
|
||||
then runas_user=$(grep "^RUNAS=" /etc/default/cryptobox | cut -d "=" -f 2)
|
||||
test -n "$runas_user" && CRYPTOBOX_USER=$runas_user
|
||||
fi
|
||||
|
||||
|
||||
create_user_home()
|
||||
{
|
||||
|
@ -22,25 +28,25 @@ create_user_home()
|
|||
chmod 750 "$USER_HOME"
|
||||
}
|
||||
|
||||
create_log_file()
|
||||
{
|
||||
# create config directories with appropriate permissions
|
||||
test ! -e "$LOG_FILE" && mkdir -p "$(dirname $LOG_FILE)" && touch "$LOG_FILE" && chown "$CRYPTOBOX_USER" "$LOG_FILE"
|
||||
test ! -e "$WEBLOG_FILE" && mkdir -p "$(dirname $WEBLOG_FILE)" && touch "$WEBLOG_FILE" && chown "$CRYPTOBOX_USER" "$WEBLOG_FILE"
|
||||
}
|
||||
|
||||
create_add_super_permission()
|
||||
{
|
||||
## this will add some lines to the configuration file of 'super'
|
||||
## do nothing, if there is already a CryptoBox line
|
||||
grep -q "CRYPTOBOX_MARKER" "$SUPER_FILE" && return 0
|
||||
echo >>"$SUPER_FILE" "## CRYPTOBOX_MARKER - please do not remove!"
|
||||
echo >>"$SUPER_FILE" "CryptoBoxRootActions /usr/bin/CryptoBoxRootActions $CRYPTOBOX_USER"
|
||||
echo >>"$SUPER_FILE" "CryptoBoxRootActions /usr/sbin/CryptoBoxRootActions $CRYPTOBOX_USER"
|
||||
}
|
||||
|
||||
create_pid_dir()
|
||||
create_dirs_and_files()
|
||||
{
|
||||
test ! -e "$PID_DIR" && mkdir -p "$PID_DIR" && chown "$CRYPTOBOX_USER" "$PID_DIR"
|
||||
# pid file
|
||||
test ! -e "$PID_DIR" && mkdir -p "$PID_DIR"
|
||||
chown "$CRYPTOBOX_USER" "$PID_DIR"
|
||||
# create config directories with appropriate permissions
|
||||
test ! -e "$LOG_FILE" && mkdir -p "$(dirname $LOG_FILE)" && touch "$LOG_FILE"
|
||||
chown "$CRYPTOBOX_USER" "$LOG_FILE"
|
||||
test ! -e "$WEBLOG_FILE" && mkdir -p "$(dirname $WEBLOG_FILE)" && touch "$WEBLOG_FILE"
|
||||
chown "$CRYPTOBOX_USER" "$WEBLOG_FILE"
|
||||
}
|
||||
|
||||
|
||||
|
@ -49,8 +55,7 @@ create_pid_dir()
|
|||
case "$1" in
|
||||
configure)
|
||||
create_user_home
|
||||
create_log_file
|
||||
create_pid_dir
|
||||
create_dirs_and_files
|
||||
create_add_super_permission
|
||||
# continue at the end
|
||||
;;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
LOG_FILE=/var/log/cryptobox.log
|
||||
WEBLOG_FILE=/var/log/cryptoboxwebserver.log
|
||||
LOG_FILE=/var/log/cryptobox/cryptobox.log
|
||||
WEBLOG_FILE=/var/log/cryptobox/webserver.log
|
||||
PID_DIR=/var/run/cryptobox
|
||||
SUPER_FILE=/etc/super.tab
|
||||
|
||||
|
|
|
@ -13,19 +13,14 @@
|
|||
.NOTPARALLEL:
|
||||
|
||||
DEB_BUILD_DIR=$(CURDIR)/debian/cryptobox
|
||||
|
||||
configure: configure-stamp
|
||||
configure-stamp: patch
|
||||
dh_testdir
|
||||
@# PUT SOMETHING HERE
|
||||
touch configure-stamp
|
||||
CB_PYDIR=$(DEB_BUILD_DIR)/usr/lib/python$(shell pyversions -vr)/site-packages/cryptobox
|
||||
|
||||
|
||||
build: build-stamp
|
||||
|
||||
build-stamp: configure-stamp
|
||||
build-stamp:
|
||||
dh_testdir
|
||||
$(MAKE) build PREFIX=/usr
|
||||
python setup.py build
|
||||
touch build-stamp
|
||||
|
||||
clean: clean-patched unpatch
|
||||
|
@ -33,8 +28,11 @@ clean: clean-patched unpatch
|
|||
clean-patched:
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
$(MAKE) clean
|
||||
rm -f build-stamp configure-stamp
|
||||
python setup.py clean
|
||||
rm -f build-stamp
|
||||
rm -rf build
|
||||
find -type f -name '*.py[co]' | xargs rm -f
|
||||
rm -f MANIFEST
|
||||
dh_clean
|
||||
|
||||
patch: patch-stamp
|
||||
|
@ -51,10 +49,18 @@ install: build
|
|||
dh_testroot
|
||||
dh_clean -k
|
||||
dh_installdirs
|
||||
dh_pycentral
|
||||
python setup.py install --root=debian/cryptobox
|
||||
install -c -m 644 conf-examples/cryptobox.conf-dist $(DEB_BUILD_DIR)/etc/cryptobox/cryptobox.conf
|
||||
install -c -m 644 conf-examples/cryptoboxwebserver.conf-dist $(DEB_BUILD_DIR)/etc/cryptobox/webserver.conf
|
||||
python setup.py install --root=$(DEB_BUILD_DIR)
|
||||
# the cryptobox is a webserver - it should be installed in /usr/sbin
|
||||
mv $(DEB_BUILD_DIR)/usr/bin/CryptoBoxWebserver $(DEB_BUILD_DIR)/usr/sbin/
|
||||
mv $(DEB_BUILD_DIR)/usr/bin/CryptoBoxRootActions $(DEB_BUILD_DIR)/usr/sbin/
|
||||
# remove tests
|
||||
rm -rf $(CB_PYDIR)/tests
|
||||
# remove duplicate documentation files
|
||||
rm -rf $(CB_PYDIR)/share/doc
|
||||
# move shared files
|
||||
mv $(CB_PYDIR)/share $(DEB_BUILD_DIR)/usr/share/cryptobox
|
||||
$(INSTALL) -d -m 755 $(DEB_BUILD_DIR)/var/log/cryptobox
|
||||
$(INSTALL) -d -m 755 $(DEB_BUILD_DIR)/var/run/cryptobox
|
||||
|
||||
|
||||
# Build architecture-independent files here.
|
||||
|
@ -70,15 +76,14 @@ binary-arch: build install
|
|||
dh_installlogrotate
|
||||
dh_installinit
|
||||
dh_installman
|
||||
dh_link
|
||||
dh_strip
|
||||
dh_install
|
||||
dh_pycentral
|
||||
dh_compress
|
||||
dh_fixperms
|
||||
dh_installdeb
|
||||
dh_shlibdeps
|
||||
dh_gencontrol
|
||||
dh_md5sums
|
||||
dh_builddeb
|
||||
|
||||
binary: binary-indep binary-arch
|
||||
.PHONY: build clean binary-indep binary-arch binary install configure clean-patched patch patch-stamp unpatch
|
||||
.PHONY: build clean binary-indep binary-arch binary install clean-patched patch patch-stamp unpatch
|
||||
|
|
24
doc/README
24
doc/README
|
@ -1,24 +0,0 @@
|
|||
$Id$
|
||||
CryptoBox version 0.3
|
||||
|
||||
1) Documentation
|
||||
The documentation is available at https://systemausfall.org/trac/cryptobox/wiki/CryptoBoxUser
|
||||
|
||||
2) Building a LiveCD
|
||||
try: "scripts/cbox-build.sh release"
|
||||
or look at the developer's documentation: https://systemausfall.org/trac/cryptobox/wiki/CryptoBoxDev
|
||||
|
||||
3) Bug reporting
|
||||
Use our issue tracker at https://systemausfall.org/trac/cryptobox/newticket
|
||||
|
||||
4) Licence
|
||||
All scripts are GPL code (v2.0 or above).
|
||||
The documentation is licenced under "Creative Commons 2.5 share-alike" (http://creativecommons.org/licenses/by-sa/2.5/).
|
||||
|
||||
5) Contributors
|
||||
Clavdia Horvat, Tadej Brce & Dušan Rebolj - slovenian translation
|
||||
|
||||
6) Contact
|
||||
email: cryptobox@systemausfall.org
|
||||
|
||||
The CryptoBox project is mainly driven by sense.lab (https://systemausfall.org/senselab).
|
32
setup.py
32
setup.py
|
@ -13,18 +13,27 @@ datadir = distutils.sysconfig.get_python_lib()
|
|||
datadir = datadir.replace(distutils.sysconfig.get_config_var("prefix") + os.path.sep, '')
|
||||
datadir = os.path.join(datadir, 'cryptobox','share')
|
||||
|
||||
def getdatafiles(dirs):
|
||||
filelist = []
|
||||
def listfiles(srcdir):
|
||||
## configuration directory
|
||||
confdir = os.path.join(os.path.sep, 'etc', 'cryptobox')
|
||||
|
||||
def listfiles(prefix,srcdir):
|
||||
"""get files below a directory recursively - map them to the appropriate datatype as expected by 'data_files' in setup"""
|
||||
## add the files of this directory
|
||||
result = [(os.path.join(datadir,srcdir), [ os.path.join(srcdir, f) for f in os.listdir(srcdir) if os.path.isfile(os.path.join(srcdir, f)) and not f in IGNORE_FILES ])]
|
||||
result = [(os.path.join(prefix,srcdir), [ os.path.join(srcdir, f) for f in os.listdir(srcdir) if os.path.isfile(os.path.join(srcdir, f)) and not f in IGNORE_FILES ])]
|
||||
## add the files in subdirectories
|
||||
for d in os.listdir(os.path.join(srcdir)):
|
||||
if os.path.isdir(os.path.join(srcdir,d)) and not d in IGNORE_FILES:
|
||||
result.extend(listfiles(os.path.join(srcdir,d)))
|
||||
result.extend(listfiles(prefix,os.path.join(srcdir,d)))
|
||||
return result
|
||||
|
||||
|
||||
def getdatafiles(prefix,dirs):
|
||||
filelist = []
|
||||
for d in dirs:
|
||||
filelist.extend(listfiles(d))
|
||||
if os.path.isdir(d):
|
||||
filelist.extend(listfiles(prefix,d))
|
||||
else:
|
||||
filelist.append((prefix, [d]))
|
||||
return filelist
|
||||
|
||||
|
||||
|
@ -39,11 +48,12 @@ setup(
|
|||
license = 'GPL',
|
||||
url = 'http://cryptobox.org',
|
||||
packages = [ 'cryptobox', 'cryptobox.core', 'cryptobox.web', 'cryptobox.plugins', 'cryptobox.tests' ],
|
||||
data_files = getdatafiles(['templates','www-data','lang','plugins','event-scripts','conf-examples']) + [
|
||||
(datadir, ['README']),
|
||||
(datadir, ['CHANGELOG']),
|
||||
(datadir, ['LICENSE'])],
|
||||
package_dir = { 'cryptobox': 'src' },
|
||||
data_files = getdatafiles(datadir, ['templates','www-data','lang','plugins']) +
|
||||
getdatafiles(confdir, ['conf-examples/cryptobox.conf']) +
|
||||
getdatafiles(os.path.join(confdir,'events.d'), ['event-scripts/README']) +
|
||||
getdatafiles(datadir, ['doc']) +
|
||||
getdatafiles(os.path.join(datadir,'doc'), ['conf-examples','event-scripts','README','changelog','LICENSE','copyright','doc/html']),
|
||||
package_dir = { '': 'src' },
|
||||
scripts = [ 'bin/CryptoBoxWebserver', 'bin/CryptoBoxRootActions' ],
|
||||
classifiers = [
|
||||
'Development Status :: 2 - Beta',
|
||||
|
|
Loading…
Reference in New Issue