├── .gitignore ├── dockerbomb └── Dockerfile ├── ledfx └── Dockerfile ├── mopidy-multiroom ├── README.md ├── docker-compose.yml └── mopidydata │ └── .gitignore ├── mopidy ├── Dockerfile ├── README.md ├── mopidy.conf └── mopidy.sh ├── offlineimap-ssl └── Dockerfile ├── sleep-snapcast └── Dockerfile ├── snapclient ├── Dockerfile └── README.md ├── snapserver ├── Dockerfile ├── Dockerfile.deb ├── Dockerfile.src ├── README.md ├── snapserver.conf └── startup.sh ├── tespeed └── Dockerfile.amd64 ├── uploadr ├── Dockerfile.amd64 ├── README.md └── server.py └── weechat └── Dockerfile.amd64 /.gitignore: -------------------------------------------------------------------------------- 1 | ledfx/ledfx 2 | -------------------------------------------------------------------------------- /dockerbomb/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM resin/rpi-raspbian:jessie 2 | 3 | RUN curl -sSL https://get.docker.com/ | sh 4 | RUN systemctl enable docker 5 | 6 | ENTRYPOINT ["docker","run","-it","--rm","ivdata/dockerbomb"] 7 | -------------------------------------------------------------------------------- /ledfx/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.10 2 | 3 | ENV SNAPCAST_HOST 192.168.0.2 4 | ENV SNAPCAST_DEVICE 1 5 | 6 | RUN apt update && apt install -y build-essential cmake libportaudio2 7 | RUN pip install numpy 8 | RUN pip install ledfx 9 | RUN wget https://github.com/badaix/snapcast/releases/download/v0.28.0/snapclient_0.28.0-1_amd64-bookworm.deb \ 10 | && apt install -f -y ./snapclient_0.28.0-1_amd64-bookworm.deb 11 | 12 | ENTRYPOINT "sh" "-c" "(ledfx &) && snapclient --hostID ledfx -h $SNAPCAST_HOST -s $SNAPCAST_DEVICE" 13 | -------------------------------------------------------------------------------- /mopidy-multiroom/README.md: -------------------------------------------------------------------------------- 1 | # Mopidy-Multiroom 2 | A mopidy setup with multi-room audio support through snapcast. 3 | 4 | 5 | Mopidy-Multiroom aims to provide simple multi-room audio through docker, without the hassle. 6 | **The music** side of things is handled by [Mopidy](https://github.com/mopidy/mopidy) - an extensible music player than can play your own music, or get music from your **Spotify** or **Google Play Music** account. 7 | **The multiroom** part is handled by [Snapcast](https://github.com/badaix/snapcast) - a **synchronous** multiroom music player. 8 | 9 | Together, Mopidy-Multiroom aims to provide a simple to set up music sever for both parts above. 10 | 11 | ## Running Mopidy-Multiroom 12 | 1. Clone the repo and `cd` to the Mopidy-Multiroom directory: 13 | `git clone https://github.com/IVData/dockerfiles && cd dockerfiles/mopidy-multiroom` 14 | 15 | 2. Create a symlink or put your music in the music folder (or don't, if you plan to use Spotify or Google Play Music). 16 | 17 | 3. Run Mopidy-Multiroom with `docker-compose up`! That's it! 18 | 19 | If you want to alter the mopidy config to enable Spotify or Google Play Music for example, the config will now be in the mopidydata folder. 20 | 21 | 22 | ## Connect Clients 23 | You can now connect any Snapcast client you'd like. For convenience I have a dockerfile for a [snapcast client](https://github.com/IVData/dockerfiles/tree/master/snapclient) in this repo. You can also connect to your snapserver through the web interface at `http://:1780` or download the Snapcast [Android client](https://play.google.com/store/apps/details?id=de.badaix.snapcast&hl=en) which is really useful for testing and adjusting latencies. 24 | 25 | ## Play Music 26 | Mopidy-Multiroom comes with a fully featured UI called [Iris](https://mopidy.com/ext/iris/) which will be available at: 27 | `http://:6680/iris`. You'll need to run a local scan in the Iris settings if you've added local music. 28 | 29 | ## Changing More Mopidy or Snapcast Options 30 | In order to configure either Mopidy or Snapcast more, you'll need to install and run both of my containers separately in docker. Visit the respective readmes for [Mopidy](https://github.com/IVData/dockerfiles/tree/master/mopidy) and [Snapserver](https://github.com/IVData/dockerfiles/tree/master/snapserver) to get hacking! 31 | -------------------------------------------------------------------------------- /mopidy-multiroom/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.3" 2 | 3 | services: 4 | mopidy: 5 | image: "ivdata/mopidy" 6 | ports: 7 | - "6680:6680" 8 | - "6600:6600" 9 | volumes: 10 | - ./music:/media/music 11 | - ./mopidydata:/home/mopidy/.config/mopidy 12 | restart: unless-stopped 13 | 14 | snapserver: 15 | image: "ivdata/snapserver" 16 | ports: 17 | - "1704:1704" 18 | - "1705:1705" 19 | - "1780:1780" 20 | restart: unless-stopped 21 | -------------------------------------------------------------------------------- /mopidy-multiroom/mopidydata/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in this directory 2 | * 3 | # Except this file 4 | !.gitignore 5 | -------------------------------------------------------------------------------- /mopidy/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:buster-slim 2 | ENV DEBIAN_FRONTEND=noninteractive 3 | 4 | RUN apt-get update && \ 5 | apt-get install -y --no-install-recommends \ 6 | wget \ 7 | ca-certificates \ 8 | gnupg && \ 9 | rm -rf /var/lib/apt/lists/* 10 | 11 | RUN mkdir -p /usr/local/share/keyrings 12 | RUN wget -q -O /usr/local/share/keyrings/mopidy-archive-keyring.gpg https://apt.mopidy.com/mopidy.gpg 13 | RUN wget -q -O /etc/apt/sources.list.d/mopidy.list https://apt.mopidy.com/buster.list 14 | 15 | RUN apt-get update && \ 16 | apt-get install -y --no-install-recommends \ 17 | tzdata \ 18 | sudo \ 19 | build-essential \ 20 | python3-dev \ 21 | python3-pip \ 22 | python3-gst-1.0 \ 23 | python3-wheel \ 24 | gir1.2-gstreamer-1.0 \ 25 | gir1.2-gst-plugins-base-1.0 \ 26 | gstreamer1.0-plugins-good \ 27 | gstreamer1.0-plugins-ugly \ 28 | gstreamer1.0-plugins-bad \ 29 | gstreamer1.0-libav \ 30 | gstreamer1.0-tools \ 31 | libxml2-dev \ 32 | libxslt1-dev \ 33 | libffi-dev \ 34 | libz-dev \ 35 | python3-setuptools \ 36 | libspotify12 \ 37 | libspotify-dev \ 38 | python3-spotify && \ 39 | rm -rf /var/lib/apt/lists/* 40 | 41 | RUN pip3 install \ 42 | Mopidy \ 43 | Mopidy-MPD \ 44 | Mopidy-Local \ 45 | Mopidy-TuneIn \ 46 | Mopidy-YTMusic \ 47 | Mopidy-Spotify \ 48 | Mopidy-Iris 49 | 50 | RUN touch /IS_CONTAINER 51 | RUN useradd -ms /bin/bash mopidy 52 | RUN sh -c 'echo "mopidy ALL=NOPASSWD: /usr/local/lib/python3.7/dist-packages/mopidy_iris/system.sh, /usr/bin/apt*" >> /etc/sudoers' 53 | RUN sed -i 's+--config .*mopidy.conf+--config /home/mopidy/.config/mopidy/mopidy.conf+g' /usr/local/lib/python3.7/dist-packages/mopidy_iris/system.sh # Fixes the silly iris script with built-in paths 54 | 55 | COPY mopidy.conf /mopidy_default.conf 56 | COPY mopidy.sh /usr/local/bin/mopidy.sh 57 | USER mopidy 58 | RUN mkdir -p /home/mopidy/.config/mopidy/ && cp /mopidy_default.conf /home/mopidy/.config/mopidy/mopidy.conf 59 | 60 | EXPOSE 6600 6680 61 | ENTRYPOINT ["/usr/local/bin/mopidy.sh"] 62 | -------------------------------------------------------------------------------- /mopidy/README.md: -------------------------------------------------------------------------------- 1 | # Mopidy 2 | This is an image for the music server [Mopidy](https://github.com/mopidy/mopidy). 3 | 4 | The image uses a default configuration that 5 | allows MPD and HTTP connections from any host. 6 | 7 | ## Configure 8 | Run the container once with `-v /some/dir:/home/mopidy/.config/mopidy` and the default config file will be copied across. Then you can edit as you would with a normal Mopidy install. 9 | All Mopidy data is also stored in this folder for ease of updating. 10 | 11 | ## Installing Mopidy Extensions 12 | By default this image contains backend extensions for TuneIn, YTMusic, and Spotify, as well as the frontend Iris, all from pip. You can specify which extra apt and pip packages you want to install though, with the `APT_PACKAGES` and `PIP_PACKAGES` env vars. You should set these to space-delimited lists of packages you want installed in the container. Upon boot, the container will make sure these packages are installed. 13 | 14 | ## Updating Mopidy / Extensions 15 | If you specify the `UPDATE` env var (set it to anything) the container will update **all** apt and pip packages before starting (including system packages). 16 | 17 | ## Audio Output 18 | By default this image is configured to output to a [Snapserver](https://github.com/IVData/dockerfiles/tree/master/snapserver) for use in [Mopidy-Multiroom](https://github.com/IVData/dockerfiles/tree/master/mopidy-multiroom). If you'd like to output audio to a regular device, you can edit the config file and follow the instructions inside under 'audio'. 19 | 20 | 21 | `docker run --rm -p 6680:6680 -p 6600:6600 -v /tmp/snapcast:/tmp/snapcast -v /mopidy/data/folder:/home/mopidy/.conifg/mopidy ivdata/mopidy` 22 | -------------------------------------------------------------------------------- /mopidy/mopidy.conf: -------------------------------------------------------------------------------- 1 | [core] 2 | cache_dir = /home/mopidy/.config/mopidy 3 | config_dir = /home/mopidy/.config/mopidy 4 | data_dir = /home/mopidy/.config/mopidy 5 | 6 | [mpd] 7 | hostname = :: 8 | 9 | [http] 10 | hostname = :: 11 | 12 | [spotify] 13 | enabled = false 14 | client_id = 15 | client_secret = 16 | 17 | [ytmusic] 18 | enabled = false 19 | auth_json = 20 | 21 | [local] 22 | enabled = true 23 | media_dir = /media/music 24 | 25 | [audio] 26 | # Comment out this line for mopidy to use the default audio device 27 | output = audioresample ! audioconvert ! audio/x-raw,rate=48000,channels=2,format=S16LE ! wavenc ! tcpclientsink host=snapserver 28 | 29 | [file] 30 | enabled = false 31 | media_dir = /media|Media 32 | -------------------------------------------------------------------------------- /mopidy/mopidy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copy config if it does not already exist 4 | if [ ! -f /home/mopidy/.config/mopidy/mopidy.conf ]; then 5 | cp /mopidy_default.conf /home/mopidy/.config/mopidy/mopidy.conf 6 | fi 7 | 8 | if [ ${APT_PACKAGES:+x} ]; then 9 | echo "-- INSTALLING APT PACKAGES $APT_PACKAGES --" 10 | sudo apt-get update 11 | sudo apt-get install -y $APT_PACKAGES 12 | fi 13 | if [ ${PIP_PACKAGES:+x} ]; then 14 | echo "-- INSTALLING PIP PACKAGES $PIP_PACKAGES --" 15 | pip3 install $PIP_PACKAGES 16 | fi 17 | if [ ${UPDATE:+x} ]; then 18 | echo "-- UPDATING ALL PACKAGES --" 19 | sudo apt-get update 20 | sudo apt-get upgrade -y 21 | pip3 freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip3 install -U # Upgrade all pip packages 22 | fi 23 | 24 | exec mopidy --config /home/mopidy/.config/mopidy/mopidy.conf "$@" 25 | -------------------------------------------------------------------------------- /offlineimap-ssl/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM kalbasit/offlineimap 2 | 3 | RUN apk add --update-cache openssl ca-certificates \ 4 | && rm -rf /var/cache/apk/* 5 | -------------------------------------------------------------------------------- /sleep-snapcast/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine 2 | 3 | ENV HOST=snapserver 4 | ENV PORT=4953 5 | ENV LOWPASS=20000 6 | 7 | RUN apk add -U --no-cache sox socat 8 | ENTRYPOINT ["sh", "-c", "sox -V -n -t wav -b 16 -c 2 -r 48k --buffer 32 - synth brownnoise lowpass $LOWPASS | socat -u - TCP4:$HOST:$PORT"] 9 | -------------------------------------------------------------------------------- /snapclient/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine 2 | 3 | ENV HOST snapserver 4 | 5 | RUN apk add -U snapcast-client 6 | RUN rm -rf /var/cache/apk/* 7 | ENTRYPOINT /usr/bin/snapclient -h $HOST $EXTRA_ARGS 8 | -------------------------------------------------------------------------------- /snapclient/README.md: -------------------------------------------------------------------------------- 1 | # Snapcast Client 2 | This is a docker image for the [snapcast client](https://github.com/badaix/snapcast). 3 | 4 | If you want to use Snapcast to make your own multiroom audio setup, please check out [Mopidy-Multiroom](https://github.com/IVData/dockerfiles/tree/master/mopidy-multiroom). 5 | 6 | ## Run Snapclient 7 | To run, use the command below, but you can change the following values: 8 | 9 | * `/dev/snd` a sound device for snapclient to output sound to. 10 | * `HOST` the hostname or IP of the snapserver. 11 | * `EXTRA_ARGS` any other arguments you'd like to pass along to `snapclient` 12 | 13 | `docker run --rm --device /dev/snd -e HOST=127.0.0.1 -e EXTRA_ARGS= ivdata/snapclient` 14 | -------------------------------------------------------------------------------- /snapserver/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine/git AS git 2 | WORKDIR /librespot 3 | RUN git clone --depth 1 --branch v0.4.1 https://github.com/librespot-org/librespot.git . 4 | 5 | 6 | FROM alpine:3.16 as librespot-build 7 | WORKDIR /app 8 | RUN apk -U add git build-base cargo alsa-lib-dev 9 | COPY --from=git /librespot . 10 | #RUN cargo --config net.git-fetch-with-cli=true build --release --features alsa-backend 11 | RUN cargo build --release --features alsa-backend 12 | 13 | 14 | FROM alpine:3.16 AS snapweb-build 15 | WORKDIR /snapcast 16 | RUN apk add npm curl alpine-sdk 17 | RUN npm install --silent --save-dev -g typescript@4.3 18 | RUN curl -L https://github.com/badaix/snapweb/archive/refs/tags/v0.3.0.tar.gz | tar xz --directory / && cd /snapweb-0.3.0 && make 19 | 20 | 21 | 22 | FROM alpine:3.16 23 | 24 | #RUN echo "https://dl-cdn.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories 25 | RUN apk add --no-cache musl 26 | RUN rm /etc/apk/repositories && apk add --no-cache snapcast-server dbus avahi avahi-compat-libdns_sd alsa-lib libgcc mpv \ 27 | --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community \ 28 | --repository=http://dl-cdn.alpinelinux.org/alpine/edge/main \ 29 | --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing # We need the latest snapserver 30 | 31 | COPY --from=snapweb-build /snapweb-0.3.0/dist /usr/share/snapserver/snapweb 32 | COPY --from=librespot-build /app/target/release/librespot /usr/bin/librespot 33 | COPY snapserver.conf /etc/snapserver.conf 34 | COPY startup.sh startup.sh 35 | RUN chmod +x ./startup.sh 36 | 37 | EXPOSE 1704 1705 1780 38 | ENTRYPOINT [ "./startup.sh" ] 39 | -------------------------------------------------------------------------------- /snapserver/Dockerfile.deb: -------------------------------------------------------------------------------- 1 | FROM rust as build-env 2 | RUN git clone --depth 1 --branch master https://github.com/librespot-org/librespot.git 3 | RUN cd librespot && cargo build --release --no-default-features 4 | 5 | 6 | FROM debian:bookworm 7 | 8 | ARG snapcast_version=0.28.0 9 | ARG TARGETARCH 10 | 11 | RUN printf '#!/bin/sh\nexit 0' > /usr/sbin/policy-rc.d 12 | RUN apt-get update \ 13 | && apt-get install -y wget ca-certificates avahi-daemon libavahi-compat-libdnssd1 wireguard nano \ 14 | && rm -rf /var/lib/apt/lists/* 15 | RUN wget https://github.com/badaix/snapcast/releases/download/v${snapcast_version}/snapserver_${snapcast_version}-1_${TARGETARCH}-bookworm.deb 16 | RUN dpkg -i snapserver_${snapcast_version}-1_${TARGETARCH}-bookworm.deb \ 17 | ; apt-get update \ 18 | && apt-get -f install -y \ 19 | && rm -rf /var/lib/apt/lists/* 20 | 21 | RUN /usr/bin/snapserver -v 22 | COPY --from=build-env /librespot/target/release/librespot /usr/bin/librespot 23 | COPY snapserver.conf /etc/snapserver.conf 24 | COPY startup.sh startup.sh 25 | RUN chmod +x ./startup.sh 26 | 27 | EXPOSE 1704 1705 1780 28 | ENTRYPOINT [ "./startup.sh" ] 29 | -------------------------------------------------------------------------------- /snapserver/Dockerfile.src: -------------------------------------------------------------------------------- 1 | FROM alpine:edge AS builder 2 | WORKDIR /snapcast 3 | 4 | RUN apk add npm curl alpine-sdk 5 | RUN npm install --silent --save-dev -g typescript@4.3 6 | RUN curl -L https://github.com/badaix/snapweb/archive/refs/tags/v0.2.0.tar.gz | tar xz --directory / && cd /snapweb-0.2.0 && make 7 | 8 | FROM alpine:edge 9 | 10 | RUN echo "https://dl-cdn.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories 11 | RUN apk add --no-cache gdb librespot snapcast-server dbus avahi avahi-compat-libdns_sd 12 | RUN apk upgrade 13 | RUN apk add bash git alpine-sdk boost-dev avahi-dev alsa-lib-dev soxr-dev libogg-dev libvorbis-dev flac-dev opus-dev 14 | 15 | RUN git clone https://github.com/badaix/snapcast.git 16 | RUN cd snapcast && git checkout develop && cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug && cmake --build build && cp bin/snapserver /usr/bin/snapserver 17 | 18 | 19 | 20 | COPY --from=builder /snapweb-0.2.0/dist /usr/share/snapserver/snapweb 21 | COPY snapserver.conf /etc/snapserver.conf 22 | COPY startup.sh startup.sh 23 | RUN chmod +x ./startup.sh 24 | 25 | EXPOSE 1704 1705 1780 26 | ENTRYPOINT [ "./startup.sh" ] 27 | 28 | -------------------------------------------------------------------------------- /snapserver/README.md: -------------------------------------------------------------------------------- 1 | # Snapcast Server 2 | This is a docker image for the [snapcast server](https://github.com/badaix/snapcast). 3 | 4 | This image runs `avahi-daemon` inside the container in order to advertise the snapcast service (or Spotify connect service if you're using librespot). This will interfere with a host machine that is also running avahi. There are three options to fix this: 5 | - Give this container it's own IP on your local network with a macvlan docker network or similar. 6 | - Disable `avahi-daemon` on the host and run this container with `--net=host`. 7 | - Disable `avahi-daemon` in this container by overriding the entrypoint with `snapserver $EXTRA_ARGS` 8 | 9 | If you want to use Snapcast to make your own multiroom audio setup, please check out [Mopidy-Multiroom](https://github.com/IVData/dockerfiles/tree/master/mopidy-multiroom). 10 | 11 | ## Run Snapserver 12 | To run, use the command below, but you can change the following values: 13 | 14 | * `1705, 1704, and 1780` the ports used by Snapserver (1780 is for the web UI). You currently can't configure the internal ports used but can change the external ones. 15 | * `snapserver.conf` an optional Snapserver config file. If you omit this, a default config will be used (see below). 16 | * `EXTRA_ARGS` an optional string of cmd line arguments to pass to `snapserver`. 17 | 18 | `docker run --rm -v /tmp/snapcast:/tmp/snapcast -p 1704:1704 -p 1705:1705 -p 1780:1780 -e EXTRA_ARGS= ivdata/snapserver` 19 | 20 | ## Config 21 | You can overwrite snapcast's config by mounting a file to `/etc/snapserver.conf` in the container. The default settings create a single stream called "Snapserver" which listens on a TCP socket on port 4953 (this was previously a fifo), and enables [SnapWeb](https://github.com/badaix/snapweb) on port 1780. See the [Snapcast docs](https://github.com/badaix/snapcast/blob/master/doc/configuration.md) to create your own config. 22 | -------------------------------------------------------------------------------- /snapserver/snapserver.conf: -------------------------------------------------------------------------------- 1 | [stream] 2 | stream = tcp://0.0.0.0?name=Snapserver 3 | 4 | [http] 5 | doc_root = /usr/share/snapserver/snapweb 6 | -------------------------------------------------------------------------------- /snapserver/startup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | #dbus-daemon --system 4 | #avahi-daemon --no-chroot & 5 | /usr/bin/snapserver $EXTRA_ARGS 6 | -------------------------------------------------------------------------------- /tespeed/Dockerfile.amd64: -------------------------------------------------------------------------------- 1 | FROM python:2.7-wheezy 2 | 3 | RUN git clone --recursive --depth 1 https://github.com/IVData/tespeed.git 4 | RUN pip install lxml 5 | 6 | CMD ["/usr/local/bin/python","/tespeed/tespeed.py"] 7 | -------------------------------------------------------------------------------- /uploadr/Dockerfile.amd64: -------------------------------------------------------------------------------- 1 | FROM python:2.7-alpine3.7 2 | 3 | RUN apk update 4 | RUN apk add py-pip git 5 | RUN pip install requests dnspython pyasn1==0.3.7 pyasn1-modules==0.1.5 6 | 7 | RUN git clone https://github.com/sezuan/SleekXMPP.git -b xep_0363 8 | RUN cd SleekXMPP && pip install . 9 | 10 | RUN git clone https://github.com/sezuan/uploadr.git 11 | 12 | COPY server.py /uploadr/server.py 13 | 14 | ENTRYPOINT ["/bin/sh","-c","cd /uploadr && python server.py"] 15 | -------------------------------------------------------------------------------- /uploadr/README.md: -------------------------------------------------------------------------------- 1 | # XMPP Uploadr 2 | 3 | Send a http POST request to this container, port 8080, to upload a file to xmpp. 4 | Post data should include: 5 | 6 | * notify: The JID of the persion to notify with the file 7 | * url: The url of the file to upload 8 | 9 | You need to mount your .uploadrc file to /root/.uploadrc as described here: https://github.com/sezuan/uploadr 10 | 11 | `docker run --rm -it -p 8080:8080 -v /path/to/.uploadrc:/root/.uploadrc ivdata/xmpp-uploadr` 12 | 13 | upload e.g.: 14 | 15 | `curl -d "url=http://localhost/picture.jpg¬ify=me@example.com" -X POST localhost:8080` 16 | -------------------------------------------------------------------------------- /uploadr/server.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # Reflects the requests from HTTP methods GET, POST, PUT, and DELETE 3 | # Written by Nathan Hamiel (2010) 4 | 5 | from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler 6 | from optparse import OptionParser 7 | import cgi 8 | from subprocess import call 9 | 10 | class RequestHandler(BaseHTTPRequestHandler): 11 | 12 | def do_POST(self): 13 | 14 | ctype, pdict = cgi.parse_header(self.headers.getheader('content-type')) 15 | if ctype == 'multipart/form-data': 16 | postvars = cgi.parse_multipart(self.rfile, pdict) 17 | elif ctype == 'application/x-www-form-urlencoded': 18 | length = int(self.headers.getheader('content-length')) 19 | postvars = cgi.parse_qs(self.rfile.read(length), keep_blank_values=1) 20 | else: 21 | postvars = {} 22 | 23 | call(["/bin/sh", "-c", "wget -O /tmp/upfile.jpg " + postvars["url"][0]]) 24 | call(["/bin/sh", "-c", "./uploadr.py --notify " + postvars["notify"][0] + " /tmp/upfile.jpg"]) 25 | self.send_response(200) 26 | 27 | def main(): 28 | port = 8080 29 | print('Listening on localhost:%s' % port) 30 | server = HTTPServer(('', port), RequestHandler) 31 | server.serve_forever() 32 | 33 | 34 | if __name__ == "__main__": 35 | parser = OptionParser() 36 | parser.usage = ("Creates an http-server that will echo out any GET or POST parameters\n" 37 | "Run:\n\n" 38 | " reflect") 39 | (options, args) = parser.parse_args() 40 | 41 | main() 42 | -------------------------------------------------------------------------------- /weechat/Dockerfile.amd64: -------------------------------------------------------------------------------- 1 | FROM alpine:edge 2 | 3 | RUN apk add --update weechat openssl ca-certificates 4 | ENV TERM xterm 5 | 6 | ENTRYPOINT ["weechat"] 7 | --------------------------------------------------------------------------------