Personal software development project

Drive Backup Manager

Google Driveの必要なファイルやフォルダーをWindows PCへ安全に保存する、個人開発のWindowsデスクトップソフトウェアです。このサイトでは、利用方法だけでなく、設計・実装技術・セキュリティ・開発状況・ビルド方針を公開しています。

Developer-facing summary Drive Backup Manager is a personal Windows software development project. The application is being designed and maintained as a local-first backup utility, and this website documents the project's architecture, implementation choices, security model, build and release workflow, development status, and Google OAuth data handling.

Project overview

何を開発しているか

共有Google Driveの中から必要な対象だけを選び、Windows PCへ継続的にバックアップできる仕組みを開発しています。Google Drive側を変更せず、ローカル側で最新版と過去版を安全に管理することを重視しています。

Goal

選択対象だけを継続保存

ユーザーが指定したファイル・フォルダーを手動またはスケジュールでバックアップし、不要な全件コピーを避けます。

Local-first

Current / Versions

最新状態をCurrent、更新前の履歴をVersionsとしてローカルに分離し、復元時にもGoogle Driveを書き換えません。

Safety

読み取り専用のGoogle連携

Google Drive APIのread-only権限だけを使用し、クラウド側のファイル編集や削除を行わない設計です。

Architecture

アーキテクチャとデータフロー

バックアップ処理、状態管理、履歴保存、Windows自動実行を分離し、途中失敗や二重実行から復旧しやすい構成にしています。

Google Drive APIMetadata / file content / Changes API
Backup engineSelection / change detection / atomic write
Local storageCurrent / Versions

状態管理

SQLiteのbackup_state.dbで対象別の差分状態や履歴情報を保持し、大量ファイルでも必要な情報だけを参照します。

差分バックアップ

通常処理ではGoogle Drive Changes APIを利用し、必要に応じて完全走査へフォールバックするハイブリッド方式です。

安全な書き込み

ダウンロードや設定保存は一時ファイルからの原子的置換を使い、通信失敗時に壊れた途中ファイルを残しにくくしています。

Windows自動実行

定期バックアップはWindows Task Scheduler、軽量な状態確認や手動実行は通知領域プロセスが担当します。

Implementation

実装技術

ApplicationPython desktop application
DistributionPyInstaller onedir / Windows installer
State storageSQLite
SchedulingWindows Task Scheduler
Credential protectionWindows DPAPI
Cloud APIGoogle Drive API / Changes API
OAuth scopedrive.readonly

Development status

現在の開発状況

Implemented

実装済み

  • Google Drive接続と対象選択
  • Current / Versions バックアップ履歴
  • Changes APIを用いた差分バックアップ
  • SQLite状態管理とデータ移行
  • プロセス間ロックと原子的ファイル更新
  • Task Schedulerによる定期実行
  • Fast / Release / Clean ビルドフロー
Current work

現在の作業

  • Google OAuth本番公開に向けた公開サイト整備
  • HTTPSカスタムドメインの確立
  • 実環境でのOAuth・バックアップE2E確認
  • 公開前のセキュリティ・配布確認
Next

今後の改善

  • Production Authenticode署名環境の整備
  • 実端末でのSetup / Update / Uninstall検証
  • 実Driveデータを用いた長期運用検証
  • バックアップ性能と復旧性の継続改善

Security design

セキュリティ設計

OAuthトークン保護

認証情報は現在のWindowsユーザープロファイル配下に保存し、Windows DPAPIで保護します。

秘密情報を配布物から分離

アクセストークン、リフレッシュトークン、秘密鍵などをソースや公開サイトへ含めない運用を行います。

二重実行を防止

手動・自動・通知領域からのバックアップが競合しないよう、プロセス間ロックを共有します。

Build & release

開発・リリース運用

開発では共通のAppDevelopmentStandardに従い、変更をブランチとPull Requestで管理し、検証を通過してから統合する方針です。

Branch→Pull Request→Standard Check→Build validation→Merge

Fast Build

日常の変更確認用。通常はクリーンせず、増分ビルドとキャッシュを優先します。

Release Build

配布用成果物を生成します。Fastとユーザー向け機能を揃え、配布・署名検証を追加します。

Clean Rebuild

キャッシュ異常や原因不明のビルド問題を切り分ける場合だけ使用します。

Google OAuth & privacy

Googleユーザーデータの利用

読み取り専用で、バックアップに必要な範囲だけ利用します。 Drive Backup Managerは https://www.googleapis.com/auth/drive.readonly を使用し、Google Drive上のファイル・フォルダーのメタデータと内容を、ユーザーが設定したローカルバックアップを作成する目的で読み取ります。アプリがGoogle Drive上のファイルを編集・削除することはありません。

Developer serverへの保存なし

バックアップ対象のGoogle Driveデータを、開発者が運営するサーバーへ転送・保管する仕組みはありません。

ローカル保護

バックアップ本体・状態DB・認証情報はユーザー自身のWindows環境で管理されます。

販売・広告利用なし

Googleユーザーデータを販売、広告配信、広告プロファイリングのために利用しません。

English technical summary

Software development project overview

Drive Backup Manager is an actively developed personal Windows desktop software project for backing up selected Google Drive files and folders to local storage.

The implementation uses Python, PyInstaller, SQLite, Windows Task Scheduler, Windows DPAPI, and the Google Drive API. Incremental backups use the Drive Changes API with a full-scan fallback. Local history is separated into Current and Versions, and backup writes are designed to be atomic and protected against concurrent execution.

The development workflow separates Fast, Release, and Clean builds and uses branch / pull-request validation before changes are integrated. The current productionization work focuses on OAuth publication, HTTPS domain setup, real-device end-to-end testing, and release signing readiness.