Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { ExportCmd *ExportCmd `arg:"subcommand:export" json:"-" help:"export database as line structured JSON"` ImportCmd *ImportCmd `arg:"subcommand:import" json:"-" help:"import data from line structured JSON"` InitCfgCmd *InitCfg `arg:"subcommand:initcfg" json:"-" help:"initialize relay configuration files"` AddRelayCmd *AddRelay `arg:"subcommand:addrelay" json:"-" help:"add a relay to the cluster"` PubKeyCmd *PubKey `arg:"subcommand:pubkey" json:"-" help:"print public key"` RemoveRelayCmd *RemoveRelay `arg:"subcommand:removerelay" json:"-" help:"remove a relay from the cluster"` GetPermissionCmd *GetPermission `arg:"subcommand:getpermission" json:"-" help:"get permission of a relay"` Wipe *WipeBDB `arg:"subcommand:wipebdb" json:"-" help:"empties database"` Rescan *RescanAC `arg:"subcommand:rescan" json:"-" help:"clear and regenerate access counter records"` Listen string `arg:"-l,--listen" json:"listen" help:"network address to listen on"` // default:"0.0.0.0:3334" EventStore string `arg:"-e,--eventstore" json:"eventstore" help:"select event store backend [ic,badger,iconly]"` // default:"badger" CanisterAddr string `arg:"-C,--canisteraddr" json:"canister_addr" help:"IC canister address to use (for local, use 127.0.0.1:46847)"` // default:"https://icp0.io/" CanisterId string `arg:"-I,--canisterid" json:"canister_id" help:"IC canister ID to use"` Profile string `arg:"-p,--profile" json:"-" help:"profile name to use for storage"` // default:"replicatr" Name string `arg:"-n,--name" json:"name" help:"name of relay for NIP-11"` // default:"replicatr relay" Description string `arg:"-d,--description" json:"description" help:"description of relay for NIP-11"` Pubkey string `arg:"--pubkey" json:"pubkey" help:"public key of relay operator"` Contact string `arg:"-c,--contact" json:"contact,omitempty" help:"non-nostr relay operator contact details"` Icon string `arg:"-i,--icon" json:"icon" help:"icon to show on relay information pages"` // default:"https://i.nostr.build/n8vM.png" AuthRequired bool `arg:"-a,--auth" json:"auth_required" help:"NIP-42 authentication required for all access"` // default:"false" Public bool `arg:"--public" json:"public" help:"allow public read access to users not on ACL"` // default:"true" Owners []string `arg:"-o,--owner,separate" json:"owners" help:"specify public keys of users with owner level permissions on relay"` SecKey string `` /* 131-byte string literal not displayed */ // Whitelist permits ONLY inbound connections from specified IP addresses. Whitelist []string `arg:"-w,--whitelist,separate" json:"ip_whitelist" help:"IP addresses that are only allowed to access"` // AllowIPs is for bypassing authentication required for clients based on IP // addresses... primarily for testing with wireguard VPN clients run by the // developer, as these are stable, non-routeable addresses, this skips the // requirement enforced by AuthRequired. AllowIPs []string `arg:"-A,--allow,separate" json:"allow_ip" help:"IP addresses that are always allowed to access"` // DBSizeLimit configures a target maximum size to maintain the local // event store cache at, in megabytes (1,000,000 bytes). DBSizeLimit int `arg:"-S,--sizelimit" json:"db_size_limit" help:"set the maximum size of the badger event store in bytes"` // default:"0" // DBLowWater is the proportion of the DBSizeLimit to prune the database // down to when performing a garbage collection run. DBLowWater int `arg:"-L,--lowwater" json:"db_low_water" help:"set target percentage for database size during garbage collection"` // default:"86" // DBHighWater is the proportion of the DBSizeLimit at which a garbage // collection run is triggered. DBHighWater int `` // default:"92" /* 135-byte string literal not displayed */ // GCFrequency is the frequency to run a check on the database size and // if it breaches DBHighWater to prune it back to DBLowWater percentage // of DBSizeLimit in minutes. GCFrequency int `arg:"-G,--gcfreq" json:"gc_frequency" help:"frequency in seconds to check if database needs garbage collection"` // default:"300" MaxProcs int `arg:"--maxprocs" json:"max_procs" help:"maximum number of goroutines to use"` // default:"128" LogLevel string `arg:"--loglevel" help:"set log level [off,fatal,error,warn,info,debug,trace] (can also use GODEBUG environment variable)"` // default:"info" PProf bool `arg:"--pprof" help:"enable CPU and memory profiling"` EncodeCache int `arg:"--encodecache" help:"JSON encode cache size limit for GC"` // default:"10000000" GCRatio int `arg:"--gcratio" help:"set GC percentage for triggering GC sweeps"` // default:"100" MemLimit int64 `arg:"--memlimit" help:"set memory limit on process to constrain memory usage"` // default:"500000000" }
func GetDefaultConfig ¶
func GetDefaultConfig() *Config
type ExportCmd ¶
type ExportCmd struct {
ToFile string `arg:"-f,--tofile" help:"write to file instead of stdout"`
}
type GetPermission ¶
type GetPermission struct { }
type RemoveRelay ¶
type RemoveRelay struct {
PubKey string `arg:"-k,--pubkey" help:"public key of client to remove"`
}
Click to show internal directories.
Click to hide internal directories.