diff --git a/rootfs/standard/etc/nginx/sites-enabled/https_caravan.conf b/rootfs/standard/etc/nginx/sites-enabled/https_caravan.conf new file mode 100644 index 00000000..f2d65d42 --- /dev/null +++ b/rootfs/standard/etc/nginx/sites-enabled/https_caravan.conf @@ -0,0 +1,33 @@ +# Serve copy of caravan files via HTTP +server { + listen 3020; + server_name caravan; + + access_log /var/log/nginx/access_caravan_http.log; + error_log /var/log/nginx/error_caravan_http.log; + + location / { + root /opt/mynode/caravan/build; + index index.html index.htm; + } +} + +# HTTPS +server { + listen 3021 ssl; + server_name caravanhttps; + + include /etc/nginx/mynode/mynode_ssl_params.conf; + include /etc/nginx/mynode/mynode_ssl_cert_key.conf; + + access_log /var/log/nginx/access_caravan.log; + error_log /var/log/nginx/error_caravan.log; + + location / { + proxy_pass http://127.0.0.1:3020; + + proxy_read_timeout 300; + + include /etc/nginx/mynode/mynode_ssl_proxy_params.conf; + } +} diff --git a/rootfs/standard/etc/systemd/system/caravan.service b/rootfs/standard/etc/systemd/system/caravan.service index d391b5e8..3f6951c6 100644 --- a/rootfs/standard/etc/systemd/system/caravan.service +++ b/rootfs/standard/etc/systemd/system/caravan.service @@ -9,9 +9,9 @@ After=bitcoin.service [Service] ExecStartPre=/usr/bin/is_not_shutting_down.sh ExecStartPre=/usr/bin/wait_on_bitcoin.sh -Environment="PORT=3020 NODE_ENV=production" WorkingDirectory=/opt/mynode/caravan -ExecStart=/usr/bin/npm start +#ExecStart=/usr/bin/npm start --port 3020 --base=/ --host +ExecStart=/usr/bin/sleep 365d StandardInput=tty-force TTYVHangup=yes diff --git a/rootfs/standard/etc/tor/torrc b/rootfs/standard/etc/tor/torrc index 19e934a9..31a62cfb 100644 --- a/rootfs/standard/etc/tor/torrc +++ b/rootfs/standard/etc/tor/torrc @@ -229,6 +229,7 @@ HiddenServicePort 3003 127.0.0.1:3003 HiddenServicePort 3010 127.0.0.1:3010 HiddenServicePort 3011 127.0.0.1:3011 HiddenServicePort 3020 127.0.0.1:3020 +HiddenServicePort 3021 127.0.0.1:3021 HiddenServicePort 3030 127.0.0.1:3030 HiddenServicePort 3031 127.0.0.1:3031 HiddenServicePort 4080 127.0.0.1:4080 diff --git a/rootfs/standard/usr/bin/mynode_post_upgrade.sh b/rootfs/standard/usr/bin/mynode_post_upgrade.sh index f13c448f..3bce4023 100755 --- a/rootfs/standard/usr/bin/mynode_post_upgrade.sh +++ b/rootfs/standard/usr/bin/mynode_post_upgrade.sh @@ -316,7 +316,7 @@ if ! skip_base_upgrades ; then fi # Update NPM (Node Package Manager) - npm install -g npm@$NODE_NPM_VERSION + #npm install -g npm@$NODE_NPM_VERSION npm install -g yarn @quasar/cli # Install Docker @@ -633,7 +633,7 @@ fi # Install Caravan if should_install_app "caravan" ; then - CARAVAN_UPGRADE_URL=https://github.com/unchained-capital/caravan/archive/$CARAVAN_VERSION.tar.gz + CARAVAN_UPGRADE_URL=https://github.com/unchained-capital/caravan/archive/caravan-$CARAVAN_VERSION.tar.gz CURRENT="" if [ -f $CARAVAN_VERSION_FILE ]; then CURRENT=$(cat $CARAVAN_VERSION_FILE) @@ -650,7 +650,12 @@ if should_install_app "caravan" ; then chown -R bitcoin:bitcoin caravan cd caravan - sudo -u bitcoin npm install --only=production + + # Change path to / from /caravan + sed -i 's|/caravan/#|/#|' vite.config.js + + sudo -u bitcoin npm install + sudo -u bitcoin npm run build echo $CARAVAN_VERSION > $CARAVAN_VERSION_FILE touch $CARAVAN_SETTINGS_UPDATE_FILE fi diff --git a/rootfs/standard/var/www/mynode/templates/caravan.html b/rootfs/standard/var/www/mynode/templates/caravan.html index 7271cf6a..42feb5db 100644 --- a/rootfs/standard/var/www/mynode/templates/caravan.html +++ b/rootfs/standard/var/www/mynode/templates/caravan.html @@ -7,7 +7,7 @@ $(document).ready(function() { $("#caravan").on("click", function() { - url = 'https://'+location.hostname+':3020' + url = 'https://'+location.hostname+':3021' window.open(url,'_blank'); }) @@ -47,10 +47,7 @@