From 54afca3221a60235e9556a9fb918759846b96f71 Mon Sep 17 00:00:00 2001 From: Charlie Root Date: Sat, 30 Jan 2021 18:56:38 -0500 Subject: fixed dichroism build, moved nginx to appropriate dir --- Bastillefile | 23 ++++++++++++++------- nginx.conf | 47 ------------------------------------------ usr/local/etc/nginx/nginx.conf | 47 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 55 deletions(-) delete mode 100644 nginx.conf create mode 100644 usr/local/etc/nginx/nginx.conf diff --git a/Bastillefile b/Bastillefile index cfec439..734dcd9 100644 --- a/Bastillefile +++ b/Bastillefile @@ -1,25 +1,32 @@ # Dirs and mounts +PRE mkdir -p /tmp/build +#CMD mkdir -p /tmp/build CMD mkdir -p /var/db/gl FSTAB /zroot/gl /var/db/gl nullfs rw 0 0 # Prereqs -PKG nginx yarn sqlite3 +PKG nginx yarn sqlite3 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 +CMD curl -kf http://192.168.1.50:3000/53hornet/theglassyladies/archive/master.tar.gz -o /tmp/build/master.tar.gz +CMD tar -xzvf /tmp/build/master.tar.gz -C /tmp/build # Build backend -#CMD CARGO_HOME=/tmp cargo install --root /usr/local diesel_cli --no-default-features --features sqlite -CMD curl https://sh.rustup.rs -sSf | sh -s -- -y -CMD CARGO_HOME=/tmp ~/.cargo/bin/cargo install --root /usr/local --path /tmp/theglassyladies/dichroism +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 cd /tmp/theglassyladies/iridescence ; yarn ; yarn build -CMD mv /tmp/theglassyladies/iridescence/dist /var/www +CMD cd /tmp/build/theglassyladies/iridescence ; yarn ; yarn build +CMD mv /tmp/build/theglassyladies/iridescence/dist /var/www # Config OVERLAY usr + +# 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 diff --git a/nginx.conf b/nginx.conf deleted file mode 100644 index 555f7e0..0000000 --- a/nginx.conf +++ /dev/null @@ -1,47 +0,0 @@ -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; - } - } - -} - diff --git a/usr/local/etc/nginx/nginx.conf b/usr/local/etc/nginx/nginx.conf new file mode 100644 index 0000000..555f7e0 --- /dev/null +++ b/usr/local/etc/nginx/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 From 27138be0504ddfa1cf7ad3bf11c920a922452eae Mon Sep 17 00:00:00 2001 From: "Adam T. Carpenter" Date: Sat, 30 Jan 2021 18:58:04 -0500 Subject: PRE -> CMD --- Bastillefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Bastillefile b/Bastillefile index 734dcd9..fc385b9 100644 --- a/Bastillefile +++ b/Bastillefile @@ -1,6 +1,5 @@ # Dirs and mounts -PRE mkdir -p /tmp/build -#CMD mkdir -p /tmp/build +CMD mkdir -p /tmp/build CMD mkdir -p /var/db/gl FSTAB /zroot/gl /var/db/gl nullfs rw 0 0 -- cgit v1.2.3