chore: Update README and fabfile

This commit is contained in:
nikolark committed 2025-05-30 11:36:16 +02:00
1 parent 1f02ed5eff
commit eaaf7b38c4
2 files changed
+19 -12

No files matched your search

+16 -8
View File
@@ -1,6 +1,9 @@
# kassa
Kassa helps you register purchased membership cards and memberships. It's a tool for volunteers and bar employees at The Norwegian Student Society. Kassa helps you register purchased membership cards and memberships. It's a tool for volunteers and bar employees at The Norwegian Student Society.
## TODO ## TODO
* replace nunjucks with something that is maintained * replace nunjucks with something that is maintained
* autoprefixer * autoprefixer
* bootstrap 4.x * bootstrap 4.x
@@ -8,21 +11,23 @@ Kassa helps you register purchased membership cards and memberships. It's a tool
* Galtinn/LDAP auth * Galtinn/LDAP auth
## Installation ## Installation
```shell script ```shell script
apt install libldap2-dev libsasl2-dev # pyldap deps apt install libldap2-dev libsasl2-dev # pyldap deps
python3 -m venv venv uv run manage.py migrate
. venv/bin/activate uv run manage.py runserver
pip install -U pip wheel
pip install -r requirements.txt
python manage.py migrate
``` ```
### Development tasks ### Development tasks
```shell script ```shell script
npm run build:templates # regenerate nunjucks templates npm run build:templates # regenerate nunjucks templates
``` ```
## Configuration ## Configuration
Create a user in Galtinn with the following permissions: Create a user in Galtinn with the following permissions:
* galtinn | User | Can view User * galtinn | User | Can view User
* galtinn | Member card | Can change Member card * galtinn | Member card | Can change Member card
* galtinn | Member card | Can view Member card * galtinn | Member card | Can view Member card
@@ -31,17 +36,20 @@ Create a user in Galtinn with the following permissions:
* galtinn | Order | Can view Order * galtinn | Order | Can view Order
Fetch GALTINN_API_KEY: Fetch GALTINN_API_KEY:
```shell script
curl -H "Content-Type: application/json" -X POST -d '{"username":"apiuser","password":"test"}' GALTINN_API_URL/auth/obtain-token/ ```shell
curl -H "Content-Type: application/json" -X POST -d '{"username":"apiuser","password":"test"}' GALTINN_API_URL/auth/obtain-token/
``` ```
If developing you can disable calls to Tekstmelding in local_settings.py: If developing you can disable calls to Tekstmelding in local_settings.py:
```python ```python
TEKSTMELDING_ENABLED = False TEKSTMELDING_ENABLED = False
``` ```
## LDAP ## LDAP
```shell script
```shell
sudo docker run -e LDAP_DOMAIN=neuf.no -e LDAP_ORGANISATION="Neuf" -e LDAP_ADMIN_PASSWORD="toor" -p 389:389 -d nikolaik/openldap sudo docker run -e LDAP_DOMAIN=neuf.no -e LDAP_ORGANISATION="Neuf" -e LDAP_ADMIN_PASSWORD="toor" -p 389:389 -d nikolaik/openldap
ldapadd -D "cn=admin,dc=neuf,dc=no" -w "toor" -f test/testdata.ldif # Testdata ldapadd -D "cn=admin,dc=neuf,dc=no" -w "toor" -f test/testdata.ldif # Testdata
# Verify import # Verify import
Vendored
+3 -4
View File
@@ -14,13 +14,12 @@ def deploy(c):
with c.cd(project_path), c.prefix(f"source {project_path}/venv/bin/activate"): with c.cd(project_path), c.prefix(f"source {project_path}/venv/bin/activate"):
c.run("git pull") # Get source c.run("git pull") # Get source
c.run("pip install -U pip") c.run("uv sync") # install deps in virtualenv
c.run("pip install -r requirements.txt") # install deps in virtualenv
with c.cd("static"): # install and compile frontend deps with c.cd("static"): # install and compile frontend deps
c.run("npm i") c.run("npm i")
c.run("npm run build") c.run("npm run build")
c.run("python manage.py collectstatic --noinput -i node_modules") # Collect static c.run("uv run manage.py collectstatic --noinput -i node_modules") # Collect static
c.run("python manage.py migrate") # Run DB migrations c.run("uv run manage.py migrate") # Run DB migrations
# Reload gunicorn # Reload gunicorn
c.sudo("/usr/bin/supervisorctl pid kassa.neuf.no | xargs kill -HUP", shell=False) c.sudo("/usr/bin/supervisorctl pid kassa.neuf.no | xargs kill -HUP", shell=False)