소스 검색

Disable file logging in Docker by default

To enable it, use a custom path that points at a writable volume
Tulir Asokan 3 년 전
부모
커밋
d554490a0f
1개의 변경된 파일9개의 추가작업 그리고 0개의 파일을 삭제
  1. 9 0
      docker-run.sh

+ 9 - 0
docker-run.sh

@@ -3,6 +3,12 @@
 # Define functions.
 function fixperms {
 	chown -R $UID:$GID /data
+
+	# /opt/mautrix-instagram is read-only, so disable file logging if it's pointing there.
+	if [[ "$(yq e '.logging.handlers.file.filename' /data/config.yaml)" == "./mautrix-instagram.log" ]]; then
+		yq -I4 e -i 'del(.logging.root.handlers[] | select(. == "file"))' /data/config.yaml
+		yq -I4 e -i 'del(.logging.handlers.file)' /data/config.yaml
+	fi
 }
 
 cd /opt/mautrix-instagram
@@ -19,6 +25,9 @@ fi
 
 if [ ! -f /data/registration.yaml ]; then
 	python3 -m mautrix_instagram -g -c /data/config.yaml -r /data/registration.yaml
+	echo "Didn't find a registration file."
+	echo "Generated one for you."
+	echo "See https://docs.mau.fi/bridges/general/registering-appservices.html on how to use it."
 	fixperms
 	exit
 fi