Files
datastore/packages/datastore-keeper.postinstall
zooqueen 2c6671844d datastore: rename hanzo-datastore → datastore (one canonical name)
The white-label name is just `datastore`, not `hanzo-datastore` — one name, DRY.

- binary / packages / paths / user / config: hanzo-datastore → datastore
  (binary `datastore`, packages `datastore-{client,server,common-static,keeper}`,
  `/var/lib/datastore`, `/etc/datastore-server`, `/var/log/datastore-server`, user `datastore`)
- env vars: HANZO_* → DATASTORE_* across the white-label scripts (entrypoint, init,
  service, postinstall, docs) and compose — the docker image env is now consistently
  `DATASTORE_*` and compose matches what the entrypoint reads.
- renamed 13 spec/config files: `packages/hanzo-datastore-*` → `packages/datastore-*`,
  `docker/server/hanzo-paths.xml` → `docker/server/datastore-paths.xml`.

Left intentionally: GitHub Actions secrets `ROBOT_HANZO_{SSH_KEY,COMMIT_TOKEN}` (renaming
needs rotating org secrets). The C++ source still reads `CLICKHOUSE_*` env and expects a
`<clickhouse>` config root — that's the deeper clickhouse→datastore source debrand, tracked
separately. The Hanzo brand stays in human prose (maintainer, homepage `hanzo.ai`, image
org `hanzoai/datastore`).
2026-06-21 19:06:04 -07:00

61 lines
2.0 KiB
Bash

#!/bin/sh
set -e
PROGRAM=datastore-keeper
KEEPER_USER=${KEEPER_USER:-datastore}
KEEPER_GROUP=${KEEPER_GROUP:-datastore}
KEEPER_CONFDIR=${KEEPER_CONFDIR:-/etc/datastore-keeper}
KEEPER_DATADIR=${KEEPER_DATADIR:-/var/lib/datastore}
KEEPER_LOGDIR=${KEEPER_LOGDIR:-/var/log/datastore-keeper}
[ -f /usr/share/debconf/confmodule ] && . /usr/share/debconf/confmodule
[ -f /etc/default/datastore-keeper ] && . /etc/default/datastore-keeper
if [ ! -f "/etc/debian_version" ]; then
not_deb_os=1
fi
if [ "$1" = configure ] || [ -n "$not_deb_os" ]; then
if ! getent group "${KEEPER_GROUP}" > /dev/null 2>&1 ; then
groupadd --system "${KEEPER_GROUP}"
fi
GID=$(getent group "${KEEPER_GROUP}" | cut -d: -f 3)
if ! id "${KEEPER_USER}" > /dev/null 2>&1 ; then
adduser --system --home /dev/null --no-create-home \
--gid "${GID}" --shell /bin/false \
"${KEEPER_USER}"
fi
if [ -x "/bin/systemctl" ] && [ -f /lib/systemd/system/datastore-keeper.service ] && [ -d /run/systemd/system ]; then
if [ -x "/etc/init.d/datastore-keeper" ] && [ -x "/usr/sbin/update-rc.d" ]; then
/usr/sbin/update-rc.d datastore-keeper remove
fi
/bin/systemctl daemon-reload
/bin/systemctl enable datastore-keeper
else
if [ -x "/etc/init.d/datastore-keeper" ]; then
if [ -x "/usr/sbin/update-rc.d" ]; then
/usr/sbin/update-rc.d datastore-keeper defaults 19 19 >/dev/null || exit $?
else
echo # Other OS
fi
fi
fi
chown -R "${KEEPER_USER}:${KEEPER_GROUP}" "${KEEPER_CONFDIR}"
chmod 0755 "${KEEPER_CONFDIR}"
if ! [ -d "${KEEPER_DATADIR}" ]; then
mkdir -p "${KEEPER_DATADIR}"
chown -R "${KEEPER_USER}:${KEEPER_GROUP}" "${KEEPER_DATADIR}"
chmod 0700 "${KEEPER_DATADIR}"
fi
if ! [ -d "${KEEPER_LOGDIR}" ]; then
mkdir -p "${KEEPER_LOGDIR}"
chown -R "${KEEPER_USER}:${KEEPER_GROUP}" "${KEEPER_LOGDIR}"
chmod 0770 "${KEEPER_LOGDIR}"
fi
fi