diff --git a/acp/src/acp.game.list.jsx b/acp/src/acp.game.list.jsx index 744a6007..e180aeca 100644 --- a/acp/src/acp.game.list.jsx +++ b/acp/src/acp.game.list.jsx @@ -3,6 +3,8 @@ const { Component } = require('preact'); const { connect } = require('preact-redux'); const linkState = require('linkstate').default; +const axios = require('axios'); + const actions = require('./actions'); const addState = connect( diff --git a/bin/client.sh b/bin/client.sh index 922b77d3..a2407748 100755 --- a/bin/client.sh +++ b/bin/client.sh @@ -18,4 +18,3 @@ cd $MNML_PATH/acp rm -rf dist npm i npm run build -mv dist/* $MNML_PATH/client/dist/ diff --git a/bin/deploy.sh b/bin/deploy.sh index fd95857d..94a2bd26 100755 --- a/bin/deploy.sh +++ b/bin/deploy.sh @@ -6,8 +6,12 @@ MNML_PATH=$(realpath "$DIR/../") VERSION=$(<"$MNML_PATH/VERSION") SERVER_BIN_DIR="/usr/local/mnml/bin" + CLIENT_DIST_DIR="/var/lib/mnml/client" -CLIENT_PUBLIC_DIR="/var/lib/mnml/public/current" +CLIENT_PUBLIC_DIR="/var/lib/mnml/public/client" + +ACP_DIST_DIR="/var/lib/mnml/acp" +ACP_PUBLIC_DIR="/var/lib/mnml/public/acp" # server updates echo "syncing server $VERSION " @@ -16,9 +20,14 @@ ssh -q mnml ln -nfs "$SERVER_BIN_DIR/$VERSION" "$SERVER_BIN_DIR/mnml" ssh -q mnml ls -lah "$SERVER_BIN_DIR" # client updates -echo "syncing client and acp $VERSION" +echo "syncing client $VERSION" rsync -a --delete --delete-excluded "$MNML_PATH/client/dist/" mnml:"$CLIENT_DIST_DIR/$VERSION/" ssh -q mnml ln -nfs "$CLIENT_DIST_DIR/$VERSION" "$CLIENT_PUBLIC_DIR" + +# acp updates +echo "syncing acp $VERSION" +rsync -a --delete --delete-excluded "$MNML_PATH/acp/dist/" mnml:"$ACP_DIST_DIR/$VERSION/" +ssh -q mnml ln -nfs "$ACP_DIST_DIR/$VERSION" "$ACP_PUBLIC_DIR" ssh -q mnml ls -lah "/var/lib/mnml/public" echo "restarting mnml service" diff --git a/etc/nginx/sites-available/mnml.gg.STAGING.SAMPLE.nginx.conf b/etc/nginx/sites-available/mnml.gg.STAGING.SAMPLE.nginx.conf index 7b5ecbfd..446c2878 100644 --- a/etc/nginx/sites-available/mnml.gg.STAGING.SAMPLE.nginx.conf +++ b/etc/nginx/sites-available/mnml.gg.STAGING.SAMPLE.nginx.conf @@ -1,4 +1,4 @@ -error_log /var/log/mnml/nginx.log debug; +error_log /var/log/mnml/nginx.log; upstream mnml_http { server 127.0.0.1:40000; @@ -8,6 +8,7 @@ upstream mnml_ws { server 127.0.0.1:40055; } + map $http_upgrade $connection_upgrade { default upgrade; '' close; @@ -15,14 +16,18 @@ map $http_upgrade $connection_upgrade { # DEV server { - server_name mnml.gg; - location / { - root /var/lib/mnml/public/client/; + root /var/lib/mnml/public/client; index index.html; try_files $uri $uri/ index.html; } + location /acp { + root /var/lib/mnml/public/acp; + index acp.html; + try_files $uri $uri/ acp.html; + } + location /imgs/ { root /var/lib/mnml/public/; try_files $uri $uri/ =404;