v0.1.15 - Fix config page display and rebrand admin UI from relay to Blossom terminology
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Ginxsom Admin Event Test Script
|
||||
# Tests Kind 23456/23457 admin command system with NIP-44 encryption
|
||||
# Tests Kind 23458/23459 admin command system with NIP-44 encryption
|
||||
#
|
||||
# Prerequisites:
|
||||
# - nak: https://github.com/fiatjaf/nak
|
||||
@@ -72,12 +72,12 @@ check_dependencies() {
|
||||
log_success "All dependencies found"
|
||||
}
|
||||
|
||||
# Create NIP-44 encrypted admin command event (Kind 23456)
|
||||
# Create NIP-44 encrypted admin command event (Kind 23458)
|
||||
create_admin_command_event() {
|
||||
local command="$1"
|
||||
local expiration=$(($(date +%s) + 3600)) # 1 hour from now
|
||||
|
||||
log_info "Creating Kind 23456 admin command event..."
|
||||
log_info "Creating Kind 23458 admin command event..."
|
||||
log_info "Command: $command"
|
||||
|
||||
# For now, we'll create the event structure manually since nak may not support NIP-44 encryption yet
|
||||
@@ -87,9 +87,9 @@ create_admin_command_event() {
|
||||
local content="[\"$command\"]"
|
||||
|
||||
# Create event with nak
|
||||
# Kind 23456 = admin command
|
||||
# Kind 23458 = admin command
|
||||
# Tags: p = server pubkey, expiration
|
||||
local event=$(nak event -k 23456 \
|
||||
local event=$(nak event -k 23458 \
|
||||
-c "$content" \
|
||||
--tag p="$SERVER_PUBKEY" \
|
||||
--tag expiration="$expiration" \
|
||||
@@ -104,7 +104,7 @@ send_admin_command() {
|
||||
|
||||
log_info "=== Testing Admin Command: $command ==="
|
||||
|
||||
# Create Kind 23456 event
|
||||
# Create Kind 23458 event
|
||||
local event=$(create_admin_command_event "$command")
|
||||
|
||||
if [[ -z "$event" ]]; then
|
||||
@@ -132,10 +132,10 @@ send_admin_command() {
|
||||
log_success "HTTP $http_code - Response received"
|
||||
echo "$body" | jq . 2>/dev/null || echo "$body"
|
||||
|
||||
# Try to parse as Kind 23457 event
|
||||
# Try to parse as Kind 23459 event
|
||||
local kind=$(echo "$body" | jq -r '.kind // empty' 2>/dev/null)
|
||||
if [[ "$kind" == "23457" ]]; then
|
||||
log_success "Received Kind 23457 response event"
|
||||
if [[ "$kind" == "23459" ]]; then
|
||||
log_success "Received Kind 23459 response event"
|
||||
local response_content=$(echo "$body" | jq -r '.content // empty' 2>/dev/null)
|
||||
log_info "Response content (encrypted): $response_content"
|
||||
# TODO: Decrypt NIP-44 content to see actual response
|
||||
@@ -174,7 +174,7 @@ test_server_health() {
|
||||
|
||||
main() {
|
||||
echo "=== Ginxsom Admin Event Test Suite ==="
|
||||
echo "Testing Kind 23456/23457 admin command system"
|
||||
echo "Testing Kind 23458/23459 admin command system"
|
||||
echo ""
|
||||
|
||||
log_info "Test Configuration:"
|
||||
|
||||
Reference in New Issue
Block a user