Skip to content
Snippets Groups Projects
Commit 34887ef3 authored by Martin Mareš's avatar Martin Mareš
Browse files

Instalace: README

parent ac444255
Branches
No related tags found
No related merge requests found
......@@ -6,6 +6,57 @@
. venv/bin/activate
pip install wheel
pip install -c constraints.txt -e .
# vytvořit mo/web/config.py podle etc/config.py.example
mkdir -p data/imports
## Instalace na produkční server
# Založit účet mo-web (jako root)
adduser --system mo-web --shell /bin/bash
loginctl enable-linger mo-web
# Založit databázi (jako správce PostgreSQL)
psql -e 'CREATE ROLE mo_osmo'
psql -e 'CREATE ROLE "mo-web" LOGIN'
psql -e 'GRANT mo_osmo TO "mo-web"' # a případně dalším uživatelům
psql -e 'CREATE DATABASE mo_osmo_test WITH OWNER=mo_osmo'
# Inicializovat databázi (už jako mo-web)
psql mo_osmo_test <db/db.ddl
# Založit adresář pro instanci
mkdir /akce/mo/osmo-test
setfacl -m u:mo-web:rwx -m g:mo:rwx /akce/mo/osmo-test
setfacl -d -m u:mo-web:rwx -m g:mo:rwx /akce/mo/osmo-test
# Zbytek jako uživatel mo-web v /akce/mo/osmo-test
git clone <repozitář> src
# Vytvořit etc/config.py podle src/etc/config.py.example
# Vytvořit etc/uwsgi.ini podle src/etc/uwsgi.ini.example
cd src
bin/deploy
# Inicializovat regiony v DB
. ../venv/bin/activate
bin/init-regions
# Případně ručně otestovat, že uwsgi funguje
# uwsgi --ini etc/osmo.ini
# Založit ~/.config/systemd/user/osmo_test.service podle etc/osmo.service.example
systemctl --user daemon-reload
systemctl --user enable osmo_test.service
systemctl --user start osmo_test.service
systemctl --user status osmo_test.service
# Nastavit nginx:
location /osmo-test {
include uwsgi_params;
uwsgi_pass unix:/akce/mo/osmo-test/var/osmo.sock;
}
# Na instalaci nové verze pak stačí spustit bin/deploy
## Mražení závislostí
......
- nastavit cestu k cookies
- budeme znát roky narození?
- uklidit v logování (jak do DB, tak do app.logger)
- na import by bylo hezké mít testy
......@@ -15,6 +14,7 @@
Nasazení:
- kontakt na správce
- mailing list
- zkontrolovat rotování logů (i u /akce/mathletics/ a jiných instancí uwsgi)
### Dořešit v importu škol ###
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment