Giter VIP home page Giter VIP logo

gwbackupy's People

Contributors

kamarton avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

kenzokai

gwbackupy's Issues

web interface for stored item listing

A web interface where user can easily view the locally stored items. Probably this will be included in a separate package, because it is not necessarily part of this CLI project.

restore missing messages (gmail)

If the backup is not run before, then has not yet marked the missing emails as deleted.

Currently, missing messages can only be restored after running a backup.

gmail: deleted email storing forever problem

Stores mails indefinitely. This is unnecessary in the case of spam or larger letters or other cases.

  • Storage management e.g. remove those older than 30 days, remove based on label.
  • While syncing e.g. remove emails older than 30 days.

SA not working

Describe the bug
I did the SA account JSON key on a paid account as written. It doesn't work.

To Reproduce
Steps to reproduce the behavior:

Run

gwbackupy --service-account-key-filepath sa.json gmail backup --email [email protected]
INFO 2023-08-08 13:33:10,814 - Starting backup for [email protected]
INFO 2023-08-08 13:33:10,814 - Scanning backup storage...
INFO 2023-08-08 13:33:10,814 - Stored items: 0
INFO 2023-08-08 13:33:10,814 - Backing up labels...
INFO 2023-08-08 13:33:10,814 - Getting labels from server ([email protected])
INFO 2023-08-08 13:33:10,816 - file_cache is only supported with oauth2client<4.0.0
INFO 2023-08-08 13:33:10,818 - Attempting refresh to obtain initial access_token
INFO 2023-08-08 13:33:10,820 - Refreshing access_token
INFO 2023-08-08 13:33:10,981 - Failed to retrieve access token: {
  "error": "unauthorized_client",
  "error_description": "Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested."
}

Desktop (please complete the following information):
Ubuntu Linux CLI

exception if cli started without parameters

$ gwbackupy
...
ERROR:root:CLI startup/run failed
Traceback (most recent call last):
  File "/home/smarton/.local/lib/python3.10/site-packages/gwbackupy/gwbackupy.py", line 161, in cli_startup
    args = parse_arguments()
  File "/home/smarton/.local/lib/python3.10/site-packages/gwbackupy/gwbackupy.py", line 137, in parse_arguments
    args = parser.parse_args(args=None if sys.argv[1:] else ["--help"])
  File "/usr/lib/python3.10/argparse.py", line 1838, in parse_args
    args, argv = self.parse_known_args(args, namespace)
  File "/usr/lib/python3.10/argparse.py", line 1871, in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
  File "/usr/lib/python3.10/argparse.py", line 2080, in _parse_known_args
    start_index = consume_optional(start_index)
  File "/usr/lib/python3.10/argparse.py", line 2020, in consume_optional
    take_action(action, args, option_string)
  File "/usr/lib/python3.10/argparse.py", line 1948, in take_action
    action(self, namespace, argument_values, option_string)
  File "/usr/lib/python3.10/argparse.py", line 1112, in __call__
    parser.exit()
  File "/usr/lib/python3.10/argparse.py", line 2582, in exit
    _sys.exit(status)
SystemExit: 0

args = parser.parse_args(args=None if sys.argv[1:] else ["--help"])

After OAuth authentication check email matches

Currently, it is easily possible that the browser starts in a different profile and the user approves it with another profile. The system does not check the email address thereafter, so another account is backed up.

More log

  • add tag for items (eg. gmail message id)
  • gmail local files scanning

Separated OAuth token storage

Currently, the service stores the tokens, so sharing them between several services is a problem in the future.

Tasks:

  • store tokens in common storage
  • scopes add incrementally to token

Service account setup doc

  • service account key file creation
  • Google Workspace wide application settings
  • free plan oauth screen and usage

Error if python 3.7 used

Debian uses python 3.7.2

$ gwbackupy
Traceback (most recent call last):
  File "/usr/local/bin/gwbackupy", line 3, in <module>
    from gwbackupy import gwbackupy_cli
  File "/usr/local/lib/python3.7/dist-packages/gwbackupy/[gwbackupy_cli.py](http://gwbackupy_cli.py/)", line 10, in <module>
    from gwbackupy.filters.gmail_filter import GmailFilter
  File "/usr/local/lib/python3.7/dist-packages/gwbackupy/filters/[gmail_filter.py](http://gmail_filter.py/)", line 7, in <module>
    from gwbackupy.storage.storage_interface import LinkInterface
  File "/usr/local/lib/python3.7/dist-packages/gwbackupy/storage/[storage_interface.py](http://storage_interface.py/)", line 53, in <module>
    LinkGroupBy = Callable[[LinkInterface], list[Union[str, int]]]
TypeError: 'type' object is not subscriptable

Can't restore to a different mailbox

Hi - I'm using the pip installed latest version on Ubuntu. i've just taken my first full backup and im trying to restore it to a different (new) gmail account. I've got the creds etc for both.

I'm attempting to do the restore using the following command:

gwbackupy --credentials-filepath restore-account-creds.json --workdir /mnt/gmail gmail restore --restore-deleted --email [email protected] --to-email [email protected]

I get the following output but nothing is restored.....am i doing something wrong?

thanks!

        INFO 2023-04-18 14:04:05,019 - Filter options: deleted
        INFO 2023-04-18 14:04:05,019 - Scanning backup storage...
        INFO 2023-04-18 14:04:10,497 - Stored items: 476545
        INFO 2023-04-18 14:04:10,497 - Loading labels...
        INFO 2023-04-18 14:04:10,695 - Labels loaded successfully (23)
        INFO 2023-04-18 14:04:10,695 - Getting labels from server ([email protected])
        INFO 2023-04-18 14:04:10,703 - file_cache is only supported with oauth2client<4.0.0
        INFO 2023-04-18 14:04:10,922 - Filtering messages...
        INFO 2023-04-18 14:04:12,848 - Number of potentially affected messages: 0
        INFO 2023-04-18 14:04:12,848 - Upload messages...
        INFO 2023-04-18 14:04:13,852 - Messages uploaded successfully

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.