setconfig command

This commit is contained in:
Ted Unangst 2022-05-20 18:48:40 -04:00
parent 1b1bbdc91c
commit 8a635bd682
2 changed files with 17 additions and 1 deletions

View File

@ -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.

10
honk.go
View File

@ -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":