From 9ab21e1cb7ad2d3f2325dc5ca819dce13b427907 Mon Sep 17 00:00:00 2001 From: Drew Short Date: Mon, 25 May 2020 22:32:08 -0500 Subject: [PATCH] Added a Dockerfile and example configs --- .dockerignore | 7 +++++++ Dockerfile | 14 ++++++++++++++ README.md | 19 +++++++++++++++++++ config.json.example | 3 +++ state.json.example | 3 +++ 5 files changed, 46 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 config.json.example create mode 100644 state.json.example diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..baf3498 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +.git/ +target/ +tmp/ +*.json +*.md +*.abbj +*.example \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7542b45 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM rust:1.43.1-slim-stretch as build +COPY . /project +WORKDIR /project +RUN apt-get update \ + && apt-get install -y pkg-config libssl-dev curl +RUN cargo build --release + +FROM debian:stretch-slim +RUN apt-get update \ + && apt-get install -y curl \ + && rm -rf /var/lib/apt/lists/* +COPY --from=build /project/target/release/animebox-sync /usr/bin/animebox-sync +WORKDIR /app +CMD ["animebox-sync", "backup.abbj", "download"] \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..80cb2fb --- /dev/null +++ b/README.md @@ -0,0 +1,19 @@ +# AnimeBox Sync + +A tool to read AnimeBox backup files and download the favorited files + +## Usage + +### Docker + +To download all favorites from a backup file. + +```bash +docker run -v :/app/backup.abbj -v :/app/tmp/ -v :/app/state.json sothr/animebox-sync:latest +``` + +To list all searches from a backup file. + +```bash +docker run -v :/app/backup.abbj sothr/animebox-sync:latest animebox-sync backup.abbj searches +``` \ No newline at end of file diff --git a/config.json.example b/config.json.example new file mode 100644 index 0000000..964f975 --- /dev/null +++ b/config.json.example @@ -0,0 +1,3 @@ +{ + "save_directory": "tmp" +} \ No newline at end of file diff --git a/state.json.example b/state.json.example new file mode 100644 index 0000000..dcc10ca --- /dev/null +++ b/state.json.example @@ -0,0 +1,3 @@ +{ + "downloaded": [] +} \ No newline at end of file