Modified - Added admin actor badge beside the Is Administrator option.
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled

This commit is contained in:
2026-04-29 23:48:49 +00:00
parent 3afb4e8afa
commit 4aacf3bd20
5 changed files with 79 additions and 5 deletions
+9
View File
@@ -341,3 +341,12 @@ Project Change ID[date-time] - application-version - Type - Summary:
- 1 - I disabled User Account Is Activated and Is Restricted when an administrator edits their own account, matching the existing self-edit protection for Disable Sign-In. - 1 - I disabled User Account Is Activated and Is Restricted when an administrator edits their own account, matching the existing self-edit protection for Disable Sign-In.
- 2 - I hardened the admin user update handler so manually submitted self-edit forms cannot change the current admin's active, restricted, or prohibit-login state. - 2 - I hardened the admin user update handler so manually submitted self-edit forms cannot change the current admin's active, restricted, or prohibit-login state.
- 3 - I regenerated local ignored template bindata and verified the admin package compilation with reduced build pressure. - 3 - I regenerated local ignored template bindata and verified the admin package compilation with reduced build pressure.
65 - [2026-04-29 22:37:56] - v1.27.0-dev-62-g3afb4e8afa - Type: Added - Added Codex ChatGPT login helper script.
- 1 - I added `.codex_gpt_login`, an interactive helper for completing the local Codex ChatGPT auth callback in code-server environments.
- 2 - The script accepts either a raw received code or a full URL/query containing `code=...`, calls the local callback endpoint, extracts `id_token`, and completes the `/success` request.
- 3 - I made the script executable and verified its shell syntax with `bash -n`.
66 - [2026-04-29 22:55:08] - v1.27.0-dev-62-g3afb4e8afa - Type: Modified - Added admin actor badge beside the Is Administrator option.
- 1 - I updated the admin user edit panel so the Is Administrator checkbox label shows `by <admin>` when administrator grant metadata exists.
- 2 - I reused the stored admin email as the badge hover tooltip and regenerated local ignored template bindata.
+61
View File
@@ -0,0 +1,61 @@
#!/usr/bin/env bash
set -euo pipefail
CALLBACK_URL="http://127.0.0.1:1455/auth/callback"
SUCCESS_URL="http://localhost:1455/success"
die() {
printf 'ERROR: %s\n' "$*" >&2
exit 1
}
extract_code() {
local input="$1"
case "$input" in
*code=*)
input="${input#*code=}"
input="${input%%&*}"
input="${input%%#*}"
;;
esac
printf '%s' "$input"
}
extract_id_token() {
local response_file="$1"
sed -n 's/.*id_token=\([^&[:space:]"'"'"'<>]*\).*/\1/p' "$response_file" |
tr -d '\r' |
head -n 1
}
printf 'Codex ChatGPT login helper\n'
printf 'Paste the received code, full callback URL, or query string containing code=...\n'
printf 'Received key: '
IFS= read -r received_key
[ -n "$received_key" ] || die "empty received key"
code="$(extract_code "$received_key")"
[ -n "$code" ] || die "could not extract code"
response_file="$(mktemp)"
trap 'rm -f "$response_file"' EXIT
printf '\nCalling Codex auth callback...\n'
curl -sv -H "Host: localhost" --get --data-urlencode "code=$code" "$CALLBACK_URL" >"$response_file" 2>&1 || {
cat "$response_file" >&2
die "callback request failed"
}
id_token="$(extract_id_token "$response_file")"
[ -n "$id_token" ] || {
cat "$response_file" >&2
die "could not find id_token in callback response"
}
printf 'id_token received. Completing login...\n'
curl -sv --get --data-urlencode "id_token=$id_token" "$SUCCESS_URL"
printf '\nDone.\n'
+1 -1
View File
@@ -1 +1 @@
4ed0aeeac4f78bdb9801d09f5b79994c4cefbabd 8059ee228d61449c58de918e054b61dfed3a2708
+4 -3
View File
@@ -156,8 +156,9 @@
} }
}, },
"scripts": { "scripts": {
"0-configure-buid": "./configure.sh", "0-codex-gpt-login": "./.codex_gpt_login.sh",
"1-update-gitea": "./update-gitea.sh", "1-configure-buid": "./configure.sh",
"2-smart-build": "./smart-build.sh" "2-update-gitea": "./update-gitea.sh",
"3-smart-build": "./smart-build.sh"
} }
} }
+4 -1
View File
@@ -163,7 +163,10 @@
{{if ne .User.ID .SignedUserID}} {{if ne .User.ID .SignedUserID}}
<div class="inline field"> <div class="inline field">
<div class="ui checkbox"> <div class="ui checkbox">
<label><strong>{{ctx.Locale.Tr "admin.users.is_admin"}}</strong></label> <label>
<strong>{{ctx.Locale.Tr "admin.users.is_admin"}}</strong>
{{if .AdminReasonByAdmin}}{{if .AdminReasonByAdmin.Name}}<span class="ui mini label tw-whitespace-nowrap" {{if .AdminReasonByAdmin.Email}}data-tooltip-content="{{.AdminReasonByAdmin.Email}}"{{end}}>by {{.AdminReasonByAdmin.Name}}</span>{{end}}{{end}}
</label>
<input name="admin" type="checkbox" data-admin-status-reason-toggle="#admin-reason-field" data-admin-status-reason-inverted="true" {{if .User.IsAdmin}}checked{{end}}> <input name="admin" type="checkbox" data-admin-status-reason-toggle="#admin-reason-field" data-admin-status-reason-inverted="true" {{if .User.IsAdmin}}checked{{end}}>
</div> </div>
</div> </div>