Merge pull request 'fix: Forgejo org ligbox visível para todos os users' (#855) from develop into main
This commit is contained in:
commit
ce4f30cbeb
2 changed files with 33 additions and 5 deletions
|
|
@ -63,11 +63,16 @@ python3 scripts/sync-tasks-to-forgejo-issues.py
|
|||
|
||||
## Utilizadores
|
||||
|
||||
| User | Senha | Admin |
|
||||
|------|-------|-------|
|
||||
| roger | 805353 | ✅ |
|
||||
| ligboxadmin | 805353 | ✅ |
|
||||
| mini | 805353 | — |
|
||||
| User | Senha | Admin | Org `ligbox` |
|
||||
|------|-------|-------|----------------|
|
||||
| roger | 805353 | ✅ | ✅ Owners |
|
||||
| ligboxadmin | 805353 | ✅ | ✅ Owners |
|
||||
| mini | 805353 | — | ✅ Owners |
|
||||
|
||||
**Importante:** utilizadores têm de estar na org `ligbox` (team Owners) para ver repos no dashboard Forgejo.
|
||||
Script: `scripts/setup-forgejo-org-access.sh`
|
||||
|
||||
**Homepage Forgejo:** `LANDING_PAGE = /ligbox` (não landing vazia).
|
||||
|
||||
## Spec
|
||||
|
||||
|
|
|
|||
23
scripts/setup-forgejo-org-access.sh
Executable file
23
scripts/setup-forgejo-org-access.sh
Executable file
|
|
@ -0,0 +1,23 @@
|
|||
#!/usr/bin/env bash
|
||||
# Garante utilizadores Ligbox na org `ligbox` (Owners) — dashboard Forgejo preenchido.
|
||||
set -euo pipefail
|
||||
|
||||
FORGEJO_URL="${FORGEJO_URL:-http://10.10.10.130:3000}"
|
||||
USER="${FORGEJO_USER:-roger}"
|
||||
PASS="${FORGEJO_TOKEN:-805353}"
|
||||
ORG="${FORGEJO_ORG:-ligbox}"
|
||||
TEAM_ID="${FORGEJO_OWNERS_TEAM_ID:-1}"
|
||||
MEMBERS=(ligboxadmin mini roger)
|
||||
|
||||
auth() { echo -n "${USER}:${PASS}" | base64 -w0 2>/dev/null || echo -n "${USER}:${PASS}" | base64; }
|
||||
|
||||
for m in "${MEMBERS[@]}"; do
|
||||
code=$(curl -sk -o /dev/null -w "%{http_code}" -X PUT \
|
||||
-H "Authorization: Basic $(auth)" \
|
||||
"${FORGEJO_URL}/api/v1/teams/${TEAM_ID}/members/${m}")
|
||||
echo " ${m} → team Owners HTTP ${code}"
|
||||
done
|
||||
|
||||
echo "Membros org ${ORG}:"
|
||||
curl -sk -H "Authorization: Basic $(auth)" \
|
||||
"${FORGEJO_URL}/api/v1/orgs/${ORG}/members" | python3 -c "import sys,json; print(', '.join(u['login'] for u in json.load(sys.stdin)))"
|
||||
Loading…
Reference in a new issue