From d85c880d23eb6cfe0cb9fcb34d43a12e7cd89625 Mon Sep 17 00:00:00 2001 From: adampweb Date: Fri, 9 May 2025 18:32:47 +0200 Subject: [PATCH 1/3] Vulnerablity fix: Updates Ruby version to address vulnerability Updates the Ruby version in the Dockerfile to the latest stable release in the 3.x series to address identified vulnerabilities. Details: https://hub.docker.com/layers/library/ruby/3.1.6-alpine/images/sha256-7ff1261ca74033c38e86b04e30a6078567ec17e59d465d96250665897fb52180 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f59e11b..167dd11 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:3.1.6-alpine +FROM ruby:3.4.3-alpine USER root WORKDIR /build COPY . /build From 99a6de981e6e7f4a4d4e0998eba8e179b211ed1d Mon Sep 17 00:00:00 2001 From: adampweb Date: Fri, 9 May 2025 19:38:39 +0200 Subject: [PATCH 2/3] Env. vars: set default values and related docs --- README.md | 22 ++++++++++++++++++++++ docker-compose.yml | 4 +++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bf9c8e2..65cf4ab 100644 --- a/README.md +++ b/README.md @@ -74,9 +74,31 @@ services: tty: true image: wayback_machine_downloader:latest container_name: wayback_machine_downloader + environment: + - ENVIRONMENT=${ENVIRONMENT:-development} + - OPTIONS=${OPTIONS:-""} + - TARGET_URL=${TARGET_URL} volumes: - .:/build:rw - ./websites:/build/websites:rw + command: --directory /build/websites ${OPTIONS} ${TARGET_URL} +``` +#### Usage: +Now You can create a Docker image as named "wayback_machine_downloader" with the following command: +```bash +docker compose up -d --build +``` + +After that you must set TARGET_URL environment variable: +```bash +export TARGET_URL="https://example.com/" +``` + +The **OPTIONS** env. variable is optional this may include additional settings which are found in the "**Advanced usage**" section below. + +Example: +```bash +export OPTIONS="--list -f 20060121" ``` ## ⚙️ Configuration diff --git a/docker-compose.yml b/docker-compose.yml index 053a11b..c2092b0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,9 @@ services: image: wayback_machine_downloader:latest container_name: wayback_machine_downloader environment: - - ENVIRONMENT=${ENVIRONMENT} + - DEVELOPMENT=${DEVELOPMENT:-production} + - OPTIONS=${OPTIONS:-""} + - TARGET_URL=${TARGET_URL} volumes: - .:/build:rw - ./websites:/build/websites:rw From 543161d7fb1c73ac153850ec01126f062fd29d21 Mon Sep 17 00:00:00 2001 From: adampweb Date: Fri, 9 May 2025 19:54:15 +0200 Subject: [PATCH 3/3] Supplement of docs --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 65cf4ab..e810875 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,11 @@ Example: export OPTIONS="--list -f 20060121" ``` +After that you can run the exists container with the following command: +```bash +docker compose run --rm wayback_machine_downloader https://example.com +``` + ## ⚙️ Configuration There are a few constants that can be edited in the `wayback_machine_downloader.rb` file for your convenience. The default values may be conservative, so you can adjust them to your needs. They are: