diff options
| author | Clawd <ai@clawd.bot> | 2026-02-22 14:08:54 -0800 |
|---|---|---|
| committer | Clawd <ai@clawd.bot> | 2026-02-22 14:08:54 -0800 |
| commit | 5195d8031b7930069ba5441a6cd1e7a59c21c546 (patch) | |
| tree | 50a110dd565cc1c9330c61dea6f4cc720e1efbd0 /internal/config | |
| parent | 3b760256768e45ddb2965aab2a60f11327972e63 (diff) | |
NIP-11: make relay info configurable
- Add relay config section (name, description, pubkey, contact, icon)
- Wire config to NIP-11 handler
- AuthRequired/RestrictedWrites now reflect actual auth config
- Add NIP-42 to supported_nips list
- Update example config
Diffstat (limited to 'internal/config')
| -rw-r--r-- | internal/config/config.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/internal/config/config.go b/internal/config/config.go index 7eca750..36d3e1e 100644 --- a/internal/config/config.go +++ b/internal/config/config.go | |||
| @@ -14,6 +14,7 @@ import ( | |||
| 14 | ) | 14 | ) |
| 15 | 15 | ||
| 16 | type Config struct { | 16 | type Config struct { |
| 17 | Relay RelayConfig `yaml:"relay"` | ||
| 17 | Server ServerConfig `yaml:"server"` | 18 | Server ServerConfig `yaml:"server"` |
| 18 | Database DatabaseConfig `yaml:"database"` | 19 | Database DatabaseConfig `yaml:"database"` |
| 19 | Auth AuthConfig `yaml:"auth"` | 20 | Auth AuthConfig `yaml:"auth"` |
| @@ -23,6 +24,14 @@ type Config struct { | |||
| 23 | Storage StorageConfig `yaml:"storage"` | 24 | Storage StorageConfig `yaml:"storage"` |
| 24 | } | 25 | } |
| 25 | 26 | ||
| 27 | type RelayConfig struct { | ||
| 28 | Name string `yaml:"name"` | ||
| 29 | Description string `yaml:"description"` | ||
| 30 | Pubkey string `yaml:"pubkey"` | ||
| 31 | Contact string `yaml:"contact"` | ||
| 32 | Icon string `yaml:"icon"` | ||
| 33 | } | ||
| 34 | |||
| 26 | type ServerConfig struct { | 35 | type ServerConfig struct { |
| 27 | GrpcAddr string `yaml:"grpc_addr"` | 36 | GrpcAddr string `yaml:"grpc_addr"` |
| 28 | HttpAddr string `yaml:"http_addr"` | 37 | HttpAddr string `yaml:"http_addr"` |
| @@ -90,6 +99,10 @@ type StorageConfig struct { | |||
| 90 | // Default returns the default configuration. | 99 | // Default returns the default configuration. |
| 91 | func Default() *Config { | 100 | func Default() *Config { |
| 92 | return &Config{ | 101 | return &Config{ |
| 102 | Relay: RelayConfig{ | ||
| 103 | Name: "muxstr relay", | ||
| 104 | Description: "High-performance Nostr relay with gRPC, Connect, and WebSocket support", | ||
| 105 | }, | ||
| 93 | Server: ServerConfig{ | 106 | Server: ServerConfig{ |
| 94 | GrpcAddr: ":50051", | 107 | GrpcAddr: ":50051", |
| 95 | HttpAddr: ":8080", | 108 | HttpAddr: ":8080", |
