Make "Me" configurable in backend.json
This commit is contained in:
parent
b62f719221
commit
d28f0d85c2
|
@ -169,7 +169,7 @@ func (h *microsubHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
if token.Me != "https://publog.stuifzandapp.com/" {
|
||||
if token.Me != h.Backend.(*memoryBackend).Me {
|
||||
log.Printf("Missing \"me\" in token response: %#v\n", token)
|
||||
http.Error(w, "Wrong me", 403)
|
||||
return
|
||||
|
|
|
@ -38,6 +38,7 @@ type memoryBackend struct {
|
|||
Channels map[string]microsub.Channel
|
||||
Feeds map[string][]microsub.Feed
|
||||
NextUid int
|
||||
Me string
|
||||
|
||||
ticker *time.Ticker
|
||||
quit chan struct{}
|
||||
|
@ -128,6 +129,11 @@ func createMemoryBackend() microsub.Microsub {
|
|||
backend.Channels[c.UID] = c
|
||||
}
|
||||
backend.NextUid = 1002
|
||||
|
||||
backend.Me = "https://example.com/"
|
||||
|
||||
log.Println(`Config file "backend.json" is created in the current directory.`)
|
||||
log.Println(`Update "Me" variable to your website address "https://example.com/"`)
|
||||
return &backend
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user