Skip to content

Commit

Permalink
Improve commands for container-based usage
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyates committed Oct 14, 2024
1 parent 6362873 commit 0a52178
Showing 1 changed file with 45 additions and 8 deletions.
53 changes: 45 additions & 8 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,41 @@ we'll use `./my-data` here.
If you have just one account, you can do as follows

```sh
docker run -v ./my-data:/data -ti ghcr.io/joeyates/imap-backup:latest \
imap-backup single backup \
docker run \
--volume ./my-data:/data \
--dns 8.8.8.8 \
--email me@example.com --password mysecret --server imap.example.com \
--path /data/me_example.com
ghcr.io/joeyates/imap-backup:latest \
imap-backup single backup \
--email me@example.com \
--password mysecret \
--server imap.example.com \
--path /data/me_example.com
```

Podman will work exactly the same.

Notes:

* If you're using Docker, add `--user $(id -u):$(id -g)` so that the files
created by the container are owned by you and not by root,
* Pass imap-backup the `--password-environment-variable=VARIABLE_NAME` or
`--password-file=FILE` option to avoid having your password in
the command line history:

docker run --env THE_PASSWORD=$THE_PASSWORD \
... \
imap-backup single backup \
--password-environment-variable=THE_PASSWORD \
...

or

docker run \
... \
imap-backup single backup \
--password-file=/data/password.txt \
...

If you have multiple accounts, you can create a configuration file.

You'll need to choose a path on your computer where your configuration will be saved,
Expand All @@ -63,16 +89,27 @@ we'll use `./my-config` here.
First, run the menu-driven setup program to configure your accounts

```sh
docker run -v ./my-config:/config -v ./my-data:/data -ti ghcr.io/joeyates/imap-backup:latest \
docker run \
--volume ./my-config:/config \
--volume ./my-data:/data \
--dns 8.8.8.8 \
imap-backup setup -c /config/imap-backup.json
--tty \
--interactive \
ghcr.io/joeyates/imap-backup:latest \
imap-backup setup \
--config /config/imap-backup.json
```

Then, run the backup

```sh
docker run -v ./my-config:/config -v ./my-data:/data --dns 8.8.8.8 -ti ghcr.io/joeyates/imap-backup:latest \
imap-backup backup -c /config/imap-backup.json
docker run \
--volume ./my-config:/config \
--volume ./my-data:/data \
--dns 8.8.8.8 \
ghcr.io/joeyates/imap-backup:latest \
imap-backup backup \
--config /config/imap-backup.json
```
</details>

Expand Down

0 comments on commit 0a52178

Please sign in to comment.