From aa0e672a2ab82521b2668846a930a83f95a7db57 Mon Sep 17 00:00:00 2001 From: fake Date: Thu, 14 May 2020 18:04:52 -0700 Subject: [PATCH] initial commit --- Dockerfile | 8 ++++++++ README.md | 22 ++++++++++++++++++++++ build.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 Dockerfile create mode 100644 README.md create mode 100755 build.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..cf77b3b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ + +FROM python:2 + +COPY build.sh /build.sh + +RUN bash /build.sh + +ENTRYPOINT deluged && deluge-web --fork && bash diff --git a/README.md b/README.md new file mode 100644 index 0000000..c255282 --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +# Premiere Deluge Docker + +This helps build the premiere Deluge plugin and libtorrent inside of a Docker container. +To read more about what premiere mode does, see below. + +--- +#### How to install +1. Install Docker (instructions here ) +2. Run `docker build . -t premiere-deluge` in the same directory as this repo's Dockerfile +3. Run `docker run --network host -it premiere-deluge` or `docker run -p 8112:8112 -it premiere-deluge` +4. You should be able to connect to the web UI running locally on port 8112 +5. Default password is "deluge" +6. Right click torrents and select "Premiere Mode" to put them in premiere mode + +#### What is "Premiere Mode"? +Setting a torrent to premiere mode causes all of its pieces to become +unavailble to peers except the first piece. After all peers in the swarm +have completely downloaded the first piece, the second piece gets announced +as available and peers may download it. This continues on until the last piece. + +This plugin requires a forked version of libtorrent that supports setting pieces +into premiere mode. diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..0002542 --- /dev/null +++ b/build.sh @@ -0,0 +1,48 @@ + +set -ex + +git clone https://git.fuwafuwa.moe/premiere/premiere-libtorrent.git --depth=1 +git clone https://git.fuwafuwa.moe/premiere/premiere-deluge-plugin.git --depth=1 +git clone https://github.com/deluge-torrent/deluge.git +git clone https://github.com/boostorg/boost.git --depth=1 --branch=boost-1.72.0 + +apt update +apt install build-essential libssl-dev -y + +pushd boost +export BOOST_ROOT=$PWD +git submodule update --init --depth=1 +./bootstrap.sh +./b2 cxxstd=11 release install --with-python --with-system +pushd tools/build +./bootstrap.sh +./b2 install --prefix=/usr/ +ln -s /usr/local/lib/libboost_python27.so /usr/local/lib/libboost_python.so +export PATH=$BOOST_ROOT:$PATH +popd +popd + +pushd premiere-libtorrent +git submodule update --init --recursive +b2 toolset=gcc link=shared variant=release target-os=linux address-model=64 crypto=openssl +cp bin/gcc-*/release/address-model-64/crypto-openssl/threading-multi/libtorrent.so* /usr/local/lib +ldconfig +pushd bindings/python/ +b2 toolset=gcc link=shared variant=release target-os=linux address-model=64 libtorrent-link=shared +cp bin/gcc*/release/address-model-64/lt-visibility-hidden/python-2.7/libtorrent.so /usr/local/lib/python2.7/site-packages +popd +popd + +pushd deluge +pip install . +popd + +deluged +sleep 3 +pkill -f deluged + +pushd premiere-deluge-plugin +python setup.py bdist_egg +cp dist/*.egg ~/.config/deluge/plugins +popd +