Compare commits

..

No commits in common. "4761d466968fb85ae38a5f0f109555a3fab5a845" and "71f6daf0e8ddc4c2bc6c9295aa0b1b86ab4e16f2" have entirely different histories.

11 changed files with 4 additions and 163 deletions

View File

@ -1,4 +1,4 @@
DJANGO_APP_STAGE=prod DJANGO_APP_STAGE=dev
# Only used in dev mode, change to "postgresql" if you want to use PostgreSQL in dev # Only used in dev mode, change to "postgresql" if you want to use PostgreSQL in dev
DJANGO_DEV_STORE_METHOD=sqllite DJANGO_DEV_STORE_METHOD=sqllite
DJANGO_DB_HOST=localhost DJANGO_DB_HOST=localhost
@ -13,6 +13,6 @@ NOTE_URL=localhost
# Config for mails. Only used in production # Config for mails. Only used in production
NOTE_MAIL=notekfet@localhost NOTE_MAIL=notekfet@localhost
EMAIL_HOST=smtp.localhost EMAIL_HOST=smtp.localhost
EMAIL_PORT=465 EMAIL_PORT=443
EMAIL_USER=notekfet@localhost EMAIL_USER=notekfet@localhost
EMAIL_PASSWORD=CHANGE_ME EMAIL_PASSWORD=CHANGE_ME

2
.gitmodules vendored
View File

@ -1,3 +1,3 @@
[submodule "apps/scripts"] [submodule "apps/scripts"]
path = apps/scripts path = apps/scripts
url = https://gitlab.crans.org/bde/nk20-scripts.git url = git@gitlab.crans.org:bde/nk20-scripts.git

View File

@ -121,7 +121,7 @@ On supposera pour la suite que vous utilisez Debian/Ubuntu sur un serveur tout n
# Le reste n'est utile qu'en production, pour configurer l'envoi des mails # Le reste n'est utile qu'en production, pour configurer l'envoi des mails
NOTE_MAIL=notekfet@localhost NOTE_MAIL=notekfet@localhost
EMAIL_HOST=smtp.localhost EMAIL_HOST=smtp.localhost
EMAIL_PORT=465 EMAIL_PORT=443
EMAIL_USER=notekfet@localhost EMAIL_USER=notekfet@localhost
EMAIL_PASSWORD=CHANGE_ME EMAIL_PASSWORD=CHANGE_ME

View File

@ -1,14 +0,0 @@
[defaults]
inventory = ./hosts
timeout = 42
[privilege_escalation]
become = True
become_ask_pass = True
[ssh_connection]
pipelining = True
retries = 3
[diff]
always = yes

View File

@ -1,10 +0,0 @@
#!/usr/bin/env ansible-playbook
---
- hosts: bde-nk20-beta.adh.crans.org
roles:
- 1-apt-basic
- 2-nk20
- 3-pip
- 4-nginx
- 5-psql

View File

@ -1,5 +0,0 @@
[server]
bde-nk20-beta.adh.crans.org
[all:vars]
ansible_python_interpreter=/usr/bin/python3

View File

@ -1,20 +0,0 @@
---
- name: Install basic APT packages
apt:
update_cache: true
name:
- nginx
- python3
- python3-pip
- python3-dev
- uwsgi
- uwsgi-plugin-python3
- python3-venv
- git
- acl
- texlive-latex-extra
- texlive-fonts-extra
- texlive-lang-french
register: pkg_result
retries: 3
until: pkg_result is succeeded

View File

@ -1,26 +0,0 @@
---
- name: Create note_kfet dir with good permissions
file:
path: /var/www/note_kfet
state: directory
owner: www-data
group: www-data
mode: u=rwx,g=rwxs,o=rx
- name: Clone Note Kfet
git:
repo: https://gitlab.crans.org/bde/nk20.git
dest: /var/www/note_kfet
version: beta-soon
force: true
- name: Use default env vars (should be updated!)
command: cp /var/www/note_kfet/.env_example /var/www/note_kfet/.env
- name: Update permissions for note_kfet dir
file:
path: /var/www/note_kfet
state: directory
recurse: yes
owner: www-data
group: www-data

View File

@ -1,14 +0,0 @@
---
- name: Install PIP basic dependencies
pip:
requirements: /var/www/note_kfet/requirements/base.txt
virtualenv: /var/www/note_kfet/env
virtualenv_command: /usr/bin/python3 -m venv
become_user: www-data
- name: Install PIP production dependencies
pip:
requirements: /var/www/note_kfet/requirements/production.txt
virtualenv: /var/www/note_kfet/env
virtualenv_command: /usr/bin/python3 -m venv
become_user: www-data

View File

@ -1,31 +0,0 @@
---
- name: Copy example conf of Nginx
command: cp /var/www/note_kfet/nginx_note.conf_example /var/www/note_kfet/nginx_note.conf
- name: Update Nginx conf
replace:
path: /var/www/note_kfet/nginx_note.conf
regexp: 'note.example.org'
replace: 'bde-nk20-beta.adh.crans.org'
- name: Copy conf to Nginx
file:
src: /var/www/note_kfet/nginx_note.conf
dest: /etc/nginx/sites-enabled/nginx_note.conf
state: link
- name: Copy conf to UWSGI
file:
src: /var/www/note_kfet/uwsgi_note.ini
dest: /etc/uwsgi/apps-enabled/uwsgi_note.ini
state: link
- name: Reload Nginx
systemd:
name: nginx
state: reloaded
- name: Restart UWSGI
systemd:
name: uwsgi
state: restarted

View File

@ -1,39 +0,0 @@
---
- name: Install PostgreSQL APT packages
apt:
update_cache: true
name:
- postgresql
- postgresql-contrib
- libpq-dev
register: pkg_result
retries: 3
until: pkg_result is succeeded
- name: Install Psycopg2
pip:
name: psycopg2-binary
- name: Create role note
postgresql_user:
name: note
password: "CHANGE_ME"
become_user: postgres
- name: Create NK20 database
postgresql_db:
name: note_db
owner: note
become_user: postgres
- name: Make Django migrations
command: /var/www/note_kfet/env/bin/python manage.py makemigrations
args:
chdir: /var/www/note_kfet
become_user: www-data
- name: Migrate Django database
command: /var/www/note_kfet/env/bin/python manage.py migrate
args:
chdir: /var/www/note_kfet
become_user: www-data