From 9957096b834f28863c89bcea7b7984d99bac035c Mon Sep 17 00:00:00 2001 From: Disassembler Date: Wed, 29 Nov 2017 20:01:17 +0100 Subject: [PATCH] Introduce install script for CTS --- 80-cts.sh | 65 +++++++++++++++++++++++++++ basic/srv/portal/img/CTS.png | Bin 0 -> 17279 bytes basic/srv/portal/index.html | 9 ++++ cts/etc/nginx/sites-available/cts | 43 ++++++++++++++++++ cts/etc/uwsgi/apps-available/cts.ini | 8 ++++ cts/srv/cts/cts/settings/spotter.py | 46 +++++++++++++++++++ cts/tmp/cts-adminpwd.sql | 1 + cts/tmp/cts-createdb.sql | 10 +++++ 8 files changed, 182 insertions(+) create mode 100644 80-cts.sh create mode 100644 basic/srv/portal/img/CTS.png create mode 100644 cts/etc/nginx/sites-available/cts create mode 100644 cts/etc/uwsgi/apps-available/cts.ini create mode 100644 cts/srv/cts/cts/settings/spotter.py create mode 100644 cts/tmp/cts-adminpwd.sql create mode 100644 cts/tmp/cts-createdb.sql diff --git a/80-cts.sh b/80-cts.sh new file mode 100644 index 0000000..ec72873 --- /dev/null +++ b/80-cts.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +SOURCE_DIR=$(realpath $(dirname "${0}")) + +# Install packages +apt-get -y --no-install-recommends install build-essential libpq-dev python-dev python-virtualenv virtualenv zlib1g-dev + +# Clone CTS git repository +git clone --depth 1 https://github.com/theirc/CTS /srv/cts + +# Install CTS python virtual environment +virtualenv --no-site-packages --python=/usr/bin/python2.7 /srv/cts +/srv/cts/bin/pip install -r /srv/cts/requirements/production.txt + +# Create database +export CTS_PWD=$(head -c 18 /dev/urandom | base64) +envsubst <${SOURCE_DIR}/cts/tmp/cts-createdb.sql >/tmp/cts-createdb.sql +sudo -u postgres psql -f /tmp/cts-createdb.sql +rm /tmp/cts-createdb.sql + +# Configure CTS +export CTS_SECRET=$(head -c 26 /dev/urandom | base64) +envsubst <${SOURCE_DIR}/cts/srv/cts/cts/settings/spotter.py >/srv/cts/cts/settings/spotter.py +ln -s /srv/cts/lib/python2.7/site-packages/django/contrib/admin/static/admin /srv/cts/cts/static/admin +ln -s /srv/cts/lib/python2.7/site-packages/django_extensions/static/django_extensions /srv/cts/cts/static/django_extensions +ln -s /srv/cts/lib/python2.7/site-packages/django_tables2/static/django_tables2 /srv/cts/cts/static/django_tables2 +ln -s /srv/cts/lib/python2.7/site-packages/leaflet/static/leaflet /srv/cts/cts/static/leaflet +ln -s /srv/cts/lib/python2.7/site-packages/rest_framework/static/rest_framework /srv/cts/cts/static/rest_framework +ln -s /srv/cts/lib/python2.7/site-packages/rest_framework_swagger/static/rest_framework_swagger /srv/cts/cts/static/rest_framework_swagger +ln -s /srv/cts/lib/python2.7/site-packages/selectable/static/selectable /srv/cts/cts/static/selectable +ln -s /srv/cts/lib/python2.7/site-packages/session_security/static/session_security /srv/cts/cts/static/session_security + +# Set "production values" (increases performance) only if the DEBUG environment variable is not set +if [ ${DEBUG:-0} -eq 0 ]; then + sed -i 's/DEBUG = True/DEBUG = False/' /srv/cts/cts/settings/spotter.py +fi + +# Populate database +DJANGO_SETTINGS_MODULE=cts.settings.spotter /srv/cts/bin/python /srv/cts/manage.py migrate + +# Create admin account +export CTS_ADMIN_EMAIL=admin@example.com +export CTS_ADMIN_PWD=$(head -c 12 /dev/urandom | base64) +export CTS_ADMIN_HASH=$(cd /srv/cts && DJANGO_SETTINGS_MODULE=cts.settings.spotter /srv/cts/bin/python -c "from django.contrib.auth.hashers import make_password; print make_password('${CTS_ADMIN_PWD}')") +export CTS_ADMIN_SECRET=$(head -c 12 /dev/urandom | sha256sum | cut -c1-13) +envsubst <${SOURCE_DIR}/cts/tmp/cts-adminpwd.sql >/tmp/cts-adminpwd.sql +sudo -u postgres psql -f /tmp/cts-adminpwd.sql cts +rm /tmp/cts-adminpwd.sql + +# Create CTS OS user +adduser --system --group --home /srv/cts --shell /bin/false cts +chown -R cts:cts /srv/cts + +# Create uwsgi and nginx app definition +cp ${SOURCE_DIR}/cts/etc/uwsgi/apps-available/cts.ini /etc/uwsgi/apps-available/cts.ini +ln -s /etc/uwsgi/apps-available/cts.ini /etc/uwsgi/apps-enabled/cts.ini +cp ${SOURCE_DIR}/cts/etc/nginx/sites-available/cts /etc/nginx/sites-available/cts +ln -s /etc/nginx/sites-available/cts /etc/nginx/sites-enabled/cts + +# Restart services +systemctl restart uwsgi +systemctl restart nginx + +# Add portal application definition +${SOURCE_DIR}/basic/portal-app-manager.py cts "https://{host}:8004/" "${CTS_ADMIN_EMAIL}" "${CTS_ADMIN_PWD}" diff --git a/basic/srv/portal/img/CTS.png b/basic/srv/portal/img/CTS.png new file mode 100644 index 0000000000000000000000000000000000000000..9bd35f4b5eef8a268589332dcfa4e356a73b7cc3 GIT binary patch literal 17279 zcmcJ%RaDzS*Dp*3C{WxA6faQRp?GmCuEAXrq&O67DPG*2;uf6XuEjk#DXzg?Kj`zG z_gm}Sor~upD`lxmWNnQt%~j2f%{(0X%>@w<#3^MZMAhBr_tTNn@FeGZ zONu>L4@NfiXK5^z@gzQvcX4JHeDq7gXaDt)&hjG6@*#L4hE%9$`tH0tGSu1g2y6YT%m z{D157-y}Ty`q}1ZjAvgX{2%cDGU0y%{S5wp0{smBUm$!2Hv7%$c+zZJAyaI?8pHHl zQ#i}hH7lVM{6Z9m>^4ykLfk5pPm1L7_{Dyf5xi37mn|@Zco+c_)QjatcuzI$%tR~N ze~cv>W)kT+NL=q*&wUu40Kcl#Li5P{iZZ^~@uR~{KAc)weIz5Hhu_L8JS5-SsPVDz z<=6J3E{?UrXpPQ60G-s^Ddg8^-|r2o1H-_pE`BakzX4CVt@^n-A|Zta&SXXKOwBxG z9;Ooh_Ze>-Og#$rPe<%{Nul8-e!8tP!Q1Wr%oSHrEfS3-t_2Mvfp8xg+|ASpV5mb4p*oO^$Lkt1%eDc4C^0ffLE6sWVzxM7n&d9XE`fq zA;W6WKP*YE!BCg>X38fZ^}n}y10$+y0Me*mNPdXz5B8SKkk!BU{x1F&qEE6AhsD6J zp7^H5!7)hxBNu-kEbFW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ZSlq%;oT7l||qC2MrWo;y-(Xf{) zv+^GnUPi|1Yog3Ov?4IR=>zmnXy(%y870z#4{anN3%Wn?og7lCWK& zK9l|Q!gSpQKn#LCLhA!-*+xGQkp*Ms-= ziaI-APNFmyk;|ffEzx?;BmF!{AhNevbHm##pOH|ahiW=mnlyXMvSit{mz`%qGgeHz zbbo!vF6E3ELvcc{*v#6PNcDWa0$V&@Yfm;u`m!2ZBoQ{~Te|=@W{O@k-}@pd|EG)8 zbz%seSSL3s-Ht~!xu#)HA1r2OD^Uh~dh#V!8H1LJ1H4J9OhUAsV`|i6_sIcaO=%jsjy7i%D!#sj}aH8V*R2CGN2tiQjTs8 zp+G}H`eOkI#_|9#QRnal?0Z!k*iC{{r(?-vZ9eAq4nle@sJ=Y)`T`VPvuB8+bBCd8 zrs2aq10pXR}92u#NSg6q#=H#`?VtAd< z42{v*%ymg@uO-a-=n{J3j^JmO%165&$^~Pvhl)CxrcgiqETlB3yHQhTc%^1*o@9Y& zrQWlA%%n*(tA0a#4l~GtMuCP)`-heo&2CfAwLylTtRL3?YEnkbN+U@)-qNA&VRtJ& zNCMea-aH+{HhTL%cNILHZ2sT73Z8q%{#_XHbnf}TeUHHNS@3@tHCT_V?FiO=q~jJ- T>4{I5CLqX4DoT`z8TtKx433CD literal 0 HcmV?d00001 diff --git a/basic/srv/portal/index.html b/basic/srv/portal/index.html index d14b716..8c584a0 100644 --- a/basic/srv/portal/index.html +++ b/basic/srv/portal/index.html @@ -160,6 +160,15 @@

