Skip to content

V0.1#7

Merged
arumes31 merged 13 commits into
mainfrom
v0.1
Jun 17, 2026
Merged

V0.1#7
arumes31 merged 13 commits into
mainfrom
v0.1

Conversation

@arumes31

@arumes31 arumes31 commented Jun 17, 2026

Copy link
Copy Markdown
Owner

Overview

This PR implements the foundational version (V0.1) of gcrypt, a secure file synchronization tool for Google Drive. It includes the core project structure, encryption/decryption modules, a synchronization engine, a graphical user interface, and automated CI/CD workflows.

Key Features

  • Core Architecture: Modular design with dedicated packages for configuration, crypto, sync, and services.
  • Crypto Engine: Implemented AES-GCM stream encryption with HKDF for key derivation and filename encryption.
  • Sync Engine: Robust directory synchronization with Google Drive, including change detection and throttling.
  • GUI (Fyne): A modern system tray application with status indicators and settings dialogs.
  • CI/CD Integration: Comprehensive GitHub Actions workflows for linting, security scanning (\gosec, \govulncheck), and automated releases.
  • Platform Support: Specialized Windows support including RDP-safe OpenGL fallback and a custom GCC wrapper for CGO builds.

Local Verification

I have manually verified the following on a local Windows environment:

  • Linting: \golangci-lint\ passed with zero issues.
  • Security: \gosec\ and \govulncheck\ identified no vulnerabilities.
  • Secret Detection: \gitleaks\ scanned all commits and found no leaks.
  • Integrity: \go mod verify\ confirmed dependency consistency.
  • Unit Tests: All internal package tests (crypto, sync, drive, config) are passing.
  • Ignore Rules: Updated .gitignore\ to prevent accidental inclusion of log files and secrets.

Changes

  • Added core services and application state management.
  • Implemented Google Drive API integration.
  • Added graphical user interface using the Fyne toolkit.
  • Configured GitHub Actions for CI/CD.
  • Updated documentation with setup and building instructions.

Summary by CodeRabbit

  • New Features

    • Desktop GUI application with activity feed showing recent sync operations and system tray integration.
    • Software OpenGL rendering support on Windows for systems without hardware acceleration.
    • Configurable log level filtering for diagnostic output.
  • Documentation

    • Added Google Drive API setup guide with step-by-step OAuth configuration instructions.
    • Updated installation prerequisites and build instructions for platform requirements.
  • Bug Fixes

    • Improved conflict resolution during syncing with better remote change detection.
  • Chores

    • Removed system tray-only UI in favor of full desktop application.

@arumes31
arumes31 merged commit 3bb03e8 into main Jun 17, 2026
3 of 4 checks passed
@arumes31
arumes31 deleted the v0.1 branch June 17, 2026 08:07
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 17a560d7-7b05-4a04-bdcf-849fc7b8c5cb

📥 Commits

Reviewing files that changed from the base of the PR and between 9b8f70b and adc4c12.

