Compare commits
3 commits
14dac17024
...
03991fdea5
| Author | SHA1 | Date | |
|---|---|---|---|
| 03991fdea5 | |||
| e0b316fe65 | |||
| 9d39ed8201 |
8 changed files with 2993 additions and 2981 deletions
53
README.md
53
README.md
|
|
@ -19,7 +19,7 @@ WebDrop Bridge embeds a web application in a Qt container with full filesystem a
|
|||
|
||||
## Features
|
||||
|
||||
- ✅ **Qt-based Architecture** - Native Windows & macOS support via PySide6
|
||||
- ✅ **Qt-based Architecture** - Professional Windows support via PySide6 (macOS support planned)
|
||||
- ✅ **Embedded Web App** - QtWebEngine provides Chromium without browser limitations
|
||||
- ✅ **Drag Interception** - Converts text paths to native file operations
|
||||
- ✅ **Path Whitelist** - Security-conscious file system access control
|
||||
|
|
@ -35,7 +35,7 @@ WebDrop Bridge embeds a web application in a Qt container with full filesystem a
|
|||
|
||||
### Requirements
|
||||
- Python 3.10+
|
||||
- Windows 10/11 or macOS 12+
|
||||
- Windows 10/11
|
||||
- 200 MB disk space (includes Chromium from PyInstaller)
|
||||
|
||||
### Installation from Source
|
||||
|
|
@ -47,7 +47,6 @@ cd webdrop-bridge
|
|||
|
||||
# Create and activate virtual environment
|
||||
python -m venv venv
|
||||
source venv/bin/activate # macOS/Linux
|
||||
# venv\Scripts\activate.ps1 # Windows (PowerShell)
|
||||
# venv\Scripts\activate.bat # Windows (cmd.exe)
|
||||
|
||||
|
|
@ -71,8 +70,7 @@ pytest tests -v
|
|||
tox
|
||||
|
||||
# Build installers
|
||||
python build/scripts/build_windows.py # Windows MSI
|
||||
bash build/scripts/build_macos.sh # macOS DMG
|
||||
python build/scripts/build_windows.py --msi # Windows MSI
|
||||
```
|
||||
|
||||
## Project Structure
|
||||
|
|
@ -92,7 +90,6 @@ webdrop-bridge/
|
|||
│ └── conftest.py # Pytest configuration
|
||||
├── build/
|
||||
│ ├── windows/ # Windows-specific build configs
|
||||
│ ├── macos/ # macOS-specific build configs
|
||||
│ └── scripts/ # Build automation scripts
|
||||
├── webapp/ # Embedded web application
|
||||
├── resources/
|
||||
|
|
@ -225,48 +222,27 @@ See [CHANGELOG.md](CHANGELOG.md) for release notes.
|
|||
### Windows MSI Installer
|
||||
|
||||
```bash
|
||||
# Simple build (creates standalone .exe)
|
||||
python build/scripts/build_windows.py
|
||||
|
||||
# Build with MSI installer
|
||||
# Build with MSI installer (recommended)
|
||||
python build/scripts/build_windows.py --msi
|
||||
|
||||
# Build and sign executable
|
||||
python build/scripts/build_windows.py --sign
|
||||
# Build with code signing (requires certificate)
|
||||
python build/scripts/build_windows.py --msi --code-sign
|
||||
```
|
||||
|
||||
Output:
|
||||
- Standalone executable: `build/dist/windows/WebDropBridge.exe` (~195 MB)
|
||||
- Optional MSI installer: `build/dist/windows/WebDropBridge.msi`
|
||||
- SHA256 checksum: `build/dist/windows/WebDropBridge.exe.sha256`
|
||||
- Portable executable: `build/dist/windows/WebDropBridge/WebDropBridge.exe` (~195 MB)
|
||||
- Professional MSI installer: `build/dist/windows/WebDropBridge-{version}-Setup.msi`
|
||||
- SHA256 checksum: `build/dist/windows/WebDropBridge/WebDropBridge.exe.sha256`
|
||||
|
||||
### macOS DMG Installer
|
||||
|
||||
```bash
|
||||
# Build DMG (requires macOS)
|
||||
bash build/scripts/build_macos.sh
|
||||
|
||||
# Build with code signing
|
||||
SIGN_APP=true bash build/scripts/build_macos.sh
|
||||
|
||||
# Build with notarization
|
||||
NOTARIZE_APP=true bash build/scripts/build_macos.sh
|
||||
```
|
||||
|
||||
Output:
|
||||
- DMG installer: `build/dist/macos/WebDropBridge.dmg`
|
||||
- App bundle: `build/dist/macos/WebDropBridge.app`
|
||||
**Note on macOS**: Build scripts exist for macOS (DMG generation), but have never been built or tested. macOS support is theoretical at this point. The Qt/PySide6 architecture should support macOS, but platform-specific testing and validation would be required.
|
||||
|
||||
### Creating Releases
|
||||
|
||||
For Forgejo/GitHub releases:
|
||||
|
||||
```bash
|
||||
# Windows - Create release with executable
|
||||
# Windows - Create release with MSI installer
|
||||
powershell -ExecutionPolicy Bypass -File build/scripts/create_release.ps1
|
||||
|
||||
# macOS - Create release with DMG
|
||||
bash build/scripts/create_release.sh
|
||||
```
|
||||
|
||||
## Development Workflow
|
||||
|
|
@ -314,9 +290,10 @@ bash build/scripts/create_release.sh
|
|||
|
||||
| Platform | Version | Status | Notes |
|
||||
|----------|---------|--------|-------|
|
||||
| Windows | 10, 11 | ✅ Full | Tested on x64 |
|
||||
| macOS | 12, 13, 14 | ✅ Full | Intel & Apple Silicon |
|
||||
| Linux | Ubuntu 22.04+ | ⚠️ Partial | Limited testing |
|
||||
| Windows | 10, 11 | ✅ Full | Tested on x64, MSI installer support |
|
||||
| macOS | 12+ | ⚠️ **Untested** | Possible via Qt/PySide6, but never built or tested. Theoretical support only. |
|
||||
|
||||
**Note**: WebDrop Bridge is currently developed and tested exclusively on Windows. While the Qt/PySide6 framework supports macOS, we cannot guarantee functionality without actual macOS testing and validation. Contributions for macOS support validation are welcome.
|
||||
|
||||
## Contributing
|
||||
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
|
||||
xmlns:ui="http://schemas.microsoft.com/wix/2010/ui">
|
||||
<Product Id="*" Name="WebDrop Bridge" Language="1033" Version="0.5.0"
|
||||
<Product Id="*" Name="WebDrop Bridge" Language="1033" Version="0.6.0"
|
||||
Manufacturer="HIM-Tools"
|
||||
UpgradeCode="12345678-1234-1234-1234-123456789012">
|
||||
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
|
|
@ -16,11 +16,12 @@ param(
|
|||
|
||||
[switch]$ClearCredentials,
|
||||
|
||||
[switch]$SkipExe,
|
||||
|
||||
[string]$ForgejoUrl = "https://git.him-tools.de",
|
||||
[string]$Repo = "HIM-public/webdrop-bridge",
|
||||
[string]$ExePath = "build\dist\windows\WebDropBridge.exe",
|
||||
[string]$ChecksumPath = "build\dist\windows\WebDropBridge.exe.sha256",
|
||||
[string]$MsiPath = "build\dist\windows\WebDropBridge-1.0.0-Setup.msi"
|
||||
[string]$ExePath = "build\dist\windows\WebDropBridge\WebDropBridge.exe",
|
||||
[string]$ChecksumPath = "build\dist\windows\WebDropBridge\WebDropBridge.exe.sha256"
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
|
@ -107,32 +108,44 @@ if (-not $Version) {
|
|||
Write-Host "Using version: $Version" -ForegroundColor Green
|
||||
}
|
||||
|
||||
# Verify files exist
|
||||
if (-not (Test-Path $ExePath)) {
|
||||
Write-Host "ERROR: Executable not found at $ExePath" -ForegroundColor Red
|
||||
exit 1
|
||||
# Define MSI path with resolved version
|
||||
$MsiPath = Join-Path $projectRoot "build\dist\windows\WebDropBridge-$Version-Setup.msi"
|
||||
|
||||
# Verify files exist (exe/checksum optional, MSI required)
|
||||
if (-not $SkipExe) {
|
||||
if (-not (Test-Path $ExePath)) {
|
||||
Write-Host "WARNING: Executable not found at $ExePath" -ForegroundColor Yellow
|
||||
Write-Host " Use -SkipExe flag to skip exe upload" -ForegroundColor Gray
|
||||
$SkipExe = $true
|
||||
}
|
||||
|
||||
if (-not $SkipExe -and -not (Test-Path $ChecksumPath)) {
|
||||
Write-Host "WARNING: Checksum file not found at $ChecksumPath" -ForegroundColor Yellow
|
||||
Write-Host " Exe will not be uploaded" -ForegroundColor Gray
|
||||
$SkipExe = $true
|
||||
}
|
||||
}
|
||||
|
||||
if (-not (Test-Path $ChecksumPath)) {
|
||||
Write-Host "ERROR: Checksum file not found at $ChecksumPath" -ForegroundColor Red
|
||||
# MSI is the primary release artifact
|
||||
if (-not (Test-Path $MsiPath)) {
|
||||
Write-Host "ERROR: MSI installer not found at $MsiPath" -ForegroundColor Red
|
||||
Write-Host "Please build with MSI support:" -ForegroundColor Yellow
|
||||
Write-Host " python build\scripts\build_windows.py --msi" -ForegroundColor Cyan
|
||||
exit 1
|
||||
}
|
||||
|
||||
# MSI is optional (only available on Windows after build)
|
||||
$hasMsi = Test-Path $MsiPath
|
||||
|
||||
Write-Host "Creating WebDropBridge $Version release on Forgejo..." -ForegroundColor Cyan
|
||||
|
||||
# Get file info
|
||||
$exeSize = (Get-Item $ExePath).Length / 1MB
|
||||
$checksum = Get-Content $ChecksumPath -Raw
|
||||
$msiSize = (Get-Item $MsiPath).Length / 1MB
|
||||
Write-Host "Primary Artifact: WebDropBridge-$Version-Setup.msi ($([math]::Round($msiSize, 2)) MB)"
|
||||
|
||||
Write-Host "File: WebDropBridge.exe ($([math]::Round($exeSize, 2)) MB)"
|
||||
if ($hasMsi) {
|
||||
$msiSize = (Get-Item $MsiPath).Length / 1MB
|
||||
Write-Host "File: WebDropBridge-1.0.0-Setup.msi ($([math]::Round($msiSize, 2)) MB)"
|
||||
if (-not $SkipExe) {
|
||||
$exeSize = (Get-Item $ExePath).Length / 1MB
|
||||
$checksum = Get-Content $ChecksumPath -Raw
|
||||
Write-Host "Optional Artifact: WebDropBridge.exe ($([math]::Round($exeSize, 2)) MB)"
|
||||
Write-Host " Checksum: $($checksum.Substring(0, 16))..."
|
||||
}
|
||||
Write-Host "Checksum: $($checksum.Substring(0, 16))..."
|
||||
|
||||
# Create basic auth header
|
||||
$auth = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes("${ForgejoUser}:${ForgejoPW}"))
|
||||
|
|
@ -146,10 +159,17 @@ $headers = @{
|
|||
Write-Host "`nCreating release v$Version..." -ForegroundColor Yellow
|
||||
$releaseUrl = "$ForgejoUrl/api/v1/repos/$Repo/releases"
|
||||
|
||||
# Build release body with checksum info if exe is being uploaded
|
||||
$releaseBody = "WebDropBridge v$Version`n`n**Release Artifacts:**`n- MSI Installer (Windows Setup)`n"
|
||||
if (-not $SkipExe) {
|
||||
$checksum = Get-Content $ChecksumPath -Raw
|
||||
$releaseBody += "- Portable Executable`n`n**Checksum:**`n$checksum`n"
|
||||
}
|
||||
|
||||
$releaseData = @{
|
||||
tag_name = "v$Version"
|
||||
name = "WebDropBridge v$Version"
|
||||
body = "WebDropBridge v$Version`n`nChecksum: $checksum"
|
||||
body = $releaseBody
|
||||
draft = $false
|
||||
prerelease = $false
|
||||
} | ConvertTo-Json
|
||||
|
|
@ -172,56 +192,14 @@ catch {
|
|||
exit 1
|
||||
}
|
||||
|
||||
# Step 2: Upload executable as asset using curl
|
||||
Write-Host "Uploading executable asset..." -ForegroundColor Yellow
|
||||
# Setup curl authentication
|
||||
$curlAuth = "$ForgejoUser`:$ForgejoPW"
|
||||
$uploadUrl = "$ForgejoUrl/api/v1/repos/$Repo/releases/$releaseId/assets"
|
||||
|
||||
# Step 2: Upload MSI installer as primary artifact
|
||||
Write-Host "`nUploading MSI installer (primary artifact)..." -ForegroundColor Yellow
|
||||
|
||||
try {
|
||||
$curlAuth = "$ForgejoUser`:$ForgejoPW"
|
||||
$uploadUrl = "$ForgejoUrl/api/v1/repos/$Repo/releases/$releaseId/assets"
|
||||
|
||||
$response = curl.exe -s -X POST `
|
||||
-u $curlAuth `
|
||||
-F "attachment=@$ExePath" `
|
||||
$uploadUrl
|
||||
|
||||
if ($response -like "*error*" -or $response -like "*404*") {
|
||||
Write-Host "ERROR uploading executable: $response" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host "[OK] Executable uploaded" -ForegroundColor Green
|
||||
}
|
||||
catch {
|
||||
Write-Host "ERROR uploading executable: $_" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Step 3: Upload checksum as asset using curl
|
||||
Write-Host "Uploading checksum asset..." -ForegroundColor Yellow
|
||||
|
||||
try {
|
||||
$response = curl.exe -s -X POST `
|
||||
-u $curlAuth `
|
||||
-F "attachment=@$ChecksumPath" `
|
||||
$uploadUrl
|
||||
|
||||
if ($response -like "*error*" -or $response -like "*404*") {
|
||||
Write-Host "ERROR uploading checksum: $response" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host "[OK] Checksum uploaded" -ForegroundColor Green
|
||||
}
|
||||
catch {
|
||||
Write-Host "ERROR uploading checksum: $_" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Step 4: Upload MSI as asset (if available)
|
||||
if ($hasMsi) {
|
||||
Write-Host "Uploading MSI installer asset..." -ForegroundColor Yellow
|
||||
|
||||
try {
|
||||
$response = curl.exe -s -X POST `
|
||||
-u $curlAuth `
|
||||
-F "attachment=@$MsiPath" `
|
||||
|
|
@ -232,11 +210,52 @@ if ($hasMsi) {
|
|||
exit 1
|
||||
}
|
||||
|
||||
Write-Host "[OK] MSI uploaded" -ForegroundColor Green
|
||||
}
|
||||
catch {
|
||||
Write-Host "[OK] MSI installer uploaded" -ForegroundColor Green
|
||||
}
|
||||
catch {
|
||||
Write-Host "ERROR uploading MSI: $_" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Step 3: Upload executable as optional artifact (if available)
|
||||
if (-not $SkipExe) {
|
||||
Write-Host "`nUploading executable (optional portable version)..." -ForegroundColor Yellow
|
||||
|
||||
try {
|
||||
$response = curl.exe -s -X POST `
|
||||
-u $curlAuth `
|
||||
-F "attachment=@$ExePath" `
|
||||
$uploadUrl
|
||||
|
||||
if ($response -like "*error*" -or $response -like "*404*") {
|
||||
Write-Host "WARNING: Could not upload executable: $response" -ForegroundColor Yellow
|
||||
}
|
||||
else {
|
||||
Write-Host "[OK] Executable uploaded" -ForegroundColor Green
|
||||
}
|
||||
}
|
||||
catch {
|
||||
Write-Host "WARNING: Could not upload executable: $_" -ForegroundColor Yellow
|
||||
}
|
||||
|
||||
# Step 4: Upload checksum as asset
|
||||
Write-Host "Uploading checksum..." -ForegroundColor Yellow
|
||||
|
||||
try {
|
||||
$response = curl.exe -s -X POST `
|
||||
-u $curlAuth `
|
||||
-F "attachment=@$ChecksumPath" `
|
||||
$uploadUrl
|
||||
|
||||
if ($response -like "*error*" -or $response -like "*404*") {
|
||||
Write-Host "WARNING: Could not upload checksum: $response" -ForegroundColor Yellow
|
||||
}
|
||||
else {
|
||||
Write-Host "[OK] Checksum uploaded" -ForegroundColor Green
|
||||
}
|
||||
}
|
||||
catch {
|
||||
Write-Host "WARNING: Could not upload checksum: $_" -ForegroundColor Yellow
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -137,7 +137,22 @@ class Config:
|
|||
log_file = Config.get_default_log_path()
|
||||
|
||||
app_name = data.get("app_name", "WebDrop Bridge")
|
||||
window_title = data.get("window_title", f"{app_name} v{__version__}")
|
||||
stored_window_title = data.get("window_title", "")
|
||||
|
||||
# Regenerate default window titles on version upgrade
|
||||
# If the stored title matches the pattern "{app_name} v{version}", regenerate it
|
||||
# with the current version. This ensures the title updates automatically on upgrades.
|
||||
import re
|
||||
version_pattern = re.compile(rf"^{re.escape(app_name)}\s+v[\d.]+$")
|
||||
if stored_window_title and version_pattern.match(stored_window_title):
|
||||
# Detected a default-pattern title with old version, regenerate
|
||||
window_title = f"{app_name} v{__version__}"
|
||||
elif stored_window_title:
|
||||
# Custom window title, keep it as-is
|
||||
window_title = stored_window_title
|
||||
else:
|
||||
# No window title specified, use default
|
||||
window_title = f"{app_name} v{__version__}"
|
||||
|
||||
return cls(
|
||||
app_name=app_name,
|
||||
|
|
@ -178,12 +193,10 @@ class Config:
|
|||
|
||||
# Extract and validate configuration values
|
||||
app_name = os.getenv("APP_NAME", "WebDrop Bridge")
|
||||
# Version comes from __init__.py (lazy import to avoid circular imports)
|
||||
if not os.getenv("APP_VERSION"):
|
||||
# Version always comes from __init__.py for consistency
|
||||
from webdrop_bridge import __version__
|
||||
app_version = __version__
|
||||
else:
|
||||
app_version = os.getenv("APP_VERSION")
|
||||
|
||||
log_level = os.getenv("LOG_LEVEL", "INFO").upper()
|
||||
log_file_str = os.getenv("LOG_FILE", None)
|
||||
allowed_roots_str = os.getenv("ALLOWED_ROOTS", "Z:/,C:/Users/Public")
|
||||
|
|
|
|||
|
|
@ -52,8 +52,11 @@ class TestConfigFromEnv:
|
|||
# Load config (env vars from file, not system)
|
||||
config = Config.from_env(str(env_file))
|
||||
|
||||
# Version always comes from package __init__.py, not from APP_VERSION env var
|
||||
from webdrop_bridge import __version__
|
||||
|
||||
assert config.app_name == "TestApp"
|
||||
assert config.app_version == "2.0.0"
|
||||
assert config.app_version == __version__ # Uses package version, not env var
|
||||
assert config.log_level == "DEBUG"
|
||||
assert config.allowed_roots == [root1.resolve(), root2.resolve()]
|
||||
assert config.allowed_urls == ["example.com", "*.test.org"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue