# ShappeTrack Engine — Gitea, rebranded so the raw Gitea UI is never shown.
# Exposed at https://trackengine.shappe.ai; the login gate + home get a ShappeTrack
# identity (logo, teal theme, title, meta) with no "Gitea" anywhere.
#
# GITEA_CUSTOM stays at its default (/data/gitea) so app.ini stays on the data
# volume and the GITEA__* config env below applies normally. The custom templates/
# assets are baked at /custom-src and overlaid onto /data/gitea/custom at boot by
# st-entrypoint.sh (the data volume would otherwise hide files baked under /data).
FROM gitea/gitea:1.26.4

# Branding config (baked; runtime task-def env still overrides). Section names with
# a dot ([ui.meta]) use Gitea's _0X2E_ env escaping.
# Plain APP_NAME drives the app.ini template substitution on a FRESH volume; on an
# existing volume st-entrypoint.sh rewrites the stale APP_NAME line. (Do NOT also set
# GITEA__DEFAULT__APP_NAME — env-to-ini would append a duplicate the UI ignores.)
ENV APP_NAME="ShappeTrack Engine"
ENV GITEA__ui_0X2E_meta__AUTHOR="ShappeTrack"
ENV GITEA__ui_0X2E_meta__DESCRIPTION="ShappeTrack Engine — secure Git hosting and CI."
ENV GITEA__ui_0X2E_meta__KEYWORDS="shappetrack,git,ci"
ENV GITEA__other__SHOW_FOOTER_POWERED_BY="false"
ENV GITEA__other__SHOW_FOOTER_VERSION="false"
ENV GITEA__other__SHOW_FOOTER_TEMPLATE_LOAD_TIME="false"
# No public self-signup — the engine is invite/admin-managed only.
ENV GITEA__service__DISABLE_REGISTRATION="true"
ENV GITEA__service__SHOW_REGISTRATION_BUTTON="false"
# Kill the public Gitea API docs page (/api/swagger → "Gitea API" + "Return to Gitea").
ENV GITEA__api__ENABLE_SWAGGER="false"

COPY custom/ /custom-src/
COPY --chmod=0755 st-entrypoint.sh /usr/local/bin/st-entrypoint.sh

ENTRYPOINT ["/usr/local/bin/st-entrypoint.sh"]
