Added libreddit

master
Meliurwen 3 years ago
parent 232e8f1ba4
commit 1632496b55
Signed by: meliurwen
GPG Key ID: 818A8B35E9F1CE10
  1. 1
      .gitignore
  2. 2
      build.sh
  3. 12
      docker-compose.yml
  4. 11
      libreddit.env.example
  5. 26
      nginx/root/etc/nginx/conf.d/default.template

1
.gitignore vendored

@ -3,4 +3,5 @@ bibliogram/
nitter/ nitter/
omgur/ omgur/
invidious/ invidious/
libreddit/
config/ config/

@ -10,4 +10,6 @@ echo "Updating omgur..."
./build.updaterepo.sh https://git.geraldwu.com/gerald/omgur.git omgur ./build.updaterepo.sh https://git.geraldwu.com/gerald/omgur.git omgur
echo "Updating invidious..." echo "Updating invidious..."
./build.updaterepo.sh https://github.com/iv-org/invidious.git invidious ./build.updaterepo.sh https://github.com/iv-org/invidious.git invidious
echo "Updating libreddit..."
./build.updaterepo.sh https://github.com/spikecodes/libreddit.git libreddit
echo "Done." echo "Done."

@ -100,6 +100,18 @@ services:
depends_on: depends_on:
- invidious-postgres - invidious-postgres
libreddit:
build:
context: libreddit/
container_name: ${LRT_CONTAINER_NAME:-libreddit}
restart: ${LRT_RESTART:-unless-stopped}
env_file:
- libreddit.env
expose:
- 8080
networks:
- socials
volumes: volumes:
nginx-cache: nginx-cache:
bibliogram-db: bibliogram-db:

@ -0,0 +1,11 @@
# See: https://github.com/spikecodes/libreddit/blob/master/README.md
#LIBREDDIT_DEFAULT_THEME=
#LIBREDDIT_DEFAULT_FRONT_PAGE=
#LIBREDDIT_DEFAULT_LAYOUT=
#LIBREDDIT_DEFAULT_WIDE=
#LIBREDDIT_DEFAULT_COMMENT_SORT=
#LIBREDDIT_DEFAULT_POST_SORT=
#LIBREDDIT_DEFAULT_SHOW_NSFW=
#LIBREDDIT_DEFAULT_USE_HLS=
#LIBREDDIT_DEFAULT_HIDE_HLS_NOTIFICATION=

@ -34,6 +34,13 @@ upstream invidious {
server ${INV_ADDR}:${INV_PORT}; server ${INV_ADDR}:${INV_PORT};
} }
upstream libreddit {
# Cannot connect to network of this container
server 127.0.0.1 down;
## Can be connected with the network
server ${LRT_ADDR}:${LRT_PORT};
}
server { server {
# This is a catch-all hostname (it will never trigger on a real hostname). # This is a catch-all hostname (it will never trigger on a real hostname).
# If an access by IP or by an unhandled domain linking to this IP is tried, # If an access by IP or by an unhandled domain linking to this IP is tried,
@ -78,7 +85,6 @@ server {
add_header Content-Type text/plain; add_header Content-Type text/plain;
return 200 "User-agent: *\nDisallow: /\n"; return 200 "User-agent: *\nDisallow: /\n";
} }
} }
server { server {
@ -96,7 +102,6 @@ server {
add_header Content-Type text/plain; add_header Content-Type text/plain;
return 200 "User-agent: *\nDisallow: /\n"; return 200 "User-agent: *\nDisallow: /\n";
} }
} }
server { server {
@ -114,7 +119,6 @@ server {
add_header Content-Type text/plain; add_header Content-Type text/plain;
return 200 "User-agent: *\nDisallow: /\n"; return 200 "User-agent: *\nDisallow: /\n";
} }
} }
server { server {
@ -158,5 +162,21 @@ server {
proxy_cache_valid 200 31d; # Used for /videoplayback responses proxy_cache_valid 200 31d; # Used for /videoplayback responses
proxy_cache_valid 302 31d; # Used for /latest_version responses proxy_cache_valid 302 31d; # Used for /latest_version responses
} }
}
server {
listen ${NGINX_LISTEN_PORT};
server_name ${LRT_HOSTNAME};
# Disable do not add the server version in the header
server_tokens off;
location / {
proxy_pass http://libreddit;
}
location = /robots.txt {
add_header Content-Type text/plain;
return 200 "User-agent: *\nDisallow: /\n";
}
} }

Loading…
Cancel
Save