1
0

Well, actually... Let's hardcode guestbook owner. :)

This commit is contained in:
Alexander Andreev 2023-09-25 01:56:54 +04:00
parent a3525418f1
commit 33cd1dc3b8
Signed by: Arav
GPG Key ID: D22A817D95815393
2 changed files with 4 additions and 4 deletions

View File

@ -24,7 +24,7 @@ var (
showVersion = flag.Bool("v", false, "show version")
listenAddress = flag.String("listen", "/var/run/dwelling-home/sock", "listen address (ip:port|unix_path)")
captchaExpiry = flag.Duration("captcha-expiry", 10*time.Minute, "CAPTCHA expiry (e.g. 5m, 60s)")
guestbookOwner = flag.String("guestbook-owner", "Admin", "name of a guestbook owner")
guestbookOwner = "Arav"
guestbookPageSize = flag.Int64("guestbook-page-size", 60, "size of a guestbook page")
databasesPath = flag.String("database-path", "/var/lib/dwelling-home", "path to a directory where to store DB files")
)
@ -51,7 +51,7 @@ func main() {
}
defer mindflowDB.Close()
hand := dwhttp.NewHandlers(*captchaExpiry, *guestbookOwner, *guestbookPageSize, guestbookDB, mindflowDB)
hand := dwhttp.NewHandlers(*captchaExpiry, guestbookOwner, *guestbookPageSize, guestbookDB, mindflowDB)
r := httpr.New()
@ -82,7 +82,7 @@ func main() {
s.Handler(http.MethodPost, "/:id", captchaApi.Solve)
s.Handler(http.MethodGet, "/:id/image", captchaApi.Image)
guestbookApi := dwhttp.NewGuestbookApiHandlers(*guestbookOwner, *guestbookPageSize, guestbookDB)
guestbookApi := dwhttp.NewGuestbookApiHandlers(guestbookOwner, *guestbookPageSize, guestbookDB)
s = r.Sub("/api/guestbook")
s.Handler(http.MethodPost, "/", guestbookApi.New)

View File

@ -8,7 +8,7 @@ Restart=on-failure
DynamicUser=yes
ExecStart=/usr/bin/dwelling-home -listen /var/run/dwelling-home/sock \
-database-path /var/lib/dwelling-home -captcha-expiry 10m \
-guestbook-owner Arav -guestbook-page-size 60
-guestbook-page-size 60
ReadOnlyPaths=/