cleanup (plugin): deprecated starter plugin

That plugin wouldn't work as expected and result in some angry email
from people who gave it a try so I'm getting rid of it to focus on the
other core plugin that make more sense for the project
This commit is contained in:
Mickael Kerjean 2022-02-16 08:53:12 +11:00
parent 394ae29c03
commit 8018454dff
2 changed files with 0 additions and 42 deletions

View file

@ -1,10 +0,0 @@
package plg_starter_web
import (
. "github.com/mickael-kerjean/filestash/server/common"
)
func init() {
Hooks.Register.Starter(WebServer)
// Hooks.Register.Hook() // letsencrypt hook
}

View file

@ -1,32 +0,0 @@
package plg_starter_web
import (
"github.com/gorilla/mux"
. "github.com/mickael-kerjean/filestash/server/common"
"golang.org/x/crypto/acme/autocert"
"net/http"
"path/filepath"
)
func WebServer(r *mux.Router) {
certManager := autocert.Manager{
Prompt: autocert.AcceptTOS,
HostPolicy: autocert.HostWhitelist(Config.Get("general.host").String()),
Cache: autocert.DirCache(filepath.Join(CERT_PATH, "ssl")),
}
go func() {
if err := http.ListenAndServe(":http", certManager.HTTPHandler(nil)); err != nil {
Log.Error("error: %v", err)
return
}
}()
srv := &http.Server{
Addr: ":https",
Handler: r,
TLSConfig: certManager.TLSConfig(),
}
if err := srv.ListenAndServeTLS("", ""); err != nil {
Log.Error("error: %v", err)
return
}
}