From 9a6346430089d9db1090a74c5caeb1b2460cb682 Mon Sep 17 00:00:00 2001 From: stupidcomputer Date: Sat, 29 Jun 2024 15:48:06 -0500 Subject: [PATCH] add a knowledgebase feature --- Makefile | 17 +++++++++--- .../explorer/templates/explorer/base.html | 1 + gen_kb.sh | 10 +++++++ kb/index.md | 7 +++++ kb/writing-resolution.md | 5 ++++ links-to-html.lua | 4 +++ nginx/nginx.conf | 4 +++ shell.nix | 2 +- template.html | 27 +++++++++++++++++++ 9 files changed, 72 insertions(+), 5 deletions(-) create mode 100755 gen_kb.sh create mode 100644 kb/index.md create mode 100644 kb/writing-resolution.md create mode 100644 links-to-html.lua create mode 100644 template.html diff --git a/Makefile b/Makefile index b86a4b5..074b640 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,19 @@ prod: # execute this target on the production server in the nix-shell - rm -fr franklincce/staticfiles cd franklincce; python3 manage.py collectstatic - sed "s/change_me/$(shell shuf -i1-1000000 -n1)/g" .env.prod.orig > .env.prod + sh gen_kb.sh sed "s|change_me|$(shell dd if=/dev/urandom bs=1024 count=1|base64)|g" .env.prod.orig > .env.prod docker-compose -f docker-compose.prod.yml up -d --build -permissions: +permissions: db.sqlite3 chmod -f 660 db.sqlite3 - echo "make sure that db.sqlite3 is owned by group users" \ No newline at end of file + echo "make sure that db.sqlite3 is owned by group users" + +db.sqlite3: + touch db.sqlite3 + +make_kb: + sh gen_kb.sh + +clean: + rm -fr franklincce/staticfiles + docker-compose -f docker-compose.prod.yml down -v diff --git a/franklincce/explorer/templates/explorer/base.html b/franklincce/explorer/templates/explorer/base.html index 05dc393..0d00b24 100644 --- a/franklincce/explorer/templates/explorer/base.html +++ b/franklincce/explorer/templates/explorer/base.html @@ -14,6 +14,7 @@