Commit db8c55c9 authored by rexxnor's avatar rexxnor

removed database from repo, improved ansible scripts

parent fe450b15
......@@ -112,3 +112,4 @@ secret.txt
*.retry
prepaidmatewebsite/prepaidmatewebsite/settings.py
hosts
db.sqlite3
---
- name: Cleanup PrepaidMate system and reset database
hosts: prepaidmate
become: True
tasks:
- name: Django - flush the database
django_manage:
virtualenv: /var/www/prepaidmatevenv/
command: flush
app_path: /var/www/html/ppm/prepaidmatewebsite/
- name: Delete the database
file:
dest: /var/www/html/ppm/prepaidmatewebsite/db.sqlite3
status: absent
- name: Restarting apache and enabling it
systemd:
name: apache2
state: restarted
enabled: yes
......@@ -33,6 +33,11 @@
file:
dest: /etc/apache2/sites-enabled/default-ssl.conf
state: absent
- name: Restarting apache and enabling it
systemd:
name: apache2
state: restarted
enabled: yes
- name: Activate apache2 site for Prepaidmate
file:
src: /etc/apache2/sites-available/prepaidmate.conf
......@@ -44,11 +49,6 @@
owner: www-data
group: www-data
recurse: yes
- name: Restarting apache and enabling it
systemd:
name: apache2
state: restarted
enabled: yes
- name: Generating run secret with script
shell: bash gen_safe_secret.sh
args:
......@@ -61,3 +61,13 @@
owner: www-data
group: www-data
mode: 0755
- name: Django - Collect static files for admin interface
django_manage:
virtualenv: /var/www/prepaidmatevenv/
command: collectstatic
app_path: /var/www/html/ppm/prepaidmatewebsite/
- name: Restarting apache and enabling it
systemd:
name: apache2
state: reloaded
enabled: yes
......@@ -135,9 +135,9 @@ STATIC_ROOT = os.path.join(BASE_DIR, 'prepaid/static/')
# Security Stuff
SECURE_CONTENT_TYPE_NOSNIFF = True
SECURE_BROWSER_XSS_FILTER = True
CSRF_COOKIE_SECURE = True
X_FRAME_OPTIONS = "DENY"
# Needs to have TLS enabled for this!!
# CSRF_COOKIE_SECURE = True
# SESSION_COOKIE_SECURE = True
# Secret key generated by gen_safe_secret.sh
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment