Debian 中自定义 Copidar 的设置指南
一 安装与定位配置
二 配置方式与常用参数
port: 8080
debug: true
logLevel: "info"
watch:
- path: "/path/to/watch"
filters: ["*.txt", "!important.txt"]
ignoreInitial: true
followSymlinks: true
events:
created: ["echo 'File created: {{ .Path }}'"]
modified: ["echo 'File modified: {{ .Path }}'"]
deleted: ["echo 'File deleted: {{ .Path }}'"]
{
"watch": ["src"],
"ignore": ["node_modules"],
"exec": "nodemon app.js",
"delay": 1000,
"verbose": true
}
export COPIDAR_WATCH="src"
export COPIDAR_IGNORE="node_modules"
export COPIDAR_EXEC="nodemon app.js"
export COPIDAR_DELAY=1000
export COPIDAR_VERBOSE=true
copidar
三 以 systemd 管理并开机自启
[Unit]
Description=Copidar Service
After=network.target
[Service]
ExecStart=/usr/local/bin/copidar --config /path/to/copidar.yml
Restart=always
User=nobody
Group=nogroup
[Install]
WantedBy=multi-user.target
四 网络访问与安全加固
server:
authentication:
enabled: true
api_key: your_api_key_here
五 排错与最佳实践