fix: resolve Arch Linux defunct process and tray issues by hardening sandbox permissions and environment flags
This commit is contained in:
16
PKGBUILD
16
PKGBUILD
@@ -1,18 +1,17 @@
|
|||||||
# Maintainer: Nils Pukropp <nils@narl.io>
|
# Maintainer: Nils Pukropp <nils@narl.io>
|
||||||
pkgname=ultimate-ban-tracker
|
pkgname=ultimate-ban-tracker
|
||||||
pkgver=1.3.3
|
pkgver=1.3.3
|
||||||
pkgrel=3
|
pkgrel=4
|
||||||
pkgdesc="Professional Steam Account Manager & Ban Tracker"
|
pkgdesc="Professional Steam Account Manager & Ban Tracker"
|
||||||
arch=('x86_64')
|
arch=('x86_64')
|
||||||
url="https://narl.io"
|
url="https://narl.io"
|
||||||
license=('custom:Personal Use and Non-Commercial')
|
license=('custom:Personal Use and Non-Commercial')
|
||||||
depends=('electron' 'nodejs' 'npm' 'libxss' 'nss' 'libxtst' 'libappindicator-gtk3')
|
depends=('electron' 'nodejs' 'npm' 'libxss' 'nss' 'libxtst' 'libappindicator-gtk3' 'libsecret')
|
||||||
makedepends=('imagemagick')
|
makedepends=('imagemagick')
|
||||||
source=("ultimate-ban-tracker-${pkgver}.tar.gz::https://git.narl.io/nvrl/ultimate-ban-tracker/archive/v${pkgver}.tar.gz")
|
source=("ultimate-ban-tracker-${pkgver}.tar.gz::https://git.narl.io/nvrl/ultimate-ban-tracker/archive/v${pkgver}.tar.gz")
|
||||||
sha256sums=('SKIP')
|
sha256sums=('SKIP')
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
# The Gitea archive extracts to a folder named 'ultimate-ban-tracker'
|
|
||||||
cd "${srcdir}/ultimate-ban-tracker"
|
cd "${srcdir}/ultimate-ban-tracker"
|
||||||
|
|
||||||
cd frontend
|
cd frontend
|
||||||
@@ -37,10 +36,15 @@ package() {
|
|||||||
# Copy the unpacked linux build
|
# Copy the unpacked linux build
|
||||||
cp -r release/linux-unpacked/* "${pkgdir}/usr/lib/${pkgname}/"
|
cp -r release/linux-unpacked/* "${pkgdir}/usr/lib/${pkgname}/"
|
||||||
|
|
||||||
# Create a wrapper script instead of a direct symlink
|
# Fix permissions for chrome-sandbox (Crucial for Arch)
|
||||||
# The actual binary produced by electron-builder is 'ultimate-ban-tracker-desktop'
|
chmod 4755 "${pkgdir}/usr/lib/${pkgname}/chrome-sandbox"
|
||||||
|
|
||||||
|
# Create a more robust wrapper script
|
||||||
cat > "${pkgdir}/usr/bin/${pkgname}" <<EOF
|
cat > "${pkgdir}/usr/bin/${pkgname}" <<EOF
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# Electron apps on Wayland sometimes need specific flags for the tray
|
||||||
|
export ELECTRON_OZONE_PLATFORM_HINT=auto
|
||||||
|
export XDG_CURRENT_DESKTOP=Unity
|
||||||
exec /usr/lib/${pkgname}/${pkgname}-desktop "\$@"
|
exec /usr/lib/${pkgname}/${pkgname}-desktop "\$@"
|
||||||
EOF
|
EOF
|
||||||
chmod +x "${pkgdir}/usr/bin/${pkgname}"
|
chmod +x "${pkgdir}/usr/bin/${pkgname}"
|
||||||
@@ -58,7 +62,7 @@ Comment=Professional Steam Account Manager & Ban Tracker
|
|||||||
StartupWMClass=${pkgname}-desktop
|
StartupWMClass=${pkgname}-desktop
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Install Icon
|
# Install Icons
|
||||||
install -m644 "assets-build/icon.png" "${pkgdir}/usr/share/pixmaps/${pkgname}.png"
|
install -m644 "assets-build/icon.png" "${pkgdir}/usr/share/pixmaps/${pkgname}.png"
|
||||||
|
|
||||||
# Install License
|
# Install License
|
||||||
|
|||||||
@@ -94,22 +94,25 @@ const initBackend = () => {
|
|||||||
// --- System Tray ---
|
// --- System Tray ---
|
||||||
const createTray = () => {
|
const createTray = () => {
|
||||||
const possiblePaths = [
|
const possiblePaths = [
|
||||||
'/usr/share/pixmaps/ultimate-ban-tracker.png', // System installed (highest priority)
|
'/usr/share/pixmaps/ultimate-ban-tracker.png', // System installed
|
||||||
path.join(__dirname, '..', 'assets-build', 'icon.png'),
|
|
||||||
path.join(__dirname, '..', 'assets-build', 'icon.svg'),
|
|
||||||
path.join(process.resourcesPath, 'assets-build', 'icon.png'),
|
path.join(process.resourcesPath, 'assets-build', 'icon.png'),
|
||||||
path.join(app.getAppPath(), 'assets-build', 'icon.png')
|
path.join(app.getAppPath(), 'assets-build', 'icon.png'),
|
||||||
|
path.join(__dirname, '..', 'assets-build', 'icon.png')
|
||||||
];
|
];
|
||||||
|
|
||||||
let iconPath = '';
|
let iconPath = '';
|
||||||
for (const p of possiblePaths) {
|
for (const p of possiblePaths) {
|
||||||
if (fs.existsSync(p)) { iconPath = p; break; }
|
if (p && fs.existsSync(p)) { iconPath = p; break; }
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(`[Tray] Resolved icon path: ${iconPath || 'NONE FOUND'}`);
|
console.log(`[Tray] Attempting to initialize with icon: ${iconPath || 'NONE FOUND'}`);
|
||||||
|
|
||||||
if (!iconPath) {
|
if (!iconPath) {
|
||||||
console.warn(`[Tray] FAILED: No valid icon found.`);
|
console.warn(`[Tray] FAILED: No valid icon found.`);
|
||||||
|
// Fallback to a native empty icon just to avoid crashing if possible
|
||||||
|
try {
|
||||||
|
tray = new Tray(nativeImage.createEmpty());
|
||||||
|
} catch (e) {}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,19 +121,18 @@ const createTray = () => {
|
|||||||
tray = new Tray(icon);
|
tray = new Tray(icon);
|
||||||
tray.setToolTip('Ultimate Ban Tracker');
|
tray.setToolTip('Ultimate Ban Tracker');
|
||||||
|
|
||||||
// Linux Fix: Some DEs need this to show the menu correctly
|
|
||||||
if (process.platform === 'linux') {
|
if (process.platform === 'linux') {
|
||||||
tray.setIgnoreMouseEvents(false);
|
tray.setIgnoreMouseEvents(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
tray.on('click', () => { if (mainWindow) { mainWindow.show(); mainWindow.focus(); } });
|
tray.on('click', () => { if (mainWindow) { mainWindow.show(); mainWindow.focus(); } });
|
||||||
|
|
||||||
// Load initial themed icon if possible
|
// Force initial menu build
|
||||||
|
updateTrayMenu();
|
||||||
|
|
||||||
const config = store.get('serverConfig');
|
const config = store.get('serverConfig');
|
||||||
if (config?.theme) {
|
if (config?.theme) {
|
||||||
setAppIcon(config.theme);
|
setAppIcon(config.theme);
|
||||||
} else {
|
|
||||||
updateTrayMenu();
|
|
||||||
}
|
}
|
||||||
console.log(`[Tray] Successfully initialized`);
|
console.log(`[Tray] Successfully initialized`);
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
|
|||||||
Reference in New Issue
Block a user