Skip to content
This repository was archived by the owner on Oct 24, 2018. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 28 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,23 +73,44 @@ Initialize the database using [tracimcli](doc/cli.md) tool

tracimcli db init

### Run Tracim_backend ###
create wsgidav configuration file for webdav:

Run your project:
cp wsgidav.conf.sample wsgidav.conf

pserve development.ini
## Run Tracim_backend ##

### Configure and Run Webdav Server (Unstable) ###
### With Uwsgi ###

create wsgidav configuration file :
Run all services with uwsgi

cp wsgidav.conf.sample wsgidav.conf
# install uwsgi with pip ( unneeded if you already have uwsgi with python3 plugin enabled)
sudo pip3 install uwsgi
# set tracim_conf_file path
export TRACIM_CONF_PATH="$(pwd)/development.ini"
export TRACIM_WEBDAV_CONF_PATH="$(pwd)/wsgidav.conf"
# pyramid webserver
uwsgi -d /tmp/tracim_web.log --http-socket :6543 --wsgi-file wsgi/web.py -H env --pidfile /tmp/tracim_web.pid
# webdav wsgidav server
uwsgi -d /tmp/tracim_webdav.log --http-socket :3030 --wsgi-file wsgi/webdav.py -H env --pidfile /tmp/tracim_webdav.pid

to stop them:

# pyramid webserver
uwsgi --stop /tmp/tracim_web.pid
# webdav wsgidav server
uwsgi --stop /tmp/tracim_webdav.pid

### With Waitress (legacy way, usefull for debug) ###

run tracim_backend web api:

pserve developement.ini

run wsgidav server:

tracimcli webdav start

### Run Tests and others checks ###
## Run Tests and others checks ##

Run your project's tests:

Expand Down
9 changes: 9 additions & 0 deletions wsgi/web.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# coding=utf-8
# Runner for uwsgi
import os
import pyramid.paster

config_uri = os.environ['TRACIM_CONF_PATH']

pyramid.paster.setup_logging(config_uri)
application = pyramid.paster.get_app(config_uri)
12 changes: 12 additions & 0 deletions wsgi/webdav.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# coding=utf-8
# Runner for uwsgi
from tracim.lib.webdav import WebdavAppFactory
import os

config_uri = os.environ['TRACIM_CONF_PATH']
webdav_config_uri = os.environ['TRACIM_WEBDAV_CONF_PATH']
app_factory = WebdavAppFactory(
tracim_config_file_path=config_uri,
webdav_config_file_path=webdav_config_uri,
)
application = app_factory.get_wsgi_app()