testing: strongTNC does not come with django.db any more
authorAndreas Steffen <andreas.steffen@strongswan.org>
Sat, 17 Dec 2016 17:09:20 +0000 (18:09 +0100)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Sat, 17 Dec 2016 17:09:20 +0000 (18:09 +0100)
testing/hosts/default/usr/local/bin/init_tnc [new file with mode: 0755]
testing/scripts/recipes/015_strongTNC.mk
testing/tests/tnc/tnccs-20-pdp-eap/pretest.dat
testing/tests/tnc/tnccs-20-pdp-pt-tls/pretest.dat

diff --git a/testing/hosts/default/usr/local/bin/init_tnc b/testing/hosts/default/usr/local/bin/init_tnc
new file mode 100755 (executable)
index 0000000..49084e4
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+cd /var/www/tnc
+
+if [ -f django.db ]
+then
+       exit 0 
+fi
+
+./manage.py migrate --database meta
+./manage.py setpassword strongSwan strongSwan
+./manage.py collectstatic --noinput
+
+chmod g+w django.db
+exit 0
index cc4a94a..419d60b 100644 (file)
@@ -19,4 +19,4 @@ $(DEPS): $(PKG)-master
 
 install: $(DEPS)
        pip install --no-index --find-links=file://`pwd`/$(DEPS) -r $(PKG)-master/requirements.txt
-       cp -r $(PKG)-master /var/www/tnc && chgrp -R www-data /var/www/tnc && chmod g+w /var/www/tnc /var/www/tnc/django.db
+       cp -r $(PKG)-master /var/www/tnc && chgrp -R www-data /var/www/tnc && chmod g+sw /var/www/tnc
index 36c7cc6..385cc30 100644 (file)
@@ -16,7 +16,7 @@ alice::sed -i "s/NOW/`date +%s`/g" /etc/pts/data1.sql
 alice::sed -i "s:DEBIAN_VERSION:\`cat /etc/debian_version\`:" /etc/pts/data1.sql
 alice::cd /usr/local/share/strongswan/templates/database/imv; cat tables.sql data.sql /etc/pts/data1.sql | sqlite3 /etc/db.d/config.db
 alice::chgrp -R www-data /etc/db.d/config.db; chmod -R g+w /etc/db.d/config.db
-alice::/var/www/tnc/manage.py setpassword strongSwan strongSwan
+alice::/usr/local/bin/init_tnc
 alice::service apache2 start
 alice::service charon start
 moon::service charon start
index 860a6c3..17951e8 100644 (file)
@@ -10,7 +10,7 @@ alice::sed -i "s/NOW/`date +%s`/g" /etc/pts/data1.sql
 alice::sed -i "s:DEBIAN_VERSION:\`cat /etc/debian_version\`:" /etc/pts/data1.sql
 alice::cd /usr/local/share/strongswan/templates/database/imv; cat tables.sql data.sql /etc/pts/data1.sql | sqlite3 /etc/db.d/config.db
 alice::chgrp -R www-data /etc/db.d/config.db; chmod -R g+w /etc/db.d/config.db
-alice::/var/www/tnc/manage.py setpassword strongSwan strongSwan
+alice::/usr/local/bin/init_tnc
 alice::rm /etc/swanctl/x509/aliceCert.pem
 alice::rm /etc/swanctl/rsa/aliceKey.pem
 alice::service charon start