Selaa lähdekoodia

allow to launch tracim with uwsgi

Guénaël Muller 6 vuotta sitten
vanhempi
commit
836ca8d2f0
2 muutettua tiedostoa jossa 34 lisäystä ja 7 poistoa
  1. 24 7
      README.md
  2. 10 0
      wsgi/webdav.py

+ 24 - 7
README.md Näytä tiedosto

@@ -19,6 +19,7 @@ on Debian Stretch (9) with sudo:
19 19
     sudo apt update
20 20
     sudo apt install git
21 21
     sudo apt install python3 python3-venv python3-dev python3-pip
22
+    sudo apt install uwsgi uwsgi-plugin-python
22 23
 
23 24
 ### Get the source ###
24 25
 
@@ -73,23 +74,39 @@ Initialize the database using [tracimcli](doc/cli.md) tool
73 74
 
74 75
     tracimcli db init
75 76
 
76
-### Run Tracim_backend ###
77
+create wsgidav configuration file for webdav:
77 78
 
78
-Run your project:
79
+    cp wsgidav.conf.sample wsgidav.conf
79 80
 
80
-    pserve development.ini
81
+## Run Tracim_backend ##
81 82
 
82
-### Configure and Run Webdav Server (Unstable) ###
83
+### With Uwsgi ###
83 84
 
84
-create wsgidav configuration file :
85
+Run all services with uwsgi
85 86
 
86
-    cp wsgidav.conf.sample wsgidav.conf
87
+    # pyramid webserver
88
+    uwsgi -d /tmp/tracim_web.log --http-socket :6543 --ini-paste-logged  development.ini -H env --pidfile /tmp/tracim_web.pid
89
+    # webdav wsgidav server
90
+    uwsgi -d /tmp/tracim_webdav.log --http-socket :3030 --wsgi-file wsgi//webdav.py  development.ini -H env --pidfile /tmp/tracim_webdav.pid
91
+
92
+to stop them:
93
+
94
+    # pyramid webserver
95
+    uwsgi --stop /tmp/tracim_web.pid
96
+    # webdav wsgidav server
97
+    uswgi --stop /tmp/tracim_webdav.pid
98
+
99
+### With Waitress (legacy way, usefull for debug) ###
100
+
101
+run tracim_backend web api:
102
+
103
+    pserve developement.ini
87 104
 
88 105
 run wsgidav server:
89 106
 
90 107
     tracimcli webdav start
91 108
 
92
-### Run Tests and others checks ###
109
+## Run Tests and others checks ##
93 110
 
94 111
 Run your project's tests:
95 112
 

+ 10 - 0
wsgi/webdav.py Näytä tiedosto

@@ -0,0 +1,10 @@
1
+# coding=utf-8
2
+# Runner for uwsgi
3
+from tracim.lib.webdav import WebdavAppFactory
4
+
5
+APP_CONFIG = "development.ini"
6
+
7
+app_factory = WebdavAppFactory(
8
+    tracim_config_file_path=APP_CONFIG,
9
+)
10
+application = app_factory.get_wsgi_app()