+
+

CTSCTS

+

Logistika hmotné pomoci pro humanitární potřeby.

+
    +
  • Login:
  • +
  • Heslo:
  • +
+
+

diaspora*diaspora*

Autonomní sociání síť s možností propojení do cizích sociálních sítí.

diff --git a/cts/etc/nginx/sites-available/cts b/cts/etc/nginx/sites-available/cts new file mode 100644 index 0000000..0e38569 --- /dev/null +++ b/cts/etc/nginx/sites-available/cts @@ -0,0 +1,43 @@ +server { + listen 8004 ssl http2; + + root /srv/cts/cts; + + access_log /var/log/nginx/cts.access.log; + error_log /var/log/nginx/cts.error.log; + + location /robots.txt { + alias /srv/cts/cts/static/robots.txt; + } + + location /media { + alias /srv/cts/cts/media; + } + + location /static { + gzip on; + alias /srv/cts/cts/static; + expires max; + add_header Cache-Control public; + + location /static/protected { + return 401; + } + } + + location /protected { + internal; + root /srv/cts/cts/static; + } + + error_page 502 503 504 /502.html; + + location /502.html { + alias /srv/cts/cts/static/502.html; + } + + location / { + uwsgi_pass unix:///run/uwsgi/app/cts/socket; + include uwsgi_params; + } +} diff --git a/cts/etc/uwsgi/apps-available/cts.ini b/cts/etc/uwsgi/apps-available/cts.ini new file mode 100644 index 0000000..5ccfa87 --- /dev/null +++ b/cts/etc/uwsgi/apps-available/cts.ini @@ -0,0 +1,8 @@ +[uwsgi] +uid = cts +gid = cts +chown-socket = www-data:www-data +chdir = /srv/cts +home = /srv/cts +module = cts.wsgi:application +env = DJANGO_SETTINGS_MODULE=cts.settings.spotter diff --git a/cts/srv/cts/cts/settings/spotter.py b/cts/srv/cts/cts/settings/spotter.py new file mode 100644 index 0000000..3bd2f7f --- /dev/null +++ b/cts/srv/cts/cts/settings/spotter.py @@ -0,0 +1,46 @@ +import os +import sys + +os.environ['ENVIRONMENT'] = 'dev' +os.environ['INSTANCE'] = 'local' +os.environ['PREFIX_URL'] = '' + +from cts.settings.base import * + +INSTANCE_NAME = 'Local' +INSTANCES = [ + (INSTANCE_NAME, ''), +] + +DATABASES = { + 'default': { + 'ENGINE': 'django.contrib.gis.db.backends.postgis', + 'NAME': 'cts', + 'USER': 'cts', + 'PASSWORD': '${CTS_PWD}', + 'HOST': '', + 'PORT': '', + } +} +SECRET_KEY = '${CTS_SECRET}' + +ADMINS = ( + ('Admin', 'admin@example.com'), +) + +INTERNAL_IPS = ('127.0.0.1', ) +PUBLIC_ROOT = os.path.join(PROJECT_ROOT, 'public') +SENDFILE_ROOT = os.path.join(PUBLIC_ROOT, 'static/protected') +COMPRESS_ENABLED = False + +EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' +SERVER_EMAIL = 'cts@spotter.ngo' + +CELERY_ALWAYS_EAGER = True +CELERY_EAGER_PROPAGATES_EXCEPTIONS = True + +TIME_ZONE = 'Europe/Prague' +LANGUAGE_CODE = 'cs' + +DEBUG = True +TEMPLATE_DEBUG = DEBUG diff --git a/cts/tmp/cts-adminpwd.sql b/cts/tmp/cts-adminpwd.sql new file mode 100644 index 0000000..f10ebd5 --- /dev/null +++ b/cts/tmp/cts-adminpwd.sql @@ -0,0 +1 @@ +INSERT INTO accounts_ctsuser (id, password, last_login, is_superuser, name, email, is_staff, is_active, date_joined, mobile, code, skype, notes, role, referrer_id, city_id, colour, deviceid) VALUES (nextval('accounts_ctsuser_id_seq'), '${CTS_ADMIN_HASH}', now(), true, '${CTS_ADMIN_USER}', '${CTS_ADMIN_EMAIL}', true, true, now(), '', '${CTS_ADMIN_SECRET}', '', '', 'partner', NULL, NULL, '', ''); diff --git a/cts/tmp/cts-createdb.sql b/cts/tmp/cts-createdb.sql new file mode 100644 index 0000000..3c800c2 --- /dev/null +++ b/cts/tmp/cts-createdb.sql @@ -0,0 +1,10 @@ +CREATE ROLE cts NOSUPERUSER NOCREATEDB NOCREATEROLE NOINHERIT LOGIN ENCRYPTED PASSWORD '${CTS_PWD}'; +CREATE DATABASE cts; +REVOKE ALL ON DATABASE cts FROM public; +ALTER DATABASE cts OWNER TO cts; +\c cts; +CREATE EXTENSION hstore; +CREATE EXTENSION postgis; +GRANT ALL ON geometry_columns TO cts; +GRANT ALL ON spatial_ref_sys TO cts; +GRANT ALL ON geography_columns TO cts;