diff --git a/cmf-cli/resources/template_feed/init/.devcontainer/devcontainer.json b/cmf-cli/resources/template_feed/init/.devcontainer/devcontainer.json index 05a050648..468d895c3 100644 --- a/cmf-cli/resources/template_feed/init/.devcontainer/devcontainer.json +++ b/cmf-cli/resources/template_feed/init/.devcontainer/devcontainer.json @@ -65,6 +65,7 @@ }, "forwardPorts": [ 80, + 443, 1433 ], "initializeCommand": "docker pull criticalmanufacturing.io/criticalmanufacturing/devcontainer:<%= $CLI_PARAM_MESVersion-Major %><%= $CLI_PARAM_DevContainerTagSuffix %>" diff --git a/docs/src/03-explore/commands/init.md b/docs/src/03-explore/commands/init.md index 51864010d..334b373fb 100644 --- a/docs/src/03-explore/commands/init.md +++ b/docs/src/03-explore/commands/init.md @@ -12,6 +12,7 @@ cmf init test --tenant test --baseVersion 12.0.0-beta.2 --ciRepo https://dev.cri * `--config` and `--infrastructure` (alias `--infra`) are optional. The package version defaults to `1.0.0`; normal initialization does not need `--version`. * `--nugetVersion` and `--testScenariosNugetVersion` default to the MES version. `--ngxSchematicsVersion` defaults to `release-` for stable releases (for example, `release-1101` for MES `11.0.1`). For prereleases, `init` resolves the matching npm dist-tag (for example, `beta-1200`) against the configured registry and saves the exact version it references. An explicit override skips the lookup. * The devcontainer image tag uses the MES major version (for example, `12`). When the running CLI is a prerelease, the tag adds `-next` (for example, `12-next`), including in the startup image pull command. The CLI install feature also uses `next` for a prerelease CLI; a stable CLI uses its major range (for example, `6.x.x`). +* Generated devcontainers forward HTTP (`80`), HTTPS (`443`), and SQL Server (`1433`). HTTPS forwarding lets browser-based Security Portal/OpenID login reach the local stack when Docker runs inside the devcontainer. Existing projects must add `443` to `.devcontainer/devcontainer.json`'s `forwardPorts` and reopen the devcontainer, or forward remote port `443` to local port `443` in the editor's Ports view. * Each registry resolves independently: command-line option, infrastructure file, then default. `--npmRegistry` defaults to `https://criticalmanufacturing.io/repository/npm/`; `--nugetRegistry` defaults to `https://criticalmanufacturing.io/repository/nuget/index.json`. Existing credential options remain supported. * A config file remains useful for full environment setup. MES v10/v11 HTML scaffolding uses its domain and environment settings; test scaffolding uses its hostname and ports. Supplied files are copied unchanged into `EnvironmentConfigs`, including for MES v12. * New configs omit unused database server/replica backup paths, AlwaysOn, ReportServer, Installation, Temporary, and Gateway fields; model API properties remain for legacy compatibility. diff --git a/tests/Specs/Init.cs b/tests/Specs/Init.cs index 1a004e8b1..5f7264c75 100644 --- a/tests/Specs/Init.cs +++ b/tests/Specs/Init.cs @@ -115,7 +115,7 @@ public void Init_(string baseVersionStr, string dotnetSDKVersion) .Should().Contain(@$"""image"": ""criticalmanufacturing.io/criticalmanufacturing/devcontainer:{baseVersion.Major}""", "Devcontainer image is not correct"); devContainerFile .Should().Contain(@$"""version"": ""5.x.x""", "Devcontainer image is not correct"); - JObject.Parse(devContainerFile)["forwardPorts"].Values().Should().Equal(80, 1433); + JObject.Parse(devContainerFile)["forwardPorts"].Values().Should().Equal(80, 443, 1433); } else { @@ -625,7 +625,7 @@ public void Init_WithoutJsonFiles_ScaffoldsSupportedVersions(string mesVersion, File.ReadAllText("NuGet.Config").Should().Contain(project["NuGetRegistry"].Value()); File.ReadAllText(".devcontainer/devcontainer.json").Should().Contain($"devcontainer:{NuGetVersion.Parse(mesVersion).Major}"); JObject.Parse(File.ReadAllText(".devcontainer/devcontainer.json"))["forwardPorts"] - .Values().Should().Equal(80, 1433); + .Values().Should().Equal(80, 443, 1433); var repositories = JsonConvert.DeserializeObject(File.ReadAllText("repositories.json")); repositories.CIRepository.AbsoluteUri.Should().Be("https://dev.criticalmanufacturing.io/"); repositories.Repositories.Should().ContainSingle().Which.AbsoluteUri.Should().Be("https://dev.criticalmanufacturing.io/"); @@ -845,7 +845,7 @@ public void Init_App() Assert.True(File.Exists(Path.Combine(tmp, "assets", "default_app_icon.png")), "App Icon is missing"); JObject.Parse(File.ReadAllText(".devcontainer/devcontainer.json"))["forwardPorts"] - .Values().Should().Equal(80, 1433); + .Values().Should().Equal(80, 443, 1433); File.ReadAllText(Path.Join(tmp, ".project-config.json")) .Should().Contain(@"""RepositoryType"": ""App""", "Applied repository type was not App");