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.
## TODO
* replace nunjucks with something that is maintained
* autoprefixer
* bootstrap 4.x
@@ -8,21 +11,23 @@ Kassa helps you register purchased membership cards and memberships. It's a tool
* Galtinn/LDAP auth
## Installation
```shell script
apt install libldap2-dev libsasl2-dev # pyldap deps
python3 -m venv venv
. venv/bin/activate
pip install -U pip wheel
pip install -r requirements.txt
python manage.py migrate
uv run manage.py migrate
uv run manage.py runserver
```
### Development tasks
```shell script
npm run build:templates # regenerate nunjucks templates
```
## Configuration
Create a user in Galtinn with the following permissions:
* galtinn | User | Can view User
* galtinn | Member card | Can change 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
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:
```python
TEKSTMELDING_ENABLED = False
```
## 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
ldapadd -D "cn=admin,dc=neuf,dc=no" -w "toor" -f test/testdata.ldif # Testdata
# 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"):
c.run("git pull") # Get source
c.run("pip install -U pip")
c.run("pip install -r requirements.txt") # install deps in virtualenv
c.run("uv sync") # install deps in virtualenv
with c.cd("static"): # install and compile frontend deps
c.run("npm i")
c.run("npm run build")
c.run("python manage.py collectstatic --noinput -i node_modules") # Collect static
c.run("python manage.py migrate") # Run DB migrations
c.run("uv run manage.py collectstatic --noinput -i node_modules") # Collect static
c.run("uv run manage.py migrate") # Run DB migrations
# Reload gunicorn
c.sudo("/usr/bin/supervisorctl pid kassa.neuf.no | xargs kill -HUP", shell=False)