Working dockerization

This commit is contained in:
Andrew Davidson 2020-04-08 14:31:26 -04:00
parent 5658790edd
commit 0fed6f0c6e
Signed by: amd
GPG key ID: 17AF8F2A49CF25C6
4 changed files with 40 additions and 7 deletions

1
.dockerignore Normal file
View file

@ -0,0 +1 @@
archivist.yml

14
Dockerfile Normal file
View file

@ -0,0 +1,14 @@
FROM debian:stable
RUN apt-get update && apt-get install -y python3-pip && apt-get clean && pip3 install pipenv
VOLUME /backups
COPY . /archivist
WORKDIR /archivist
RUN pipenv install
CMD /archivist/bin/archivist.sh backup

View file

@ -12,7 +12,7 @@ if None != os.environ.get("XDG_CONFIG_HOME"):
config_locations.append(Path(os.environ.get("XDG_CONFIG_HOME")) / "archivist/archivist.yml") config_locations.append(Path(os.environ.get("XDG_CONFIG_HOME")) / "archivist/archivist.yml")
config_locations.append(Path.home() / ".config/archivist/archivist.yml") config_locations.append(Path.home() / ".config/archivist/archivist.yml")
config_locations.append(Path.home() / ".archivist.yml") config_locations.append(Path.home() / ".archivist.yml")
config_locations.append(Path("/etc/archivist.yml")) config_locations.append(Path("/etc/archivist/archivist.yml"))
got_config = False got_config = False
i = 0 i = 0

View file

@ -1,10 +1,24 @@
# Archivist # Archivist
The archivist is run from a either a central `archivist.py` script The archivist is run from a either a `archivist.py` script or a Docker container.
Running `./archivist.py` alone will back up all configured services. ## Script Use
Running `bin/archivist.sh` alone will back up all configured services.
You can also back up a single service by running `./archivist.py backup service` You can also back up a single service by running `bin/archivist.sh backup service`
## Docker Use
The docker container needs two volumes, one mounted wherever you store the backups and
the other at `/archivist/archivist.yml` for the config file.
Example:
```bash
docker run --rm \
-v /home/host-user/host_backup_dir:/backups \
-v /home/host-user/archivist_config.yml:/archivist/archivist.yml \
amdavidson/archivist
```
## Configuring the Archivist ## Configuring the Archivist
@ -19,6 +33,13 @@ services:
service_type: github service_type: github
backup_folder: /home/user/backups/github backup_folder: /home/user/backups/github
user: gh-user user: gh-user
token: 0xDEADBEEF
disable_repos: False
disable_gists: False
repo_backup_list:
- important-repository
gist_backup_list
- 1337
pinboard: pinboard:
name: "Pinboard" name: "Pinboard"
service_type: pinboard service_type: pinboard
@ -44,8 +65,5 @@ services:
### Service Notes ### Service Notes
#### Github
The Archivist only supports backups of a users public repositories and gists at this time. See [#2](https://github.com/amdavidson/archivist/issues/2).
#### IMAP Servers #### IMAP Servers
The Archivist is currently tested against Fastmail, other IMAP servers may present issues. Report an issue with any problesm you see. The Archivist is currently tested against Fastmail, other IMAP servers may present issues. Report an issue with any problesm you see.