Fix proxy path resolution for portable builds, simplify landing page
The proxy launch used __dirname to find aware-cam-proxy.exe, which points to a temp extraction directory in portable builds. Added getAppDirectory() helper that resolves the actual .exe location via PORTABLE_EXECUTABLE_FILE. Rewrote landing page as a simple kit download page. Added build-kit script to bundle app + proxy + extension into zip. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
# build-kit.ps1 — Build the Alta Proxy Tool Kit zip for distribution
|
||||
# Usage: powershell -ExecutionPolicy Bypass -File build-kit.ps1
|
||||
#
|
||||
# Produces: dist/AltaProxyToolKit.zip containing:
|
||||
# - AltaCameraProxy-<version>-portable.exe
|
||||
# - aware-cam-proxy.exe
|
||||
# - chrome-extension/ (folder)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
# Read version from package.json
|
||||
$pkg = Get-Content "package.json" -Raw | ConvertFrom-Json
|
||||
$version = $pkg.version
|
||||
Write-Host "Building Alta Proxy Tool Kit v$version" -ForegroundColor Cyan
|
||||
|
||||
# Step 1: Build the Electron portable exe
|
||||
Write-Host "`n[1/4] Building Electron app..." -ForegroundColor Yellow
|
||||
npm run build
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Host "Build failed!" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
|
||||
$portableExe = "dist\AltaCameraProxy-$version-portable.exe"
|
||||
if (-not (Test-Path $portableExe)) {
|
||||
Write-Host "Expected output not found: $portableExe" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
Write-Host " Built: $portableExe" -ForegroundColor Green
|
||||
|
||||
# Step 2: Verify aware-cam-proxy.exe exists
|
||||
Write-Host "`n[2/4] Checking for aware-cam-proxy.exe..." -ForegroundColor Yellow
|
||||
if (-not (Test-Path "aware-cam-proxy.exe")) {
|
||||
Write-Host "aware-cam-proxy.exe not found in project root!" -ForegroundColor Red
|
||||
Write-Host "Place aware-cam-proxy.exe in the project root and try again." -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
Write-Host " Found: aware-cam-proxy.exe" -ForegroundColor Green
|
||||
|
||||
# Step 3: Verify chrome-extension folder exists
|
||||
Write-Host "`n[3/4] Checking for chrome-extension/..." -ForegroundColor Yellow
|
||||
if (-not (Test-Path "chrome-extension\manifest.json")) {
|
||||
Write-Host "chrome-extension/ folder not found or missing manifest.json!" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
Write-Host " Found: chrome-extension/" -ForegroundColor Green
|
||||
|
||||
# Step 4: Create the kit zip
|
||||
Write-Host "`n[4/4] Creating AltaProxyToolKit.zip..." -ForegroundColor Yellow
|
||||
|
||||
$kitDir = "dist\AltaProxyToolKit"
|
||||
$zipPath = "dist\AltaProxyToolKit.zip"
|
||||
|
||||
# Clean previous kit
|
||||
if (Test-Path $kitDir) { Remove-Item $kitDir -Recurse -Force }
|
||||
if (Test-Path $zipPath) { Remove-Item $zipPath -Force }
|
||||
|
||||
# Assemble kit contents
|
||||
New-Item -ItemType Directory -Path $kitDir | Out-Null
|
||||
Copy-Item $portableExe "$kitDir\AltaCameraProxy.exe"
|
||||
Copy-Item "aware-cam-proxy.exe" "$kitDir\aware-cam-proxy.exe"
|
||||
Copy-Item "chrome-extension" "$kitDir\chrome-extension" -Recurse
|
||||
|
||||
# Create zip
|
||||
Compress-Archive -Path "$kitDir\*" -DestinationPath $zipPath -Force
|
||||
|
||||
# Clean up temp directory
|
||||
Remove-Item $kitDir -Recurse -Force
|
||||
|
||||
$zipSize = [math]::Round((Get-Item $zipPath).Length / 1MB, 1)
|
||||
Write-Host "`nKit ready: $zipPath ($zipSize MB)" -ForegroundColor Green
|
||||
Write-Host "Upload this file as a release asset named 'AltaProxyToolKit.zip'" -ForegroundColor Cyan
|
||||
+113
-171
@@ -13,7 +13,6 @@
|
||||
--text-secondary: #999999;
|
||||
--accent-primary: #0E7AFE;
|
||||
--accent-primary-hover: #0A5FD9;
|
||||
--success: #4CAF50;
|
||||
--card-bg: #2D2D30;
|
||||
}
|
||||
|
||||
@@ -29,6 +28,9 @@
|
||||
color: var(--text-primary);
|
||||
font-size: 16px;
|
||||
line-height: 1.6;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
a {
|
||||
@@ -48,7 +50,7 @@
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 960px;
|
||||
max-width: 720px;
|
||||
margin: 0 auto;
|
||||
padding: 0 24px;
|
||||
}
|
||||
@@ -86,9 +88,13 @@
|
||||
}
|
||||
|
||||
/* Hero */
|
||||
main {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.hero {
|
||||
text-align: center;
|
||||
padding: 80px 0 64px;
|
||||
padding: 100px 0 48px;
|
||||
}
|
||||
|
||||
.hero-icon {
|
||||
@@ -105,10 +111,10 @@
|
||||
}
|
||||
|
||||
.hero .tagline {
|
||||
font-size: 20px;
|
||||
font-size: 18px;
|
||||
color: var(--text-secondary);
|
||||
margin-bottom: 36px;
|
||||
max-width: 600px;
|
||||
margin-bottom: 40px;
|
||||
max-width: 500px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
@@ -119,7 +125,7 @@
|
||||
color: #fff;
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
padding: 14px 36px;
|
||||
padding: 16px 40px;
|
||||
border-radius: 6px;
|
||||
transition: background 0.2s;
|
||||
}
|
||||
@@ -135,125 +141,111 @@
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
/* Sections */
|
||||
section {
|
||||
padding: 56px 0;
|
||||
}
|
||||
|
||||
section + section {
|
||||
/* Kit contents */
|
||||
.kit-info {
|
||||
padding: 48px 0;
|
||||
border-top: 1px solid var(--border);
|
||||
}
|
||||
|
||||
section h2 {
|
||||
font-size: 24px;
|
||||
.kit-info h2 {
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
color: var(--accent-primary);
|
||||
margin-bottom: 24px;
|
||||
color: var(--text-primary);
|
||||
margin-bottom: 16px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* Features */
|
||||
.features-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
|
||||
gap: 20px;
|
||||
.kit-contents {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.feature-card {
|
||||
.kit-item {
|
||||
background: var(--card-bg);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 8px;
|
||||
padding: 24px;
|
||||
padding: 20px 28px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.feature-card h3 {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
margin-bottom: 8px;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.feature-card p {
|
||||
.kit-item strong {
|
||||
display: block;
|
||||
font-size: 14px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.kit-item span {
|
||||
font-size: 13px;
|
||||
color: var(--text-secondary);
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
/* Setup Steps */
|
||||
.steps {
|
||||
counter-reset: step;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.steps li {
|
||||
counter-increment: step;
|
||||
position: relative;
|
||||
padding: 16px 0 16px 52px;
|
||||
}
|
||||
|
||||
.steps li + li {
|
||||
/* Setup */
|
||||
.setup {
|
||||
padding: 48px 0;
|
||||
border-top: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.steps li::before {
|
||||
.setup h2 {
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
margin-bottom: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.setup-steps {
|
||||
list-style: none;
|
||||
max-width: 480px;
|
||||
margin: 0 auto;
|
||||
counter-reset: step;
|
||||
}
|
||||
|
||||
.setup-steps li {
|
||||
counter-increment: step;
|
||||
padding: 12px 0 12px 44px;
|
||||
position: relative;
|
||||
font-size: 15px;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.setup-steps li + li {
|
||||
border-top: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.setup-steps li::before {
|
||||
content: counter(step);
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 16px;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
top: 12px;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
background: var(--accent-primary);
|
||||
color: #fff;
|
||||
font-weight: 700;
|
||||
font-size: 14px;
|
||||
font-size: 13px;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.steps li strong {
|
||||
display: block;
|
||||
margin-bottom: 4px;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.steps li span {
|
||||
font-size: 14px;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.steps code {
|
||||
.setup-steps code {
|
||||
background: var(--bg-primary);
|
||||
border: 1px solid var(--border);
|
||||
padding: 2px 6px;
|
||||
border-radius: 4px;
|
||||
padding: 1px 5px;
|
||||
border-radius: 3px;
|
||||
font-size: 13px;
|
||||
color: var(--accent-primary);
|
||||
}
|
||||
|
||||
/* Requirements */
|
||||
.requirements-list {
|
||||
list-style: none;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.requirements-list li {
|
||||
background: var(--card-bg);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px;
|
||||
padding: 14px 18px;
|
||||
font-size: 14px;
|
||||
.setup-note {
|
||||
text-align: center;
|
||||
margin-top: 20px;
|
||||
font-size: 13px;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.requirements-list li strong {
|
||||
color: var(--text-primary);
|
||||
display: block;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
/* Footer */
|
||||
.footer {
|
||||
border-top: 1px solid var(--border);
|
||||
@@ -274,7 +266,7 @@
|
||||
/* Responsive */
|
||||
@media (max-width: 600px) {
|
||||
.hero {
|
||||
padding: 48px 0 40px;
|
||||
padding: 60px 0 36px;
|
||||
}
|
||||
|
||||
.hero h1 {
|
||||
@@ -290,16 +282,14 @@
|
||||
padding: 12px 28px;
|
||||
}
|
||||
|
||||
section {
|
||||
padding: 36px 0;
|
||||
.kit-contents {
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.features-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.requirements-list {
|
||||
grid-template-columns: 1fr;
|
||||
.kit-item {
|
||||
width: 100%;
|
||||
max-width: 280px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -322,87 +312,39 @@
|
||||
<div class="hero">
|
||||
<img src="icon.png" alt="" class="hero-icon">
|
||||
<h1>Alta Proxy Tool</h1>
|
||||
<p class="tagline">Connect to Avigilon Alta cameras through a local RTSP proxy — no cloud relay required.</p>
|
||||
<a href="https://github.com/PageZ948/Alta-Proxy-Tool/releases/latest" class="btn-download">Download for Windows</a>
|
||||
<p class="hero-note">Portable .exe — no installation needed</p>
|
||||
<p class="tagline">Local RTSP proxy for Avigilon Alta cameras. No cloud relay required.</p>
|
||||
<a href="https://github.com/PageZ948/Alta-Proxy-Tool/releases/latest/download/AltaProxyToolKit.zip" class="btn-download">Download Kit for Windows</a>
|
||||
<p class="hero-note">Portable — extract the zip and run. No installation needed.</p>
|
||||
</div>
|
||||
|
||||
<section>
|
||||
<h2>Features</h2>
|
||||
<div class="features-grid">
|
||||
<div class="feature-card">
|
||||
<h3>Cookie-Based Auth</h3>
|
||||
<p>Authenticate seamlessly via the companion Chrome extension. No credentials stored in the app.</p>
|
||||
<section class="kit-info">
|
||||
<h2>What's in the kit</h2>
|
||||
<div class="kit-contents">
|
||||
<div class="kit-item">
|
||||
<strong>AltaCameraProxy.exe</strong>
|
||||
<span>Electron desktop app</span>
|
||||
</div>
|
||||
<div class="feature-card">
|
||||
<h3>Device Discovery</h3>
|
||||
<p>Automatically discovers all on-premise cameras in your Alta deployment with online/offline status.</p>
|
||||
</div>
|
||||
<div class="feature-card">
|
||||
<h3>Local RTSP Proxy</h3>
|
||||
<p>Launches aware-cam-proxy to establish direct camera connections for RTSP streaming.</p>
|
||||
</div>
|
||||
<div class="feature-card">
|
||||
<h3>Batch Operations</h3>
|
||||
<p>Connect to multiple cameras at once with batch proxy launch and sequential port assignment.</p>
|
||||
</div>
|
||||
<div class="feature-card">
|
||||
<h3>Self-Updating</h3>
|
||||
<p>Built-in update checker downloads new releases directly from GitHub.</p>
|
||||
</div>
|
||||
<div class="feature-card">
|
||||
<h3>Portable</h3>
|
||||
<p>Single .exe, no installer. Run it from anywhere on any Windows machine.</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>Quick Start</h2>
|
||||
<ol class="steps">
|
||||
<li>
|
||||
<strong>Download the app</strong>
|
||||
<span>Grab the latest <code>.exe</code> from the <a href="https://github.com/PageZ948/Alta-Proxy-Tool/releases/latest">Releases</a> page and place it in a folder alongside <code>aware-cam-proxy.exe</code>.</span>
|
||||
</li>
|
||||
<li>
|
||||
<strong>Install the Chrome extension</strong>
|
||||
<span>Open <code>chrome://extensions</code>, enable Developer mode, click "Load unpacked", and select the <code>chrome-extension</code> folder from this repo.</span>
|
||||
</li>
|
||||
<li>
|
||||
<strong>Log in to Alta</strong>
|
||||
<span>Sign in to your Avigilon Alta deployment in Chrome as you normally would.</span>
|
||||
</li>
|
||||
<li>
|
||||
<strong>Send cookies to the app</strong>
|
||||
<span>Click the extension icon and press "Send Cookie to APT". The app will connect automatically.</span>
|
||||
</li>
|
||||
<li>
|
||||
<strong>Start proxying</strong>
|
||||
<span>Select cameras from the device list and click Start Proxy. Use the generated RTSP URL in your video client.</span>
|
||||
</li>
|
||||
</ol>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>Requirements</h2>
|
||||
<ul class="requirements-list">
|
||||
<li>
|
||||
<strong>Windows 10+</strong>
|
||||
The proxy executable is Windows-only.
|
||||
</li>
|
||||
<li>
|
||||
<strong>Google Chrome</strong>
|
||||
Required for the cookie bridge extension.
|
||||
</li>
|
||||
<li>
|
||||
<div class="kit-item">
|
||||
<strong>aware-cam-proxy.exe</strong>
|
||||
Must be in the same folder as the app.
|
||||
</li>
|
||||
<li>
|
||||
<strong>Alta Deployment</strong>
|
||||
An active Avigilon Alta Video account.
|
||||
</li>
|
||||
</ul>
|
||||
<span>Camera proxy engine</span>
|
||||
</div>
|
||||
<div class="kit-item">
|
||||
<strong>chrome-extension/</strong>
|
||||
<span>Cookie bridge for Chrome</span>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="setup">
|
||||
<h2>Setup</h2>
|
||||
<ol class="setup-steps">
|
||||
<li>Extract the zip to any folder</li>
|
||||
<li>Load <code>chrome-extension/</code> in Chrome via <code>chrome://extensions</code> (Developer mode)</li>
|
||||
<li>Log into your Alta deployment in Chrome</li>
|
||||
<li>Click the extension icon and send cookies to the app</li>
|
||||
<li>Run <strong>AltaCameraProxy.exe</strong> and start proxying</li>
|
||||
</ol>
|
||||
<p class="setup-note">Requires Windows 10+, Google Chrome, and an Avigilon Alta account.</p>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -13,6 +13,16 @@ let cookieServer = null;
|
||||
const COOKIE_SERVER_PORT = 18247;
|
||||
const COOKIE_SERVER_TOKEN = 'apt-local-bridge-token';
|
||||
|
||||
// Get the directory where the user-facing executable resides.
|
||||
// In portable builds, __dirname points to a temp extraction directory,
|
||||
// so we use the actual .exe location instead.
|
||||
function getAppDirectory() {
|
||||
if (app.isPackaged) {
|
||||
return path.dirname(process.env.PORTABLE_EXECUTABLE_FILE || app.getPath('exe'));
|
||||
}
|
||||
return __dirname;
|
||||
}
|
||||
|
||||
// Sanitize strings before embedding in batch files to prevent command injection
|
||||
function sanitizeBatchInput(input) {
|
||||
if (typeof input !== 'string') return '';
|
||||
@@ -238,7 +248,7 @@ ipcMain.handle('api-get-auth-info', async (event, { deploymentUrl, cookies }) =>
|
||||
ipcMain.handle('camera-proxy-cookie-launch', async (event, { deploymentUrl, cookieKey, deviceUuid }) => {
|
||||
try {
|
||||
// Path to the cookie-based camera proxy executable
|
||||
const proxyExePath = path.join(__dirname, 'aware-cam-proxy.exe');
|
||||
const proxyExePath = path.join(getAppDirectory(), 'aware-cam-proxy.exe');
|
||||
|
||||
// Check if the executable exists
|
||||
if (!fs.existsSync(proxyExePath)) {
|
||||
@@ -502,7 +512,7 @@ ipcMain.handle('download-and-install-update', async (event, { downloadUrl }) =>
|
||||
try {
|
||||
// Determine the path to the currently running executable
|
||||
const currentExePath = process.env.PORTABLE_EXECUTABLE_FILE || app.getPath('exe');
|
||||
const currentDir = path.dirname(currentExePath);
|
||||
const currentDir = getAppDirectory();
|
||||
const currentExeName = path.basename(currentExePath);
|
||||
|
||||
// Check write permission on the app directory
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"dev": "electron . --dev",
|
||||
"build": "electron-builder --win --publish=never",
|
||||
"build-test": "electron-builder --win --dir",
|
||||
"build-kit": "powershell -ExecutionPolicy Bypass -File build-kit.ps1",
|
||||
"prebuild": "echo Checking build requirements..."
|
||||
},
|
||||
"build": {
|
||||
|
||||
Reference in New Issue
Block a user