id = "gmvault" name = "Gmvault" homepage = "https://github.com/gaubert/gmvault" description = "Gmvault is a tool for backing up your gmail account and never lose email correspondence." # The Gmvault icon, from the installer artwork in the project's repository. icon = "https://raw.githubusercontent.com/gaubert/gmvault/master/etc/nsis-install/images/gmv-icon-256.png" executables = ["gmvault"] [dotfiles] # src/gmv/gmvault_utils.py, get_home_dir_path(): $GMVAULT_DIR, and with no such # variable "$HOME/.gmvault". The README says the same of the credential — # "the XOAuth token is stored in $HOME/.gmvault". # # There is nothing in that directory to sync as content. The one file that # looks like configuration, gmvault_defaults.conf, is generated rather than # authored: get_conf_filepath() rewrites it from gmvault_const.DEFAULT_CONF_FILE # whenever the file's conf_version is not in VERSIONS_TO_PRESERVE, which is # ['1.9'] while the shipped template declares conf_version=1.9.1 — so on # current gmvault the file is overwritten on essentially every run, and the # header inside it says "DO NOT CHANGE IT IF YOU ARE NOT AN ADVANCED USER". # Carrying it to another machine would achieve nothing. paths = [] exclude = [] # Everything else the directory holds is a credential, all of it from # src/gmv/credential_utils.py: # .oauth2 line 113, '%s/%s.oauth2' — JSON with access_token, # refresh_token, validity, access_creation, type # .passwd line 93, '%s/%s.passwd' — the Gmail password, Blowfish # encrypted; the README warns "your password will be stored # encrypted but please avoid using this option if possible" # token.sec line 64, SECRET_FILEPATH = '%s/token.sec' — the Blowfish # key that decrypts the .passwd file, so it is no less a # credential than the file it opens # The globs are because the first two are named after the account being backed # up, and one gmvault directory can hold several. secret = [ "~/.gmvault/*.oauth2", "~/.gmvault/*.passwd", "~/.gmvault/token.sec", ] # A CLI: it opens these files per run and does not hold them. side_effect = false [commands] format = 1 label = "Back up or restore Gmail" description = "Back up a Gmail account to a local database or restore one. Check and export are left out." quality = "ai-draft" parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false } [[commands.subcommand]] path = ["sync"] label = "Sync account" description = "Back up a Gmail account into the local database." [[commands.subcommand.source]] id = "src" kind = "help" url = "https://github.com/gaubert/gmvault/blob/master/src/gmv/gmv_cmd.py" evidence = """ sync_parser.add_argument('email', \ sync_parser.add_argument("-d", "--db-dir", \ sync_parser.add_argument("-y", "--oauth2", \ sync_parser.add_argument("-p", "--passwd", \ sync_parser.add_argument("--renew-oauth2-tok", \ sync_parser.add_argument("--emails-only", \ sync_parser.add_argument("--chats-only", \ sync_parser.add_argument("--debug", "-debug", \ sync_parser.add_argument('-t', '-type', '--type', \ help='type of synchronisation: full|quick|custom. (default: full)') """ [[commands.subcommand.field]] id = "email" label = "Gmail address" type = "string" position = 0 sources = ["src"] [[commands.subcommand.field]] id = "type" label = "Sync type" type = "enum" option = ['--type', '-t'] choices = [{ value = "full", label = "Full" }, { value = "quick", label = "Quick" }, { value = "custom", label = "Custom" }] sources = ["src"] [[commands.subcommand.field]] id = "db_dir" label = "Database directory" type = "path" option = ['--db-dir', '-d'] path = { kind = "directory", role = "output", must_exist = false } sources = ["src"] [[commands.subcommand.field]] id = "oauth2" label = "Use OAuth" type = "boolean" option = ['--oauth2', '-y'] sources = ["src"] [[commands.subcommand.field]] id = "passwd" label = "Interactive password" type = "boolean" option = ['--passwd', '-p'] sources = ["src"] [[commands.subcommand.field]] id = "renew_token" label = "Renew OAuth token" type = "boolean" option = ['--renew-oauth2-tok'] sources = ["src"] [[commands.subcommand.field]] id = "emails_only" label = "Emails only" type = "boolean" option = ['--emails-only'] sources = ["src"] [[commands.subcommand.field]] id = "chats_only" label = "Chats only" type = "boolean" option = ['--chats-only'] sources = ["src"] [[commands.subcommand.field]] id = "debug" label = "Debug" type = "boolean" option = ['--debug'] sources = ["src"] [[commands.subcommand.task]] id = "sync" label = "Sync account" fields = ["email", "type", "db_dir", "oauth2", "passwd", "renew_token", "emails_only", "chats_only", "debug"] required = ["email"] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["email", "type", "db_dir", "oauth2", "passwd", "renew_token", "emails_only", "chats_only", "debug"] [[commands.subcommand]] path = ["restore"] label = "Restore account" description = "Restore the local database into a Gmail account." [[commands.subcommand.source]] id = "src" kind = "help" url = "https://github.com/gaubert/gmvault/blob/master/src/gmv/gmv_cmd.py" evidence = """ rest_parser.add_argument('email', \ rest_parser.add_argument("-d", "--db-dir", \ rest_parser.add_argument("-y", "--oauth2", \ rest_parser.add_argument("-p", "--passwd", \ rest_parser.add_argument("--renew-oauth2-tok", \ rest_parser.add_argument("--emails-only", \ rest_parser.add_argument("--chats-only", \ rest_parser.add_argument("--debug", "-debug", \ rest_parser.add_argument('-t', '-type', '--type', \ help='type of restoration: full|quick. (default: full)') rest_parser.add_argument('-a', '--apply-label' , \ help='Apply a label to restored emails') """ [[commands.subcommand.field]] id = "email" label = "Gmail address" type = "string" position = 0 sources = ["src"] [[commands.subcommand.field]] id = "type" label = "Restore type" type = "enum" option = ['--type', '-t'] choices = [{ value = "full", label = "Full" }, { value = "quick", label = "Quick" }] sources = ["src"] [[commands.subcommand.field]] id = "apply_label" label = "Apply label" type = "string" option = ['--apply-label', '-a'] sources = ["src"] [[commands.subcommand.field]] id = "db_dir" label = "Database directory" type = "path" option = ['--db-dir', '-d'] path = { kind = "directory", role = "output", must_exist = false } sources = ["src"] [[commands.subcommand.field]] id = "oauth2" label = "Use OAuth" type = "boolean" option = ['--oauth2', '-y'] sources = ["src"] [[commands.subcommand.field]] id = "passwd" label = "Interactive password" type = "boolean" option = ['--passwd', '-p'] sources = ["src"] [[commands.subcommand.field]] id = "renew_token" label = "Renew OAuth token" type = "boolean" option = ['--renew-oauth2-tok'] sources = ["src"] [[commands.subcommand.field]] id = "emails_only" label = "Emails only" type = "boolean" option = ['--emails-only'] sources = ["src"] [[commands.subcommand.field]] id = "chats_only" label = "Chats only" type = "boolean" option = ['--chats-only'] sources = ["src"] [[commands.subcommand.field]] id = "debug" label = "Debug" type = "boolean" option = ['--debug'] sources = ["src"] [[commands.subcommand.task]] id = "restore" label = "Restore account" fields = ["email", "type", "apply_label", "db_dir", "oauth2", "passwd", "renew_token", "emails_only", "chats_only", "debug"] required = ["email"] [[commands.subcommand.group]] id = "basic" label = "Basic" fields = ["email", "type", "apply_label", "db_dir", "oauth2", "passwd", "renew_token", "emails_only", "chats_only", "debug"]