summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2019-08-08 12:52:22 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2019-08-08 12:52:22 +0200
commitd122dcacc3f7d95124f30ee988cebb0873befa34 (patch)
tree8eb72f1d4e638ac85187f6dc53d6cb1352d458ad
parent6cc4e9dbd781cf30a7d4108a2d64ed0ac28b2a1e (diff)
downloadComm-on-net-d122dcacc3f7d95124f30ee988cebb0873befa34.tar.bz2
Comm-on-net-d122dcacc3f7d95124f30ee988cebb0873befa34.zip
Install: ALLOWED_HOSTS
-rw-r--r--commonnet/INSTALL.md15
-rw-r--r--commonnet/local_settings.py.sample2
-rw-r--r--conf/uwsgi.ini.template4
-rwxr-xr-xinstall.sh8
4 files changed, 23 insertions, 6 deletions
diff --git a/commonnet/INSTALL.md b/commonnet/INSTALL.md
new file mode 100644
index 0000000..655b4b8
--- /dev/null
+++ b/commonnet/INSTALL.md
@@ -0,0 +1,15 @@
+Install instructions for debian stretch.
+
+``` bash
+apt install git python3 python3-pip
+
+echo "deb http://deb.debian.org/debian stretch-backports main contrib" >> /etc/apt/sources.list
+
+apt update
+
+cd /srv
+git clone https://gitlab.com/iggdrasil/comm-on-net.git
+
+cd comm-on-net
+URL=commonnet.myorganisation.net RESPONSIBLE_EMAIL=dev@myorganisation.net ./install.sh
+```
diff --git a/commonnet/local_settings.py.sample b/commonnet/local_settings.py.sample
index 30800cc..879abf0 100644
--- a/commonnet/local_settings.py.sample
+++ b/commonnet/local_settings.py.sample
@@ -16,3 +16,5 @@ DATABASES = {
'PORT': '5432',
}
}
+
+ALLOWED_HOSTS = ["#URL#"]
diff --git a/conf/uwsgi.ini.template b/conf/uwsgi.ini.template
index 653dc70..4be58f4 100644
--- a/conf/uwsgi.ini.template
+++ b/conf/uwsgi.ini.template
@@ -1,8 +1,8 @@
[uwsgi]
# variables
projectname = commonnet
-projectdomain = #URL# # ex: commonnet.myorganization.net
-base = /srv/comm-on-net/ # install path
+projectdomain = #URL#
+base = /srv/comm-on-net/
# config
plugins = python
diff --git a/install.sh b/install.sh
index 8fd48b9..70ee7a6 100755
--- a/install.sh
+++ b/install.sh
@@ -35,7 +35,7 @@ mkdir -p /var/lib/uwsgi/run
chown -R www-data:www-data /var/lib/uwsgi/run
chown -R www-data:www-data /var/log/django/
-sed -s "s|#PASSWORD#|$PASSWORD|g;\
+sed -s "s|#URL#|$URL|g;s|#PASSWORD#|$PASSWORD|g;\
s|RESPONSIBLE_EMAIL = None|RESPONSIBLE_EMAIL = '$RESPONSIBLE_EMAIL'|;" \
commonnet/local_settings.py.sample > conf/local_settings.py
rm -f commonnet/local_settings.py
@@ -51,16 +51,16 @@ sed -s "s|#URL#|$URL|g;" conf/nginx.conf.template > \
rm -f /etc/nginx/sites-enabled/commonnet.conf
ln -s "$PWD"/conf/nginx.conf /etc/nginx/sites-enabled/commonnet.conf
-echo " * Checking database $DB_NAME"
+echo " * Creating database $DB_NAME"
if ! su postgres -c "psql -l" | grep -qs "$DB_NAME"; then
- echo " - not present, creating"
su postgres -c "createuser --echo --adduser --createdb --encrypted $DB_NAME"
echo "ALTER USER \""$DB_NAME"\" with password '"$PASSWORD"';" > /tmp/inst.sql
su postgres -c "psql -f /tmp/inst.sql"
rm /tmp/inst.sql
su postgres -c "createdb --echo --owner $DB_NAME --encoding UNICODE $DB_NAME"
else
- echo " - already present"
+ echo " * commonnet database already present"
+ exit 1
fi
make update