Some fixes and updates
This commit is contained in:
parent
8420d67968
commit
3beb597593
@ -1,6 +1,6 @@
|
|||||||
# dcomms
|
# dcomms
|
||||||
|
|
||||||
Decentralized communications that work with or without the Internet
|
Decentralized communications that work with or without the Internet
|
||||||
|
|
||||||
# Prerequisites
|
# Prerequisites
|
||||||
* `docker` using the docker guide (https://docs.docker.com/engine/install/)
|
* `docker` using the docker guide (https://docs.docker.com/engine/install/)
|
||||||
@ -67,7 +67,7 @@ In the future, if you need to start the dcomms containers again simply run the `
|
|||||||
|
|
||||||
# Tor
|
# Tor
|
||||||
|
|
||||||
If you wish to provide users with a Tor hidden service address by which they can access your services, you must first install and [configure Tor](https://community.torproject.org/onion-services/setup/).
|
If you wish to provide users with a Tor hidden service address by which they can access your services, you must first install and [configure Tor](https://community.torproject.org/onion-services/setup/).
|
||||||
The script will detect if you have Tor installed and prompt you for a hidden service address. You can find this in the `hostname` file in your `HiddenServiceDir`.
|
The script will detect if you have Tor installed and prompt you for a hidden service address. You can find this in the `hostname` file in your `HiddenServiceDir`.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|||||||
@ -41,7 +41,7 @@ matrix.{$DWEB_DOMAIN}:8448 {
|
|||||||
reverse_proxy http://synapse:8008
|
reverse_proxy http://synapse:8008
|
||||||
}
|
}
|
||||||
|
|
||||||
social.{$DWEB_DOMAIN}, http://social.{$DWEB_ONION} {
|
social.{$DWEB_DOMAIN}, http://social.{$DWEB_ONION} {
|
||||||
|
|
||||||
root * /srv/mastodon/public
|
root * /srv/mastodon/public
|
||||||
encode gzip
|
encode gzip
|
||||||
|
|||||||
@ -12,7 +12,7 @@ services:
|
|||||||
entrypoint:
|
entrypoint:
|
||||||
- sh
|
- sh
|
||||||
- -c
|
- -c
|
||||||
- "postconf -M submission/inet=\"submission inet n - n - - smtpd\" && postconf -P submission/inet/syslog_name=postfix/submission && postconf -P submission/inet/smtpd_tls_security_level=encrypt && postconf -P submission/inet/smtpd_sasl_type=dovecot && postconf -P submission/inet/smtpd_sasl_path=inet:localhost:12345 && postconf -P submission/inet/smtpd_sasl_auth_enable=yes && postconf \"myhostname=${DWEB_DOMAIN}\" && postconf \"mydestination=\" && postconf \"virtual_mailbox_domains=${DWEB_DOMAIN}\" && postconf \"virtual_transport=lmtp:localhost:24\" && postconf \"virtual_mailbox_base=/home/vmail\" && postconf \"virtual_mailbox_maps=texthash:/var/lib/mailadm/virtual_mailboxes\" && postconf \"maillog_file=/dev/stdout\" && postconf \"smtpd_tls_cert_file=/certs/fullchain.pem\" && postconf \"smtpd_tls_key_file=/certs/privkey.pem\" && postfix start-fg"
|
- "postconf -M submission/inet=\"submission inet n - n - - smtpd\" && postconf -P submission/inet/syslog_name=postfix/submission && postconf -P submission/inet/smtpd_tls_security_level=encrypt && postconf -P submission/inet/smtpd_sasl_type=dovecot && postconf -P submission/inet/smtpd_sasl_path=inet:localhost:12345 && postconf -P submission/inet/smtpd_sasl_auth_enable=yes && postconf \"myhostname=${DWEB_DOMAIN}\" && postconf \"mydestination=\" && postconf \"virtual_mailbox_domains=${DWEB_DOMAIN}\" && postconf \"virtual_transport=lmtp:localhost:24\" && postconf \"virtual_mailbox_base=/home/vmail\" && postconf \"virtual_mailbox_maps=texthash:/var/lib/mailadm/virtual_mailboxes\" && postconf \"maillog_file=/dev/stdout\" && postconf \"smtpd_tls_cert_file=/certs/fullchain.pem\" && postconf \"smtpd_tls_key_file=/certs/privkey.pem\" && postfix start-fg"
|
||||||
volumes:
|
volumes:
|
||||||
- mailadm_db:/var/lib/mailadm/
|
- mailadm_db:/var/lib/mailadm/
|
||||||
- ../caddy/certs/${DWEB_DOMAIN}.crt:/certs/fullchain.pem
|
- ../caddy/certs/${DWEB_DOMAIN}.crt:/certs/fullchain.pem
|
||||||
@ -20,7 +20,7 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
MAIL_DOMAIN: "${DWEB_DOMAIN}"
|
MAIL_DOMAIN: "${DWEB_DOMAIN}"
|
||||||
networks:
|
networks:
|
||||||
- back
|
- back
|
||||||
depends_on:
|
depends_on:
|
||||||
- caddy
|
- caddy
|
||||||
restart: always
|
restart: always
|
||||||
@ -36,7 +36,7 @@ services:
|
|||||||
VMAIL_UID: "${VMAIL_UID}"
|
VMAIL_UID: "${VMAIL_UID}"
|
||||||
VMAIL_GID: "${VMAIL_GID}"
|
VMAIL_GID: "${VMAIL_GID}"
|
||||||
networks:
|
networks:
|
||||||
- back
|
- back
|
||||||
depends_on:
|
depends_on:
|
||||||
- caddy
|
- caddy
|
||||||
restart: always
|
restart: always
|
||||||
@ -56,7 +56,7 @@ services:
|
|||||||
VMAIL_GID: "${VMAIL_GID}"
|
VMAIL_GID: "${VMAIL_GID}"
|
||||||
WEB_ENDPOINT: "https://${DWEB_DOMAIN}/new_email"
|
WEB_ENDPOINT: "https://${DWEB_DOMAIN}/new_email"
|
||||||
networks:
|
networks:
|
||||||
- back
|
- back
|
||||||
depends_on:
|
depends_on:
|
||||||
- caddy
|
- caddy
|
||||||
restart: always
|
restart: always
|
||||||
|
|||||||
@ -13,21 +13,21 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- caddy_data:/data
|
- caddy_data:/data
|
||||||
- caddy_config:/config
|
- caddy_config:/config
|
||||||
- type: bind
|
- type: bind
|
||||||
source: /var/www
|
source: /var/www
|
||||||
target: /www
|
target: /www
|
||||||
- type: bind
|
- type: bind
|
||||||
source: ../caddy/certs
|
source: ../caddy/certs
|
||||||
target: /data/caddy/certificates/acme-v02.api.letsencrypt.org-directory/${DWEB_DOMAIN}
|
target: /data/caddy/certificates/acme-v02.api.letsencrypt.org-directory/${DWEB_DOMAIN}
|
||||||
networks:
|
networks:
|
||||||
- back
|
- back
|
||||||
ports:
|
ports:
|
||||||
- target: 80
|
- target: 80
|
||||||
published: 80
|
published: 80
|
||||||
protocol: tcp
|
protocol: tcp
|
||||||
mode: host
|
mode: host
|
||||||
- target: 443
|
- target: 443
|
||||||
published: 443
|
published: 443
|
||||||
protocol: tcp
|
protocol: tcp
|
||||||
mode: host
|
mode: host
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
@ -9,7 +9,7 @@ services:
|
|||||||
### ELEMENT
|
### ELEMENT
|
||||||
# synapse is a matrix homeserver running as a service
|
# synapse is a matrix homeserver running as a service
|
||||||
synapse:
|
synapse:
|
||||||
image: matrixdotorg/synapse:v1.110.0
|
image: matrixdotorg/synapse:v1.121.1
|
||||||
entrypoint:
|
entrypoint:
|
||||||
- sh
|
- sh
|
||||||
- -c
|
- -c
|
||||||
@ -44,17 +44,17 @@ services:
|
|||||||
mode: 0644
|
mode: 0644
|
||||||
restart: always
|
restart: always
|
||||||
|
|
||||||
synapse-pg:
|
synapse-pg:
|
||||||
restart: always
|
restart: always
|
||||||
image: postgres:14-alpine
|
image: postgres:14-alpine
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ['CMD', 'pg_isready', '-U', 'postgres']
|
test: ['CMD', 'pg_isready', '-U', 'postgres']
|
||||||
environment:
|
environment:
|
||||||
- 'POSTGRES_HOST_AUTH_METHOD=trust'
|
- 'POSTGRES_HOST_AUTH_METHOD=trust'
|
||||||
- 'POSTGRES_INITDB_ARGS=--encoding="UTF8" --lc-collate="C" --lc-ctype="C"'
|
- 'POSTGRES_INITDB_ARGS=--encoding="UTF8" --lc-collate="C" --lc-ctype="C"'
|
||||||
volumes:
|
volumes:
|
||||||
- synapse_db:/var/lib/postgresql/data
|
- synapse_db:/var/lib/postgresql/data
|
||||||
depends_on:
|
depends_on:
|
||||||
- caddy
|
- caddy
|
||||||
networks:
|
networks:
|
||||||
- back
|
- back
|
||||||
@ -71,7 +71,7 @@ services:
|
|||||||
|
|
||||||
# element is a matrix web GUI running as a service
|
# element is a matrix web GUI running as a service
|
||||||
element:
|
element:
|
||||||
image: vectorim/element-web:v1.11.69
|
image: vectorim/element-web:v1.11.88
|
||||||
networks:
|
networks:
|
||||||
- back
|
- back
|
||||||
ports:
|
ports:
|
||||||
|
|||||||
@ -10,10 +10,6 @@ volumes:
|
|||||||
mastodon_db:
|
mastodon_db:
|
||||||
services:
|
services:
|
||||||
### MASTODON
|
### MASTODON
|
||||||
caddy:
|
|
||||||
image: caddy:2.6.4
|
|
||||||
volumes:
|
|
||||||
- mastodon_public:/srv/mastodon/public:ro
|
|
||||||
|
|
||||||
mastodon-redis:
|
mastodon-redis:
|
||||||
restart: always
|
restart: always
|
||||||
@ -32,11 +28,10 @@ services:
|
|||||||
image: tootsuite/mastodon:v4.3.0
|
image: tootsuite/mastodon:v4.3.0
|
||||||
#healthcheck:
|
#healthcheck:
|
||||||
#test: ['CMD-SHELL', 'wget -q --spider --proxy=off localhost:3000/health || exit 1']
|
#test: ['CMD-SHELL', 'wget -q --spider --proxy=off localhost:3000/health || exit 1']
|
||||||
#entrypoint:
|
entrypoint:
|
||||||
# - bash
|
- bash
|
||||||
# - -c
|
- -c
|
||||||
# #- "bundle exec rake db:prepare && cd /opt/mastodon && /usr/bin/tini -- bundle exec rails server"
|
- "cd /opt/mastodon && /usr/bin/tini -- bundle exec rails server"
|
||||||
# - "[[ -e /mastodon/public/db.lock ]] && touch /mastodon/public/db.lock || touch /mastodon/public/db.lock && bundle exec rake db:prepare; /usr/bin/tini -- bundle exec rails server"
|
|
||||||
env_file: ../mastodon/env.production
|
env_file: ../mastodon/env.production
|
||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:3000:3000"
|
- "127.0.0.1:3000:3000"
|
||||||
@ -49,16 +44,19 @@ services:
|
|||||||
- mastodon-redis
|
- mastodon-redis
|
||||||
- mastodon-streaming
|
- mastodon-streaming
|
||||||
volumes:
|
volumes:
|
||||||
# https://www.digitalocean.com/community/tutorials/how-to-share-data-between-docker-containers
|
- type: volume
|
||||||
- mastodon_public:/mastodon/public/ # map static files in volume for caddy
|
source: mastodon_public
|
||||||
|
target: /mastodon/public/system
|
||||||
|
volume:
|
||||||
|
subpath: system
|
||||||
networks:
|
networks:
|
||||||
- mast-int
|
- mast-int
|
||||||
- back
|
- back
|
||||||
restart: always
|
restart: always
|
||||||
|
|
||||||
mastodon-streaming:
|
mastodon-streaming:
|
||||||
restart: always
|
restart: always
|
||||||
image: tootsuite/mastodon:v4.3.0
|
image: tootsuite/mastodon-streaming:v4.3.2
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: wget -q --spider --proxy=off localhost:4000/api/v1/streaming/health || exit 1
|
test: wget -q --spider --proxy=off localhost:4000/api/v1/streaming/health || exit 1
|
||||||
]
|
]
|
||||||
@ -79,11 +77,11 @@ services:
|
|||||||
|
|
||||||
mastodon-sidekiq:
|
mastodon-sidekiq:
|
||||||
restart: always
|
restart: always
|
||||||
image: tootsuite/mastodon:v4.3.0
|
image: tootsuite/mastodon:v4.3.2
|
||||||
#entrypoint:
|
entrypoint:
|
||||||
# - sh
|
- sh
|
||||||
# - -c
|
- -c
|
||||||
# - "service sendmail start && /usr/bin/tini -- bundle exec sidekiq"
|
- "service sendmail start && /usr/bin/tini -- bundle exec sidekiq"
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ps aux | grep '[s]idekiq\ 6' || false
|
test: ps aux | grep '[s]idekiq\ 6' || false
|
||||||
env_file: ../mastodon/env.production
|
env_file: ../mastodon/env.production
|
||||||
@ -95,7 +93,11 @@ services:
|
|||||||
- mastodon-db
|
- mastodon-db
|
||||||
- mastodon-redis
|
- mastodon-redis
|
||||||
volumes:
|
volumes:
|
||||||
- mastodon_public:/mastodon/public/
|
- type: volume
|
||||||
|
source: mastodon_public
|
||||||
|
target: /mastodon/public/system
|
||||||
|
volume:
|
||||||
|
subpath: system
|
||||||
networks:
|
networks:
|
||||||
- mast-int
|
- mast-int
|
||||||
restart: always
|
restart: always
|
||||||
|
|||||||
@ -4,7 +4,7 @@ volumes:
|
|||||||
mau_data:
|
mau_data:
|
||||||
services:
|
services:
|
||||||
### MAU
|
### MAU
|
||||||
# mau is a synapse bot we run for news and other things
|
# mau is a synapse bot we run for news and other things
|
||||||
mau:
|
mau:
|
||||||
image: dock.mau.dev/maubot/maubot:v0.3.1
|
image: dock.mau.dev/maubot/maubot:v0.3.1
|
||||||
configs:
|
configs:
|
||||||
@ -15,7 +15,7 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- mau_data:/data/
|
- mau_data:/data/
|
||||||
networks:
|
networks:
|
||||||
- back
|
- back
|
||||||
depends_on:
|
depends_on:
|
||||||
- caddy
|
- caddy
|
||||||
- synapse
|
- synapse
|
||||||
|
|||||||
19
install.sh
19
install.sh
@ -179,7 +179,7 @@ matrix_config () {
|
|||||||
-e SYNAPSE_SERVER_NAME=matrix.$DWEB_DOMAIN \
|
-e SYNAPSE_SERVER_NAME=matrix.$DWEB_DOMAIN \
|
||||||
-e SYNAPSE_REPORT_STATS=no \
|
-e SYNAPSE_REPORT_STATS=no \
|
||||||
-e SYNAPSE_DATA_DIR=/data \
|
-e SYNAPSE_DATA_DIR=/data \
|
||||||
matrixdotorg/synapse:v1.80.0 generate 2>/dev/null
|
matrixdotorg/synapse:v1.121.1 generate 2>/dev/null
|
||||||
sudo chown -R $USER:$USER $DCOMMS_DIR/conf/synapse/
|
sudo chown -R $USER:$USER $DCOMMS_DIR/conf/synapse/
|
||||||
|
|
||||||
sed -i -z "s/database.*homeserver.db//" $DCOMMS_DIR/conf/element/config.json
|
sed -i -z "s/database.*homeserver.db//" $DCOMMS_DIR/conf/element/config.json
|
||||||
@ -205,26 +205,33 @@ mastodon_config () {
|
|||||||
sudo cp -a $DCOMMS_DIR/conf/mastodon/example.env.production $DCOMMS_DIR/conf/mastodon/env.production
|
sudo cp -a $DCOMMS_DIR/conf/mastodon/example.env.production $DCOMMS_DIR/conf/mastodon/env.production
|
||||||
SECRET_KEY_BASE=`sudo docker run -it --rm \
|
SECRET_KEY_BASE=`sudo docker run -it --rm \
|
||||||
--mount type=volume,src=masto_data_tmp,dst=/opt/mastodon \
|
--mount type=volume,src=masto_data_tmp,dst=/opt/mastodon \
|
||||||
-e RUBYOPT=-W0 tootsuite/mastodon:v4.2.9 \
|
-e RUBYOPT=-W0 tootsuite/mastodon:v4.3.2 \
|
||||||
bundle exec rake secret` >/dev/null
|
bundle exec rake secret` >/dev/null
|
||||||
|
|
||||||
OTP_SECRET=$(sudo docker run -it --rm \
|
OTP_SECRET=$(sudo docker run -it --rm \
|
||||||
--mount type=volume,src=masto_data_tmp,dst=/opt/mastodon \
|
--mount type=volume,src=masto_data_tmp,dst=/opt/mastodon \
|
||||||
-e RUBYOPT=-W0 tootsuite/mastodon:v4.2.9 \
|
-e RUBYOPT=-W0 tootsuite/mastodon:v4.3.2 \
|
||||||
bundle exec rake secret) >/dev/null
|
bundle exec rake secret) >/dev/null
|
||||||
|
|
||||||
VAPID_KEYS=$(sudo docker run -it --rm \
|
VAPID_KEYS=$(sudo docker run -it --rm \
|
||||||
--mount type=volume,src=masto_data_tmp,dst=/opt/mastodon \
|
--mount type=volume,src=masto_data_tmp,dst=/opt/mastodon \
|
||||||
-e RUBYOPT=-W0 tootsuite/mastodon:v4.2.9 \
|
-e RUBYOPT=-W0 tootsuite/mastodon:v4.3.2 \
|
||||||
bundle exec rake mastodon:webpush:generate_vapid_key)>/dev/null
|
bundle exec rake mastodon:webpush:generate_vapid_key)>/dev/null
|
||||||
VAPID_FRIENDLY_KEYS=${VAPID_KEYS//$'\n'/\\$'\n'}
|
VAPID_FRIENDLY_KEYS=${VAPID_KEYS//$'\n'/\\$'\n'}
|
||||||
|
|
||||||
|
ACTIVE_RECORD_ENCRYPTION=$(sudo docker run -it --rm \
|
||||||
|
--mount type=volume,src=masto_data_tmp,dst=/opt/mastodon \
|
||||||
|
-e RUBYOPT=-W0 tootsuite/mastodon:v4.3.2 \
|
||||||
|
bundle exec rake db:encryption:init)>/dev/null
|
||||||
|
ACTIVE_RECORD_ENCRYPTION_FRIENDLY_KEYS=${ACTIVE_RECORD_ENCRYPTION//$'\n'/\\$'\n'}
|
||||||
|
|
||||||
#REDIS_PW=$(openssl rand -base64 12)
|
#REDIS_PW=$(openssl rand -base64 12)
|
||||||
|
|
||||||
sed -i "s/REPLACEME/$DWEB_DOMAIN/" $DCOMMS_DIR/conf/mastodon/env.production
|
sed -i "s/REPLACEME/$DWEB_DOMAIN/" $DCOMMS_DIR/conf/mastodon/env.production
|
||||||
sed -i "s/SECRET_KEY_BASE=/&$SECRET_KEY_BASE/" $DCOMMS_DIR/conf/mastodon/env.production
|
sed -i "s/SECRET_KEY_BASE=/&$SECRET_KEY_BASE/" $DCOMMS_DIR/conf/mastodon/env.production
|
||||||
sed -i "s/OTP_SECRET=/&$OTP_SECRET/" $DCOMMS_DIR/conf/mastodon/env.production
|
sed -i "s/OTP_SECRET=/&$OTP_SECRET/" $DCOMMS_DIR/conf/mastodon/env.production
|
||||||
sed -i "s/VAPID_KEYS=/$VAPID_FRIENDLY_KEYS/" $DCOMMS_DIR/conf/mastodon/env.production
|
sed -i "s/VAPID_KEYS=/$VAPID_FRIENDLY_KEYS/" $DCOMMS_DIR/conf/mastodon/env.production
|
||||||
|
sed -i "s/ACTIVE_RECORD=/$ACTIVE_RECORD_ENCRYPTION_FRIENDLY_KEYS/" $DCOMMS_DIR/conf/mastodon/env.production
|
||||||
sed -i 's/\r$//g' $DCOMMS_DIR/conf/mastodon/env.production
|
sed -i 's/\r$//g' $DCOMMS_DIR/conf/mastodon/env.production
|
||||||
sed -i "s/ALTERNATE_DOMAINS=social./&$DWEB_ONION/" $DCOMMS_DIR/conf/mastodon/env.production
|
sed -i "s/ALTERNATE_DOMAINS=social./&$DWEB_ONION/" $DCOMMS_DIR/conf/mastodon/env.production
|
||||||
sed -i "s/SMTP_SERVER=/&$DWEB_DOMAIN/" $DCOMMS_DIR/conf/mastodon/env.production
|
sed -i "s/SMTP_SERVER=/&$DWEB_DOMAIN/" $DCOMMS_DIR/conf/mastodon/env.production
|
||||||
@ -333,7 +340,7 @@ main() {
|
|||||||
DELTA=true
|
DELTA=true
|
||||||
;;
|
;;
|
||||||
"2")
|
"2")
|
||||||
D_IMAGES+=("vectorim/element-web:v1.11.40" "matrixdotorg/synapse:v1.110.0")
|
D_IMAGES+=("vectorim/element-web:v1.11.88" "matrixdotorg/synapse:v1.121.1")
|
||||||
FILES+=("synapse_v1.80.0.tar" "element-web_v1.11.26.tar")
|
FILES+=("synapse_v1.80.0.tar" "element-web_v1.11.26.tar")
|
||||||
FILE_MAGNETS+=("${MAGNET_LINKS[11]}$MAG_TRACKERS" "${MAGNET_LINKS[6]}$MAG_TRACKERS")
|
FILE_MAGNETS+=("${MAGNET_LINKS[11]}$MAG_TRACKERS" "${MAGNET_LINKS[6]}$MAG_TRACKERS")
|
||||||
COMPOSE_FILES+="-f ./conf/compose/element.docker-compose.yml "
|
COMPOSE_FILES+="-f ./conf/compose/element.docker-compose.yml "
|
||||||
@ -354,7 +361,7 @@ main() {
|
|||||||
MAU=true
|
MAU=true
|
||||||
;;
|
;;
|
||||||
"5")
|
"5")
|
||||||
D_IMAGES+=("tootsuite/mastodon:v4.2.9" "redis:7.0-alpine" "postgres:14-alpine")
|
D_IMAGES+=("tootsuite/mastodon:v4.3.2" "redis:7.0-alpine" "postgres:14-alpine")
|
||||||
FILES+=("mastodon_4.1.2.tar" "postgres_14.tar" "redis_7.0.tar")
|
FILES+=("mastodon_4.1.2.tar" "postgres_14.tar" "redis_7.0.tar")
|
||||||
FILE_MAGNETS+=("${MAGNET_LINKS[7]}$MAG_TRACKERS" "${MAGNET_LINKS[9]}$MAG_TRACKERS" "${MAGNET_LINKS[10]}$MAG_TRACKERS")
|
FILE_MAGNETS+=("${MAGNET_LINKS[7]}$MAG_TRACKERS" "${MAGNET_LINKS[9]}$MAG_TRACKERS" "${MAGNET_LINKS[10]}$MAG_TRACKERS")
|
||||||
COMPOSE_FILES+="-f ./conf/compose/mastodon.docker-compose.yml "
|
COMPOSE_FILES+="-f ./conf/compose/mastodon.docker-compose.yml "
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user