Makefile for BiscuIT
The snippet can be accessed without any authentication.
Authored by
Jakob Kirsch
Edited
Makefile 1.42 KiB
ED = nano
CONF = /etc/biscuit/00_default.toml
LDAP = /ect/biscuit/default.ldap
run: install_venv install_postgresql
poetry run ./manage.py runserver
install_venv:
sudo apt install python3-pip python3-venv yarn-pkg
sudo pip3 install poetry
PWD = $(pwd)
cd ..
python3 -m venv venv
source venv/bin/activate
cd $PWD
poetry install
poetry run ./manage.py yarn install
poetry run ./manage.py collectstatic
poetry run ./manage.py migrate
install_postgresql:
sudo apt install postgresql
sudo -u postgres createuser -D -P -R -S biscuit
sudo -u postgres createdb -E UTF-8 -O biscuit -T template0 -l C.UTF-8 biscuit
echo '[default]' > $CONF
echo 'secret_key = "VerySecretKeyForSessionSecurity"' >> $CONF
echo '[default.caching]' >> $CONF
echo 'memcached = { enabled = true, address = "127.0.0.1" }' >> $CONF
echo '[default.http]' >> $CONF
echo 'allowed_hosts = [localhost]' >> $CONF
echo '[default.database]' >> $CONF
echo 'host = "localhost"' >> $CONF
echo 'name = "biscuit"' >> $CONF
echo 'username = "biscuit"' >> $CONF
echo 'password = "biscuit"' >> $CONF
$ED $CONF
install_ldap:
echo '[default.ldap]' >> $LDAP
echo 'uri = "ldaps://localhost"' >> $LDAP
echo 'bind = { dn = "cn=reader,dc=myschool,dc=edu", password = "secret" }' >> $LDAP
echo 'users = { base = "ou=people,dc=myschool,dc=edu", filter = "(uid=%(user)s)" }' >> $LDAP
echo 'map = { first_name = "givenName", last_name = "sn", email = "mail" }' >> $LDAP
$ED $LDAP
Please register or sign in to comment