initial commit

This commit is contained in:
fake 2020-05-14 18:04:52 -07:00
commit aa0e672a2a
3 changed files with 78 additions and 0 deletions

8
Dockerfile Normal file
View File

@ -0,0 +1,8 @@
FROM python:2
COPY build.sh /build.sh
RUN bash /build.sh
ENTRYPOINT deluged && deluge-web --fork && bash

22
README.md Normal file
View File

@ -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 <https://docs.docker.com/engine/install/>)
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.

48
build.sh Executable file
View File

@ -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