Fosi Fossil Service
Small teams. Open source. Built on Fossil.

CaaS / Lamina

Unified Management for Fossil Repositories

Public | Owner: CaaS | Default branch: trunk | Last update: 2026-10-25 00:41

Artifact ca77cc83587592fc744473c66694f5f3457b835995d747e1e42c85284f5812b3:


#!/bin/sh
set -eu
cd /app

DATA=/app/data
mkdir -p "$DATA/repos" "$DATA/fossil-home" "$DATA/logs" "$DATA/skin-cache"

# 绑定到宿主机 ./data 时,目录属主常与容器进程不一致,导致 fossil init / sqlite 写失败。
# 启动时对齐属主,并把数据目录放宽为可写(含已有仓库文件)。
if [ "$(id -u)" = "0" ]; then
  if [ -z "${PUID:-}" ] || [ -z "${PGID:-}" ]; then
    PUID=$(stat -c %u "$DATA")
    PGID=$(stat -c %g "$DATA")
  fi
  chown -R "${PUID}:${PGID}" "$DATA"
  chmod -R u+rwX,g+rwX "$DATA"
  if [ "$PUID" != "0" ] && command -v setpriv >/dev/null 2>&1; then
    exec setpriv --reuid="$PUID" --regid="$PGID" --clear-groups -- /app/docker-entrypoint.sh
  fi
fi

umask 0002

PA=""
for d in /app/_build/default/lib/*/ebin; do
  if [ -d "$d" ]; then
    PA="$PA -pa $d"
  fi
done

# shellcheck disable=SC2086
exec erl -noshell -config /app/config/sys.config $PA \
  -eval 'application:ensure_all_started(lamina).'

Clone

You can clone this repository with the following command:

fossil clone https://fosi.dev/CaaS/Lamina

Contribute

The best way to contribute is through e-mail. See the project documentation for more details.