mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-26 02:02:24 +01:00
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:
parent
394ae29c03
commit
8018454dff
2 changed files with 0 additions and 42 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue