瀏覽代碼

Disable file logging in Docker by default

To enable it, use a custom path that points at a writable volume
Tulir Asokan 3 年之前
父節點
當前提交
601864131e
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      docker-run.sh

+ 6 - 1
docker-run.sh

@@ -7,6 +7,11 @@ fi
 # Define functions.
 # Define functions.
 function fixperms {
 function fixperms {
 	chown -R $UID:$GID /data
 	chown -R $UID:$GID /data
+
+	# /opt/mautrix-whatsapp is read-only, so disable file logging if it's pointing there.
+	if [[ "$(yq e '.logging.directory' /data/config.yaml)" == "./logs" ]]; then
+		yq -I4 e -i '.logging.file_name_format = ""' /data/config.yaml
+	fi
 }
 }
 
 
 if [[ ! -f /data/config.yaml ]]; then
 if [[ ! -f /data/config.yaml ]]; then
@@ -22,7 +27,7 @@ if [[ ! -f /data/registration.yaml ]]; then
 	/usr/bin/mautrix-whatsapp -g -c /data/config.yaml -r /data/registration.yaml
 	/usr/bin/mautrix-whatsapp -g -c /data/config.yaml -r /data/registration.yaml
 	echo "Didn't find a registration file."
 	echo "Didn't find a registration file."
 	echo "Generated one for you."
 	echo "Generated one for you."
-	echo "Copy that over to synapses app service directory."
+	echo "See https://docs.mau.fi/bridges/general/registering-appservices.html on how to use it."
 	exit
 	exit
 fi
 fi