diff --git a/CHANGELOG.md b/CHANGELOG.md index e32c3dfd9..e52c04bdf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Added +- Added support for PHP 8.1. +- Added support for more Linux distributions when installing certificates. ([#380](https://github.com/craftcms/nitro/issues/380), [#414](https://github.com/craftcms/nitro/issues/414)) + ### Removed - Removed the `blackfire` command. diff --git a/Dockerfile b/Dockerfile index c393108db..12b4ffb7b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM caddy:2.3.0-alpine AS caddy # build the api -FROM golang:1.16-alpine AS builder +FROM golang:1.17-alpine AS builder ARG NITRO_VERSION ENV NITRO_VERSION=${NITRO_VERSION} WORKDIR /go/src/github.com/craftcms/nitro @@ -10,7 +10,7 @@ COPY . . RUN GOOS=linux go build -ldflags="-s -w -X 'github.com/craftcms/nitro/pkg/api/api.Version=${NITRO_VERSION}'" -o nitrod ./cmd/nitrod # build the final image -FROM alpine:3.12 +FROM alpine:3 # See https://caddyserver.com/docs/conventions#file-locations for details ENV XDG_CONFIG_HOME /config diff --git a/Makefile b/Makefile index 3e3d4c220..b617d4c8f 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ .PHONY: docker docs -VERSION ?= 2.0.8 +VERSION ?= 2.0.9 build: go build -trimpath -ldflags="-s -w -X 'github.com/craftcms/nitro/command/version.Version=${VERSION}'" -o nitro ./cmd/nitro @@ -20,7 +20,7 @@ build-linux-arm: mod: go mod tidy && go mod verify -docker: +proxy: docker build --build-arg NITRO_VERSION=${VERSION} -t craftcms/nitro-proxy:${VERSION} . docs: go run cmd/docs/main.go diff --git a/command/update/update.go b/command/update/update.go index 813893e91..630fd38da 100644 --- a/command/update/update.go +++ b/command/update/update.go @@ -20,6 +20,7 @@ import ( var ( DockerImages = map[string]string{ + "nginx:8.1-dev": "docker.io/craftcms/nginx:8.1-dev", "nginx:8.0-dev": "docker.io/craftcms/nginx:8.0-dev", "nginx:7.4-dev": "docker.io/craftcms/nginx:7.4-dev", "nginx:7.3-dev": "docker.io/craftcms/nginx:7.3-dev", diff --git a/go.mod b/go.mod index 2fb2ef2f3..001fdf4e6 100644 --- a/go.mod +++ b/go.mod @@ -1,32 +1,51 @@ module github.com/craftcms/nitro -go 1.16 +go 1.17 + +require ( + github.com/docker/docker v20.10.1+incompatible + github.com/docker/go-connections v0.4.0 + github.com/go-sql-driver/mysql v1.5.0 + github.com/golang/protobuf v1.4.3 + github.com/google/uuid v1.2.0 + github.com/minio/selfupdate v0.3.1 + github.com/mitchellh/go-homedir v1.1.0 + github.com/opencontainers/image-spec v1.0.1 + github.com/rodaine/table v1.0.1 + github.com/spf13/cobra v1.1.1 + google.golang.org/grpc v1.34.0 + google.golang.org/protobuf v1.25.0 + gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 +) require ( github.com/Microsoft/go-winio v0.4.16 // indirect github.com/Microsoft/hcsshim v0.8.14 // indirect + github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59 // indirect github.com/containerd/containerd v1.4.3 // indirect github.com/containerd/continuity v0.0.0-20201208142359-180525291bb7 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect github.com/docker/distribution v2.7.1+incompatible // indirect - github.com/docker/docker v20.10.1+incompatible - github.com/docker/go-connections v0.4.0 - github.com/go-sql-driver/mysql v1.5.0 - github.com/golang/protobuf v1.4.3 + github.com/docker/go-units v0.4.0 // indirect + github.com/gogo/protobuf v1.3.1 // indirect github.com/google/go-cmp v0.5.2 // indirect - github.com/google/uuid v1.2.0 github.com/gorilla/mux v1.8.0 // indirect github.com/hashicorp/golang-lru v0.5.4 // indirect + github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/kr/pretty v0.2.1 // indirect - github.com/minio/selfupdate v0.3.1 - github.com/mitchellh/go-homedir v1.1.0 github.com/moby/sys/mount v0.2.0 // indirect + github.com/moby/sys/mountinfo v0.4.0 // indirect github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 // indirect github.com/morikuni/aec v1.0.0 // indirect - github.com/opencontainers/image-spec v1.0.1 + github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/runc v0.1.1 // indirect - github.com/rodaine/table v1.0.1 + github.com/pkg/errors v0.9.1 // indirect + github.com/russross/blackfriday/v2 v2.0.1 // indirect + github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect github.com/sirupsen/logrus v1.7.0 // indirect - github.com/spf13/cobra v1.1.1 + github.com/spf13/pflag v1.0.5 // indirect + go.opencensus.io v0.22.0 // indirect + golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899 // indirect golang.org/x/net v0.0.0-20201224014010-6772e930b67b // indirect golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a // indirect golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c // indirect @@ -34,9 +53,7 @@ require ( golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d // indirect - google.golang.org/grpc v1.34.0 - google.golang.org/protobuf v1.25.0 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect - gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 + gopkg.in/yaml.v2 v2.2.8 // indirect gotest.tools/v3 v3.0.3 // indirect ) diff --git a/pkg/certinstall/certinstall_linux.go b/pkg/certinstall/certinstall_linux.go index 797bde5b0..821ab76da 100644 --- a/pkg/certinstall/certinstall_linux.go +++ b/pkg/certinstall/certinstall_linux.go @@ -1,4 +1,5 @@ -// +build linux, !darwin +//go:build (linux && ignore) || !darwin +// +build linux,ignore !darwin package certinstall @@ -99,7 +100,7 @@ func identify(description string) (string, error) { } // detect debian systems - if strings.Contains(description, "Ubuntu") || strings.Contains(description, "Pop!_OS") || strings.Contains(description, "Mint") || strings.Contains(description, "elementary") || strings.Contains(description, "Debian") { + if strings.Contains(description, "Ubuntu") || strings.Contains(description, "Pop!_OS") || strings.Contains(description, "Mint") || strings.Contains(description, "elementary") || strings.Contains(description, "Debian") || strings.Contains(description, "Zorin OS") { return "debian", nil } diff --git a/pkg/config/config.go b/pkg/config/config.go index 2cb1a1d8b..eaa634276 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -783,13 +783,13 @@ func xdebugVars(php PHP, xdebug bool, version, hostname, addr string) []string { } switch version { - case "8.0", "7.4", "7.3", "7.2": - envs = append(envs, fmt.Sprintf(`XDEBUG_CONFIG=client_host=%s client_port=9003`, addr)) - envs = append(envs, "XDEBUG_MODE=develop,debug") - default: + case "7.1", "7.0": // use legacy xdebug settings to support older versions of php envs = append(envs, fmt.Sprintf(`XDEBUG_CONFIG=idekey=PHPSTORM remote_host=%s profiler_enable=1 remote_port=9000 remote_autostart=1 remote_enable=1`, addr)) envs = append(envs, "XDEBUG_MODE=xdebug2") + default: + envs = append(envs, fmt.Sprintf(`XDEBUG_CONFIG=client_host=%s client_port=9003`, addr)) + envs = append(envs, "XDEBUG_MODE=develop,debug") } return envs diff --git a/pkg/phpversions/phpversions.go b/pkg/phpversions/phpversions.go index f5d7ef72e..5b5b46ba8 100644 --- a/pkg/phpversions/phpversions.go +++ b/pkg/phpversions/phpversions.go @@ -2,6 +2,7 @@ package phpversions // Versions is the known PHP versions we support var Versions = []string{ + "8.1", "8.0", "7.4", "7.3", diff --git a/pkg/validate/validate.go b/pkg/validate/validate.go index 91ffed95e..ca437c1d9 100644 --- a/pkg/validate/validate.go +++ b/pkg/validate/validate.go @@ -93,7 +93,7 @@ type PHPVersionValidator struct{} func (v *PHPVersionValidator) Validate(input string) error { switch input { - case "8.0", "7.4", "7.3", "7.2", "7.1", "7.0": + case "8.1", "8.0", "7.4", "7.3", "7.2", "7.1", "7.0": return nil }