Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about the usage of some env variables #11

Open
ovizii opened this issue May 11, 2023 · 6 comments
Open

Question about the usage of some env variables #11

ovizii opened this issue May 11, 2023 · 6 comments

Comments

@ovizii
Copy link

ovizii commented May 11, 2023

Does this look right inside my docker-compose.yml? Trying to use "-c no" so no emails will be deleted locally to create an email archive.

environment:
  - GMVAULT_OPTIONS="-c no --no-compression"

Is there an option to run a full sync with "-c yes" MANUALLY?

GMVAULT_SYNC_ON_STARTUP

What type of sync does this trigger? I assume it would do a "gmvault sync -t full" as that is the default?
EDIT: I tested it and the sync on startup is a quick sync.

GMVAULT_QUICK_SYNC_SCHEDULE and GMVAULT_FULL_SYNC_SCHEDULE

What variables/form can this take? (Answered my own question after looking at Dockerfile. It takes standard cron expressions.)

	GMVAULT_FULL_SYNC_SCHEDULE="1 3 * * 0" \
	GMVAULT_QUICK_SYNC_SCHEDULE="1 2 * * 1-6" \

If I don't want to automatically run GMVAULT_FULL_SYNC_SCHEDULE, is there a more elegant manner than setting it to 0 5 31 2 * “At 05:00 on day-of-month 31 in February.” which basically means never?

@ovizii
Copy link
Author

ovizii commented May 11, 2023

Here is my commented docker-compose.yml in case it helps anyone else.

version: '3.9'

services:

# https://github.com/guillaumeaubert/gmvault-docker

  gmvault:
    image: aubertg/gmvault-docker:latest
    container_name: gmvault
    hostname: gmvault
    tty: true
# tty: true is the equivalent of docker run -t 
    stdin_open: true
# stdin_open: true the equivalent of docker run -i but I am not sure if this is needed 
    networks:
      - gmvault
    volumes:
      - ./ssmtp.conf:/etc/ssmtp/ssmtp.conf
      - /path/to/store/Email-archive:/data
    restart: "no"
    environment:
      - GMVAULT_UID=1000
      - GMVAULT_GID=1000
      - [email protected]
      - [email protected]
      - GMVAULT_TIMEZONE=Europe/Berlin
      - GMVAULT_OPTIONS=-c no --no-compression
# -c no does not deleted local emails when they have been deleted from Gmail, compression is unnecessary as ZFS does that already for me
      - GMVAULT_SYNC_ON_STARTUP=yes
# does a quick sync on startup
      - GMVAULT_QUICK_SYNC_SCHEDULE=1 2 2-31 * *
# at 02:01 on every day except the 1st of every month - quick sync only goes back the last 7 days
      - GMVAULT_FULL_SYNC_SCHEDULE=1 3 1 * *
# at 03:01 on the first day of the month - full sync goes through the full mailbox
    cpus: 1
    mem_limit: 1G
# cpu and mem limits seem enough for gmvault
networks:
  gmvault:
    external: true
    name: gmvault

@ovizii
Copy link
Author

ovizii commented May 11, 2023

If and when I would like to propagate deletions from Gmail to my local archive , I can run this command which runs a full sync WITH the "-c yes" option:

docker exec -i gmvault /usr/bin/gmvault sync -t full -d /data --no-compression -c yes --oauth [email protected]

You could look at https://github.com/guillaumeaubert/gmvault-docker/blob/master/backup_full.sh if you'd like a report after this manual sync, but this might be a bit beyond me.

It might look a bit like:

docker exec -i gmvault /usr/bin/gmvault sync -t full -d /data --no-compression -c yes --oauth [email protected] 2>&1 | tee /data/[email protected]_full.log | mail -s "Mail Backup (full) | [email protected] | `date +'%Y-%m-%d %r %Z'`" [email protected]

@dasb00ter
Copy link

dasb00ter commented Jun 16, 2023

@ovizii Thanks for your docker compose file it helped me but running into auth problems with google. Could you maybe give me a hint on getting that done. The older method with oauth seems to be not working anymore although maybe you can fix it with a work around by setting up a python webserver, which I dont know how to do. Than there is a setting up an app password but not sure how this would be done in docker? Can you help a little

@ovizii
Copy link
Author

ovizii commented Jun 18, 2023

@ovizii Thanks for your docker compose file it helped me but running into auth problems with google. Could you maybe give me a hint on getting that done.

Unfortunately I can't remember. I remember that these instructions worked: http://gmvault.org/in_depth.html and when I followed this: gaubert/gmvault#335 (comment) I was all sorted.

Btw. I am running it on Linux, never needed any Gmail workaround nor anything python related outside these instructions.
The Gmail app password relates to using an app password for accessing it instead of the Gmail account password, that is totally unrelated to docker.

@dasb00ter
Copy link

dasb00ter commented Jun 19, 2023

Thanks for your response.
The one article refers to a Google security update from 12.08.2012. The other I followed but get the 400 forbidden in the browser from Google. The alternative is app password which isn't great.The image log still complains about oauth set up too which is included in emails... Which come to think of I haven't got since the first run. Not sure what you mean in terms of Linux. I would suppose the image is built in alpine and Its running on Linux based host for me. I think this image is just getting old and needs some updating our at least the instructions which is too bad considering all the pulls and the lack of alternatives. Still many thanks for your compose

@ovizii
Copy link
Author

ovizii commented Jun 20, 2023

Sorry, there might have been some confusion.

When I said:

Not sure what you mean in terms of Linux.

I was referring to your comment:
...although maybe you can fix it with a work around by setting up a python webserver

I wrongly assumed you might be working with docker on Windows or something as I haven't needed any workarounds. I only followed the two links I gave you and its working just fine. Sorry I can't contribute any more.

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

No branches or pull requests

2 participants