ezidam/documentation/alpine-linux.md
2023-07-09 17:10:31 +02:00

1.3 KiB

Build ezidam on Alpine Linux

Setup

Install alpine.

Enable community repository in /etc/apk/repositories

Install packages:

apk add rustup git build-base

Run rustup-init to download the rust compiler.

Build

Get code, get in repo

rm rust-toolchain.toml
cargo build --release

Copy

Create folders for config, assets, database

mkdir -p /etc/ezidam /usr/share/ezidam /var/lib/ezidam

Copy binary, config, assets

cp target/release/ezidam /usr/bin/ezidam
cp crates/ezidam/ezidam.toml /etc/ezidam/ezidam.toml
cp crates/ezidam/static/ crates/ezidam/templates/ /usr/share/ezidam/ -rv

Config

Here's the paths to use in /etc/ezidam/ezidam.toml:

[default]
template_dir = "/usr/share/ezidam/templates"
static_dir = "/usr/share/ezidam/static"

[default.databases.ezidam]
url = "/var/lib/ezidam/ezidam.sqlite"

Don't forget the rest of the config! The above is only a snippet!

Service

Copy the script openrc.sh as /etc/init.d/ezidam, then

chmod +x /etc/init.d/ezidam

Start/Stop/Boot

  • Start: rc-service ezidam start

  • Stop: rc-service ezidam stop

  • Start at boot: rc-update add ezidam

  • Don't start at boot: rc-update del ezidam

Logs

If ezidam is started with the service, logs will be available at /var/log/ezidam.{log,err}