openvibers/openvibe.live Commits
Serve history.js/navbar.js from /shared; deploy.sh installs unit files through sudo when systemctl does
Changes
@@@ -52,6 +52,8 @@ BASE_DIR="${BASE_DIR:-/opt/openvibe.live}"SERVICE="${SERVICE:-openvibe-live}"SYSTEMD_DIR="${SYSTEMD_DIR:-/etc/systemd/system}"SYSTEMCTL="${SYSTEMCTL:-systemctl}"++# Unit files land in /etc: when systemctl is being run through sudo, so is the install.++SUDO_INSTALL=""; case "$SYSTEMCTL" in sudo*) SUDO_INSTALL="sudo";; esac; [ "$(id -u)" -eq 0 ] && SUDO_INSTALL=""SITE_URL="${SITE_URL:-https://openvibe.live}"API_URL="${API_URL:-http://127.0.0.1:3000}"GIT_REMOTE="${GIT_REMOTE:-origin}"@@@ -158,7 +160,7 @@ install_units() {[ -f "$src" ] || return 0if [ ! -f "$dest" ] || ! cmp -s "$src" "$dest"; thensay "installing $(basename "$dest")"-- run install -m 0644 -D "$src" "$dest"++ run $SUDO_INSTALL install -m 0644 -D "$src" "$dest"changed=truefi}@@@ -435,7 +435,7 @@ app.use((req, res, next) => {// Serve openvibe-shared browser assets at /shared/ — serve directly from the// resolved source directory to avoid write operations (the public/ directory// is read-only under systemd ProtectSystem=strict on production).--const SHARED_BROWSER_FILES = ['theme-loader.js', 'notification-ui.js', 'account-switcher.js', 'openvibe-sw.js', 'footer.js', 'ov-mark.js', 'tooltip.js'];++const SHARED_BROWSER_FILES = ['theme-loader.js', 'notification-ui.js', 'account-switcher.js', 'openvibe-sw.js', 'footer.js', 'ov-mark.js', 'tooltip.js', 'history.js', 'navbar.js'];let sharedServePath = null;(function resolveSharedAssets() {
@@ -52,6 +52,8 @@ BASE_DIR="${BASE_DIR:-/opt/openvibe.live}"
@@ -52,6 +52,8 @@ BASE_DIR="${BASE_DIR:-/opt/openvibe.live}"
SERVICE="${SERVICE:-openvibe-live}"
SERVICE="${SERVICE:-openvibe-live}"
SYSTEMD_DIR="${SYSTEMD_DIR:-/etc/systemd/system}"
SYSTEMD_DIR="${SYSTEMD_DIR:-/etc/systemd/system}"
SYSTEMCTL="${SYSTEMCTL:-systemctl}"
SYSTEMCTL="${SYSTEMCTL:-systemctl}"
+# Unit files land in /etc: when systemctl is being run through sudo, so is the install.
+SUDO_INSTALL=""; case "$SYSTEMCTL" in sudo*) SUDO_INSTALL="sudo";; esac; [ "$(id -u)" -eq 0 ] && SUDO_INSTALL=""
SITE_URL="${SITE_URL:-https://openvibe.live}"
SITE_URL="${SITE_URL:-https://openvibe.live}"
API_URL="${API_URL:-http://127.0.0.1:3000}"
API_URL="${API_URL:-http://127.0.0.1:3000}"
GIT_REMOTE="${GIT_REMOTE:-origin}"
GIT_REMOTE="${GIT_REMOTE:-origin}"
@@ -158,7 +160,7 @@ install_units() {
@@ -158,7 +160,7 @@ install_units() {
[ -f "$src" ] || return 0
[ -f "$src" ] || return 0
if [ ! -f "$dest" ] || ! cmp -s "$src" "$dest"; then
if [ ! -f "$dest" ] || ! cmp -s "$src" "$dest"; then
say "installing $(basename "$dest")"
say "installing $(basename "$dest")"
- run install -m 0644 -D "$src" "$dest"
+ run $SUDO_INSTALL install -m 0644 -D "$src" "$dest"
changed=true
changed=true
fi
fi
}
}
@@ -435,7 +435,7 @@ app.use((req, res, next) => {
@@ -435,7 +435,7 @@ app.use((req, res, next) => {
// Serve openvibe-shared browser assets at /shared/ — serve directly from the
// Serve openvibe-shared browser assets at /shared/ — serve directly from the
// resolved source directory to avoid write operations (the public/ directory
// resolved source directory to avoid write operations (the public/ directory
// is read-only under systemd ProtectSystem=strict on production).
// is read-only under systemd ProtectSystem=strict on production).
-const SHARED_BROWSER_FILES = ['theme-loader.js', 'notification-ui.js', 'account-switcher.js', 'openvibe-sw.js', 'footer.js', 'ov-mark.js', 'tooltip.js'];
+const SHARED_BROWSER_FILES = ['theme-loader.js', 'notification-ui.js', 'account-switcher.js', 'openvibe-sw.js', 'footer.js', 'ov-mark.js', 'tooltip.js', 'history.js', 'navbar.js'];
let sharedServePath = null;
let sharedServePath = null;
(function resolveSharedAssets() {
(function resolveSharedAssets() {