From 00925bb267edcd1e96671ef5056ee1dbe9df1f80 Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Sat, 23 Dec 2017 18:45:39 -0800 Subject: [PATCH] Don't allow reconfiguring the site --- core/initial-setup.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/initial-setup.go b/core/initial-setup.go index d97adc1..ee88843 100644 --- a/core/initial-setup.go +++ b/core/initial-setup.go @@ -15,6 +15,13 @@ func (b *Blog) SetupHandler(w http.ResponseWriter, r *http.Request) { Form: forms.Setup{}, } + // Reject if we're already set up. + s, _ := settings.Load() + if s.Initialized { + b.FlashAndRedirect(w, r, "/", "This website has already been configured.") + return + } + if r.Method == http.MethodPost { form := forms.Setup{ Username: r.FormValue("username"),