Repository Public
1#!/bin/zsh2# =============================================================================3# SP BOUCHER | INFRASTRUCTURE & AUTOMATION4# ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5# =============================================================================6#7# Project : MacLustr Social Engine & Remote Navigator8# File : infra/launchd/run-worker.sh9# Module : infra10# Repository : https://git.spboucher.ai/maclustr-social11# Project Website : https://social.spboucher.ai12# Created : 2026-12-0113# Last Modified : 2026-12-0114#15# Author : Simon-Pierre Boucher16# Position : Professor of Finance17# Institution : Université du Québec en Outaouais (UQO)18# Organization : SP Boucher19# Website : https://spboucher.ai20# Git : https://git.spboucher.ai21#22# Preferred Contact: admin@spboucher.ai23# Technical Contact: dev@spboucher.ai24# Security/Admin : admin@spboucher.ai25#26# Copyright (c) 202627# Simon-Pierre Boucher28# All rights reserved where applicable. This file is governed by the29# applicable project license, copyright notices and relevant law.30# Existing third-party rights and notices remain unaffected.31#32# License : None specified (no license file in this repository)33#34# Do not embed credentials, private keys, access tokens,35# certificates or confidential personal information.36#37# =============================================================================38# END OF SP BOUCHER SOURCE HEADER39# =============================================================================4041# Started by the LaunchAgent of the console user through `sudo -n -u mlnav` (see infra/launchd/README.md):42# the browser runs in the graphical session, under a dedicated NON-administrator account that cannot read the43# database, the service keys or the operator's home. Environment is fixed here because sudo strips it.44set -euo pipefail45APP="${0:A:h:h:h}"46export HOME="/Users/$(id -un)"47export PATH="/opt/homebrew/bin:/usr/bin:/bin:/usr/sbin:/sbin"48export PLAYWRIGHT_BROWSERS_PATH="$HOME/Library/Caches/ms-playwright"49export MLS_CONTROL_INTERNAL_URL="${MLS_CONTROL_INTERNAL_URL:-http://127.0.0.1:8880}"50export MLS_GATEWAY_WS_URL="${MLS_GATEWAY_WS_URL:-ws://127.0.0.1:8882/worker}"51export MLS_WORKER_TOKEN_FILE="$HOME/.config/maclustr-navigator-worker/${MLS_WORKER_INSTANCE:-prod}.token"52export MLS_PROFILES_DIR="$HOME/maclustr-navigator-profiles/${MLS_WORKER_INSTANCE:-prod}"53export MLS_HEADED="${MLS_HEADED:-1}"54export MLS_AX_BRIDGE="$APP/native/MacAccessibilityBridge/mlax"55export MLS_VERSION="$(cat "$APP/dist/VERSION" 2>/dev/null || echo dev)"56umask 07757cd "$HOME"58exec /opt/homebrew/bin/node "$APP/dist/navigator-worker.mjs"59