Add RTORRENT_SCGI variable for use scgi port (#158)

* Feature(rtorrent-flood) : Add RTORRENT_SCGI variable for use scgi port

* Fix rtorrent-flood
This commit is contained in:
xataz 2017-03-22 16:04:34 +01:00 committed by Wonderfall
parent 3b8e2be84c
commit 74befe2cc4
3 changed files with 7 additions and 0 deletions

View File

@ -9,6 +9,7 @@ ARG BUILD_CORES
ENV UID=991 GID=991 \
FLOOD_SECRET=supersecret \
CONTEXT_PATH=/ \
RTORRENT_SCGI=0 \
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
RUN NB_CORES=${BUILD_CORES-`getconf _NPROCESSORS_CONF`} \

View File

@ -21,6 +21,7 @@
- **GID** : group id (defaut : 991)
- **FLOOD_SECRET** : flood secret key (defaut : mysupersecretkey) (CHANGE IT)
- **CONTEXT_PATH** : context path (base_URI) (default : /)
- **RTORRENT_SCGI** : SCGI port (default : 0 for use local socket)
- **PKG_CONFIG_PATH** : `/usr/local/lib/pkgconfig` (don't touch)
#### Ports

View File

@ -15,4 +15,9 @@ rm -f /data/.session/rtorrent.lock
mv /usr/flood /usr/fix && mv /usr/fix /usr/flood # fix strange bug
chown -R $UID:$GID /data /home/torrent /tmp /filebot /usr/flood /flood-db /etc/s6.d
if [ ${RTORRENT_SCGI} -ne 0 ]; then
sed -i -e 's|^scgi_local.*$|scgi_port = 0.0.0.0:'${RTORRENT_SCGI}'|' /home/torrent/.rtorrent.rc
sed -i -e 's|socket: true,|socket: false,|' -e 's|port: 5000,|port: '${RTORRENT_SCGI}',|' /usr/flood/config.js
fi
exec su-exec $GID:$UID /bin/s6-svscan /etc/s6.d