Now it's webby

This commit is contained in:
James May 2021-04-26 01:29:16 +02:00
parent a651af63df
commit a26599d4eb
5 changed files with 87 additions and 16 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
config
downloads

32
README.md Normal file
View File

@ -0,0 +1,32 @@
# Intro
Running a gtk-gnutella instance in docker, build from latest source and accessible via IPC-socket over SOCAT (see usage) or VNC.
# Usage
Make sure **all** mounted volumes under `/app` are owned by `1000:1000`.
## VNC
You can conenct and control your instance via given VNC port and password in `docker-compose.yml`.
## NoVNC
You can also access the VNC Interface via NoVNC WebInterface on port 5800
## IPC over `socat`
You connect to the gtk-gnutella daemon via IPC over TCP. You need to have socat and gtk-gnutella on your client too.
1.:
```
sudo socat UNIX-LISTEN:/home/user/local.socket,fork TCP-CONNECT:<REMOTE_HOST>:8089
```
2.:
```
gtk-gnutella --shell /home/user/local.socket
```
## Notes
In both cases I strongly recommend using a VPN and not running either VNC or IPC over the internet. Especially the "IPC over socat" hack is truly dangerous when listening on outward facing interfaces since there is no protection at all.

View File

@ -3,11 +3,21 @@ services:
gnutella-server:
build: docker
environment:
VNC_PASSWORD: "23eris42"
SOCAT_PORT: 1337
ENABLE_SOCAT_TUNNEL: "FALSE"
HEADLESS: "FALSE"
DISPLAY_HEIGHT: 900
DISPLAY_WIDTH: 1440
ports:
- "22271:22271/tcp"
- "5903:5900/tcp"
- "22271:22271/udp"
- "192.168.5.26:5903:5900/tcp"
- "192.168.5.26:5800:5800/tcp"
# - "192.168.5.26:1337:1337/tcp"
volumes:
- ./downloads:/home/nya/gtl-gnutella-downloads
- ./config:/home/nya/.gtk-gnutella/
- ./downloads:/app/gtk-gnutella/downloads
- ./config:/app/.gtk-gnutella/
container_name: gnutella_server
#restart: always

View File

@ -1,5 +1,28 @@
FROM debian:unstable-slim
RUN apt update && apt-get -y install wget unzip bash make gcc glibc-source gtk+2.0 gtk+2.0-dev zlib1g zlib1g-dev libgnutls28-dev xvfb x11vnc && rm -rf /var/lib/apt/lists/*
FROM jlesage/baseimage-gui:debian-10
ENV APP_NAME="Gnutella"
RUN \
APP_ICON_URL=https://upload.wikimedia.org/wikipedia/commons/thumb/c/cc/Gtk-gnutella.svg/600px-Gtk-gnutella.svg.png && \
install_app_icon.sh "$APP_ICON_URL"
RUN \
apt update && \
apt-get -y --no-install-recommends install \
socat \
wget \
unzip \
bash \
make \
gcc \
xterm \
glibc-source \
gettext \
gtk+2.0 gtk+2.0-dev \
zlib1g zlib1g-dev \
libgnutls28-dev && \
rm -rf /var/cache/apt/archives/*
RUN mkdir /app; \
wget -O /app/src.zip https://codeload.github.com/gtk-gnutella/gtk-gnutella/zip/master; \
cd /app && \
@ -7,7 +30,7 @@ RUN mkdir /app; \
cd gtk-gnutella-master && \
./build.sh --cc=gcc --gtk2 --disable-dbus && \
make install
ADD docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh && useradd -m -u 1010 nya
USER nya
ENTRYPOINT ["/docker-entrypoint.sh"]
RUN chown 1000:1000 /app
COPY docker-entrypoint.sh /startapp.sh

18
docker/docker-entrypoint.sh Normal file → Executable file
View File

@ -1,9 +1,13 @@
#!/bin/bash
#
Xvfb :99 -screen 0 1650x1050x24 &
x11vnc -display :99 -rfbport 5900 -rfbportv6 -1 -no6 -noipv6 -httpportv6 -1 -forever -desktop Gnutella-Gtk -cursor arrow -shared -passwd 23eris42 &
sleep 5
export DISPLAY=:99.0
export XAUTHORITY=~/.Xauthority
gtk-gnutella --geometry 1650x1050
export HOME=/app
if [ "${ENABLE_SOCAT_TUNNEL}" = "TRUE" ]; then
socat TCP-LISTEN:${SOCAT_PORT},fork UNIX-CONNECT:/home/nya/.gtk-gnutella/ipc/socket &
fi
if [ "${HEADLESS}" = "TRUE" ]; then
gtk-gnutella --topless --log-stderr /dev/null --log-stdout /dev/null
else
echo "nyanya"
gtk-gnutella --geometry ${DISPLAY_WIDTH}x${DISPLAY_HEIGHT} --log-stderr /dev/null --log-stdout /dev/null
sleep 2323;
fi