Get rid of rss
This commit is contained in:
parent
8ed0676e51
commit
0b9bae3bf8
@ -17,7 +17,6 @@ args_bin = [
|
|||||||
"-pdfs tmp/pdfs",
|
"-pdfs tmp/pdfs",
|
||||||
"-pics tmp/pics",
|
"-pics tmp/pics",
|
||||||
"-port 8080",
|
"-port 8080",
|
||||||
"-rss tmp/orientexpress_alle.rss",
|
|
||||||
"-title 'Freimaurer Distrikt Niedersachsen und Sachsen-Anhalt'",
|
"-title 'Freimaurer Distrikt Niedersachsen und Sachsen-Anhalt'",
|
||||||
"-web web",
|
"-web web",
|
||||||
"-width 1024",
|
"-width 1024",
|
||||||
|
@ -26,7 +26,6 @@ type Config struct {
|
|||||||
PDFDir string
|
PDFDir string
|
||||||
PicsDir string
|
PicsDir string
|
||||||
Port string
|
Port string
|
||||||
RSSFile string
|
|
||||||
Title string
|
Title string
|
||||||
WebDir string
|
WebDir string
|
||||||
MaxImgHeight int
|
MaxImgHeight int
|
||||||
@ -48,7 +47,6 @@ func newConfig() *Config {
|
|||||||
PDFDir: "/var/www/cpolis/pdfs",
|
PDFDir: "/var/www/cpolis/pdfs",
|
||||||
PicsDir: "/var/www/cpolis/pics",
|
PicsDir: "/var/www/cpolis/pics",
|
||||||
Port: ":8080",
|
Port: ":8080",
|
||||||
RSSFile: "/var/www/cpolis/cpolis.rss",
|
|
||||||
WebDir: "/var/www/cpolis/web",
|
WebDir: "/var/www/cpolis/web",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -117,7 +115,6 @@ func (c *Config) handleCliArgs() error {
|
|||||||
flag.StringVar(&c.LogFile, "log", c.LogFile, "log file")
|
flag.StringVar(&c.LogFile, "log", c.LogFile, "log file")
|
||||||
flag.StringVar(&c.PDFDir, "pdfs", c.PDFDir, "pdf directory")
|
flag.StringVar(&c.PDFDir, "pdfs", c.PDFDir, "pdf directory")
|
||||||
flag.StringVar(&c.PicsDir, "pics", c.PicsDir, "pictures directory")
|
flag.StringVar(&c.PicsDir, "pics", c.PicsDir, "pictures directory")
|
||||||
flag.StringVar(&c.RSSFile, "rss", c.RSSFile, "RSS file")
|
|
||||||
flag.StringVar(&c.Title, "title", c.Title, "channel title")
|
flag.StringVar(&c.Title, "title", c.Title, "channel title")
|
||||||
flag.StringVar(&c.WebDir, "web", c.WebDir, "web directory")
|
flag.StringVar(&c.WebDir, "web", c.WebDir, "web directory")
|
||||||
flag.IntVar(&c.MaxImgHeight, "height", c.MaxImgHeight, "maximum image height")
|
flag.IntVar(&c.MaxImgHeight, "height", c.MaxImgHeight, "maximum image height")
|
||||||
@ -246,14 +243,6 @@ func (c *Config) setupConfig(cliConfig *Config) error {
|
|||||||
c.Port = cliConfig.Port
|
c.Port = cliConfig.Port
|
||||||
}
|
}
|
||||||
|
|
||||||
if cliConfig.RSSFile != defaultConfig.RSSFile {
|
|
||||||
c.RSSFile = cliConfig.RSSFile
|
|
||||||
}
|
|
||||||
c.RSSFile, err = mkFile(c.RSSFile, 0600, 0700)
|
|
||||||
if err != nil {
|
|
||||||
return fmt.Errorf("error setting up file: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if cliConfig.Title != defaultConfig.Title {
|
if cliConfig.Title != defaultConfig.Title {
|
||||||
c.Title = cliConfig.Title
|
c.Title = cliConfig.Title
|
||||||
}
|
}
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
package calls
|
|
||||||
|
|
||||||
import (
|
|
||||||
"net/http"
|
|
||||||
|
|
||||||
b "streifling.com/jason/cpolis/cmd/backend"
|
|
||||||
)
|
|
||||||
|
|
||||||
func ServeRSS(c *b.Config) http.HandlerFunc {
|
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
|
||||||
if !tokenIsVerified(w, r, c) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
http.ServeFile(w, r, c.RSSFile)
|
|
||||||
}
|
|
||||||
}
|
|
@ -72,7 +72,6 @@ func main() {
|
|||||||
mux.HandleFunc("GET /logout", f.Logout(config, store))
|
mux.HandleFunc("GET /logout", f.Logout(config, store))
|
||||||
mux.HandleFunc("GET /pdf/get-list", c.ServePDFList(config))
|
mux.HandleFunc("GET /pdf/get-list", c.ServePDFList(config))
|
||||||
mux.HandleFunc("GET /pdf/serve/{id}", c.ServePDF(config))
|
mux.HandleFunc("GET /pdf/serve/{id}", c.ServePDF(config))
|
||||||
mux.HandleFunc("GET /rss/serve", c.ServeRSS(config))
|
|
||||||
mux.HandleFunc("GET /tag/create", f.CreateTag(config, store))
|
mux.HandleFunc("GET /tag/create", f.CreateTag(config, store))
|
||||||
mux.HandleFunc("GET /user/create", f.CreateUser(config, store))
|
mux.HandleFunc("GET /user/create", f.CreateUser(config, store))
|
||||||
mux.HandleFunc("GET /user/delete/{id}", f.DeleteUser(config, db, store))
|
mux.HandleFunc("GET /user/delete/{id}", f.DeleteUser(config, db, store))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user