diff --git a/dicos/50_lemur.xml b/dicos/50_lemur.xml index 9ee43c1d..86b41e61 100644 --- a/dicos/50_lemur.xml +++ b/dicos/50_lemur.xml @@ -4,7 +4,7 @@ - + diff --git a/funcs/lemur.py b/funcs/lemur.py index 836cf42a..8cd6505e 100644 --- a/funcs/lemur.py +++ b/funcs/lemur.py @@ -1,5 +1,6 @@ from secrets import token_bytes as _token_bytes from base64 import urlsafe_b64encode as _urlsafe_b64encode + def gen_random_base64(): - return base64.urlsafe_b64encode(secrets.token_bytes(32)).decode() + return _urlsafe_b64encode(_token_bytes(32)).decode() diff --git a/tmpl/lemur.yml b/tmpl/lemur.yml index 0218cf08..fa09b2e3 100644 --- a/tmpl/lemur.yml +++ b/tmpl/lemur.yml @@ -1,5 +1,4 @@ -%from os import listdir -%set %%dbname = %lemur_db_name +%set %%dbname = %%lemur_db_name --- dbuser: %%lemur_db_user dbuser_options: diff --git a/tmpl/nginx-lemur b/tmpl/nginx-lemur deleted file mode 100644 index c623766a..00000000 --- a/tmpl/nginx-lemur +++ /dev/null @@ -1,20 +0,0 @@ -server { - listen 80 default_server; - listen [::]:80 default_server; - - location /lemur/api { - proxy_pass http://127.0.0.1:8002/api; - proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; - proxy_redirect off; - proxy_buffering off; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - } - - location /lemur { - root /usr/share/lemur/static; - include mime.types; - index index.html; - } -} diff --git a/tmpl/nginx-lemur.conf b/tmpl/nginx-lemur.conf new file mode 100644 index 00000000..d1eb2b18 --- /dev/null +++ b/tmpl/nginx-lemur.conf @@ -0,0 +1,15 @@ +location /lemur/api { + proxy_pass http://127.0.0.1:8002/api; + proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; + proxy_redirect off; + proxy_buffering off; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +} + +location /lemur/ { + alias /usr/share/lemur/static/; + include mime.types; + index index.html; +}