From f8de05cc50c64aa1113c690c3c58259ecddf2f3f Mon Sep 17 00:00:00 2001 From: Opnxng Date: Wed, 27 Dec 2023 14:59:44 +0800 Subject: [PATCH] Replaced Libreddit with Redlib --- files/teddit/about.pug | 2 +- templates/compose/libremdb.yaml.j2 | 4 +-- .../{libredditarm.yaml.j2 => redlib.yaml.j2} | 15 ++++++----- templates/conf/Caddyfile.j2 | 24 ++++++++--------- templates/conf/nitter/nitter.conf.j2 | 2 +- templates/conf/settings.yml.j2 | 6 ++--- vars/services.yaml | 27 +++++++++---------- 7 files changed, 41 insertions(+), 39 deletions(-) rename templates/compose/{libredditarm.yaml.j2 => redlib.yaml.j2} (67%) diff --git a/files/teddit/about.pug b/files/teddit/about.pug index 6ed13ef..425a4d5 100644 --- a/files/teddit/about.pug +++ b/files/teddit/about.pug @@ -11,7 +11,7 @@ html .container .content h1 About - p Teddit is a free and open source alternative Reddit front-end focused on privacy. Teddit doesn't require you to have JavaScript enabled in your browser. The source is available on Codeberg at https://codeberg.org/teddit/teddit. This instance utilizes Cloudflare Warp to avoid rate limiting. Please be aware of the privacy implications. The instance is hosted only to mitigate bad experiences on a bad platform. Seek greener pastures! + p Teddit is a free and open source alternative Reddit front-end focused on privacy. Teddit doesn't require you to have JavaScript enabled in your browser. The source is available on Codeberg at https://codeberg.org/teddit/teddit. This instance utilizes Cloudflare Warp to avoid rate limiting. Please be aware of the privacy implications. The instance is hosted only to mitigate bad experiences on a bad platform. Seek greener pastures! ul li No JavaScript or ads li All requests go through the backend, client never talks to Reddit diff --git a/templates/compose/libremdb.yaml.j2 b/templates/compose/libremdb.yaml.j2 index fd15b72..28e8cd9 100644 --- a/templates/compose/libremdb.yaml.j2 +++ b/templates/compose/libremdb.yaml.j2 @@ -17,10 +17,10 @@ services: - AXIOS_LANGUAGE='en-US,en;q=0.5' ports: - 8905:3000 - restart: unless-stopped + restart: unless-stopped networks: - libremdb networks: libremdb: - name: libremdb \ No newline at end of file + name: libremdb diff --git a/templates/compose/libredditarm.yaml.j2 b/templates/compose/redlib.yaml.j2 similarity index 67% rename from templates/compose/libredditarm.yaml.j2 rename to templates/compose/redlib.yaml.j2 index 8481e63..21b71e1 100644 --- a/templates/compose/libredditarm.yaml.j2 +++ b/templates/compose/redlib.yaml.j2 @@ -1,10 +1,11 @@ # {{ ansible_managed }} version: '3.7' services: - libreddit: - container_name: libreddit - image: libreddit/libreddit:arm + redlib: + container_name: redlib + image: quay.io/redlib/redlib:latest-arm security_opt: + #- seccomp="seccomp-redlib.json" - no-new-privileges environment: - PUID=1000 @@ -12,6 +13,8 @@ services: - TZ=Asia/Singapore - LIBREDDIT_DEFAULT_THEME=black - LIBREDDIT_DEFAULT_SHOW_NSFW=on + - REDLIB_DEFAULT_THEME=black + - REDLIB_DEFAULT_SHOW_NSFW=on restart: unless-stopped healthcheck: test: ["CMD", "wget", "--spider", "-q", "--tries=1", "http://localhost:8080/settings"] @@ -20,8 +23,8 @@ services: ports: - 8882:8080 networks: - - libreddit + - redlib networks: - libreddit: - name: libreddit + redlib: + name: redlib diff --git a/templates/conf/Caddyfile.j2 b/templates/conf/Caddyfile.j2 index 2503e02..b1beed9 100755 --- a/templates/conf/Caddyfile.j2 +++ b/templates/conf/Caddyfile.j2 @@ -145,7 +145,17 @@ @l host l.{$HOSTNAME} handle @l { encode zstd gzip - reverse_proxy {{ vultr_private_ip }}:8882 + reverse_proxy { + to {{ oracle1_private_ip }}:8882 + to {{ oracle2_private_ip }}:8882 + to {{ oracle3_private_ip }}:8882 + to {{ oracle4_private_ip }}:8882 + lb_policy ip_hash + lb_try_duration 5s + lb_try_interval 1s + fail_duration 30s + max_fails 3 + } header { Content-Security-Policy "default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self' https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests" X-Robots-Tag "noindex, noimageindex, nosnippet, notranslate, noarchive, nofollow" @@ -362,17 +372,7 @@ @z host z.{$HOSTNAME} handle @z { encode zstd gzip - reverse_proxy { - to {{ oracle1_private_ip }}:8897 - to {{ oracle2_private_ip }}:8897 - to {{ oracle3_private_ip }}:8897 - to {{ oracle4_private_ip }}:8897 - lb_policy ip_hash - lb_try_duration 5s - lb_try_interval 1s - fail_duration 30s - max_fails 3 - } + reverse_proxy {{ oracle3_private_ip }}:8897 header { X-Permitted-Cross-Domain-Policies "none" X-Robots-Tag "noindex, noimageindex, nosnippet, notranslate, noarchive, nofollow" diff --git a/templates/conf/nitter/nitter.conf.j2 b/templates/conf/nitter/nitter.conf.j2 index 45330a3..263dae0 100755 --- a/templates/conf/nitter/nitter.conf.j2 +++ b/templates/conf/nitter/nitter.conf.j2 @@ -41,7 +41,7 @@ tokenCount = 10 theme = "auto_(Twitter)" replaceTwitter = "n.opnxng.com" replaceYouTube = "invidious.fdn.fr" -replaceReddit = "i.opnxng.com" +replaceReddit = "l.opnxng.com" replaceInstagram = "" proxyVideos = true hlsPlayback = false diff --git a/templates/conf/settings.yml.j2 b/templates/conf/settings.yml.j2 index dc560d5..a9f08eb 100755 --- a/templates/conf/settings.yml.j2 +++ b/templates/conf/settings.yml.j2 @@ -217,9 +217,9 @@ hostname_replace: '(.*\.)?youtube\.com$': 'invidious.fdn.fr' '(.*\.)?youtu\.be$': 'invidious.fdn.fr' '(.*\.)?youtube-noocookie\.com$': 'invidious.fdn.fr' - '(.*\.)?reddit\.com$': 'i.opnxng.com' - '(.*\.)?redd\.it$': 'i.opnxng.com' - '(.*\.)?libi.opnxng\.com$': 'l.opnxng.com' + '(.*\.)?reddit\.com$': 'l.opnxng.com' + '(.*\.)?redd\.it$': 'l.opnxng.com' +# '(.*\.)?libi.opnxng\.com$': 'l.opnxng.com' # '(.*\.)?reddit\.com$': 'old.reddit.com' # '(.*\.)?redd\.it$': 'old.reddit.com' '(.*\.)?medium\.com$': 'm.opnxng.com' diff --git a/vars/services.yaml b/vars/services.yaml index ed265e9..91ecaf0 100644 --- a/vars/services.yaml +++ b/vars/services.yaml @@ -1,17 +1,18 @@ -config: - oracle4: - - caddy - compose: oracle4: - - caddy + - nitter + - paulgo + +config: + oracle4: + - nitter + - paulgo # ---------------------------------------------------------------------------------------------------- deployed-compose: vultr: - - libreddit - teddit - cloudtube - imgin @@ -22,7 +23,7 @@ deployed-compose: - send - privatebin #################### - - breezewiki + - redlib - voyager - mlmym - photon @@ -45,7 +46,7 @@ deployed-compose: - firefox - wolfree #################### - - breezewiki + - redlib - voyager - mlmym - photon @@ -69,8 +70,9 @@ deployed-compose: - gitea - runner - ntfy - #################### - breezewiki + #################### + - redlib - voyager - mlmym - photon @@ -96,7 +98,7 @@ deployed-compose: - authelia - geoipupdate #################### - - breezewiki + - redlib - voyager - mlmym - photon @@ -126,22 +128,20 @@ deployed-config: - anonymousoverflow - scribe - priviblur - - breezewiki oracle2: - firefox - anonymousoverflow - scribe - priviblur - - breezewiki oracle3: - ntfy - gitea - gitea-netrc - runner - - breezewiki - anonymousoverflow - scribe - priviblur + - breezewiki oracle4: - authelia - nitter @@ -150,4 +150,3 @@ deployed-config: - anonymousoverflow - scribe - priviblur - - breezewiki