0
0

Added Cloudtube + Removed 4get

This commit is contained in:
Opnxng 2023-11-20 02:43:41 +08:00
parent 478b39ca89
commit 08dd1273c6
8 changed files with 163 additions and 43 deletions

View File

@ -0,0 +1,51 @@
- name: Set up cloudtube config.js
template:
src: "conf/config.js.j2"
dest: "{{ docker_dir }}/cloudtube/config.js"
owner: 1000
group: 1000
mode: 0755
- name: Set up newleaf
template:
src: "conf/configuration.py.j2"
dest: "{{ docker_dir }}/cloudtube/configuration.py"
owner: 1000
group: 1000
mode: 0755
- name: Install packages for smart-ipv6-rotator
apt:
name:
- python3-pyroute2
- python3-requests
state: latest
install_recommends: false
- name: Clone smart-ipv6-rotator
ansible.builtin.git:
repo: https://github.com/iv-org/smart-ipv6-rotator.git
dest: "{{ docker_dir }}/cloudtube/smart-ipv6-rotator"
single_branch: yes
version: master
# - name: vultr cron
# cron:
# name: "Rotating IPv6 address on boot"
# special_time: "reboot"
# job: 'sleep 30s && python3 {{ docker_dir }}/cloudtube/smart-ipv6-rotator/smart-ipv6-rotator.py run --ipv6range=2001:19f0:4400:2e62::/64 && curl -H prio:low -d "Rotate IPv6 address successful" https://ntfy.opnxng.com/cron || curl -H tags:warning -H prio:high -d "Rotate IPv6 address failed!" https://ntfy.opnxng.com/cron;'
# user: root
# become: true
# when:
# - inventory_hostname == 'vultr'
#
# - name: vultr cron
# cron:
# name: "Rotating IPv6 address twice a day"
# minute: "0"
# hour: "*/12"
# job: 'python3 {{ docker_dir }}/cloudtube/smart-ipv6-rotator/smart-ipv6-rotator.py run --ipv6range=2001:19f0:4400:2e62::/64 && curl -H prio:low -d "Rotate IPv6 address successful" https://ntfy.opnxng.com/cron || curl -H tags:warning -H prio:high -d "Rotate IPv6 address failed!" https://ntfy.opnxng.com/cron;'
# user: root
# become: true
# when:
# - inventory_hostname == 'vultr'

View File

@ -16,7 +16,7 @@ services:
- FOURGET_SERVER_ADMIN_EMAIL=opnxng@tuta.io
volumes:
- {{ docker_dir }}/4get/config.php:/data/config.php
restart: unless-stopped
#restart: unless-stopped
ports:
- '8907:80'
networks:

View File

@ -0,0 +1,46 @@
# {{ ansible_managed }}
version: "3.4"
services:
cloudtube:
image: abeltramo/cloudtube:latest
container_name: cloudtube
security_opt:
- no-new-privileges
cap_drop:
- ALL
environment:
- PUID=1000
- PGID=1000
- TZ=Asia/Singapore
ports:
- 8911:10412
depends_on:
- newleaf
restart: unless-stopped
volumes:
- {{ docker_dir }}/cloudtube/db:/workdir/db
- {{ docker_dir }}/cloudtube/config.js:/workdir/config/config.js #instance should be "http://newleaf:3000"
networks:
- cloudtube
newleaf:
image: abeltramo/newleaf:latest
container_name: newleaf
security_opt:
- no-new-privileges
cap_drop:
- ALL
environment:
- PUID=1000
- PGID=1000
- TZ=Asia/Singapore
restart: unless-stopped
volumes:
- {{ docker_dir }}/cloudtube/configuration.py:/workdir/configuration.py #set e.g. website_origin = "https://tube.domain.tld" and bind_port = 3000
networks:
- cloudtube
networks:
cloudtube:
name: cloudtube

View File

