From c16e80f507a3c95871721ed31532d1092054a9cd Mon Sep 17 00:00:00 2001 From: Sunshine Date: Mon, 2 Mar 2020 23:56:17 -0500 Subject: [PATCH] add Dockerfile --- .travis.yml | 39 +++++++++++++++++++++++---------------- Dockerfile | 18 ++++++++++++++++++ README.md | 11 +++++++++++ 3 files changed, 52 insertions(+), 16 deletions(-) create mode 100644 Dockerfile diff --git a/.travis.yml b/.travis.yml index e1e0129..2b6fb9a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,30 +1,37 @@ language: rust cache: cargo -sudo: false - os: - - linux - - osx - - windows +- linux +- osx +- windows rust: - - stable - - beta - - nightly +- stable +- beta +- nightly + +services: +- docker before_script: - - rustup component add rustfmt +- rustup component add rustfmt script: - - cargo build --all --locked --verbose - - cargo test --all --locked --verbose - - | - if [[ "$TRAVIS_RUST_VERSION" == "stable" ]]; then - cargo fmt --all -- --check - fi +- cargo build --all --locked --verbose +- cargo test --all --locked --verbose +- | + if [[ "$TRAVIS_RUST_VERSION" == "stable" ]]; then + cargo fmt --all -- --check + fi + +after_success: | + if [ "${TRAVIS_OS_NAME}" == linux ] && [ "${TRAVIS_RUST_VERSION}" == stable ]; then + docker build -t monolith . + docker run monolith monolith -V + fi jobs: allow_failures: - - rust: nightly + - rust: nightly fast_finish: true diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..244f839 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM rust + +WORKDIR /usr/local/src/ +RUN curl -s https://api.github.com/repos/y2z/monolith/releases/latest \ +| grep "tarball_url.*\"," \ +| cut -d '"' -f 4 \ +| wget -qi - -O monolith.tar.gz + +RUN tar xfz monolith.tar.gz \ +&& mv Y2Z-monolith-* monolith \ +&& rm monolith.tar.gz + +WORKDIR /usr/local/src/monolith +RUN ls -a +RUN make install + +WORKDIR /tmp +CMD ["/usr/local/cargo/bin/monolith"] diff --git a/README.md b/README.md index d349cef..3beb787 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ Unlike the conventional "Save page as", `monolith` not only saves the target doc If compared to saving websites with `wget -mpk`, this tool embeds all assets as data URLs and therefore lets browsers render the saved page exactly the way it was on the Internet, even when no network connection is available. + ## Installation ### From source @@ -30,9 +31,14 @@ If compared to saving websites with `wget -mpk`, this tool embeds all assets as ### Using Snapcraft (on GNU/Linux) $ snap install monolith +### Via Docker +The guide can be found [here](https://github.com/Y2Z/monolith/wiki/Using-containers) + + ## Usage $ monolith https://lyrics.github.io/db/P/Portishead/Dummy/Roads/ -o portishead-roads-lyrics.html + ## Options - `-c`: Ignore styles - `-f`: Exclude frames and iframes @@ -45,19 +51,24 @@ If compared to saving websites with `wget -mpk`, this tool embeds all assets as - `-t`: Set custom network request timeout - `-u`: Provide own User-Agent + ## HTTPS and HTTP proxies Please set `https_proxy`, `http_proxy`, and `no_proxy` environment variables. + ## Contributing Please open an issue if something is wrong, that helps make this project better. + ## Related projects - `Monolith Chrome Extension`: https://github.com/rhysd/monolith-of-web - `Pagesaver`: https://github.com/distributed-mind/pagesaver - `Personal WayBack Machine`: https://github.com/popey/pwbm + ## License The Unlicense + Keep in mind that `monolith` is not aware of your browser's session