Skip to content

Commit

Permalink
Merge pull request Lukasa#18 from mac-chaffee/master
Browse files Browse the repository at this point in the history
Update to golang 1.23
  • Loading branch information
Lukasa authored Sep 11, 2024
2 parents 6911a8f + 8385b61 commit 2f8a725
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
FROM docker.io/golang:bullseye@sha256:8d717e8a7fa8035f5cfdcdc86811ffd53b7bb17542f419f2a121c4c7533d29ee as builder
FROM docker.io/golang:1.23 as builder
COPY . /app
WORKDIR /app
RUN go test ./...
RUN GOOS=linux GOARCH=amd64 go build -o dist/

FROM gcr.io/distroless/static-debian11@sha256:8ad6f3ec70dad966479b9fb48da991138c72ba969859098ec689d1450c2e6c97
FROM gcr.io/distroless/static-debian12:latest
COPY --from=builder /app/dist/mkcert /bin/mkcert
USER 1001
CMD ["/bin/mkcert"]
Expand Down
6 changes: 3 additions & 3 deletions body/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ package body
import (
"encoding/json"
"errors"
"github.com/Lukasa/mkcert/certs"
"io"
"io/ioutil"
"log"
"mime"
"mime/multipart"
"strings"

"github.com/Lukasa/mkcert/certs"
)

var (
Expand Down Expand Up @@ -98,7 +98,7 @@ func ParseMultipartBody(f io.Reader, boundary string) ([]string, []*certs.Certif
label = labelVals[0]
}

body, err := ioutil.ReadAll(p)
body, err := io.ReadAll(p)
if err != nil {
log.Printf("Unexpected IO error: %v.\n", err)
return nil, nil, err
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/Lukasa/mkcert

go 1.17
go 1.23
7 changes: 2 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ package main
import (
"encoding/json"
"fmt"
"github.com/Lukasa/mkcert/certs"
"io"
"log"
"net/http"
"runtime"
"strings"
"sync"
"time"

"github.com/Lukasa/mkcert/certs"
)

const CERT_URL = "https://hg.mozilla.org/mozilla-central/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt"
Expand Down Expand Up @@ -237,9 +237,6 @@ func listAllCerts(w http.ResponseWriter, r *http.Request) {
}

func main() {
// Before we do anything, TURN ON THE CPUS.
runtime.GOMAXPROCS(runtime.NumCPU())

// Start the certificate update loop.
go certUpdateLoop()

Expand Down

0 comments on commit 2f8a725

Please sign in to comment.