⛔ Files ignored due to path filters (23)
  • blue.ico is excluded by !**/*.ico
  • blue.png is excluded by !**/*.png
  • branding/error.png is excluded by !**/*.png
  • branding/logo.png is excluded by !**/*.png
  • branding/synced.png is excluded by !**/*.png
  • branding/syncing.png is excluded by !**/*.png
  • branding/warning.png is excluded by !**/*.png
  • go.sum is excluded by !**/*.sum
  • gray.ico is excluded by !**/*.ico
  • gray.png is excluded by !**/*.png
  • green.ico is excluded by !**/*.ico
  • green.png is excluded by !**/*.png
  • internal/service/assets/error.png is excluded by !**/*.png
  • internal/service/assets/logo.png is excluded by !**/*.png
  • internal/service/assets/synced.png is excluded by !**/*.png
  • internal/service/assets/syncing.png is excluded by !**/*.png
  • internal/service/assets/warning.png is excluded by !**/*.png
  • local_systray/example/icon/icon.png is excluded by !**/*.png
  • local_systray/example/icon/iconwin.ico is excluded by !**/*.ico
  • local_systray/example/screenshot.png is excluded by !**/*.png
  • local_systray/go.sum is excluded by !**/*.sum
  • red.ico is excluded by !**/*.ico
  • red.png is excluded by !**/*.png
📒 Files selected for processing (59)
  • .gitignore
  • README.md
  • build.ps1
  • cmd/gcrypt/main.go
  • cmd/gcrypt/opengl_other.go
  • cmd/gcrypt/opengl_windows.go
  • encode_icons.go
  • gen_icons.go
  • gen_output.txt
  • go.mod
  • install-mesa.ps1
  • internal/config/config.go
  • internal/config/config_test.go
  • internal/crypto/crypto.go
  • internal/crypto/crypto_test.go
  • internal/drive/auth.go
  • internal/drive/client.go
  • internal/models/models.go
  • internal/service/appcontroller.go
  • internal/service/autostart.go
  • internal/service/fyneui.go
  • internal/service/fyneui_activity.go
  • internal/service/fyneui_settings.go
  • internal/service/logger.go
  • internal/service/logger_test.go
  • internal/service/syncpair.go
  • internal/service/tray.go
  • internal/sync/engine.go
  • internal/sync/manager.go
  • local_systray/.gitignore
  • local_systray/LICENSE
  • local_systray/Makefile
  • local_systray/README.md
  • local_systray/example/icon/iconunix.go
  • local_systray/example/icon/iconwin.go
  • local_systray/example/icon/make_icon.bat
  • local_systray/example/icon/make_icon.sh
  • local_systray/example/main.go
  • local_systray/go.mod
  • local_systray/systray.go
  • local_systray/systray.h
  • local_systray/systray_darwin.go
  • local_systray/systray_darwin.m
  • local_systray/systray_linux.c
  • local_systray/systray_linux.go
  • local_systray/systray_linux_appindicator.go
  • local_systray/systray_linux_ayatana.go
  • local_systray/systray_nonwindows.go
  • local_systray/systray_windows.go
  • local_systray/systray_windows_test.go
  • local_systray/webview_example/example.manifest
  • local_systray/webview_example/main.go
  • local_systray/webview_example/webview.h
  • local_systray/webview_example/webview_darwin.m
  • local_systray/webview_example/webview_linux.c
  • local_systray/webview_example/webview_nonwindows.go
  • local_systray/webview_example/webview_windows.go
  • temp_clone
  • tools/gccwrap/main.go
 _______________________________
< I turn WTF moments into TILs. >
 -------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 17a560d7-7b05-4a04-bdcf-849fc7b8c5cb

📥 Commits

Reviewing files that changed from the base of the PR and between 9b8f70b and adc4c12.

⛔ Files ignored due to path filters (23)
  • blue.ico is excluded by !**/*.ico
  • blue.png is excluded by !**/*.png
  • branding/error.png is excluded by !**/*.png
  • branding/logo.png is excluded by !**/*.png
  • branding/synced.png is excluded by !**/*.png
  • branding/syncing.png is excluded by !**/*.png
  • branding/warning.png is excluded by !**/*.png
  • go.sum is excluded by !**/*.sum
  • gray.ico is excluded by !**/*.ico
  • gray.png is excluded by !**/*.png
  • green.ico is excluded by !**/*.ico
  • green.png is excluded by !**/*.png
  • internal/service/assets/error.png is excluded by !**/*.png
  • internal/service/assets/logo.png is excluded by !**/*.png
  • internal/service/assets/synced.png is excluded by !**/*.png
  • internal/service/assets/syncing.png is excluded by !**/*.png
  • internal/service/assets/warning.png is excluded by !**/*.png
  • local_systray/example/icon/icon.png is excluded by !**/*.png
  • local_systray/example/icon/iconwin.ico is excluded by !**/*.ico
  • local_systray/example/screenshot.png is excluded by !**/*.png
  • local_systray/go.sum is excluded by !**/*.sum
  • red.ico is excluded by !**/*.ico
  • red.png is excluded by !**/*.png
