Add TokenEndpoint to backend.json
- The tokenEndpoint provided here will be used to check the authenticity of the token
This commit is contained in:
parent
5207e43430
commit
7199652e4a
|
|
@ -6,7 +6,8 @@ RUN go get github.com/pstuifzand/ekster/cmd/eksterd
|
||||||
# final stage
|
# final stage
|
||||||
FROM alpine
|
FROM alpine
|
||||||
RUN apk --no-cache add ca-certificates
|
RUN apk --no-cache add ca-certificates
|
||||||
WORKDIR /app
|
RUN ["mkdir", "-p", "/opt/micropub"]
|
||||||
|
WORKDIR /opt/micropub
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
COPY --from=build-env /go/bin/eksterd /app/
|
COPY --from=build-env /go/bin/eksterd /app/
|
||||||
ENTRYPOINT ./eksterd
|
ENTRYPOINT ["/app/eksterd"]
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,10 @@ func (h *microsubHandler) cachedCheckAuthToken(header string, r *TokenResponse)
|
||||||
|
|
||||||
func (h *microsubHandler) checkAuthToken(header string, token *TokenResponse) bool {
|
func (h *microsubHandler) checkAuthToken(header string, token *TokenResponse) bool {
|
||||||
log.Println("Checking auth token")
|
log.Println("Checking auth token")
|
||||||
req, err := http.NewRequest("GET", "https://publog.stuifzandapp.com/authtoken", nil)
|
|
||||||
|
tokenEndpoint := h.Backend.(*memoryBackend).TokenEndpoint
|
||||||
|
|
||||||
|
req, err := http.NewRequest("GET", tokenEndpoint, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
return false
|
return false
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ type memoryBackend struct {
|
||||||
Feeds map[string][]microsub.Feed
|
Feeds map[string][]microsub.Feed
|
||||||
NextUid int
|
NextUid int
|
||||||
Me string
|
Me string
|
||||||
|
TokenEndpoint string
|
||||||
|
|
||||||
ticker *time.Ticker
|
ticker *time.Ticker
|
||||||
quit chan struct{}
|
quit chan struct{}
|
||||||
|
|
|
||||||
17
docker-compose.yml
Normal file
17
docker-compose.yml
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
version: '2'
|
||||||
|
services:
|
||||||
|
redis:
|
||||||
|
image: "redis"
|
||||||
|
|
||||||
|
web:
|
||||||
|
image: "pstuifzand/eksterd:alpine"
|
||||||
|
working_dir: /opt/microsub
|
||||||
|
links:
|
||||||
|
- redis:redis
|
||||||
|
volumes:
|
||||||
|
- ./data:/opt/microsub
|
||||||
|
ports:
|
||||||
|
- 8090
|
||||||
|
environment:
|
||||||
|
- "FEEDBIN_USER="
|
||||||
|
- "FEEDBIN_PASS="
|
||||||
Loading…
Reference in New Issue
Block a user