]> Sergey Matveev's repositories - godlighty.git/blob - rc/example.cfg/lists.cypherpunks.ru.go
66322c0fbe4e8b4b6064c3bf8cfc7d148f6b511f
[godlighty.git] / rc / example.cfg / lists.cypherpunks.ru.go
1 // mlmmj archive browser
2 package cfg
3
4 import (
5         "net/http"
6         "path"
7         "strings"
8
9         "go.stargrave.org/godlighty"
10 )
11
12 func init() {
13         host := "lists.cypherpunks.ru"
14         godlighty.Hosts[host] = &godlighty.HostCfg{
15                 Root: path.Join(WWW, host),
16                 TLS:  newTLSCfg(host),
17                 Hooks: []godlighty.Hook{
18                         func(w http.ResponseWriter, r *http.Request) bool {
19                                 if strings.HasPrefix(r.URL.Path, "/archive/") {
20                                         r.URL.Path = strings.TrimPrefix(r.URL.Path, "/archive")
21                                         godlighty.MainHandler.Handle(w, r, host, &godlighty.HostCfg{
22                                                 Root: "/home/mlmmj/archive",
23                                         })
24                                         return true
25                                 }
26                                 return false
27                         },
28                 },
29         }
30 }