📒 Files selected for processing (59)
  • .gitignore
  • README.md
  • build.ps1
  • cmd/gcrypt/main.go
  • cmd/gcrypt/opengl_other.go
  • cmd/gcrypt/opengl_windows.go
  • encode_icons.go
  • gen_icons.go
  • gen_output.txt
  • go.mod
  • install-mesa.ps1
  • internal/config/config.go
  • internal/config/config_test.go
  • internal/crypto/crypto.go
  • internal/crypto/crypto_test.go
  • internal/drive/auth.go
  • internal/drive/client.go
  • internal/models/models.go
  • internal/service/appcontroller.go
  • internal/service/autostart.go
  • internal/service/fyneui.go
  • internal/service/fyneui_activity.go
  • internal/service/fyneui_settings.go
  • internal/service/logger.go
  • internal/service/logger_test.go
  • internal/service/syncpair.go
  • internal/service/tray.go
  • internal/sync/engine.go
  • internal/sync/manager.go
  • local_systray/.gitignore
  • local_systray/LICENSE
  • local_systray/Makefile
  • local_systray/README.md
  • local_systray/example/icon/iconunix.go
  • local_systray/example/icon/iconwin.go
  • local_systray/example/icon/make_icon.bat
  • local_systray/example/icon/make_icon.sh
  • local_systray/example/main.go
  • local_systray/go.mod
  • local_systray/systray.go
  • local_systray/systray.h
  • local_systray/systray_darwin.go
  • local_systray/systray_darwin.m
  • local_systray/systray_linux.c
  • local_systray/systray_linux.go
  • local_systray/systray_linux_appindicator.go
  • local_systray/systray_linux_ayatana.go
  • local_systray/systray_nonwindows.go
  • local_systray/systray_windows.go
  • local_systray/systray_windows_test.go
  • local_systray/webview_example/example.manifest
  • local_systray/webview_example/main.go
  • local_systray/webview_example/webview.h
  • local_systray/webview_example/webview_darwin.m
  • local_systray/webview_example/webview_linux.c
  • local_systray/webview_example/webview_nonwindows.go
  • local_systray/webview_example/webview_windows.go
  • temp_clone
  • tools/gccwrap/main.go

📝 Walkthrough

Walkthrough

Replaces the custom local_systray-based TrayApp with a full Fyne GUI (FyneApp) that owns both a window and system tray. Consolidates encryption to the v2 stream format only, removing legacy blob/file paths. Adds an activity feed, improved conflict resolution, and remote change detection to the sync engine. Introduces Windows Mesa OpenGL fallback logic and a GCC wrapper build tool. Removes the entire local_systray submodule.

Changes

gcrypt: Fyne GUI migration, crypto v2 consolidation, sync engine improvements

