From 7a903d26e61c3e20ca4b0a67ac856dac2a285f1e Mon Sep 17 00:00:00 2001 From: "Adam T. Carpenter" Date: Fri, 29 Jan 2021 17:05:13 -0500 Subject: added config for glassy ladies, updated Bastillefile --- Bastillefile | 25 +++++++++++++++++++++++++ Dichroism.toml | 4 ++++ nginx.conf | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+) create mode 100644 Dichroism.toml create mode 100644 nginx.conf diff --git a/Bastillefile b/Bastillefile index e69de29..dc70c99 100644 --- a/Bastillefile +++ b/Bastillefile @@ -0,0 +1,25 @@ +# Dirs and mounts +CMD mkdir -p /var/db/gl && echo Created /var/db/gl +FSTAB /zroot/gl /var/db/gl nullfs rw 0 0 + +# Prereqs +PKG nginx yarn rust + +# Download sources +CMD curl -kf http://192.168.1.50:3000/53hornet/theglassyladies/archive/master.tar.gz -o /tmp/master.tar.gz +CMD tar -xzvf /tmp/master.tar.gz -C /tmp + +# Build backend +CMD cd /tmp/dichroism +CMD CARGO_HOME=/tmp cargo install --path . + +# Build frontend +CMD cd /tmp/iridescence +CMD yarn build +CMD mv dist /var/www + +# Config +OVERLAY usr +SYSRC nginx_enable=YES +SERVICE nginx start + diff --git a/Dichroism.toml b/Dichroism.toml new file mode 100644 index 0000000..9b4c5d5 --- /dev/null +++ b/Dichroism.toml @@ -0,0 +1,4 @@ +db_url = "/var/db/gl/gl.db" +bind_addr = "127.0.0.1:9876" +img_root = "/var/db/gl/images" + diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..555f7e0 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,47 @@ +server { + server_name theglassyladies.com; + listen 80; + rewrite ^/admin$ https://theglassyladies.com redirect; + rewrite ^/care$ https://theglassyladies.com redirect; + rewrite ^/faq$ https://theglassyladies.com redirect; + rewrite ^/privacy$ https://theglassyladies.com redirect; + rewrite ^/cart$ https://theglassyladies.com redirect; + rewrite ^/checkout$ https://theglassyladies.com redirect; + client_max_body_size 10M; + gzip on; + gzip_vary on; + #gzip_min_length 10240; + gzip_proxied expired no-cache no-store private auth; + gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml; + gzip_disable "MSIE [1-6]\."; + sendfile on; + sendfile_max_chunk 1m; + keepalive_timeout 65; + + location / { + root /var/www; + index index.html; + try_files $uri $uri/ /index.html; + } + + location /login { + auth_basic "Glassy Ladies only!"; + auth_basic_user_file /var/db/gl/.htpasswd; + } + + location /images/ { + root /var/db/gl/images; + autoindex on; + } + + location /api/ { + proxy_pass http://localhost:9876/; + + limit_except GET OPTIONS { + auth_basic "Glassy Ladies only!"; + auth_basic_user_file /var/db/gl/.htpasswd; + } + } + +} + -- cgit v1.2.3