Compare commits

..

No commits in common. "dfc81ca9696c8665c8fc606f19f1797b60c197c4" and "6b8235c36b974b22a13bc3d6131247f7bc88b108" have entirely different histories.

5 changed files with 5 additions and 18 deletions

View File

@ -9,4 +9,4 @@ pipeline:
commands: commands:
- go get ./... - go get ./...
- go test - go test
- CC=/usr/bin/musl-gcc go build --ldflags '-linkmode external -extldflags "-static"' - go build

View File

@ -1,8 +0,0 @@
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"]

View File

@ -5,7 +5,6 @@ import (
"log" "log"
"net/http" "net/http"
"net/url" "net/url"
"os"
"p83.nl/go/indieauth" "p83.nl/go/indieauth"
) )
@ -121,7 +120,7 @@ func (h *IndieAuthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
log.Println(authURL) log.Println(authURL)
state := RandStringBytes(16) state := RandStringBytes(16)
redirectURI := fmt.Sprintf("%s/auth/callback", os.Getenv("TRACKME_HOST")) redirectURI := fmt.Sprintf("%s/auth/callback", "http://localhost:8096")
sess.AuthorizationEndpoint = endpoints.AuthorizationEndpoint sess.AuthorizationEndpoint = endpoints.AuthorizationEndpoint
sess.Me = meURL.String() sess.Me = meURL.String()

View File

@ -37,5 +37,6 @@ func main() {
http.Handle("/auth/", http.StripPrefix("/auth/", &IndieAuthHandler{})) http.Handle("/auth/", http.StripPrefix("/auth/", &IndieAuthHandler{}))
http.Handle("/", &indexHandler{DB: db}) http.Handle("/", &indexHandler{DB: db})
http.Handle("/moment", &momentHandler{DB: db}) http.Handle("/moment", &momentHandler{DB: db})
log.Fatal(http.ListenAndServe(":8095", nil)) log.Fatal(http.ListenAndServe(":8096", nil))
} }

View File

@ -2,15 +2,10 @@ package main
import ( import (
"math/rand" "math/rand"
"time"
) )
const letterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" const letterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
func init() {
rand.Seed(time.Now().Unix())
}
func RandStringBytes(n int) string { func RandStringBytes(n int) string {
b := make([]byte, n) b := make([]byte, n)
for i := range b { for i := range b {