From ba6467a698bf5b4a6a46a109af6a1a6e6d8dae83 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 26 Mar 2023 19:02:06 +0200 Subject: [PATCH] add scope to the admin token --- forgejo.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forgejo.sh b/forgejo.sh index 43f9790..3c706ae 100755 --- a/forgejo.sh +++ b/forgejo.sh @@ -52,7 +52,7 @@ function setup() { else wait_for docker exec --user 1000 forgejo forgejo admin user create --admin --username "$user" --password "$password" --email "$user@example.com" fi - docker exec --user 1000 forgejo forgejo admin user generate-access-token -u $user --raw > forgejo-token + docker exec --user 1000 forgejo forgejo admin user generate-access-token -u $user --raw --scopes 'all,sudo' > forgejo-token ( echo -n 'Authorization: token ' ; cat forgejo-token ) > forgejo-header ( echo "#!/bin/sh" ; echo 'curl -sS -H "Content-Type: application/json" -H @'$(pwd)/forgejo-header' "$@"' ) > forgejo-api && chmod +x forgejo-api }