diff --git a/bin/disinto b/bin/disinto index 3fb4060..4038415 100755 --- a/bin/disinto +++ b/bin/disinto @@ -1001,19 +1001,12 @@ setup_ops_repo() { "${forge_url}/api/v1/repos/${ops_slug}" >/dev/null 2>&1; then echo "Ops repo: ${ops_slug} (already exists on Forgejo)" else - # Create ops repo under org (or human user if org creation failed) - if ! curl -sf -X POST \ + # Create ops repo under disinto-admin using admin API + curl -sf -X POST \ -H "Authorization: token ${admin_token:-${FORGE_TOKEN}}" \ -H "Content-Type: application/json" \ - "${forge_url}/api/v1/orgs/${org_name}/repos" \ - -d "{\"name\":\"${ops_name}\",\"auto_init\":true,\"default_branch\":\"${primary_branch}\",\"description\":\"Operational data for ${org_name}/${ops_name%-ops}\"}" >/dev/null 2>&1; then - # Fallback: create under the human user namespace - curl -sf -X POST \ - -H "Authorization: token ${admin_token:-${FORGE_TOKEN}}" \ - -H "Content-Type: application/json" \ - "${forge_url}/api/v1/users/johba/repos" \ - -d "{\"name\":\"${ops_name}\",\"auto_init\":true,\"default_branch\":\"${primary_branch}\",\"description\":\"Operational data\"}" >/dev/null 2>&1 || true - fi + "${forge_url}/api/v1/admin/users/disinto-admin/repos" \ + -d "{\"name\":\"${ops_name}\",\"auto_init\":true,\"default_branch\":\"${primary_branch}\",\"description\":\"Operational data for disinto-admin/${ops_name%-ops}\"}" >/dev/null 2>&1 || true # Add all bot users as collaborators with appropriate permissions # vault branch protection (#77) requires: @@ -1329,7 +1322,7 @@ generate_toml() { name = "${name}" repo = "${repo}" -ops_repo = "${repo}-ops" +ops_repo = "disinto-admin/${name}-ops" forge_url = "${forge_url}" repo_root = "${root}" ops_repo_root = "/home/${USER}/${name}-ops" @@ -1979,7 +1972,7 @@ p.write_text(text) echo "Branch: ${branch}" # Set up {project}-ops repo (#757) - local ops_slug="${forge_repo}-ops" + local ops_slug="disinto-admin/${project_name}-ops" local ops_root="/home/${USER}/${project_name}-ops" setup_ops_repo "$forge_url" "$ops_slug" "$ops_root" "$branch" diff --git a/projects/disinto.toml.example b/projects/disinto.toml.example index ea0b8c5..61781e5 100644 --- a/projects/disinto.toml.example +++ b/projects/disinto.toml.example @@ -5,7 +5,7 @@ name = "disinto" repo = "johba/disinto" -ops_repo = "johba/disinto-ops" +ops_repo = "disinto-admin/disinto-ops" forge_url = "http://localhost:3000" repo_root = "/home/YOU/dark-factory" ops_repo_root = "/home/YOU/disinto-ops" diff --git a/projects/harb.toml.example b/projects/harb.toml.example index 7664486..a923eaf 100644 --- a/projects/harb.toml.example +++ b/projects/harb.toml.example @@ -5,6 +5,7 @@ name = "harb" repo = "johba/harb" +ops_repo = "disinto-admin/harb-ops" forge_url = "http://localhost:3000" repo_root = "/home/YOU/harb" primary_branch = "master" diff --git a/projects/versi.toml.example b/projects/versi.toml.example index 2fbc189..85831c2 100644 --- a/projects/versi.toml.example +++ b/projects/versi.toml.example @@ -5,6 +5,7 @@ name = "versi" repo = "johba/versi" +ops_repo = "disinto-admin/versi-ops" forge_url = "http://localhost:3000" repo_root = "/home/YOU/versi" primary_branch = "main"