diff --git a/docs/electron-auto-updates.md b/docs/electron-auto-updates.md new file mode 100644 index 00000000..c5d000ed --- /dev/null +++ b/docs/electron-auto-updates.md @@ -0,0 +1,174 @@ +# Electron Auto-Updates Configuration + +**Author**: Matthew Raymer +**Date**: 2025-07-12 +**Status**: **DISABLED** - Manual Updates Only + +## Overview + +TimeSafari's Electron application currently has auto-updates disabled due to hosting on Gitea instead of GitHub. This document explains the current configuration and provides guidance for future update mechanisms. + +## Current Status + +### Auto-Updates Disabled + +Auto-updates are currently disabled for the following reasons: + +1. **Repository Hosting**: The project is hosted on Gitea (`https://gitea.anomalistdesign.com/trent_larson/crowd-funder-for-time-pwa`) rather than GitHub +2. **Provider Limitations**: `electron-updater` primarily supports GitHub, S3, and other major cloud providers +3. **404 Errors**: Attempting to use GitHub auto-updates with a Gitea repository causes 404 errors + +### Configuration Changes Made + +1. **Repository URL Updated**: Changed from `https://github.com/trentlarson/crowd-master` to the correct Gitea URL +2. **Publish Configuration Removed**: Removed GitHub provider from `electron-builder.config.json` +3. **Auto-Updater Disabled**: Commented out auto-updater code in `electron/src/index.ts` + +## Error Resolution + +The original error: +``` +HttpError: 404 +"method: GET url: https://github.com/trentlarson/crowd-master/releases.atom" +``` + +This occurred because: +- The app was trying to check for updates on GitHub +- The repository doesn't exist on GitHub +- The auto-updater was configured for GitHub releases + +## Future Update Options + +### Option 1: Manual Distribution +- Build and distribute packages manually +- Users download and install new versions manually +- No automatic update checking + +### Option 2: Custom Update Server +- Implement a custom update server compatible with `electron-updater` +- Host update files on a web server +- Configure custom update endpoints + +### Option 3: GitHub Migration +- Move repository to GitHub +- Set up GitHub releases +- Re-enable auto-updates + +### Option 4: Alternative Update Providers +- Use S3 or other supported providers +- Implement custom update mechanism +- Use third-party update services + +## Current Build Process + +### Development Builds +```bash +npm run build:electron:dev +``` + +### Production Builds +```bash +npm run build:electron:prod +``` + +### Package Distribution +```bash +# Windows +npm run build:electron:windows:prod + +# macOS +npm run build:electron:mac:prod + +# Linux +npm run build:electron:linux:prod +``` + +## Manual Update Process + +1. **Build New Version**: Use appropriate build script +2. **Test Package**: Verify the built package works correctly +3. **Distribute**: Share the package with users +4. **User Installation**: Users manually download and install + +## Security Considerations + +### Disabled Auto-Updates +- No automatic security updates +- Users must manually update for security patches +- Consider implementing update notifications + +### Package Verification +- Verify package integrity before distribution +- Use code signing for packages +- Implement checksum verification + +## Monitoring and Maintenance + +### Version Tracking +- Track application versions manually +- Document changes between versions +- Maintain changelog for users + +### User Communication +- Notify users of available updates +- Provide clear update instructions +- Document breaking changes + +## Recommendations + +### Short Term +1. Continue with manual distribution +2. Implement update notifications in-app +3. Provide clear update instructions + +### Long Term +1. Evaluate hosting platform options +2. Consider implementing custom update server +3. Plan for automated update mechanism + +## Configuration Files + +### electron-builder.config.json +```json +{ + "appId": "app.timesafari.desktop", + "productName": "TimeSafari", + // publish configuration removed +} +``` + +### electron/src/index.ts +```typescript +// Auto-updater disabled +// import { autoUpdater } from 'electron-updater'; + +// Auto-updates disabled - not supported on Gitea hosting +// if (!electronIsDev && !process.env.APPIMAGE) { +// try { +// autoUpdater.checkForUpdatesAndNotify(); +// } catch (error) { +// console.log('Update check failed (suppressed):', error); +// } +// } +``` + +## Troubleshooting + +### Common Issues + +1. **404 Errors**: Ensure repository URL is correct +2. **Build Failures**: Check build configuration +3. **Package Issues**: Verify package contents + +### Debug Mode +```bash +# Enable debug logging +DEBUG=* npm run build:electron:dev +``` + +--- + +**Status**: Auto-updates disabled +**Last Updated**: 2025-07-12 +**Version**: 1.0 +**Maintainer**: Matthew Raymer \ No newline at end of file diff --git a/electron/electron-builder.config.json b/electron/electron-builder.config.json index a69f24e0..8db7837e 100644 --- a/electron/electron-builder.config.json +++ b/electron/electron-builder.config.json @@ -11,9 +11,6 @@ "capacitor.config.*", "app/**/*" ], - "publish": { - "provider": "github" - }, "linux": { "target": [ { diff --git a/electron/package.json b/electron/package.json index adcdb2ee..d1d6d576 100644 --- a/electron/package.json +++ b/electron/package.json @@ -9,7 +9,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/trentlarson/crowd-master" + "url": "https://gitea.anomalistdesign.com/trent_larson/crowd-funder-for-time-pwa" }, "license": "MIT", "main": "build/src/index.js", diff --git a/electron/src/index.ts b/electron/src/index.ts index 58304a49..3ca3215e 100644 --- a/electron/src/index.ts +++ b/electron/src/index.ts @@ -4,7 +4,7 @@ import type { MenuItemConstructorOptions } from 'electron'; import { app, MenuItem, ipcMain, dialog } from 'electron'; import electronIsDev from 'electron-is-dev'; import unhandled from 'electron-unhandled'; -import { autoUpdater } from 'electron-updater'; +// import { autoUpdater } from 'electron-updater'; import { promises as fs } from 'fs'; import { join } from 'path'; @@ -73,10 +73,11 @@ if (electronIsDev) { } // Configure auto-updater -autoUpdater.on('error', (error) => { - console.log('Auto-updater error (suppressed):', error.message); - // Don't show error dialogs for update check failures -}); +// DISABLED: Auto-updates not supported on Gitea hosting +// autoUpdater.on('error', (error) => { +// console.log('Auto-updater error (suppressed):', error.message); +// // Don't show error dialogs for update check failures +// }); // Run Application (async () => { @@ -112,14 +113,15 @@ autoUpdater.on('error', (error) => { } }); + // Auto-updates disabled - not supported on Gitea hosting // Only check for updates in production builds, not in development or AppImage - if (!electronIsDev && !process.env.APPIMAGE) { - try { - autoUpdater.checkForUpdatesAndNotify(); - } catch (error) { - console.log('Update check failed (suppressed):', error); - } - } + // if (!electronIsDev && !process.env.APPIMAGE) { + // try { + // autoUpdater.checkForUpdatesAndNotify(); + // } catch (error) { + // console.log('Update check failed (suppressed):', error); + // } + // } })(); // Handle when all of our windows are close (platforms have their own expectations).