Pārlūkot izejas kodu

allow to launch tracim with uwsgi

Guénaël Muller 6 gadus atpakaļ
vecāks
revīzija
836ca8d2f0
2 mainītis faili ar 34 papildinājumiem un 7 dzēšanām
  1. 24 7
      README.md
  2. 10 0
      wsgi/webdav.py

+ 24 - 7
README.md Parādīt failu

19
     sudo apt update
19
     sudo apt update
20
     sudo apt install git
20
     sudo apt install git
21
     sudo apt install python3 python3-venv python3-dev python3-pip
21
     sudo apt install python3 python3-venv python3-dev python3-pip
22
+    sudo apt install uwsgi uwsgi-plugin-python
22
 
23
 
23
 ### Get the source ###
24
 ### Get the source ###
24
 
25
 
73
 
74
 
74
     tracimcli db init
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
 run wsgidav server:
105
 run wsgidav server:
89
 
106
 
90
     tracimcli webdav start
107
     tracimcli webdav start
91
 
108
 
92
-### Run Tests and others checks ###
109
+## Run Tests and others checks ##
93
 
110
 
94
 Run your project's tests:
111
 Run your project's tests:
95
 
112
 

+ 10 - 0
wsgi/webdav.py Parādīt failu

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()