From 8a635bd6822ee61f619c6c0b373efff7c788423e Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Fri, 20 May 2022 18:48:40 -0400 Subject: [PATCH] setconfig command --- docs/honk.8 | 8 +++++++- honk.go | 10 ++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/docs/honk.8 b/docs/honk.8 index 8bb578d..ceb8da5 100644 --- a/docs/honk.8 +++ b/docs/honk.8 @@ -197,9 +197,15 @@ After unzipping the data archive, navigate to the tweet_media directory and unzip any zip files contained within. .Dl ./honk import username twitter source-directory .Ss Advanced Options +Advanced configuration values may be set by running the +.Ic setconfig Ar key value +command. +For example, to increase the fast timeout value from 5 seconds to 10: +.Dl ./honk setconfig fasttimeout 10 +.Pp To support separate mentions without a subdomain, e.g. @user@example.com and https://honk.example.com/u/user, -add a ('masqname', 'example.com') row to the config table of the database. +set config key 'masqname' to 'example.com'. Route .Pa /.well-known/webfinger from the top domain to honk. diff --git a/honk.go b/honk.go index f68e18a..67cb6b6 100644 --- a/honk.go +++ b/honk.go @@ -344,6 +344,16 @@ func main() { default: elog.Fatal("argument must be on or off") } + case "setconfig": + if len(args) != 3 { + elog.Fatal("need an argument: setconfig key val") + } + var val interface{} + var err error + if val, err = strconv.Atoi(args[2]); err != nil { + val = args[2] + } + setconfig(args[1], val) case "adduser": adduser() case "deluser":