From e715ecd281d245ad8a7af5d9384cfb66dc58f426 Mon Sep 17 00:00:00 2001 From: Johannes Ahrndt Date: Thu, 11 Mar 2021 09:47:46 +0100 Subject: [PATCH 01/15] Add Linux Mint to distro finder The certificate installation fails on Linux Mint because it is not recognized as Debian based system. --- pkg/certinstall/certinstall.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/certinstall/certinstall.go b/pkg/certinstall/certinstall.go index 2c0c1bc7..4c2a6309 100644 --- a/pkg/certinstall/certinstall.go +++ b/pkg/certinstall/certinstall.go @@ -97,7 +97,7 @@ func findDistro(description string) (string, error) { } // detect debian systems - if strings.Contains(description, "Ubuntu") || strings.Contains(description, "Pop!_OS") { + if strings.Contains(description, "Ubuntu") || strings.Contains(description, "Pop!_OS" || strings.Contains(description, "Mint") { return "debian", nil } From e45c1cf121d16ec6319cfc29b4c042a9fb9ad23d Mon Sep 17 00:00:00 2001 From: Johannes Ahrndt Date: Thu, 11 Mar 2021 10:37:48 +0100 Subject: [PATCH 02/15] Fixed missing ) --- pkg/certinstall/certinstall.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/certinstall/certinstall.go b/pkg/certinstall/certinstall.go index 4c2a6309..ae49e2f5 100644 --- a/pkg/certinstall/certinstall.go +++ b/pkg/certinstall/certinstall.go @@ -97,7 +97,7 @@ func findDistro(description string) (string, error) { } // detect debian systems - if strings.Contains(description, "Ubuntu") || strings.Contains(description, "Pop!_OS" || strings.Contains(description, "Mint") { + if strings.Contains(description, "Ubuntu") || strings.Contains(description, "Pop!_OS") || strings.Contains(description, "Mint") { return "debian", nil } From 9c790b1e31d25cb3e5a5679f53ff0dcf8a8d8e5c Mon Sep 17 00:00:00 2001 From: Jason McCallister Date: Fri, 12 Mar 2021 10:32:49 -0500 Subject: [PATCH 03/15] resolve #291 --- CHANGELOG.md | 5 +++++ pkg/certinstall/certinstall.go | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e7a9796..02e58251 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Release Notes for Craft Nitro +## Unreleased + +### Fixed +- Fixed an output error for Windows users when using the `trust` command [#291](https://github.com/craftcms/nitro/issues/291). + ## 2.0.5 - 2021-03-09 ### Added diff --git a/pkg/certinstall/certinstall.go b/pkg/certinstall/certinstall.go index 2c0c1bc7..245b8a2e 100644 --- a/pkg/certinstall/certinstall.go +++ b/pkg/certinstall/certinstall.go @@ -78,7 +78,7 @@ func Install(file, system string) error { if dist, exists := os.LookupEnv("WSL_DISTRO_NAME"); exists { user := os.Getenv("USER") fmt.Println("Users on WSL will need to open an elevated (run as administrator) Command Prompt or terminal on Windows and run the following command:") - fmt.Printf(`certutil -addstore -f "Root" \\wsl$\%s\home\%s\.nitro\nitro.crt\n`, dist, user) + fmt.Println(fmt.Printf(`certutil -addstore -f "Root" \\wsl$\%s\home\%s\.nitro\nitro.crt`, dist, user)) } default: // add the certificate to the macOS keychain From 4b7a540f295c6f53d20e89cc6f4b42e0dc20fcd4 Mon Sep 17 00:00:00 2001 From: Jason McCallister Date: Fri, 12 Mar 2021 10:35:23 -0500 Subject: [PATCH 04/15] clean up --- pkg/config/config.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/pkg/config/config.go b/pkg/config/config.go index 0b938424..040a68d3 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -236,17 +236,10 @@ func (s *Site) GetContainerPath() string { func (s *Site) AsEnvs(addr string) []string { var envs []string - if addr == "" { - addr = "host.docker.internal" - } - // set the php vars envs = append(envs, phpVars(s.PHP, s.Version)...) - // get the xdebug vars - envs = append(envs, xdebugVars(s.PHP, s.Xdebug, s.Version, s.Hostname, addr)...) - - return envs + return append(envs, xdebugVars(s.PHP, s.Xdebug, s.Version, s.Hostname, addr)...) } // SetPHPBoolSetting is used to set php settings that are bool. It will look From 45bd2b581655c5d35052409ba54c8b847f811514 Mon Sep 17 00:00:00 2001 From: Jason McCallister Date: Mon, 15 Mar 2021 09:31:03 -0400 Subject: [PATCH 05/15] add package to determine docker host address --- .../internal/sitecontainer/sitecontainer.go | 4 +++- pkg/certinstall/certinstall.go | 4 ++-- pkg/config/config.go | 4 ---- pkg/dockerhost/dockerhost.go | 20 +++++++++++++++++++ 4 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 pkg/dockerhost/dockerhost.go diff --git a/command/apply/internal/sitecontainer/sitecontainer.go b/command/apply/internal/sitecontainer/sitecontainer.go index acaccab2..6bb0a05d 100644 --- a/command/apply/internal/sitecontainer/sitecontainer.go +++ b/command/apply/internal/sitecontainer/sitecontainer.go @@ -5,12 +5,14 @@ import ( "context" "fmt" "os" + "runtime" "strings" "github.com/craftcms/nitro/command/apply/internal/match" "github.com/craftcms/nitro/command/apply/internal/nginx" "github.com/craftcms/nitro/pkg/config" "github.com/craftcms/nitro/pkg/containerlabels" + "github.com/craftcms/nitro/pkg/dockerhost" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/filters" @@ -110,7 +112,7 @@ func create(ctx context.Context, docker client.CommonAPIClient, home, networkID } // get the sites environment variables - envs := site.AsEnvs("host.docker.internal") + envs := site.AsEnvs(dockerhost.Determine(runtime.GOOS)) // does the config have blackfire credentials if cfg.Blackfire.ServerID != "" { diff --git a/pkg/certinstall/certinstall.go b/pkg/certinstall/certinstall.go index e23703bf..56781c03 100644 --- a/pkg/certinstall/certinstall.go +++ b/pkg/certinstall/certinstall.go @@ -48,7 +48,7 @@ func Install(file, system string) error { } // find the linux distro - dist, err := findDistro(buf.String()) + dist, err := identify(buf.String()) if err != nil { return err } @@ -90,7 +90,7 @@ func Install(file, system string) error { return nil } -func findDistro(description string) (string, error) { +func identify(description string) (string, error) { // detect arch systems if strings.Contains(description, "Manjaro") || strings.Contains(description, "Arch Linux") { return "arch", nil diff --git a/pkg/config/config.go b/pkg/config/config.go index 0b938424..d925d5d1 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -236,10 +236,6 @@ func (s *Site) GetContainerPath() string { func (s *Site) AsEnvs(addr string) []string { var envs []string - if addr == "" { - addr = "host.docker.internal" - } - // set the php vars envs = append(envs, phpVars(s.PHP, s.Version)...) diff --git a/pkg/dockerhost/dockerhost.go b/pkg/dockerhost/dockerhost.go new file mode 100644 index 00000000..d9d22472 --- /dev/null +++ b/pkg/dockerhost/dockerhost.go @@ -0,0 +1,20 @@ +package dockerhost + +import "github.com/craftcms/nitro/pkg/wsl" + +const host = "host.docker.internal" + +// Determine takes the runtime.GOOS and determines the +// hostname to use to allow Docker to access the host machine. +func Determine(s string) string { + switch s { + case "linux": + if wsl.IsWSL() { + return host + } + + return "127.0.0.1" + } + + return host +} From 16cec489f8bcd1c0725075c3f4ade3e5367c33cd Mon Sep 17 00:00:00 2001 From: Jason McCallister Date: Mon, 15 Mar 2021 09:56:47 -0400 Subject: [PATCH 06/15] add host-gateway for linux distros, resolve #288 --- CHANGELOG.md | 1 + Makefile | 2 +- .../internal/sitecontainer/sitecontainer.go | 9 +++++++-- pkg/dockerhost/dockerhost.go | 20 ------------------- 4 files changed, 9 insertions(+), 23 deletions(-) delete mode 100644 pkg/dockerhost/dockerhost.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 02e58251..775fe274 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Unreleased ### Fixed +- Fixed an error preventing Linux users for using xdebug [#288](https://github.com/docker/for-linux/issues/288). - Fixed an output error for Windows users when using the `trust` command [#291](https://github.com/craftcms/nitro/issues/291). ## 2.0.5 - 2021-03-09 diff --git a/Makefile b/Makefile index b7f1b948..08137951 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ .PHONY: docker docs -VERSION ?= 2.0.4 +VERSION ?= 2.0.6 build: go build -trimpath -ldflags="-s -w -X 'github.com/craftcms/nitro/command/version.Version=${VERSION}'" -o nitro ./cmd/nitro diff --git a/command/apply/internal/sitecontainer/sitecontainer.go b/command/apply/internal/sitecontainer/sitecontainer.go index 6bb0a05d..3f831dc9 100644 --- a/command/apply/internal/sitecontainer/sitecontainer.go +++ b/command/apply/internal/sitecontainer/sitecontainer.go @@ -12,7 +12,7 @@ import ( "github.com/craftcms/nitro/command/apply/internal/nginx" "github.com/craftcms/nitro/pkg/config" "github.com/craftcms/nitro/pkg/containerlabels" - "github.com/craftcms/nitro/pkg/dockerhost" + "github.com/craftcms/nitro/pkg/wsl" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/filters" @@ -111,8 +111,13 @@ func create(ctx context.Context, docker client.CommonAPIClient, home, networkID extraHosts = append(extraHosts, fmt.Sprintf("%s:%s", s, "127.0.0.1")) } + // check if this is linux specific + if runtime.GOOS == "linux" && !wsl.IsWSL() { + extraHosts = append(extraHosts, fmt.Sprintf("%s:%s", "host.docker.internal", "host-gateway")) + } + // get the sites environment variables - envs := site.AsEnvs(dockerhost.Determine(runtime.GOOS)) + envs := site.AsEnvs("host.docker.internal") // does the config have blackfire credentials if cfg.Blackfire.ServerID != "" { diff --git a/pkg/dockerhost/dockerhost.go b/pkg/dockerhost/dockerhost.go deleted file mode 100644 index d9d22472..00000000 --- a/pkg/dockerhost/dockerhost.go +++ /dev/null @@ -1,20 +0,0 @@ -package dockerhost - -import "github.com/craftcms/nitro/pkg/wsl" - -const host = "host.docker.internal" - -// Determine takes the runtime.GOOS and determines the -// hostname to use to allow Docker to access the host machine. -func Determine(s string) string { - switch s { - case "linux": - if wsl.IsWSL() { - return host - } - - return "127.0.0.1" - } - - return host -} From 29c691a1cc7d056bed0c3b2b6f5ae7c3beadfaa0 Mon Sep 17 00:00:00 2001 From: Jason McCallister Date: Mon, 15 Mar 2021 14:03:54 -0400 Subject: [PATCH 07/15] wip --- command/completion/zsh.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/command/completion/zsh.go b/command/completion/zsh.go index 81f9e3aa..f2a1972a 100644 --- a/command/completion/zsh.go +++ b/command/completion/zsh.go @@ -2,7 +2,6 @@ package completion import ( "fmt" - "os" "github.com/spf13/cobra" ) @@ -19,12 +18,12 @@ var zshCompletionCommand = &cobra.Command{ $ echo "autoload -U compinit; compinit" >> ~/.zshrc # To load completions for each session, execute once: -$ nitro complete zsh > "${fpath[1]}/_nitro" +$ nitro completion zsh > "${fpath[1]}/_nitro" # You will need to start a new shell for this setup to take effect. `, Run: func(cmd *cobra.Command, args []string) { - err := cmd.GenZshCompletion(os.Stdout) + err := cmd.GenZshCompletion(cmd.OutOrStdout()) if err != nil { fmt.Println(err) } From c35d356fe48a906c9dcb5f100a19f52cdea10014 Mon Sep 17 00:00:00 2001 From: Brad Bell Date: Tue, 16 Mar 2021 16:27:41 -0700 Subject: [PATCH 08/15] Fixed #295 Fixed a bug where command completion was not working in a zsh shell. --- CHANGELOG.md | 5 +++-- command/completion/zsh.go | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 775fe274..5ec29054 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,8 +3,9 @@ ## Unreleased ### Fixed -- Fixed an error preventing Linux users for using xdebug [#288](https://github.com/docker/for-linux/issues/288). -- Fixed an output error for Windows users when using the `trust` command [#291](https://github.com/craftcms/nitro/issues/291). +- Fixed an error preventing Linux users for using Xdebug [#288](https://github.com/docker/for-linux/issues/288). +- Fixed a display error for Windows users when using the `trust` command [#291](https://github.com/craftcms/nitro/issues/291). +- Fixed a bug where command completion was not working in a zsh shell. [#295](https://github.com/craftcms/nitro/issues/295). ## 2.0.5 - 2021-03-09 diff --git a/command/completion/zsh.go b/command/completion/zsh.go index f2a1972a..f7da862e 100644 --- a/command/completion/zsh.go +++ b/command/completion/zsh.go @@ -23,7 +23,10 @@ $ nitro completion zsh > "${fpath[1]}/_nitro" # You will need to start a new shell for this setup to take effect. `, Run: func(cmd *cobra.Command, args []string) { + // Gross, but fixes a ZSH completion bug where Cobra generates the completion script using the command name. + cmd.Use = "nitro" err := cmd.GenZshCompletion(cmd.OutOrStdout()) + cmd.Use = "zsh" if err != nil { fmt.Println(err) } From 6c745050a18fe4a2ffddf36f884116d11ef1225c Mon Sep 17 00:00:00 2001 From: Brad Bell Date: Tue, 16 Mar 2021 16:30:38 -0700 Subject: [PATCH 09/15] changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ec29054..48102b57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## Unreleased ### Fixed -- Fixed an error preventing Linux users for using Xdebug [#288](https://github.com/docker/for-linux/issues/288). +- Fixed an error preventing Linux users from using Xdebug [#288](https://github.com/docker/for-linux/issues/288). - Fixed a display error for Windows users when using the `trust` command [#291](https://github.com/craftcms/nitro/issues/291). - Fixed a bug where command completion was not working in a zsh shell. [#295](https://github.com/craftcms/nitro/issues/295). From 088ca62c6d4a4546ef3a84fa610a73f005bdcb3a Mon Sep 17 00:00:00 2001 From: Jason McCallister Date: Wed, 17 Mar 2021 11:55:07 -0400 Subject: [PATCH 10/15] combine the bash and zsh completion commands --- command/completion/bash.go | 34 -------------------------------- command/completion/completion.go | 19 ++++++++++++------ command/completion/zsh.go | 34 -------------------------------- 3 files changed, 13 insertions(+), 74 deletions(-) delete mode 100644 command/completion/bash.go delete mode 100644 command/completion/zsh.go diff --git a/command/completion/bash.go b/command/completion/bash.go deleted file mode 100644 index df1bc29c..00000000 --- a/command/completion/bash.go +++ /dev/null @@ -1,34 +0,0 @@ -package completion - -import ( - "fmt" - "os" - - "github.com/spf13/cobra" -) - -// bashCompletionCommand represents the completion command -var bashCompletionCommand = &cobra.Command{ - Use: "bash", - Short: "Generates bash completion scripts", - Long: `To load completion run - -Bash: - -$ source <(nitro completion bash) - -# To load completions for each session, execute once: -Linux: - $ nitro completion bash > /etc/bash_completion.d/nitro -MacOS: - $ nitro completion bash > /usr/local/etc/bash_completion.d/nitro - -# You will need to start a new shell for this setup to take effect. -`, - Run: func(cmd *cobra.Command, args []string) { - err := cmd.Parent().Parent().GenBashCompletion(os.Stdout) - if err != nil { - fmt.Println(err) - } - }, -} diff --git a/command/completion/completion.go b/command/completion/completion.go index 69c0c2b5..a4eb6df5 100644 --- a/command/completion/completion.go +++ b/command/completion/completion.go @@ -2,6 +2,7 @@ package completion import ( "fmt" + "os" "github.com/spf13/cobra" ) @@ -39,15 +40,21 @@ $ nitro completion zsh > "${fpath[1]}/_nitro" // New is used for scaffolding new commands func New() *cobra.Command { cmd := &cobra.Command{ - Use: "completion", - Short: "Enable shell completion", - Example: exampleText, + Use: "completion", + Short: "Enable shell completion", + ValidArgs: []string{"bash", "zsh"}, + Example: exampleText, RunE: func(cmd *cobra.Command, args []string) error { - return cmd.Help() + switch args[0] { + case "zsh": + return cmd.Root().GenZshCompletion(os.Stdout) + case "bash": + return cmd.Root().GenBashCompletion(os.Stdout) + } + + return fmt.Errorf("unknown shell requested") }, } - cmd.AddCommand(bashCompletionCommand, zshCompletionCommand) - return cmd } diff --git a/command/completion/zsh.go b/command/completion/zsh.go deleted file mode 100644 index f7da862e..00000000 --- a/command/completion/zsh.go +++ /dev/null @@ -1,34 +0,0 @@ -package completion - -import ( - "fmt" - - "github.com/spf13/cobra" -) - -// zshCompletionCommand represents the completion command for zsh -var zshCompletionCommand = &cobra.Command{ - Use: "zsh", - Short: "Generates zsh completion scripts", - Long: `To load zsh completion: - -# If shell completion is not already enabled in your environment you will need -# to enable it. You can execute the following once: - -$ echo "autoload -U compinit; compinit" >> ~/.zshrc - -# To load completions for each session, execute once: -$ nitro completion zsh > "${fpath[1]}/_nitro" - -# You will need to start a new shell for this setup to take effect. -`, - Run: func(cmd *cobra.Command, args []string) { - // Gross, but fixes a ZSH completion bug where Cobra generates the completion script using the command name. - cmd.Use = "nitro" - err := cmd.GenZshCompletion(cmd.OutOrStdout()) - cmd.Use = "zsh" - if err != nil { - fmt.Println(err) - } - }, -} From 431cdbb49c9f0bc261ec026b5a1ec4b20c21c5b2 Mon Sep 17 00:00:00 2001 From: Jason McCallister Date: Wed, 17 Mar 2021 11:57:35 -0400 Subject: [PATCH 11/15] show help when no args are provided --- command/completion/completion.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/command/completion/completion.go b/command/completion/completion.go index a4eb6df5..9fd3c164 100644 --- a/command/completion/completion.go +++ b/command/completion/completion.go @@ -45,6 +45,11 @@ func New() *cobra.Command { ValidArgs: []string{"bash", "zsh"}, Example: exampleText, RunE: func(cmd *cobra.Command, args []string) error { + // print the help if not defined + if len(args) == 0 { + return cmd.Help() + } + switch args[0] { case "zsh": return cmd.Root().GenZshCompletion(os.Stdout) From bbbb6c5cc87c39f10793f6676d13b98dcd314b15 Mon Sep 17 00:00:00 2001 From: Jason McCallister Date: Wed, 17 Mar 2021 12:00:06 -0400 Subject: [PATCH 12/15] cleanup --- command/completion/completion.go | 9 ++------- command/nitro/nitro.go | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/command/completion/completion.go b/command/completion/completion.go index 9fd3c164..388c4cc6 100644 --- a/command/completion/completion.go +++ b/command/completion/completion.go @@ -7,11 +7,6 @@ import ( "github.com/spf13/cobra" ) -var ( - // ErrExample is used when we want to share an error - ErrExample = fmt.Errorf("not implemented") -) - const exampleText = `To load completions: Bash: @@ -37,8 +32,8 @@ $ nitro completion zsh > "${fpath[1]}/_nitro" # You will need to start a new shell for this setup to take effect. ` -// New is used for scaffolding new commands -func New() *cobra.Command { +// NewCommand returns the command used for generating completion shells +func NewCommand() *cobra.Command { cmd := &cobra.Command{ Use: "completion", Short: "Enable shell completion", diff --git a/command/nitro/nitro.go b/command/nitro/nitro.go index acf440ea..2833a34e 100644 --- a/command/nitro/nitro.go +++ b/command/nitro/nitro.go @@ -110,7 +110,7 @@ func NewCommand() *cobra.Command { blackfire.NewCommand(home, docker, term), bridge.NewCommand(home, docker, term), clean.NewCommand(home, docker, term), - completion.New(), + completion.NewCommand(), composer.NewCommand(docker, term), container.NewCommand(home, docker, term), context.NewCommand(home, docker, term), From 96a24d2417f9458ae346bcc0c7ab25fd8026b00d Mon Sep 17 00:00:00 2001 From: Jason McCallister Date: Wed, 17 Mar 2021 14:04:38 -0400 Subject: [PATCH 13/15] fix opcache check, resolves #298 --- CHANGELOG.md | 1 + command/apply/internal/match/match.go | 2 +- command/apply/internal/match/match_test.go | 14 ++++++++++++++ command/nitro/nitro.go | 5 ----- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48102b57..bf012c9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Unreleased ### Fixed +- Fixed an error where `initset` was not updating opcache settings [#298](https://github.com/craftcms/nitro/issues/298). - Fixed an error preventing Linux users from using Xdebug [#288](https://github.com/docker/for-linux/issues/288). - Fixed a display error for Windows users when using the `trust` command [#291](https://github.com/craftcms/nitro/issues/291). - Fixed a bug where command completion was not working in a zsh shell. [#295](https://github.com/craftcms/nitro/issues/295). diff --git a/command/apply/internal/match/match.go b/command/apply/internal/match/match.go index 3b8e40e5..4399336d 100644 --- a/command/apply/internal/match/match.go +++ b/command/apply/internal/match/match.go @@ -161,7 +161,7 @@ func checkEnvs(site config.Site, blackfire config.Blackfire, envs []string) bool return false } case "PHP_OPCACHE_ENABLE": - if site.PHP.OpcacheEnable && val == config.DefaultEnvs[env] { + if (site.PHP.OpcacheEnable && val == config.DefaultEnvs[env]) || (!site.PHP.OpcacheEnable && val != config.DefaultEnvs[env]) { return false } case "PHP_OPCACHE_REVALIDATE_FREQ": diff --git a/command/apply/internal/match/match_test.go b/command/apply/internal/match/match_test.go index 0c6ce5f0..523a2cf7 100644 --- a/command/apply/internal/match/match_test.go +++ b/command/apply/internal/match/match_test.go @@ -116,6 +116,20 @@ func Test_checkEnvs(t *testing.T) { }, want: false, }, + { + name: "opcache_disable returns false", + args: args{ + site: config.Site{ + PHP: config.PHP{ + OpcacheEnable: false, + }, + }, + envs: []string{ + "PHP_OPCACHE_ENABLE=1", + }, + }, + want: false, + }, { name: "opcache_enable returns false", args: args{ diff --git a/command/nitro/nitro.go b/command/nitro/nitro.go index 2833a34e..074080b8 100644 --- a/command/nitro/nitro.go +++ b/command/nitro/nitro.go @@ -79,11 +79,6 @@ func NewCommand() *cobra.Command { log.Fatal(err) } - // if _, err := docker.Ping(contextpkg.Background()); err != nil { - // fmt.Println("Unable to talk to Docker, it appears it is not running…") - // os.Exit(2) - // } - // get the port for the nitrod API apiPort := "5000" if os.Getenv("NITRO_API_PORT") != "" { From 0a7e10c6407b9e69e3d8f3f81edf0735826d7843 Mon Sep 17 00:00:00 2001 From: Brad Bell Date: Wed, 17 Mar 2021 11:21:29 -0700 Subject: [PATCH 14/15] changelog cleanup --- CHANGELOG.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf012c9c..e3cdd37d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,19 +3,19 @@ ## Unreleased ### Fixed -- Fixed an error where `initset` was not updating opcache settings [#298](https://github.com/craftcms/nitro/issues/298). -- Fixed an error preventing Linux users from using Xdebug [#288](https://github.com/docker/for-linux/issues/288). -- Fixed a display error for Windows users when using the `trust` command [#291](https://github.com/craftcms/nitro/issues/291). -- Fixed a bug where command completion was not working in a zsh shell. [#295](https://github.com/craftcms/nitro/issues/295). +- Fixed an error where `initset` was not updating opcache settings. [#298](https://github.com/craftcms/nitro/issues/298) +- Fixed an error preventing Linux users from using Xdebug. [#288](https://github.com/docker/for-linux/issues/288) +- Fixed a display error for Windows users when using the `trust` command. [#291](https://github.com/craftcms/nitro/issues/291) +- Fixed a bug where command completion was not working in a zsh shell. [#295](https://github.com/craftcms/nitro/issues/295) ## 2.0.5 - 2021-03-09 ### Added -- Added the `php` command to execute PHP commands in a site container [#276](https://github.com/craftcms/nitro/issues/276). +- Added the `php` command to execute PHP commands in a site container. [#276](https://github.com/craftcms/nitro/issues/276) ### Fixed -- Fixed an error where mysql permissions were not being set properly [#275](https://github.com/craftcms/nitro/issues/275). -- Fixed an error that could occur when paths included spaces [#277](https://github.com/craftcms/nitro/issues/277). +- Fixed an error where mysql permissions were not being set properly. [#275](https://github.com/craftcms/nitro/issues/275) +- Fixed an error that could occur when paths included spaces. [#277](https://github.com/craftcms/nitro/issues/277) - Fixed certificate installations for POP!_OS Linux. ## 2.0.4 - 2021-03-04 @@ -24,13 +24,13 @@ - Nitro will now verify and start containers if not running. ### Fixed -- Fixed an error that could occur when running `version` before `init` [#270](https://github.com/craftcms/nitro/issues/270). -- Fixed an error that could occur when Nitro is unable to detect the database engine from a backup [#269](https://github.com/craftcms/nitro/issues/269). +- Fixed an error that could occur when running `version` before `init`. [#270](https://github.com/craftcms/nitro/issues/270) +- Fixed an error that could occur when Nitro is unable to detect the database engine from a backup. [#269](https://github.com/craftcms/nitro/issues/269) ## 2.0.3 - 2021-03-03 ### Fixed -- Fixed a bug where the `iniset` command was not updating PHP settings for sites [#268](https://github.com/craftcms/nitro/issues/268). +- Fixed a bug where the `iniset` command was not updating PHP settings for sites. [#268](https://github.com/craftcms/nitro/issues/268) ## 2.0.2 - 2021-03-02 From ac9a50bbffcf409a25c598543ce721e840daaa5d Mon Sep 17 00:00:00 2001 From: Jason McCallister Date: Wed, 17 Mar 2021 14:26:30 -0400 Subject: [PATCH 15/15] 2.0.6 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e3cdd37d..dcec307f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Release Notes for Craft Nitro -## Unreleased +## 2.0.6 - 2021-03-17 ### Fixed - Fixed an error where `initset` was not updating opcache settings. [#298](https://github.com/craftcms/nitro/issues/298)