Add mc & synapse

This commit is contained in:
Viyurz 2023-11-28 14:01:43 +00:00
parent 563fbf202c
commit 42fa44e3ec
No known key found for this signature in database
5 changed files with 129 additions and 2 deletions

2
maj.sh
View file

@ -1,7 +1,7 @@
#!/bin/bash
services=(nginx-rp nginx-www searxng vw)
services=(mc nginx-rp nginx-www searxng synapse vw)
if [[ ! $(echo "${services[*]} all" | grep -P "\b$1\b" ) ]]; then

23
mc/docker-compose.yaml Normal file
View file

@ -0,0 +1,23 @@
services:
minecraft:
image: itzg/minecraft-server:latest
container_name: minecraft
restart: always
environment:
VERSION: latest
EULA: "TRUE"
MEMORY: 2G
ENABLE_COMMAND_BLOCK: "true"
MOTD: "Fjeaj"
OPS: |
Viyurz
ports:
- "5432:25565"
- "25565:25565"
volumes:
- minecraft:/data
volumes:
minecraft:
name: minecraft

View file

@ -213,6 +213,23 @@ http {
}
}
server {
listen 443 ssl;
listen [::]:443 ssl;
http2 on;
server_name matrix.viyurz.fr;
location ~ ^(/_matrix|/_synapse/client) {
proxy_pass http://localhost:8008;
# Nginx by default only allows file uploads up to 1M in size
# Increase client_max_body_size to match max_upload_size defined in homeserver.yaml
client_max_body_size 50M;
}
}
server {
listen 443 ssl;
listen [::]:443 ssl;
@ -234,6 +251,13 @@ http {
server_name viyurz.fr;
return 308 https://www.viyurz.fr$request_uri;
location /.well-known/matrix/server {
default_type application/json;
return 200 '{ "m.server": "matrix.viyurz.fr:443" }';
}
location / {
return 308 https://www.viyurz.fr$request_uri;
}
}
}

View file

@ -0,0 +1,36 @@
services:
postgres:
container_name: synapse_postgres
image: postgres:alpine
environment:
LANG: C
POSTGRES_INITDB_ARGS: "--locale=C --encoding=UTF8"
POSTGRES_USER: synapse
POSTGRES_PASSWORD: synapse
networks:
- synapse
volumes:
- /mnt/synapsepgdata:/var/lib/postgresql/data
synapse:
container_name: synapse
image: matrixdotorg/synapse:latest
# command: generate
restart: always
environment:
# SYNAPSE_SERVER_NAME: viyurz.fr
# SYNAPSE_REPORT_STATS: "yes"
# SYNAPSE_HTTP_PORT: 8008
TZ: "Europe/Paris"
networks:
- synapse
ports:
- "[::1]:8008:8008"
volumes:
- /mnt/synapsedata:/data
- ./homeserver.yaml:/data/homeserver.yaml
networks:
synapse:
ipam:
driver: default

44
synapse/homeserver.yaml Normal file
View file

@ -0,0 +1,44 @@
# Configuration file for Synapse.
#
# This is a YAML file: see [1] for a quick introduction. Note in particular
# that *indentation is important*: all the elements of a list or dictionary
# should have the same indentation.
#
# [1] https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html
#
# For more information on how to configure Synapse, including a complete accounting of
# each option, go to docs/usage/configuration/config_documentation.md or
# https://matrix-org.github.io/synapse/latest/usage/configuration/config_documentation.html
server_name: "viyurz.fr"
pid_file: /data/homeserver.pid
listeners:
- port: 8008
tls: false
type: http
x_forwarded: true
resources:
- names: [client, federation]
compress: false
database:
name: psycopg2
args:
user: synapse
password: synapse
dbname: synapse
host: synapse_postgres
cp_min: 5
cp_max: 10
log_config: "/data/viyurz.fr.log.config"
media_store_path: /data/media_store
enable_registration: true
registration_requires_token: true
registration_shared_secret: "=ttPttyH=QslvTeg:owJKCI7w9Dhlz&PRLvCRaz#:de^T1Dcq@"
report_stats: true
macaroon_secret_key: "Ibz1OAyP+:IR_BgLx:*cID82B=pYlDy*76gwh#kQV4,iEUDE~h"
form_secret: "bj5sv.-B:R.2Z@@cK*rBti&J,v^34.gXNNR*5tNPWTUpkrE+Sv"
signing_key_path: "/data/viyurz.fr.signing.key"
trusted_key_servers:
- server_name: "matrix.org"
# vim:ft=yaml