@ -544,29 +544,29 @@
}
}
@4g host 4g.{$HOSTNAME}
handle @4g {
encode zstd gzip
@notstatic {
not path /static/* /android-chrome* /favicon* /robots.txt /banner/* /site.webmanifest
}
rate_limit @notstatic {remote.ip} 2r/s 60000 500
rate_limit @notstatic {remote.ip} 45r/m 300000 500
reverse_proxy {
to {{ oracle1_private_ip }}:8907
to {{ oracle2_private_ip }}:8907
to {{ oracle3_private_ip }}:8907
to {{ oracle4_private_ip }}:8907
lb_policy ip_hash
lb_try_duration 5s
lb_try_interval 1s
fail_duration 30s
max_fails 3
}
header {
X-Robots-Tag "noindex, noimageindex, nosnippet, notranslate, noarchive, nofollow"
}
}
# @4g host 4g.{$HOSTNAME}
# handle @4g {
# encode zstd gzip
# @notstatic {
# not path /static/* /android-chrome* /favicon* /robots.txt /banner/* /site.webmanifest
# }
# rate_limit @notstatic {remote.ip} 2r/s 60000 500
# rate_limit @notstatic {remote.ip} 45r/m 300000 500
# reverse_proxy {
# to {{ oracle1_private_ip }}:8907
# to {{ oracle2_private_ip }}:8907
# to {{ oracle3_private_ip }}:8907
# to {{ oracle4_private_ip }}:8907
# lb_policy ip_hash
# lb_try_duration 5s
# lb_try_interval 1s
# fail_duration 30s
# max_fails 3
# }
# header {
# X-Robots-Tag "noindex, noimageindex, nosnippet, notranslate, noarchive, nofollow"
# }
# }
@ig host ig.{$HOSTNAME}
handle @ig {
@ -615,8 +615,8 @@
}
}
@y host y.{$HOSTNAME}
handle @y {
@yt host yt.{$HOSTNAME}
handle @yt {
encode zstd gzip
reverse_proxy {{ vultr_private_ip }}:8911
header {

View File

@ -0,0 +1,18 @@
module.exports = {
/*
Copy this file to `config.js`, and add options here.
They'll override the options from `utils/constants.js`.
For example, the next block changes the default instance.
*/
user_settings: {
instance: {
default: "http://newleaf:3000"
}
},
/*
If cloudtube and Newleaf is not in same docker-network, you need to also set local_instance_origin.
*/
server_setup: {
local_instance_origin: "http://newleaf:3000"
}
}

View File

@ -423,7 +423,7 @@ jobs:
## Accepted values: any string. HTML is accepted.
## Default: <none>
##
#banner:
banner: <p style="text-align:center">Please use <a href="https://invidious.fdn.fr/search/">another instance</a> if you wish to proxy videos.</p>
##
## Subscribe to channels using PubSubHub (Google PubSubHubbub service).

View File

@ -0,0 +1,17 @@
# ==============================
# You MUST set these settings.
# ==============================
# A URL that this site can be accessed on. Do not include a trailing slash.
website_origin = "http://newleaf:3000"
# ==============================
# These settings are optional.
# ==============================
# The address of the interface to bind to.
#bind_host = "0.0.0.0"
# The port to bind to.
#bind_port = 3000

View File

@ -1,23 +1,19 @@
config:
oracle4:
- caddy
vultr:
- cloudtube
compose:
oracle4:
- caddy
# ----------------------------------------------------------------------------------------------------
deployed-compose:
vultr:
- invidious
- cloudtube
####################
- teddit
- libreddit
- imgin
- rat-aint-tieba
- watchtower
- 4get
- socks5
oracle1:
- send
@ -41,7 +37,6 @@ deployed-compose:
- libremdb
- binternet
- watchtower
- 4get
- socks5
oracle2:
- firefox
@ -65,7 +60,6 @@ deployed-compose:
- libremdb
- binternet
- watchtower
- 4get
- socks5
oracle3:
- breezewiki
@ -92,7 +86,6 @@ deployed-compose:
- libremdb
- binternet
- watchtower
- 4get
- socks5
oracle4:
- caddy
@ -119,21 +112,18 @@ deployed-compose:
- libremdb
- binternet
- watchtower
- 4get
- socks5
# ----------------------------------------------------------------------------------------------------
deployed-config:
vultr:
- invidious
- cloudtube
oracle1:
- 4get
- anonymousoverflow
- scribe
oracle2:
- firefox
- 4get
- anonymousoverflow
- scribe
oracle3:
@ -142,7 +132,6 @@ deployed-config:
- gitea-netrc
- runner
- breezewiki
- 4get
- anonymousoverflow
- scribe
oracle4:
@ -150,6 +139,5 @@ deployed-config:
- nitter
- paulgo
- caddy
- 4get
- anonymousoverflow
- scribe