Ariweb Suite 0.1.1 기반: 공통 라이브러리(db·http·세션·작업 엔진·할당/예약·알림·감사·보관소), 포털 뼈대, Webmaker/AriMail 도입 소스와 manifest
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
9ca4cee341
commit
c7aea8d419
@@ -0,0 +1,39 @@
|
||||
[Unit]
|
||||
Description=@APP_NAME@ — AriMail gateway (@MAIL_HOST@: webmail, IMAP/POP3/SMTP, Resend or Haraka)
|
||||
Documentation=https://source.ibit.kr/OZ-Group/AriMail
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
# 사이트 설정(deploy/sites/@SITE@.env)의 실행 계정. www 사이트와 연동하면 www DB 를 같은 권한으로 읽기 위해 www 와 같은 계정을 씁니다.
|
||||
User=@APP_USER@
|
||||
Group=@APP_USER@
|
||||
WorkingDirectory=@APP_DIR@/current
|
||||
EnvironmentFile=@ETC_DIR@/gateway.env
|
||||
Environment=NODE_ENV=production
|
||||
Environment=HOST=127.0.0.1
|
||||
Environment=PORT=@PORT@
|
||||
ExecStart=@NODE_BIN@ server/index.mjs
|
||||
Restart=always
|
||||
RestartSec=3
|
||||
|
||||
# 110/143/465/587/993/995 포트를 일반 계정으로 열기 위한 권한
|
||||
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
||||
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
|
||||
NoNewPrivileges=yes
|
||||
PrivateTmp=yes
|
||||
ProtectSystem=strict
|
||||
ProtectHome=yes
|
||||
# 게이트웨이 DB·설정 파일(config.json, 1.0.0)·초기 설정 토큰과(www 연동 시) WAL 모드 www DB 를 읽기 위한 공유 메모리(-shm) 경로
|
||||
ReadWritePaths=@APP_DIR@/data @EXTRA_RW@
|
||||
ProtectKernelTunables=yes
|
||||
ProtectControlGroups=yes
|
||||
RestrictSUIDSGID=yes
|
||||
LockPersonality=yes
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=@APP_NAME@
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,42 @@
|
||||
[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
|
||||
@@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=@APP_NAME@ — DNS 가 이 서버를 가리키면 Let's Encrypt 인증서를 받고 443·메일 포트 TLS 를 켭니다
|
||||
After=network-online.target nginx.service
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/env bash @APP_DIR@/repo/deploy/tls-when-ready.sh @APP_DIR@/site.env
|
||||
@@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=@APP_NAME@ — 인증서가 생길 때까지 15분마다 DNS 를 확인해 TLS 를 켭니다(발급되면 스스로 멈춤)
|
||||
|
||||
[Timer]
|
||||
OnBootSec=2min
|
||||
OnUnitActiveSec=15min
|
||||
Unit=@APP_NAME@-tls.service
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
Reference in New Issue
Block a user