Added Omgur

master
Meliurwen 4 years ago
parent 0405da2939
commit ae627b3691
Signed by: meliurwen
GPG Key ID: 818A8B35E9F1CE10
  1. 1
      .gitignore
  2. 17
      build.bibliogram.sh
  3. 11
      build.sh
  4. 4
      build.updaterepo.sh
  5. 23
      docker-compose.yml
  6. 4
      nginx.env.example
  7. 25
      nginx/root/etc/nginx/conf.d/default.template

1
.gitignore vendored

@ -1,4 +1,5 @@
*.env *.env
bibliogram/ bibliogram/
nitter/ nitter/
omgur/
config/ config/

@ -1,17 +0,0 @@
#!/bin/sh
set -e
REPO_URL=https://git.sr.ht/~cadence/bibliogram
REPO_DIR_PATH=bibliogram
# If repo exists update, else clone it
if [ -d "$REPO_DIR_PATH" ]; then
# Save the root dir path, enter the repo, pull new changes and come back
ROOT_DIR=$(pwd)
cd "$REPO_DIR_PATH"
git pull
cd "$ROOT_DIR"
else
git clone "$REPO_URL" "$REPO_DIR_PATH"
fi

@ -0,0 +1,11 @@
#!/bin/sh
set -e
echo "Updating nitter..."
./build.updaterepo.sh https://github.com/zedeus/nitter.git nitter
echo "Updating bibliogram..."
./build.updaterepo.sh https://git.sr.ht/~cadence/bibliogram bibliogram
echo "Updating omgur..."
./build.updaterepo.sh https://git.geraldwu.com/gerald/omgur.git omgur
echo "Done."

@ -2,8 +2,8 @@
set -e set -e
REPO_URL=https://github.com/zedeus/nitter.git REPO_URL="${1}"
REPO_DIR_PATH=nitter REPO_DIR_PATH="${2}"
# If repo exists update, else clone it # If repo exists update, else clone it
if [ -d "$REPO_DIR_PATH" ]; then if [ -d "$REPO_DIR_PATH" ]; then

@ -42,6 +42,29 @@ services:
networks: networks:
- socials - socials
omgur-redis:
image: ${OMGR_IMG:-redis:6-alpine}
container_name: ${OMGR_CONTAINER_NAME:-omgur-redis}
restart: ${OMGR_RESTART:-unless-stopped}
environment:
- REDIS_REPLICATION_MODE=master
networks:
- socials
omgur:
build:
context: omgur/
container_name: ${OMG_CONTAINER_NAME:-omgur}
restart: ${OMG_RESTART:-unless-stopped}
environment:
- REDIS_HOST=omgur-redis
expose:
- 8080
networks:
- socials
depends_on:
- omgur-redis
volumes: volumes:
db: db:

@ -10,6 +10,10 @@ NI_HOSTNAME=
NI_ADDR=nitter NI_ADDR=nitter
NI_PORT=8080 NI_PORT=8080
OMG_HOSTNAME=
OMG_ADDR=omgur
OMG_PORT=8080
NGINX_LISTEN_PORT=80 NGINX_LISTEN_PORT=80
# Reverse-proxy and certbot # Reverse-proxy and certbot

@ -20,6 +20,13 @@ upstream nitter {
server ${NI_ADDR}:${NI_PORT}; server ${NI_ADDR}:${NI_PORT};
} }
upstream omgur {
# Cannot connect to network of this container
server 127.0.0.1 down;
## Can be connected with the network
server ${OMG_ADDR}:${OMG_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,
@ -80,3 +87,21 @@ server {
} }
} }
server {
listen ${NGINX_LISTEN_PORT};
server_name ${OMG_HOSTNAME};
# Disable do not add the server version in the header
server_tokens off;
location / {
proxy_pass http://omgur;
}
location = /robots.txt {
add_header Content-Type text/plain;
return 200 "User-agent: *\nDisallow: /\n";
}
}

Loading…
Cancel
Save