oficina / equipo Public

Clone
git clone https://amadan.net/oficina/equipo

Plain git — no account needed to clone.

Download

Download this file

1#!/bin/sh
2# Developer-only local setup diagnostics; exempt from app copy review.
3set -eu
4
5root=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
6cd "$root"
7set -a
8. "${EQUIPO_ENV_FILE:-$root/.env.local}"
9set +a
10: "${EQUIPO_ORIGIN:?Set EQUIPO_ORIGIN in .env.local}"
11: "${EQUIPO_INSTANCE_KEY:?Set a persistent EQUIPO_INSTANCE_KEY in .env.local}"
12addr=${EQUIPO_ADDR:-127.0.0.1:8824}
13case "$addr" in
14 127.0.0.1:*) port=${addr#127.0.0.1:} ;;
15 *) echo 'EQUIPO_ADDR must use 127.0.0.1' >&2; exit 1 ;;
16esac
17case "$port" in ''|*[!0-9]*) exit 1 ;; esac
18[ "$port" -ge 1 ] && [ "$port" -le 65535 ]
19[ "$EQUIPO_ORIGIN" = "http://$addr" ] || {
20 echo 'EQUIPO_ORIGIN must match the local address' >&2
21 exit 1
22}
23if [ -z "${EQUIPO_BIN:-}" ]; then
24 mkdir -p "$root/.local"
25 CGO_ENABLED=0 go build -o "$root/.local/equipo" ./cmd/equipo
26 EQUIPO_BIN=$root/.local/equipo
27fi
28exec "$EQUIPO_BIN" --db "${EQUIPO_DB:-$root/equipo.db}" --addr "$addr"
29