summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Bastillefile20
-rw-r--r--usr/local/etc/nginx/nginx.conf89
-rw-r--r--usr/local/etc/rc.d/dichroism11
3 files changed, 73 insertions, 47 deletions
diff --git a/Bastillefile b/Bastillefile
index dfa7061..168855a 100644
--- a/Bastillefile
+++ b/Bastillefile
@@ -1,7 +1,8 @@
+# TODO: user!
# Dirs and mounts
CMD mkdir -p /tmp/build
-CMD mkdir -p /var/db/gl
-FSTAB /zroot/gl /var/db/gl nullfs rw 0 0
+CMD mkdir -p /var/db/theglassyladies
+FSTAB /zroot/theglassyladies /var/db/theglassyladies nullfs rw 0 0
# Prereqs
PKG nginx yarn sqlite3 rust
@@ -14,18 +15,21 @@ CMD tar -xzvf /tmp/build/master.tar.gz -C /tmp/build
CMD CARGO_HOME=/tmp/build SQLITE3_LIB_DIR=/usr/local/lib SQLITE3_INCLUDE_DIR=/usr/local/include cargo install --root /usr/local --path /tmp/build/theglassyladies/dichroism
# Build frontend
+CMD cp /var/db/theglassyladies/env.production /tmp/build/theglassyladies/iridescence/.env.production
CMD cd /tmp/build/theglassyladies/iridescence ; yarn ; yarn build
CMD mv /tmp/build/theglassyladies/iridescence/dist /var/www
# Config
OVERLAY usr
+CMD chmod +x /usr/local/etc/rc.d/dichroism
+
+# Cleanup
+#CMD rm -rf /tmp/build
+#CMD pkg remove -y yarn rust
+#CMD pkg autoremove -y
# Launch
-CMD cd /var/db/gl ; dichroism
SYSRC nginx_enable=YES
SERVICE nginx start
-
-# Cleanup
-CMD rm -rf /tmp/build
-CMD pkg remove -y yarn rust
-CMD pkg autoremove -y
+SYSRC dichroism_enable=YES
+SERVICE dichroism start
diff --git a/usr/local/etc/nginx/nginx.conf b/usr/local/etc/nginx/nginx.conf
index 555f7e0..d049eec 100644
--- a/usr/local/etc/nginx/nginx.conf
+++ b/usr/local/etc/nginx/nginx.conf
@@ -1,47 +1,58 @@
-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;
+worker_processes auto;
- 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;
- }
+events {
+ worker_connections 1024;
+}
- location /images/ {
- root /var/db/gl/images;
- autoindex on;
- }
+http {
+ include mime.types;
+ default_type application_octet-stream;
- location /api/ {
- proxy_pass http://localhost:9876/;
+ 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_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]\.";
- limit_except GET OPTIONS {
+ 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;
+ auth_basic_user_file /var/db/theglassyladies/htpasswd;
+ }
+
+ location /images/ {
+ root /var/db/theglassyladies;
+ autoindex on;
+ }
+
+ location /api/ {
+ proxy_pass http://localhost:9876/;
+
+ limit_except GET OPTIONS {
+ auth_basic "Glassy Ladies only!";
+ auth_basic_user_file /var/db/theglassyladies/htpasswd;
+ }
}
+
}
-
+
}
-
diff --git a/usr/local/etc/rc.d/dichroism b/usr/local/etc/rc.d/dichroism
new file mode 100644
index 0000000..fba6f7c
--- /dev/null
+++ b/usr/local/etc/rc.d/dichroism
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+. /etc/rc.subr
+
+name="dichroism"
+rcvar="${name}_enable"
+command="/usr/local/bin/${name}"
+start_cmd="cd /var/db/theglassyladies; ${command}"
+load_rc_config $name
+run_rc_command "$1"
+