Quellcode durchsuchen

Add nginx and taiga backend configs

Johannes Zellner vor 9 Jahren
Ursprung
Commit
3bc4e172aa
4 geänderte Dateien mit 67 neuen und 1 gelöschten Zeilen
  1. 5 1
      Dockerfile
  2. 14 0
      conf.json
  3. 33 0
      local.py
  4. 15 0
      start.sh

+ 5 - 1
Dockerfile

@@ -18,7 +18,9 @@ WORKDIR /app/code
 RUN git clone https://github.com/taigaio/taiga-back.git taiga-back
 WORKDIR /app/code/taiga-back
 RUN git checkout stable
-RUN mkvirtualenv -p /usr/bin/python3.4 taiga
+# RUN mkvirtualenv -p /usr/bin/python3.4 taiga
+RUN apt-get install -y postgresql-9.4 postgresql-contrib-9.4
+RUN apt-get install -y postgresql-server-dev-9.4
 RUN pip install -r requirements.txt
 
 ## frontend
@@ -34,6 +36,8 @@ ADD circus.ini /app/code/circus.ini
 ADD circus.conf /etc/init/circus.conf
 RUN rm /etc/nginx/sites-enabled/default
 ADD taiga.nginx.conf /etc/nginx/sites-enabled/taiga
+ADD conf.json /app/code/taiga-front-dist/dist/js/conf.json
+ADD local.py /app/code/taiga-back/settings/local.py
 ADD start.sh /app/code/start.sh
 
 CMD [ "/app/code/start.sh" ]

+ 14 - 0
conf.json

@@ -0,0 +1,14 @@
+
+
+{
+    "api": "http://example.com/api/v1/",
+    "eventsUrl": "ws://example.com/events",
+    "debug": "true",
+    "publicRegisterEnabled": true,
+    "feedbackEnabled": true,
+    "privacyPolicyUrl": null,
+    "termsOfServiceUrl": null,
+    "maxUploadFileSize": null,
+    "contribPlugins": []
+}
+

+ 33 - 0
local.py

@@ -0,0 +1,33 @@
+
+
+from .common import *
+
+MEDIA_URL = "http://example.com/media/"
+STATIC_URL = "http://example.com/static/"
+ADMIN_MEDIA_PREFIX = "http://example.com/static/admin/"
+SITES["front"]["scheme"] = "http"
+SITES["front"]["domain"] = "example.com"
+
+SECRET_KEY = "theveryultratopsecretkey"
+
+DEBUG = False
+TEMPLATE_DEBUG = False
+PUBLIC_REGISTER_ENABLED = True
+
+DEFAULT_FROM_EMAIL = "no-reply@example.com"
+SERVER_EMAIL = DEFAULT_FROM_EMAIL
+
+# Uncomment and populate with proper connection parameters
+# for enable email sending. EMAIL_HOST_USER should end by @domain.tld
+#EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
+#EMAIL_USE_TLS = False
+#EMAIL_HOST = "localhost"
+#EMAIL_HOST_USER = ""
+#EMAIL_HOST_PASSWORD = ""
+#EMAIL_PORT = 25
+
+# Uncomment and populate with proper connection parameters
+# for enable github login/singin.
+#GITHUB_API_CLIENT_ID = "yourgithubclientid"
+#GITHUB_API_CLIENT_SECRET = "yourgithubclientsecret"
+

+ 15 - 0
start.sh

@@ -14,4 +14,19 @@ echo "==============="
 #service circus start
 #service nginx restart
 
+echo "local.py"
+sed -e "s/MEDIA_URL = \".*\"/MEDIA_URL = \"https:\/\/${HOSTNAME}\/media\/\"/" \
+    -e "s/STATIC_URL = \".*\"/STATIC_URL = \"https:\/\/${HOSTNAME}\/static\/\"/" \
+    -e "s/ADMIN_MEDIA_PREFIX = \".*\"/ADMIN_MEDIA_PREFIX = \"https:\/\/${HOSTNAME}\/static\/admin\/\"/" \
+    -e "s/SITES\[\"front\"\]\[\"scheme\"\] = \".*\"/SITES\[\"front\"\]\[\"scheme\"\] = \"https\"/" \
+    -e "s/SITES\[\"front\"\]\[\"domain\"\] = \".*\"/SITES\[\"front\"\]\[\"domain\"\] = \"${HOSTNAME}\"/" \
+    -i /app/code/taiga-back/settings/local.py
+
+echo "update conf.json"
+sed -e "s/\"api\": \".*\",/\"api\": \"https:\/\/${HOSTNAME}\/api\/v1\/\",/" \
+    -e "s/\"eventsUrl\": \".*\",/\"eventsUrl\": \"ws:\/\/${HOSTNAME}\/events\",/" \
+    -i /app/code/taiga-front-dist/dist/js/conf.json
+
+echo "update nginx"
+
 read