Layer / File(s) Summary
Crypto v2 consolidation
internal/models/models.go, internal/crypto/crypto.go, internal/crypto/crypto_test.go, internal/drive/auth.go, internal/drive/client.go
Removes CurrentVersion, EncryptFile/DecryptFile/EncryptBlob/DecryptBlob, and legacy v1 DecryptStream. Adds EncryptBytes/DecryptBytes wrappers over the v2 stream API. DeserializeHeader now accepts only CurrentStreamVersion. drive/auth.go token and client-secret storage updated to use bytes API; default ClientID/ClientSecret constants and GetTokenFromWeb removed. Tests added for stream round-trip, tamper detection, and bytes API.
Sync engine: activity feed, conflict resolution, remote change detection
internal/sync/engine.go, internal/sync/manager.go
Adds ActivityKind/ActivityEvent types and a bounded per-engine ring buffer with Engine.RecentEvents. Rewrites resolveConflict to use local hash comparison and last-write-wins with a timestamped streamed backup. Adds remote MD5 change detection enqueuing OpTypeConflict. Floors poll interval at 5 s, skips redundant uploads on hash match. SyncManager.RecentActivity aggregates across engines. StopAll uses sync.Once; AddPair starts engines asynchronously.
Logger: level filtering, stderr output, rotation fix
internal/service/logger.go, internal/service/logger_test.go
Adds minLevel field and SetLevel with case-insensitive severity mapping; messages below level are dropped early. Switches non-file output to os.Stderr. Reworks rotate() backup rename-shift. Defaults to INFO. Tests cover rotation off-by-one and level filtering.
Config, AppController lifecycle, autostart path quoting
internal/config/config.go, internal/config/config_test.go, internal/service/appcontroller.go, internal/service/autostart.go
Removes StartMinimized from AppConfig. StartSync tears down the prior SyncManager and metadata store before creating a new session. resolveOAuthCredentials prompts for re-entry on decryption failure and re-encrypts with the current master key. EnableAutoStart wraps the executable path in double quotes for the registry value.
Fyne GUI: FyneApp, activity feed, settings, and folders tabs
internal/service/fyneui.go, internal/service/fyneui_activity.go, internal/service/fyneui_settings.go, internal/service/syncpair.go
Adds FyneApp with embedded PNG icons, status-dot colors, and appstate.State-to-icon/color helpers. Window contains header, CTA button, Activity/Folders/Settings tabs, and footer toolbar. Tray menu wires open-window, sync-all, pause/resume-all, open-folder, view-log, and quit. 2 s periodic refresh with exponential transfer-rate smoothing. Activity feed renders glyph/verb/relative-time rows. Settings tab wires all config knobs with immediate persistence. Folders tab renders per-pair cards with pause/resume, sync-now, open, and remove actions. syncpair.go adds display-name and state-label helpers.
Windows OpenGL/Mesa fallback and build toolchain
cmd/gcrypt/opengl_windows.go, cmd/gcrypt/opengl_other.go, install-mesa.ps1, tools/gccwrap/main.go, build.ps1, go.mod
opengl_windows.go adds RDP detection, in-process WGL pixel-format probe, Mesa DLL staging from a bundled mesa/ directory, and process re-launch with Mesa env vars. opengl_other.go adds non-Windows no-op stubs. install-mesa.ps1 downloads Mesa from GitHub Releases via 7-Zip and stages opengl32.dll/libgallium_wgl.dll. gccwrap strips -Qunused-arguments before invoking real gcc. build.ps1 auto-builds gccwrap and sets CC/CGO_ENABLED. go.mod adds fyne.io/fyne/v2, x/sync; removes local_systray replace directive and getlantern/* entries.
Entrypoint wiring, TrayApp removal, docs and ignore
cmd/gcrypt/main.go, internal/service/tray.go, encode_icons.go, gen_icons.go, gen_output.txt, README.md, .gitignore, temp_clone
main.go routes stdlib log to the app writer, applies config log settings, calls ensureWorkingOpenGL (may exit early), then runs service.NewFyneApp instead of TrayApp. tray.go content removed (1 872 lines). Icon generator programs and generated output removed. README.md updated with Fyne build prerequisites, Google Drive API Setup guide, state-to-icon table, OpenGL troubleshooting, and version bump to v0.1. .gitignore adds .secrets, *.txt, gcrypt.exe, gccwrap.exe.

Sequence Diagram(s)

sequenceDiagram
  participant main
  participant ensureWorkingOpenGL
  participant FyneApp
  participant AppController
  participant SyncManager
  participant Engine

  main->>ensureWorkingOpenGL: check OpenGL (Windows only)
  alt Mesa re-launch needed
    ensureWorkingOpenGL-->>main: true (re-launched, exit)
  else OK
    ensureWorkingOpenGL-->>main: false
  end
  main->>FyneApp: NewFyneApp(ctrl, logger).Run()
  FyneApp->>AppController: StateChangedCh listener
  FyneApp->>FyneApp: refreshLoop() every 2s
  FyneApp->>AppController: GetState(), GetSyncStatus()
  AppController->>SyncManager: PairStatuses()
  FyneApp->>SyncManager: RecentActivity(limit)
  SyncManager->>Engine: RecentEvents(0) per engine
  Engine-->>SyncManager: []ActivityEvent
  SyncManager-->>FyneApp: merged sorted events
  FyneApp->>FyneApp: update window widgets + tray icon
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Poem

🐰 Hop, hop — the tray is gone, a window takes its place,
Fyne widgets bloom where systray lived, with status dots and grace.
The crypto shed its v1 skin, pure streams now guard each byte,
A Mesa trick fools RDP, soft-GL burns through the night.
GCC gets wrapped just right — the bunny builds with glee! 🎉

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch v0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant