Compare commits
2 Commits
6b8235c36b
...
dfc81ca969
| Author | SHA1 | Date | |
|---|---|---|---|
| dfc81ca969 | |||
| 7617f47ba0 |
|
|
@ -9,4 +9,4 @@ pipeline:
|
|||
commands:
|
||||
- go get ./...
|
||||
- go test
|
||||
- go build
|
||||
- CC=/usr/bin/musl-gcc go build --ldflags '-linkmode external -extldflags "-static"'
|
||||
|
|
|
|||
8
Dockerfile
Normal file
8
Dockerfile
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
FROM alpine
|
||||
RUN addgroup -S app && adduser -S -G app app
|
||||
RUN apk add --update ca-certificates
|
||||
WORKDIR /data
|
||||
RUN ["chown", "app:app", "/data"]
|
||||
COPY track-me /app/
|
||||
USER app
|
||||
CMD ["/app/track-me"]
|
||||
|
|
@ -5,6 +5,7 @@ import (
|
|||
"log"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"p83.nl/go/indieauth"
|
||||
)
|
||||
|
||||
|
|
@ -120,7 +121,7 @@ func (h *IndieAuthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
log.Println(authURL)
|
||||
|
||||
state := RandStringBytes(16)
|
||||
redirectURI := fmt.Sprintf("%s/auth/callback", "http://localhost:8096")
|
||||
redirectURI := fmt.Sprintf("%s/auth/callback", os.Getenv("TRACKME_HOST"))
|
||||
|
||||
sess.AuthorizationEndpoint = endpoints.AuthorizationEndpoint
|
||||
sess.Me = meURL.String()
|
||||
|
|
|
|||
5
main.go
5
main.go
|
|
@ -10,7 +10,7 @@ import (
|
|||
)
|
||||
|
||||
func init() {
|
||||
log.SetFlags(log.LstdFlags|log.Lshortfile)
|
||||
log.SetFlags(log.LstdFlags | log.Lshortfile)
|
||||
}
|
||||
|
||||
const DBFilename = "./moments.db"
|
||||
|
|
@ -37,6 +37,5 @@ func main() {
|
|||
http.Handle("/auth/", http.StripPrefix("/auth/", &IndieAuthHandler{}))
|
||||
http.Handle("/", &indexHandler{DB: db})
|
||||
http.Handle("/moment", &momentHandler{DB: db})
|
||||
log.Fatal(http.ListenAndServe(":8096", nil))
|
||||
log.Fatal(http.ListenAndServe(":8095", nil))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user