diff --git a/apps/debrid-media-manager/Dockerfile b/apps/debrid-media-manager/Dockerfile deleted file mode 100644 index 8c42e30aa2..0000000000 --- a/apps/debrid-media-manager/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -# Get the elfhosted code -ARG VERSION -FROM debridmediamanager/debrid-media-manager:${VERSION} - -# Switch to postgres -RUN sed -i -e 's/mysql/postgres/' prisma/schema.prisma && \ - sed -i -e 's/mysql/postgres/' node_modules/.prisma/client/schema.prisma && \ - sed -i -e 's/mysql/postgres/' node_modules/.prisma/client/index.js - -# Apply ElfHosted branding (soon) \ No newline at end of file diff --git a/apps/debrid-media-manager/ci/goss.yaml b/apps/debrid-media-manager/ci/goss.yaml deleted file mode 100644 index cae0f4f4b5..0000000000 --- a/apps/debrid-media-manager/ci/goss.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#process -process: - node: - running: true - -# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#port -port: - # https://github.com/aelsabbahy/goss/issues/149 - tcp:3649: - listening: true - -# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#http -http: - http://localhost:3649: - status: 200 diff --git a/apps/debrid-media-manager/ci/latest.sh b/apps/debrid-media-manager/ci/latest.sh deleted file mode 100755 index a850454118..0000000000 --- a/apps/debrid-media-manager/ci/latest.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash -version=$(curl -s -S "https://registry.hub.docker.com/v2/repositories/debridmediamanager/debrid-media-manager/tags/" | jq -r '."results"[]["name"]' | grep -v latest | head -1) -printf "%s" "${version}" \ No newline at end of file diff --git a/apps/debrid-media-manager/metadata.json b/apps/debrid-media-manager/metadata.json deleted file mode 100644 index 2e58b73c49..0000000000 --- a/apps/debrid-media-manager/metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "app": "debrid-media-manager", - "base": false, - "channels": [ - { - "name": "main", - "platforms": [ - "linux/amd64" - ], - "stable": true, - "tests": { - "enabled": false, - "type": "web" - } - }, - { - "name": "scrapers", - "platforms": [ - "linux/amd64" - ], - "stable": false, - "tests": { - "enabled": false, - "type": "web" - } - } - ] -} diff --git a/apps/debrid-media-manager/scrapers/Dockerfile b/apps/debrid-media-manager/scrapers/Dockerfile deleted file mode 100644 index a84440bcc1..0000000000 --- a/apps/debrid-media-manager/scrapers/Dockerfile +++ /dev/null @@ -1,55 +0,0 @@ -# Get the elfhosted code -FROM alpine:latest as cloner - -ARG CHANNEL -ARG VERSION -ENV SCRAPERS_SHA=23b3710afa7caa874e00cdaaa9c0494b0e3c774a - -RUN apk update && apk upgrade && \ - apk add --no-cache git - -RUN git clone https://github.com/debridmediamanager/debrid-media-manager.git /source && \ - cd /source && \ - git checkout $SCRAPERS_SHA - -# now the original build - -FROM node:18-alpine AS dependencies -WORKDIR /app -COPY --from=cloner /source/package*.json ./ -RUN npm ci - -FROM node:18-alpine AS build -WORKDIR /app -COPY --from=dependencies /app/node_modules ./node_modules -COPY --from=cloner /source/. . - - - -RUN npx prisma generate && npm run build - -FROM node:18-alpine AS deploy -WORKDIR /app -ENV NODE_ENV production -COPY --from=build /app/public ./public -COPY --from=build /app/package.json ./package.json -COPY --from=build /app/prisma ./prisma -COPY --from=build /app/.next/static ./.next/static -COPY --from=build /app/.next/standalone . -COPY --from=cloner /source/*.txt . -EXPOSE 3000 -ENV PORT 3000 -ENV HOSTNAME "0.0.0.0" -CMD ["node", "server.js"] -# Combine RUN instructions and install packages -RUN apk --no-cache add curl grep -# Healthcheck as before -HEALTHCHECK --interval=30s --timeout=1s --start-period=3s --retries=1 \ - CMD curl -s http://localhost:3000/api/healthz | grep -qm1 ok - -# Switch to postgres -RUN sed -i -e 's/mysql/postgres/' prisma/schema.prisma && \ - sed -i -e 's/mysql/postgres/' node_modules/.prisma/client/schema.prisma && \ - sed -i -e 's/mysql/postgres/' node_modules/.prisma/client/index.js - -# Apply ElfHosted branding (soon) \ No newline at end of file diff --git a/apps/stremio-jackett/Dockerfile b/apps/stremio-jackett/Dockerfile deleted file mode 100644 index 2876dd1525..0000000000 --- a/apps/stremio-jackett/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -# Get the elfhosted code -FROM alpine:latest as cloner - -ARG CHANNEL -ARG VERSION - -RUN apk update && apk upgrade && \ - apk add --no-cache git - -RUN git clone -b $VERSION https://github.com/aymene69/stremio-jackett.git /source - -FROM python:3.12.2 - -WORKDIR /app - -COPY --from=cloner /source/source/requirements.txt . - -RUN pip install -r requirements.txt - -COPY --from=cloner /source/source/. . - -EXPOSE 3000 - -CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "3000", "--reload"] \ No newline at end of file diff --git a/apps/stremio-jackett/ci/goss.yaml b/apps/stremio-jackett/ci/goss.yaml deleted file mode 100644 index c1608f76b8..0000000000 --- a/apps/stremio-jackett/ci/goss.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- -# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#process -# process: -# python: -# running: true - -# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#port -# unsure why this isn't working -# port: -# # https://github.com/aelsabbahy/goss/issues/149 -# tcp6:3000: -# listening: true - -# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#http -http: - http://localhost:3000: - status: 200 - timeout: 5000 diff --git a/apps/stremio-jackett/ci/latest.sh b/apps/stremio-jackett/ci/latest.sh deleted file mode 100755 index e749170135..0000000000 --- a/apps/stremio-jackett/ci/latest.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash -version=$(curl -L -sX GET https://api.github.com/repos/aymene69/stremio-jackett/releases/latest --header "Authorization: Bearer ${TOKEN}" | jq --raw-output '. | .tag_name') -# version=$(curl -L -sX GET "https://api.github.com/repos/aymene69/stremio-jackett/commits/dev" --header "Authorization: Bearer ${TOKEN}" | jq --raw-output '.sha') - -printf "%s" "${version}" diff --git a/apps/stremio-jackett/metadata.json b/apps/stremio-jackett/metadata.json deleted file mode 100644 index 527482050d..0000000000 --- a/apps/stremio-jackett/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "app": "stremio-jackett", - "base": false, - "channels": [ - { - "name": "main", - "platforms": [ - "linux/amd64" - ], - "stable": true, - "tests": { - "enabled": true, - "type": "web" - } - } - ] -} diff --git a/apps/wireguard/Dockerfile b/apps/wireguard/Dockerfile deleted file mode 100644 index be1c1fa38c..0000000000 --- a/apps/wireguard/Dockerfile +++ /dev/null @@ -1,47 +0,0 @@ -FROM ghcr.io/elfhosted/ubuntu:rolling@sha256:bb9a70388f6b6be4fd43cb34aa6abe15595323e76cd989c7e5cac04bb2193e5d - -ARG VERSION -USER root -COPY ./apps/wireguard/build /build -WORKDIR /tmp - -# hadolint ignore=DL3008,DL3015,SC2086 -RUN \ - export EXTRA_INSTALL_ARG="build-essential git" \ - && apt-get -qq update \ - && \ - apt-get -qq install -y \ - iptables \ - iproute2 \ - openresolv \ - inetutils-ping \ - sudo \ - ${EXTRA_INSTALL_ARG} \ - && git clone https://git.zx2c4.com/wireguard-tools . \ - && git clone https://git.zx2c4.com/wireguard-linux-compat \ - && git checkout "v${VERSION}" \ - && make -C src -j"$(nproc)" \ - && make -C src install \ - && sed -i "s:sysctl -q net.ipv4.conf.all.src_valid_mark=1:# skipping setting net.ipv4.conf.all.src_valid_mark:" /usr/bin/wg-quick \ - && mv /build/sudoers_elfie /etc/sudoers.d/elfie \ - && chown root:root /etc/sudoers.d/* \ - && chmod 644 /etc/sudoers.d/* \ - && \ - apt-get remove -y ${EXTRA_INSTALL_ARG} \ - && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ - && apt-get autoremove -y \ - && apt-get clean \ - && \ - rm -rf \ - /tmp/* \ - /var/lib/apt/lists/* \ - /var/tmp/ \ - /build \ - && chmod -R u=rwX,go=rX /app \ - && printf "umask %d" "${UMASK}" >> /etc/bash.bashrc - -USER 568 - -COPY ./apps/wireguard/shim/* /shim/ -COPY ./apps/wireguard/entrypoint.sh /entrypoint.sh -CMD ["/entrypoint.sh"] diff --git a/apps/wireguard/build/sudoers_elfie b/apps/wireguard/build/sudoers_elfie deleted file mode 100644 index 8626ae55ec..0000000000 --- a/apps/wireguard/build/sudoers_elfie +++ /dev/null @@ -1,17 +0,0 @@ -elfie ALL= EXEC: NOPASSWD: /usr/sbin/iptables-legacy-save -elfie ALL= EXEC: NOPASSWD: /usr/sbin/ip6tables-legacy-save -elfie ALL= EXEC: NOPASSWD: /usr/sbin/iptables-nft-save -elfie ALL= EXEC: NOPASSWD: /usr/sbin/ip6tables-nft-save -elfie ALL= EXEC: NOPASSWD: /usr/sbin/iptables -F OUTPUT -elfie ALL= EXEC: NOPASSWD: /usr/sbin/ip6tables -F OUTPUT -elfie ALL= EXEC: NOPASSWD: /usr/sbin/iptables -A OUTPUT * -elfie ALL= EXEC: NOPASSWD: /usr/sbin/ip6tables -A OUTPUT * -elfie ALL= EXEC: NOPASSWD: /usr/sbin/ip -4 route add * -elfie ALL= EXEC: NOPASSWD: /usr/sbin/ip -6 route add * -elfie ALL= EXEC: NOPASSWD: /usr/bin/wg show * -elfie ALL= EXEC: NOPASSWD: /usr/bin/wg-quick up * -elfie ALL= EXEC: NOPASSWD: /usr/bin/wg-quick down * -elfie ALL= EXEC: NOPASSWD: /usr/bin/find /etc/wireguard -type f * -elfie ALL= EXEC: NOPASSWD: /usr/bin/update-alternatives --set iptables * -elfie ALL= EXEC: NOPASSWD: /usr/bin/update-alternatives --set ip6tables * -Defaults env_keep +="TZ" diff --git a/apps/wireguard/ci/goss.yaml b/apps/wireguard/ci/goss.yaml deleted file mode 100644 index eefef961d5..0000000000 --- a/apps/wireguard/ci/goss.yaml +++ /dev/null @@ -1,10 +0,0 @@ ---- -# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#process -process: - node: - running: true - -# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#http -http: - http://localhost:3001: - status: 200 diff --git a/apps/wireguard/ci/latest.sh b/apps/wireguard/ci/latest.sh deleted file mode 100755 index 96e9a8ca0b..0000000000 --- a/apps/wireguard/ci/latest.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash -version=$(curl -L -sX GET "https://api.github.com/repos/WireGuard/wireguard-tools/tags" --header "Authorization: Bearer ${TOKEN}" | jq --raw-output '.[0].name') -version="${version#*v}" -version="${version#*release-}" -printf "%s" "${version}" diff --git a/apps/wireguard/entrypoint.sh b/apps/wireguard/entrypoint.sh deleted file mode 100755 index e6d8591431..0000000000 --- a/apps/wireguard/entrypoint.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env bash - -set -e - -INTERFACE_UP=false - -_shutdown () { - local exitCode=$? - if [[ ${exitCode} -gt 0 ]]; then - echo "[ERROR] Received non-zero exit code (${exitCode}) executing the command "${BASH_COMMAND}" on line ${LINENO}." - else - echo "[INFO] Caught signal to shutdown." - fi - - if [[ "${INTERFACE_UP}" == 'true' ]]; then - echo "[INFO] Shutting down VPN!" - sudo /usr/bin/wg-quick down "${INTERFACE}" - fi -} - -trap _shutdown EXIT - -source "/shim/iptables-backend.sh" - -CONFIGS=`sudo /usr/bin/find /etc/wireguard -type f -printf "%f\n"` -if [[ -z "${CONFIGS}" ]]; then - echo "[ERROR] No configuration files found in /etc/wireguard" >&2 - exit 1 -fi - -CONFIG=`echo $CONFIGS | head -n 1` -INTERFACE="${CONFIG%.*}" - -sudo /usr/bin/wg-quick up "${INTERFACE}" -INTERFACE_UP=true - -source "/shim/killswitch.sh" - -sleep infinity & -wait $! diff --git a/apps/wireguard/metadata.json b/apps/wireguard/metadata.json deleted file mode 100644 index 98ce7333c4..0000000000 --- a/apps/wireguard/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "app": "wireguard", - "base": false, - "channels": [ - { - "name": "stable", - "platforms": [ - "linux/amd64" - ], - "stable": true, - "tests": { - "enabled": false, - "type": "web" - } - } - ] -} diff --git a/apps/wireguard/shim/iptables-backend.sh b/apps/wireguard/shim/iptables-backend.sh deleted file mode 100755 index 385ade49c7..0000000000 --- a/apps/wireguard/shim/iptables-backend.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env bash -# Original idea / source: https://github.com/kubernetes-sigs/iptables-wrappers/blob/master/iptables-wrapper-installer.sh - -set -eu - -IPTABLES_BACKEND=${IPTABLES_BACKEND:-""} - -if [ -n "${IPTABLES_BACKEND}" ]; then - case "${IPTABLES_BACKEND}" in - nft|legacy) - mode="${IPTABLES_BACKEND}" - ;; - *) - echo "[ERROR] '${IPTABLES_BACKEND}' is not a valid value for IPTABLES_BACKEND. Please use either 'nft' or 'legacy'". - exit 1 - esac -else - # Detect whether the base system is using iptables-legacy or iptables-nft. - # This assumes that some non-containerized process (eg kubelet) has already created some iptables rules. - # In case of doubt, it will always pick legacy mode. - num_legacy_lines=$( (sudo /usr/sbin/iptables-legacy-save || true; sudo /usr/sbin/ip6tables-legacy-save || true) 2>/dev/null | grep '^-' | wc -l) - num_nft_lines=$( (sudo /usr/sbin/iptables-nft-save || true; sudo /usr/sbin/ip6tables-nft-save || true) 2>/dev/null | grep '^-' | wc -l) - if [ "${num_legacy_lines}" -ge "${num_nft_lines}" ]; then - mode=legacy - else - mode=nft - fi -fi - -# Update links to point to the selected binaries -sudo /usr/bin/update-alternatives --set iptables "/usr/sbin/iptables-${mode}" > /dev/null || failed=1 -sudo /usr/bin/update-alternatives --set ip6tables "/usr/sbin/ip6tables-${mode}" > /dev/null || failed=1 - -if [ "${failed:-0}" = 1 ]; then - echo "[ERROR] Unable to redirect iptables binaries. (Are you running in an unprivileged pod?)" 1>&2 - exit 1 -fi - -echo "[INFO] Running iptables in ${mode} mode" diff --git a/apps/wireguard/shim/killswitch.sh b/apps/wireguard/shim/killswitch.sh deleted file mode 100644 index 00ac0ce298..0000000000 --- a/apps/wireguard/shim/killswitch.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env bash - -KILLSWITCH=${KILLSWITCH:-"false"} -SEPARATOR=${SEPARATOR:-";"} - -if - [[ "${KILLSWITCH}" == "true" ]]; -then - if [[ "$(cat /proc/sys/net/ipv4/conf/all/src_valid_mark)" != "1" ]]; then - echo "[WARNING] sysctl net.ipv4.conf.all.src_valid_mark=1 is not set. This may prevent the killswitch from working properly and may prevent outbound network access." >&2 - fi - - # IPv4 killswitch - DEFAULTROUTE_IPV4=$(/usr/sbin/ip -4 route | grep default | awk '{print $3}') - KILLSWITCH_EXCLUDEDNETWORKS_IPV4=${KILLSWITCH_EXCLUDEDNETWORKS_IPV4:-""} - sudo /usr/sbin/iptables -F OUTPUT - if - [[ -n "${DEFAULTROUTE_IPV4}" ]] && [[ -n "$KILLSWITCH_EXCLUDEDNETWORKS_IPV4" ]]; - then - IFS="${SEPARATOR}" read -r -a networks <<< "${KILLSWITCH_EXCLUDEDNETWORKS_IPV4}" - for entry in "${networks[@]}" - do - echo "[INFO] Excluding ${entry} from VPN IPv4 traffic" - sudo /usr/sbin/ip -4 route add "${entry}" via "${DEFAULTROUTE_IPV4}" || echo "[WARNING] Received non-zero exit code adding route ${entry} via ${DEFAULTROUTE_IPV4}" - sudo /usr/sbin/iptables -A OUTPUT -d "${entry}" -j ACCEPT || echo "[WARNING] Received non-zero exit code adding iptables rule to ACCEPT ${entry}" - done - fi - - sudo /usr/sbin/iptables -A OUTPUT ! -o "${INTERFACE}" -m mark ! --mark $(sudo /usr/bin/wg show "${INTERFACE}" fwmark) -m addrtype ! --dst-type LOCAL -j REJECT - - # IPv6 killswitch - DEFAULTROUTE_IPV6=$(/usr/sbin/ip -6 route | grep default | awk '{print $3}') - KILLSWITCH_EXCLUDEDNETWORKS_IPV6=${KILLSWITCH_EXCLUDEDNETWORKS_IPV6:-""} - sudo /usr/sbin/ip6tables -F OUTPUT - if - [[ -n "${DEFAULTROUTE_IPV6}" ]] && [[ -n "${KILLSWITCH_EXCLUDEDNETWORKS_IPV6}" ]]; - then - IFS="${SEPARATOR}" read -r -a networks <<< "${KILLSWITCH_EXCLUDEDNETWORKS_IPV6}" - for entry in "${networks[@]}" - do - echo "[INFO] Excluding ${entry} from VPN IPv6 traffic" - sudo /usr/sbin/ip -6 route add "${entry}" via "${DEFAULTROUTE_IPV6}" || echo "[WARNING] Received non-zero exit code adding route ${entry} via ${DEFAULTROUTE_IPV6}" - sudo /usr/sbin/ip6tables -A OUTPUT -d "${entry}" -j ACCEPT || echo "[WARNING] Received non-zero exit code adding iptables rule to ACCEPT ${entry}" - done - - fi - - sudo /usr/sbin/ip6tables -A OUTPUT ! -o "${INTERFACE}" -m mark ! --mark $(sudo /usr/bin/wg show "${INTERFACE}" fwmark) -m addrtype ! --dst-type LOCAL -j REJECT -fi