bump
This commit is contained in:
		
							
								
								
									
										1
									
								
								go.mod
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								go.mod
									
									
									
									
									
								
							| @@ -6,6 +6,7 @@ require ( | |||||||
| 	git.teamworkapps.com/shortcut/forms v0.0.0-20240202203738-c42dc9446449 // indirect | 	git.teamworkapps.com/shortcut/forms v0.0.0-20240202203738-c42dc9446449 // indirect | ||||||
| 	github.com/emersion/go-message v0.18.0 // indirect | 	github.com/emersion/go-message v0.18.0 // indirect | ||||||
| 	github.com/emersion/go-textwrapper v0.0.0-20200911093747-65d896831594 // indirect | 	github.com/emersion/go-textwrapper v0.0.0-20200911093747-65d896831594 // indirect | ||||||
|  | 	github.com/gorilla/mux v1.8.1 // indirect | ||||||
| 	github.com/knadh/go-pop3 v0.3.0 // indirect | 	github.com/knadh/go-pop3 v0.3.0 // indirect | ||||||
| 	github.com/shopspring/decimal v1.3.1 // indirect | 	github.com/shopspring/decimal v1.3.1 // indirect | ||||||
| ) | ) | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								go.sum
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								go.sum
									
									
									
									
									
								
							| @@ -5,6 +5,8 @@ github.com/emersion/go-message v0.18.0 h1:7LxAXHRpSeoO/Wom3ZApVZYG7c3d17yCScYce8 | |||||||
| github.com/emersion/go-message v0.18.0/go.mod h1:Zi69ACvzaoV/MBnrxfVBPV3xWEuCmC2nEN39oJF4B8A= | github.com/emersion/go-message v0.18.0/go.mod h1:Zi69ACvzaoV/MBnrxfVBPV3xWEuCmC2nEN39oJF4B8A= | ||||||
| github.com/emersion/go-textwrapper v0.0.0-20200911093747-65d896831594 h1:IbFBtwoTQyw0fIM5xv1HF+Y+3ZijDR839WMulgxCcUY= | github.com/emersion/go-textwrapper v0.0.0-20200911093747-65d896831594 h1:IbFBtwoTQyw0fIM5xv1HF+Y+3ZijDR839WMulgxCcUY= | ||||||
| github.com/emersion/go-textwrapper v0.0.0-20200911093747-65d896831594/go.mod h1:aqO8z8wPrjkscevZJFVE1wXJrLpC5LtJG7fqLOsPb2U= | github.com/emersion/go-textwrapper v0.0.0-20200911093747-65d896831594/go.mod h1:aqO8z8wPrjkscevZJFVE1wXJrLpC5LtJG7fqLOsPb2U= | ||||||
|  | github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= | ||||||
|  | github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= | ||||||
| github.com/knadh/go-pop3 v0.3.0 h1:h6wh28lyT/vUBMSiSwDDUXZjHH6zL8CM8WYCPbETM4Y= | github.com/knadh/go-pop3 v0.3.0 h1:h6wh28lyT/vUBMSiSwDDUXZjHH6zL8CM8WYCPbETM4Y= | ||||||
| github.com/knadh/go-pop3 v0.3.0/go.mod h1:a5kUJzrBB6kec+tNJl+3Z64ROgByKBdcyub+mhZMAfI= | github.com/knadh/go-pop3 v0.3.0/go.mod h1:a5kUJzrBB6kec+tNJl+3Z64ROgByKBdcyub+mhZMAfI= | ||||||
| github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= | github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= | ||||||
|   | |||||||
							
								
								
									
										23
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										23
									
								
								main.go
									
									
									
									
									
								
							| @@ -8,6 +8,8 @@ import ( | |||||||
| 	"text/template" | 	"text/template" | ||||||
| 	"time" | 	"time" | ||||||
|  |  | ||||||
|  | 	"github.com/gorilla/mux" | ||||||
|  |  | ||||||
| 	"git.teamworkapps.com/shortcut/forms" | 	"git.teamworkapps.com/shortcut/forms" | ||||||
| 	"github.com/knadh/go-pop3" | 	"github.com/knadh/go-pop3" | ||||||
| ) | ) | ||||||
| @@ -19,6 +21,15 @@ type tplData struct { | |||||||
| 	Body string | 	Body string | ||||||
| } | } | ||||||
|  |  | ||||||
|  | func mwLog(next http.Handler) http.Handler { | ||||||
|  | 	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | ||||||
|  | 		log.Printf("%s %s", r.RemoteAddr, r.URL.String()) | ||||||
|  | 		next.ServeHTTP(w, r) | ||||||
|  | 	}) | ||||||
|  | } | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
| func main() { | func main() { | ||||||
|  |  | ||||||
| 	forms.GlobalStyles.ContainerClasses = "w-full bg-gray-100  justify-center py-6 rounded-lg shadow flex" | 	forms.GlobalStyles.ContainerClasses = "w-full bg-gray-100  justify-center py-6 rounded-lg shadow flex" | ||||||
| @@ -74,13 +85,15 @@ func main() { | |||||||
| 	} | 	} | ||||||
| 	var d tplData | 	var d tplData | ||||||
|  |  | ||||||
| 	s := http.NewServeMux() | 	r := mux.NewRouter() | ||||||
| 	s.HandleFunc("style.css", http.FileServer(http.Dir("./")).ServeHTTP) | 	r.Use(mwLog) | ||||||
| 	s.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { |  | ||||||
|  | 	r.HandleFunc("/style.css", http.FileServer(http.Dir("./")).ServeHTTP) | ||||||
|  | 	r.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { | ||||||
| 		d.Body = f.Render(true) | 		d.Body = f.Render(true) | ||||||
| 		tmpl.Execute(w, d) | 		tmpl.Execute(w, d) | ||||||
| 	}) | 	}) | ||||||
| 	s.HandleFunc("/changepassword", func(w http.ResponseWriter, r *http.Request) { | 	r.HandleFunc("/changepassword", func(w http.ResponseWriter, r *http.Request) { | ||||||
| 		if f.Validate(r) != nil { | 		if f.Validate(r) != nil { | ||||||
| 			d.Body = f.Render(true) | 			d.Body = f.Render(true) | ||||||
| 			tmpl.Execute(w, d) | 			tmpl.Execute(w, d) | ||||||
| @@ -111,5 +124,5 @@ func main() { | |||||||
| 	d.Time = time.Now().Unix() | 	d.Time = time.Now().Unix() | ||||||
| 	d.Body = f.Render(true) | 	d.Body = f.Render(true) | ||||||
| 	tmpl.Execute(os.Stdout, d) | 	tmpl.Execute(os.Stdout, d) | ||||||
| 	http.ListenAndServe(":8910", s) | 	http.ListenAndServe(":8910", r) | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user