mirror of
https://git.oxeozero.it.com/oxeo0/selfhosting-blogposts.git
synced 2025-05-19 17:30:22 -04:00
add selfhosting tutorials
This commit is contained in:
parent
95c33c8b41
commit
cc3824e6a2
1900 changed files with 32727 additions and 0 deletions
BIN
teddit/0.png
Normal file
BIN
teddit/0.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
BIN
teddit/1.png
Normal file
BIN
teddit/1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 68 KiB |
BIN
teddit/2.png
Normal file
BIN
teddit/2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 74 KiB |
184
teddit/index.md
Normal file
184
teddit/index.md
Normal file
|
@ -0,0 +1,184 @@
|
|||
# Teddit Setup
|
||||
|
||||

|
||||
|
||||
In this tutorial we're going to setup Teddit, a privacy front-end for Reddit.
|
||||
|
||||
## **Initial Setup**
|
||||
|
||||
first install the dependencies
|
||||
|
||||
|
||||
[ nowhere.moe ] [ /dev/pts/2 ] [~]
|
||||
→ apt install docker.io docker-compose -y
|
||||
|
||||
|
||||
|
||||
Then run it with docker-compose:
|
||||
|
||||
|
||||
[ nowhere.moe ] [ /dev/pts/2 ] [/srv]
|
||||
→ git clone https://codeberg.org/teddit/teddit
|
||||
Cloning into 'teddit'...
|
||||
remote: Enumerating objects: 609, done.
|
||||
remote: Counting objects: 100% (609/609), done.
|
||||
remote: Compressing objects: 100% (283/283), done.
|
||||
remote: Total 6548 (delta 492), reused 324 (delta 324), pack-reused 5939
|
||||
Receiving objects: 100% (6548/6548), 4.35 MiB | 24.59 MiB/s, done.
|
||||
Resolving deltas: 100% (3049/3049), done.
|
||||
|
||||
[ nowhere.moe ] [ /dev/pts/2 ] [/srv]
|
||||
→ cd teddit
|
||||
|
||||
[ nowhere.moe ] [ /dev/pts/2 ] [/srv/teddit]
|
||||
→ vim docker-compose.yml
|
||||
|
||||
[ nowhere.moe ] [ /dev/pts/2 ] [/srv/teddit]
|
||||
→ cat docker-compose.yml
|
||||
# This docker-compose file is made for development purpose and build from source, if you want to use teddit in production, the README contains a production-ready docker-compose setup.
|
||||
|
||||
version: "3"
|
||||
|
||||
services:
|
||||
|
||||
teddit:
|
||||
container_name: teddit
|
||||
build: .
|
||||
environment:
|
||||
- REDIS_HOST=teddit-redis
|
||||
ports:
|
||||
- "8082:8080"
|
||||
networks:
|
||||
- teddit_net
|
||||
healthcheck:
|
||||
test: ["CMD", "wget" ,"--no-verbose", "--tries=1", "--spider", "http://localhost:8080/about"]
|
||||
interval: 1m
|
||||
timeout: 3s
|
||||
depends_on:
|
||||
- teddit-redis
|
||||
|
||||
teddit-redis:
|
||||
container_name: teddit-redis
|
||||
image: redis:6.2.5-alpine
|
||||
command: redis-server
|
||||
environment:
|
||||
- REDIS_REPLICATION_MODE=master
|
||||
networks:
|
||||
- teddit_net
|
||||
|
||||
networks:
|
||||
teddit_net:
|
||||
|
||||
[ nowhere.moe ] [ /dev/pts/2 ] [/srv/teddit]
|
||||
→ docker-compose up -d
|
||||
Creating network "teddit_teddit_net" with the default driver
|
||||
Pulling teddit-redis (redis:6.2.5-alpine)...
|
||||
6.2.5-alpine: Pulling from library/redis
|
||||
a0d0a0d46f8b: Pull complete
|
||||
a04b0375051e: Pull complete
|
||||
cdc2bb0f9590: Pull complete
|
||||
8f19735ec10c: Pull complete
|
||||
ac5156a4c6ca: Pull complete
|
||||
7b7e1b3fdb00: Pull complete
|
||||
Digest: sha256:fa785f9bd167b94a6b30210ae32422469f4b0f805f4df12733c2f177f500d1ba
|
||||
Status: Downloaded newer image for redis:6.2.5-alpine
|
||||
Building teddit
|
||||
Step 1/9 : FROM node:slim
|
||||
slim: Pulling from library/node
|
||||
faef57eae888: Pull complete
|
||||
f54b1e40b8eb: Pull complete
|
||||
36433a2ca875: Pull complete
|
||||
604c60d297fb: Pull complete
|
||||
aa860910361c: Pull complete
|
||||
Digest: sha256:11f66bf5d0842fe1f87457fabe62aa3bbcfbb739d231a39e67597af22d8f5ffd
|
||||
Status: Downloaded newer image for node:slim
|
||||
---> 9eabbb6ea234
|
||||
Step 2/9 : RUN apt-get update && apt-get install -y ffmpeg wget
|
||||
|
||||
[...]
|
||||
|
||||
[ nowhere.moe ] [ /dev/pts/2 ] [/srv/teddit]
|
||||
→ docker-compose up -d
|
||||
teddit-redis is up-to-date
|
||||
Recreating teddit ... done
|
||||
|
||||
|
||||
|
||||
Then from here you need to setup the reverse nginx proxy as follows:
|
||||
|
||||
|
||||
[ nowhere.moe ] [ /dev/pts/2 ] [/etc/nginx/sites-available]
|
||||
→ vim teddit.nowhere.moe
|
||||
|
||||
[ nowhere.moe ] [ /dev/pts/2 ] [/etc/nginx/sites-available]
|
||||
→ cat teddit.nowhere.moe
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name teddit.nowhere.moe;
|
||||
|
||||
ssl_certificate /etc/acme/certs/teddit.nowhere.moe/teddit.nowhere.moe.cer;
|
||||
ssl_certificate_key /etc/acme/certs/teddit.nowhere.moe/teddit.nowhere.moe.key;
|
||||
|
||||
######## TOR CHANGES ########
|
||||
listen 4443;
|
||||
listen [::]:4443;
|
||||
server_name teddit.daturab6drmkhyeia4ch5gvfc2f3wgo6bhjrv3pz6n7kxmvoznlkq4yd.onion;
|
||||
add_header Onion-Location "http://teddit.daturab6drmkhyeia4ch5gvfc2f3wgo6bhjrv3pz6n7kxmvoznlkq4yd.onion$request_uri" always;
|
||||
######## TOR CHANGES ########
|
||||
|
||||
location / {
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_pass http://localhost:8082;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[ nowhere.moe ] [ /dev/pts/2 ] [/etc/nginx/sites-available]
|
||||
→ bash
|
||||
root@Datura /etc/nginx/sites-available # acme.sh --issue --standalone -d teddit.nowhere.moe -k 4096
|
||||
|
||||
root@Datura /etc/nginx/sites-available # ln -s /etc/nginx/sites-available/teddit.nowhere.moe /etc/nginx/sites-enabled/
|
||||
root@Datura /etc/nginx/sites-available # nginx -t
|
||||
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
|
||||
nginx: configuration file /etc/nginx/nginx.conf test is successful
|
||||
root@Datura /etc/nginx/sites-available # systemctl restart nginx
|
||||
|
||||
|
||||
|
||||
Then we can test if the website is reachable:
|
||||
|
||||

|
||||
|
||||
And also from tor:
|
||||
|
||||

|
||||
|
||||
Then last step is contributing to the overall [list](https://codeberg.org/teddit/teddit#instances) of instances [like so](https://codeberg.org/teddit/teddit/issues/413):
|
||||
|
||||
Then make sure teddit is restarted once every hour:
|
||||
|
||||
|
||||
[ nowhere.moe ] [ /dev/pts/1 ] [/srv/teddit]
|
||||
→ crontab -e
|
||||
|
||||
@hourly docker-compose -f /srv/teddit/docker-compose.yml stop ; git -C /srv/teddit/ pull ; docker-compose -f /srv/teddit/docker-compose.yml pull ; docker-compose -f /srv/teddit/docker-compose.yml up -d
|
||||
|
||||
|
||||
[ nowhere.moe ] [ /dev/pts/2 ] [~]
|
||||
→ cronitor select
|
||||
|
||||
✔ docker-compose -f /srv/teddit/docker-compose.yml stop ; git -C /srv/teddit/ pull ; docker-compose -f /srv/teddit/docker-compose.yml pull ; docker-compose -f /srv/teddit/docker-compose.yml up -d
|
||||
----► Running command: docker-compose -f /srv/teddit/docker-compose.yml stop ; git -C /srv/teddit/ pull ; docker-compose -f /srv/teddit/docker-compose.yml pull ; docker-compose -f /srv/teddit/docker-compose.yml up -d
|
||||
|
||||
Stopping teddit ... done
|
||||
Stopping teddit-redis ... done
|
||||
Already up to date.
|
||||
Pulling teddit-redis ... done
|
||||
Starting teddit-redis ... done
|
||||
Starting teddit ... done
|
||||
|
||||
----► ✔ Command successful Elapsed time 14.079s
|
||||
|
||||
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue