|
@@ -5,6 +5,7 @@
|
5
|
5
|
# TODO: Supporter le changement des variables d'environnement ? (actuellement utilisé pour générer le .ini)
|
6
|
6
|
# TODO: Fichiers de config link ls -s dans un dossier pour VOLUME
|
7
|
7
|
# TODO: README QQCH pour les ports ? 80, 3060 et 5333
|
|
8
|
+# TODO: generate cookie secrent (if not yet done)
|
8
|
9
|
|
9
|
10
|
# Start PostgreSQL
|
10
|
11
|
service postgresql start
|
|
@@ -17,16 +18,25 @@ if ! [ "$( su - postgres -s /bin/bash -c "psql -tAc \"SELECT 1 FROM pg_database
|
17
|
18
|
fi
|
18
|
19
|
|
19
|
20
|
# Create config.ini file if no exist
|
20
|
|
-if [ ! -f /tracim/tracim/config.ini ]; then
|
21
|
|
- cp /tracim/tracim/development.ini.base /tracim/tracim/config.ini
|
22
|
|
- sed -i "s/\(sqlalchemy.url *= *\).*/\1postgresql:\/\/tracim:tracim@127.0.0.1:5432\/tracim?client_encoding=utf8/" /tracim/tracim/config.ini
|
23
|
|
- # TODO: ENV VAR
|
|
21
|
+if [ ! -f /etc/tracim/config.ini ]; then
|
|
22
|
+ cp /tracim/tracim/development.ini.base /etc/tracim/config.ini
|
24
|
23
|
fi
|
|
24
|
+ln -s /etc/tracim/config.ini /tracim/tracim/config.ini
|
25
|
25
|
|
26
|
26
|
# Create wsgidav.conf file if no exist
|
27
|
|
-if [ ! -f /tracim/tracim/wsgidav.conf ]; then
|
28
|
|
- cp /tracim/tracim/wsgidav.conf.sample /tracim/tracim/wsgidav.conf
|
|
27
|
+if [ ! -f /etc/tracim/wsgidav.conf ]; then
|
|
28
|
+ cp /tracim/tracim/wsgidav.conf.sample /etc/tracim/wsgidav.conf
|
29
|
29
|
fi
|
|
30
|
+ln -s /etc/tracim/wsgidav.conf /tracim/tracim/wsgidav.conf
|
|
31
|
+
|
|
32
|
+# Create uwsgi file if no exist
|
|
33
|
+if [ ! -f /etc/tracim/uwsgi.ini ]; then
|
|
34
|
+ cp /tracim/tracim/uwsgi.ini /etc/tracim/uwsgi.ini
|
|
35
|
+fi
|
|
36
|
+
|
|
37
|
+# Update config with ENV
|
|
38
|
+# TODO Manage other ENV vars
|
|
39
|
+sed -i "s/\(sqlalchemy.url *= *\).*/\1postgresql:\/\/tracim:tracim@127.0.0.1:5432\/tracim?client_encoding=utf8/" /etc/tracim/config.ini
|
30
|
40
|
|
31
|
41
|
# Start with uwsgi
|
32
|
|
-uwsgi --http-socket 0.0.0.0:80 /etc/uwsgi/apps-available/tracim.ini
|
|
42
|
+uwsgi --http-socket 0.0.0.0:80 /etc/tracim/uwsgi.ini
|