Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
43 lines
1.5 KiB
Plaintext
43 lines
1.5 KiB
Plaintext
[Unit]
|
|
Description=@APP_NAME@ — AriMail 내장 Haraka 관리(수신 25 / 로컬 제출 포트, 설정 파일에 따라 켜고 끔)
|
|
Documentation=https://source.ibit.kr/OZ-Group/AriMail
|
|
After=network-online.target @APP_NAME@.service
|
|
Wants=network-online.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
User=@APP_USER@
|
|
Group=@APP_USER@
|
|
WorkingDirectory=@APP_DIR@/current
|
|
# 게이트웨이와 같은 환경 파일: DB_FILE(설정 파일 위치)·PORT(게이트웨이 HTTP)·MAILBOX(도메인)·PUBLIC_HOST·POP_TLS_* 를 읽습니다. 값이 없어도 뜹니다.
|
|
EnvironmentFile=@ETC_DIR@/gateway.env
|
|
Environment=NODE_ENV=production
|
|
Environment=PORT=@PORT@
|
|
Environment=HARAKA_DIR=@APP_DIR@/haraka
|
|
# haraka/run.mjs 는 config.json 을 5초마다 보고 Haraka(자식 프로세스)를 띄우거나 끕니다. 쓰지 않을 때는 아무 포트도 열지 않고 대기만 합니다.
|
|
ExecStart=@NODE_BIN@ @APP_DIR@/current/haraka/run.mjs
|
|
Restart=always
|
|
RestartSec=3
|
|
KillMode=mixed
|
|
TimeoutStopSec=15
|
|
|
|
# 25 포트를 일반 계정으로 열기 위한 권한(자식 프로세스 Haraka 도 상속)
|
|
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
|
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
|
|
NoNewPrivileges=yes
|
|
PrivateTmp=yes
|
|
ProtectSystem=strict
|
|
ProtectHome=yes
|
|
# haraka/: 설정·플러그인·큐·node_modules, data/: 상태 파일(haraka-status.json)
|
|
ReadWritePaths=@APP_DIR@/haraka @APP_DIR@/data
|
|
ProtectKernelTunables=yes
|
|
ProtectControlGroups=yes
|
|
RestrictSUIDSGID=yes
|
|
LockPersonality=yes
|
|
StandardOutput=journal
|
|
StandardError=journal
|
|
SyslogIdentifier=@APP_NAME@-haraka
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|