From 93b292acc06b152e6db795d6c01d664669b0fb7e Mon Sep 17 00:00:00 2001 From: Azareal Date: Tue, 5 Mar 2019 15:53:02 +1000 Subject: [PATCH] Added a little note to the installation guide about setting up emails. Alerts will be resynced whenever a WebSockets connection is re-established now. Fixed client side overrides. --- common/routes_common.go | 5 +++-- docs/installation.md | 6 ++++++ public/global.js | 8 +++++++- router_gen/routes.go | 2 ++ 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/common/routes_common.go b/common/routes_common.go index a3da8508..f2946076 100644 --- a/common/routes_common.go +++ b/common/routes_common.go @@ -153,7 +153,7 @@ func panelUserCheck(w http.ResponseWriter, r *http.Request, user *User) (header var addPreScript = func(name string) { var tname string if theme.OverridenMap != nil { - _, ok := theme.OverridenMap[name+".html"] + _, ok := theme.OverridenMap[name] if ok { tname = "_" + theme.Name } @@ -240,11 +240,12 @@ func userCheck(w http.ResponseWriter, r *http.Request, user *User) (header *Head if theme.OverridenMap != nil { //fmt.Printf("name %+v\n", name) //fmt.Printf("theme.OverridenMap %+v\n", theme.OverridenMap) - _, ok := theme.OverridenMap[name+".html"] + _, ok := theme.OverridenMap[name] if ok { tname = "_" + theme.Name } } + //fmt.Printf("tname %+v\n", tname) header.AddPreScriptAsync("template_" + name + tname + ".js") } addPreScript("topics_topic") diff --git a/docs/installation.md b/docs/installation.md index 55b9e5e9..3f0ba7eb 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -99,6 +99,12 @@ You can get a free private key and certificate pair from Let's Encrypt or Cloudf If you're using Nginx or something else as a reverse-proxy in-front of Gosora, then you will have to consult their documentation for advice on setting HTTPS. +For email, you will need a SMTP server (either provided by yourself or by a transactional mail provider who specialises in doing so) + You can setup it up via config.json with the Email setting and the ones starting with SMTP. + +It is also possible to send emails without SMTP with the experimental sendmail plugin, however there is a high chance of your emails ending up in the user's spam folder, if it arrives at all. + + # Advanced Installation This section explains how to set things up without running the batch or shell files. For Windows, you will likely have to open up cmd.exe (the app called Command Prompt in Win10) to run these commands inside or something similar, while with Linux you would likely use the Terminal or console. diff --git a/public/global.js b/public/global.js index 37562088..77f96896 100644 --- a/public/global.js +++ b/public/global.js @@ -186,7 +186,13 @@ function runWebSockets() { conn.onclose = () => { conn = false; console.log("The WebSockets connection was closed"); - setTimeout(() => runWebSockets(), 60 * 1000); + setTimeout(() => { + var alertMenuList = document.getElementsByClassName("menu_alerts"); + for(var i = 0; i < alertMenuList.length; i++) { + loadAlerts(alertMenuList[i]); + } + runWebSockets(); + }, 60 * 1000); } conn.onmessage = (event) => { diff --git a/router_gen/routes.go b/router_gen/routes.go index 32005ce8..72498f36 100644 --- a/router_gen/routes.go +++ b/router_gen/routes.go @@ -135,6 +135,8 @@ func accountRoutes() *RouteGroup { View("routes.AccountLoginMFAVerify", "/accounts/mfa_verify/"), AnonAction("routes.AccountLoginMFAVerifySubmit", "/accounts/mfa_verify/submit/"), // We have logic in here which filters out regular guests AnonAction("routes.AccountRegisterSubmit", "/accounts/create/submit/"), + //View("routes.AccountPasswordReset", "/accounts/password-reset/"), + //AnonAction("routes.AccountPasswordResetSubmit", "/accounts/password-reset/submit/"), ) }