2
Service:ezBookkeeping
Jeffery edited this page 2026-05-06 13:45:02 +00:00

下載 ezBookkeeping

wget https://github.com/mayswind/ezbookkeeping/releases/download/v1.4.0/ezbookkeeping-v1.4.0-linux-amd64.tar.gz && tar zxvf ezbookkeeping-v1.4.0-linux-amd64.tar.gz

設計 ezBookkeeping 服務

nano /etc/systemd/system/ezbookkeeping.service

服務檔內容

[Unit]
Description=ezBookkeeping

[Service]
Environment=HOME=/root
Type=simple
WorkingDirectory=/root
ExecStart=/root/ezbookkeeping server run
Restart=always
User=root

[Install]
WantedBy=multi-user.target

啟動服務

systemctl daemon-reload && systemctl enable ezbookkeeping.service && systemctl start ezbookkeeping.service && systemctl status ezbookkeeping.service

使用

sudo -u postgres psql

新建使用者與資料庫

CREATE USER ezbookkeeping WITH PASSWORD 'ezbookkeeping';

CREATE DATABASE ezbookkeeping;

設定資料庫權限

-- 1. Give ownership of the database to the app user
ALTER DATABASE ezbookkeeping OWNER TO ezbookkeeping;

-- 2. Give ownership of the public schema to the app user
ALTER SCHEMA public OWNER TO ezbookkeeping;

-- 3. Ensure the user has create permissions (Crucial for Postgres 15+)
GRANT USAGE, CREATE ON SCHEMA public TO ezbookkeeping;