Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ services:
- TZ=Asia/Shanghai
- UID=1000
- GID=1000
image: matrixdotorg/synapse:v1.118.0
image: matrixdotorg/synapse:v1.119.0
logging:
options:
max-size: "10m"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个代码没有明显的错误或问题,但是为了提升可读性和安全性,请将字符串变量TZ, UID, 和 GID转义为双引号以避免安全风险。

services = [
    {"type": "matrix", "host_type": "app"},
    ...
]

同时,我推荐你使用Python内置的日志库logging来代替当前使用的第三方库,并在控制台中替换上述配置项。

这是一个简单的调整:

import logging

LOGGING_CONFIG = {
    "version": 1,
    "formatters": {
        "verbose_logger": {        
            "()": logging.Formatter
            # 假设你的模块名为synapse
            }
        },
    "handler": {
        "console": {            
            "()": logging.StreamHandler
                },          
    }    
}


class MyClass:  ...

log = logging.getLogger(__name__)
# 将上面的方法移动到MyClass类中并替换原来的设置

Expand Down