progmaweb
The site and account service of Progmasoft: a Next.js frontend and an ASP.NET Core API.
Clonegit clone https://git.progmasoft.com/progmaweb
Remove ViGet; keep the accounts
- Commit
f66bfe76157ee16769c48f123f40ec2a55754810- Author
- Leitwolf11 ·
- Parents
2b582ca624e4
Changes
.github/ISSUE_TEMPLATE/bug_report.md | 6 +- .github/ISSUE_TEMPLATE/diagnostic.yml | 1 - .github/ISSUE_TEMPLATE/feature_request.md | 4 +- .github/pull_request_template.md | 2 +- README.md | 12 +- apps/api-tests/OAuthFlowTests.cs | 43 +-- apps/api-tests/OAuthPolicyTests.cs | 3 +- apps/api-tests/OAuthTestClient.cs | 2 +- apps/api-tests/ViGetTests.cs | 274 -------------- apps/api/Accounts/AccountNamePolicy.cs | 1 - apps/api/OAuth/OAuthScopes.cs | 15 - apps/api/Program.cs | 19 +- apps/api/ViGet/JavaProperties.cs | 155 -------- apps/api/ViGet/PostgresTazelPluginCatalog.cs | 328 ----------------- apps/api/ViGet/TazelPluginCatalog.cs | 179 --------- apps/api/ViGet/TazelPluginDescriptor.cs | 138 ------- apps/api/ViGet/TazelPluginPublishing.cs | 151 -------- apps/api/ViGet/ViGetCommand.cs | 85 ----- apps/api/ViGet/ViGetEndpoints.cs | 113 ------ apps/api/ViGet/ViGetRegistration.cs | 58 --- apps/api/appsettings.json | 2 +- apps/web/app/layout.tsx | 1 - apps/web/app/page.tsx | 2 - apps/web/app/robots.ts | 1 - apps/web/app/sitemap.ts | 19 - apps/web/app/viget.css | 407 --------------------- apps/web/app/viget/dslplugins/gradle/page.tsx | 92 ----- .../dslplugins/tazel/[publisher]/[name]/page.tsx | 197 ---------- apps/web/app/viget/dslplugins/tazel/page.tsx | 129 ------- apps/web/app/viget/langs/[language]/page.tsx | 99 ----- apps/web/app/viget/page.tsx | 122 ------ apps/web/components/DashboardClient.tsx | 21 -- apps/web/components/ViGetCatalogSection.tsx | 69 ---- apps/web/components/ViGetFooter.tsx | 39 -- apps/web/components/ViGetHeader.tsx | 42 --- apps/web/e2e/languages.spec.ts | 2 +- apps/web/e2e/layout.spec.ts | 2 +- apps/web/e2e/not-found.spec.ts | 3 +- apps/web/e2e/pages.ts | 3 - apps/web/e2e/preferences.spec.ts | 13 +- apps/web/lib/credentials-messages.ts | 28 +- apps/web/lib/credentials.ts | 3 - apps/web/lib/llms.ts | 5 +- apps/web/lib/localization.ts | 401 +------------------- apps/web/lib/theme.ts | 3 +- apps/web/lib/viget-catalogs.ts | 253 ------------- apps/web/lib/viget-plugins.ts | 254 ------------- apps/web/next.config.ts | 4 +- apps/web/playwright.config.ts | 2 +- apps/web/proxy.ts | 87 ----- apps/web/tests/localization.test.mjs | 16 +- apps/web/tests/theme.test.mjs | 2 +- apps/web/tests/viget-catalogs.test.mjs | 105 ------ apps/web/tests/viget-plugins.test.mjs | 53 --- docs/ARCHITECTURE.md | 29 +- docs/DEVELOPMENT.md | 1 - docs/LIMITATIONS.md | 7 - docs/LOCALIZATION.md | 2 +- docs/OAUTH.md | 6 - docs/api/filterConfig.yml | 3 - .../namespaces/Progmasoft.Progmaweb.Api.ViGet.md | 11 - ops/README.md | 77 +--- ops/nginx/progmaweb.conf | 71 +--- 63 files changed, 77 insertions(+), 4200 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 3722447..4ddc79a 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,18 +1,18 @@ --- name: Progmaweb bug -about: Report a problem with Progmasoft, accounts, or ViGet +about: Report a problem with Progmasoft or accounts title: "[Bug] " --- <!-- SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> --> <!-- SPDX-License-Identifier: AGPL-3.0-or-later --> -This repository owns `progmasoft.com`, `account.progmasoft.com`, and `viget.progmasoft.com`. Never post passwords, verification codes, OAuth secrets, session cookies, email headers containing private data, or access tokens. Send security vulnerabilities privately to support@progmasoft.com. +This repository owns `progmasoft.com`, and `account.progmasoft.com`. Never post passwords, verification codes, OAuth secrets, session cookies, email headers containing private data, or access tokens. Send security vulnerabilities privately to support@progmasoft.com. ### Affected host and flow - Host and sanitized path: -- Area (corporate page, account registration/login/recovery, dashboard, ViGet package catalog, DSL plugin catalog, API, localization, or theme): +- Area (corporate page, account registration/login/recovery, dashboard, API, localization, or theme): - Account state needed to reproduce (signed out, newly registered, signed in), without identifying a real account: ### Observed and expected behavior diff --git a/.github/ISSUE_TEMPLATE/diagnostic.yml b/.github/ISSUE_TEMPLATE/diagnostic.yml index b60b22d..a947ebe 100644 --- a/.github/ISSUE_TEMPLATE/diagnostic.yml +++ b/.github/ISSUE_TEMPLATE/diagnostic.yml @@ -15,7 +15,6 @@ body: - Next.js frontend - ASP.NET Core backend - Authentication or account flows - - ViGet integration - Deployment or infrastructure - Other validations: diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index f60b4dc..d6c84f8 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,6 +1,6 @@ --- name: Progmaweb improvement -about: Propose an account, ViGet, or corporate-web improvement +about: Propose an account or corporate-web improvement title: "[Proposal] " --- @@ -11,7 +11,7 @@ This repository owns the Next.js public surfaces and ASP.NET Core account API. ### User need and host -Who needs the change, on which host and route, and what cannot they do today? For publisher-related changes, remember that the ViGet publisher is the canonical Progmasoft account name, not a second profile field. +Who needs the change, on which host and route, and what cannot they do today? ### Proposed behavior diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 5b6a392..d12bc09 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later ## User-facing change -Describe the Progmasoft, account, or ViGet behavior changed. State whether a deployed route or persistent account data +Describe the Progmasoft or account behavior changed. State whether a deployed route or persistent account data is affected. ## Verification diff --git a/README.md b/README.md index 6a4caec..bbb34bc 100644 --- a/README.md +++ b/README.md @@ -14,18 +14,10 @@ the ASP.NET Core API. - `account.progmasoft.com/login` signs an existing account in. - `account.progmasoft.com/register` creates a new account after server-side validation. - `account.progmasoft.com/<Account>/dashboard` serves the authenticated account dashboard. -- `viget.progmasoft.com` shows the state of the registry first, then two groups: LANGUAGES and BUILD SYSTEM DSL PLUGINS. - An open catalog links to its page; a catalog that is not offered yet is a gray, disabled button. -- `viget.progmasoft.com/langs/c`, `/langs/cpp` and `/langs/objc` serve the catalogs of C, C++ and Objective-C packages - (`.vipkg`; Objective-C++ belongs to `/langs/objc`); `/langs` leads to the language list on the home page. -- `viget.progmasoft.com/dslplugins/tazel` serves the catalog of Kotlin DSL plugins for Tazel; `/dslplugins` leads there. Account names preserve their original display case but reserve names case-insensitively, preventing visually confusing duplicates. Email uniqueness is also evaluated case-insensitively by the API. -ViGet does not maintain a separate publisher name. A package coordinate's `<Publisher>` segment is exactly the -canonical Progmasoft `<Account>` name, with the same spelling and case. - ## Languages Every page is published in English, German, Russian and French. A visitor who has not chosen a language gets the @@ -44,7 +36,7 @@ menu is remembered across the three hosts. See [Localization](docs/LOCALIZATION. ## Architecture -- `apps/web` is a Next.js App Router application. Host-aware routing keeps the public organization, account, and ViGet +- `apps/web` is a Next.js App Router application. Host-aware routing keeps the public organization, account, product and license surfaces in one build without coupling their page hierarchies. - `apps/api` is an ASP.NET Core minimal API. It owns account-name policy, password hashing, session issuance, secure cookies, rate limiting, and authorization. @@ -102,7 +94,7 @@ dotnet docfx docs/api/docfx.json --warningsAsErrors dotnet run docs/api/CheckDocumentation.cs -- docs/api ``` -Frontend tests exercise the published locale contract and account/ViGet metadata without starting a production service. +Frontend tests exercise the published locale contract and account metadata without starting a production service. `pnpm test:layout` runs the built site with `next start` and opens one page of each kind on every host in Chromium at 360, 390, 768 and 1280 pixels; every host name resolves to the local server, so no request leaves the machine. It fails when anything reaches past the edge of the screen, a header takes more than one line or covers its own brand, diff --git a/apps/api-tests/OAuthFlowTests.cs b/apps/api-tests/OAuthFlowTests.cs index ae5e910..1138eb6 100644 --- a/apps/api-tests/OAuthFlowTests.cs +++ b/apps/api-tests/OAuthFlowTests.cs @@ -21,7 +21,7 @@ public sealed class OAuthFlowTests (string clientId, string? secret) = await browser.RegisterApplicationAsync(); (string verifier, string challenge) = OAuthTestClient.Pkce(); - Uri redirect = await browser.AuthorizeAsync(clientId, "openid profile email offline_access viget.packages.read", + Uri redirect = await browser.AuthorizeAsync(clientId, "openid profile email offline_access", challenge); Assert.StartsWith(OAuthTestClient.RedirectUri, redirect.ToString(), StringComparison.Ordinal); Assert.Equal("state-123", OAuthTestClient.Query(redirect, "state")); @@ -198,17 +198,17 @@ public sealed class OAuthFlowTests OAuthTestClient browser = new(factory); await browser.RegisterAndSignInAsync("OAuthHolder6", "holder6@example.com"); (string clientId, _) = await browser.RegisterApplicationAsync( - "profile email viget.packages.read viget.packages.publish viget.packages.yank"); + "profile email offline_access"); HttpResponseMessage authorize = await browser.Browser.GetAsync(OAuthTestClient.AuthorizePath(clientId, - "openid profile email viget.packages.read viget.packages.publish viget.packages.yank", + "openid profile email offline_access", OAuthTestClient.Pkce().Challenge), Cancel); Uri consentPage = authorize.Headers.Location!; Assert.True(OAuthTestClient.IsConsentPage(consentPage), consentPage.OriginalString); JsonElement consent = await browser.Browser.GetFromJsonAsync<JsonElement>( "/api/v1/oauth/consent" + consentPage.OriginalString["/consent".Length..], Cancel); - Assert.Equal(["profile", "email", "viget.packages.read", "viget.packages.publish", "viget.packages.yank"], + Assert.Equal(["profile", "email", "offline_access"], consent.GetProperty("scopes").EnumerateArray().Select(scope => scope.GetString())); Assert.Equal("Example Client", consent.GetProperty("displayName").GetString()); Assert.Equal("OAuthHolder6", consent.GetProperty("owner").GetString()); @@ -256,41 +256,6 @@ public sealed class OAuthFlowTests Assert.Equal(HttpStatusCode.Forbidden, blind.StatusCode); } - [Fact] - public async Task ViGetScopesGiveAccessTokensForViGet() - { - await using AccountApiFactory factory = new(); - OAuthTestClient browser = new(factory); - await browser.RegisterAndSignInAsync("OAuthHolder7", "holder7@example.com"); - (string clientId, string? secret) = await browser.RegisterApplicationAsync("viget.packages.publish"); - (string verifier, string challenge) = OAuthTestClient.Pkce(); - Uri redirect = await browser.AuthorizeAsync(clientId, "openid viget.packages.publish", challenge); - (HttpStatusCode status, JsonElement tokens) = await browser.TokenAsync(new Dictionary<string, string> - { - ["grant_type"] = "authorization_code", - ["code"] = OAuthTestClient.Query(redirect, "code")!, - ["redirect_uri"] = OAuthTestClient.RedirectUri, - ["code_verifier"] = verifier, - ["client_id"] = clientId, - ["client_secret"] = secret! - }); - Assert.Equal(HttpStatusCode.OK, status); - Assert.Equal("openid viget.packages.publish", tokens.GetProperty("scope").GetString()); - - // The access token is encrypted for the resource servers; introspection shows its audience. - using HttpClient client = factory.CreateOAuthClient(); - HttpResponseMessage response = await client.PostAsync("/connect/introspect", new FormUrlEncodedContent( - new Dictionary<string, string> - { - ["token"] = tokens.GetProperty("access_token").GetString()!, - ["client_id"] = clientId, - ["client_secret"] = secret! - }), Cancel); - JsonElement introspection = await response.Content.ReadFromJsonAsync<JsonElement>(Cancel); - Assert.True(introspection.GetProperty("active").GetBoolean(), introspection.ToString()); - Assert.Contains("viget", introspection.GetProperty("aud").ToString(), StringComparison.Ordinal); - } - [Fact] public async Task APublicClientUsesPkceWithoutASecret() { diff --git a/apps/api-tests/OAuthPolicyTests.cs b/apps/api-tests/OAuthPolicyTests.cs index 72961c6..ce81f7a 100644 --- a/apps/api-tests/OAuthPolicyTests.cs +++ b/apps/api-tests/OAuthPolicyTests.cs @@ -104,8 +104,7 @@ public sealed class OAuthPolicyTests string scopes = document.GetProperty("scopes_supported").ToString(); foreach (string scope in new[] { - "openid", "profile", "email", "offline_access", "viget.packages.read", "viget.packages.publish", - "viget.packages.yank" + "openid", "profile", "email", "offline_access" }) { Assert.Contains($"\"{scope}\"", scopes, StringComparison.Ordinal); diff --git a/apps/api-tests/OAuthTestClient.cs b/apps/api-tests/OAuthTestClient.cs index 371e136..614358f 100644 --- a/apps/api-tests/OAuthTestClient.cs +++ b/apps/api-tests/OAuthTestClient.cs @@ -53,7 +53,7 @@ internal sealed class OAuthTestClient(AccountApiFactory factory) /// <summary>Makes a token in the developer portal and returns its identifier and secret.</summary> public async Task<(string ClientId, string? Secret)> RegisterApplicationAsync( - string scopes = "profile email offline_access viget.packages.read", + string scopes = "profile email offline_access", string kind = "web", string redirectUris = RedirectUri) { diff --git a/apps/api-tests/ViGetTests.cs b/apps/api-tests/ViGetTests.cs deleted file mode 100644 index 4ae00b2..0000000 --- a/apps/api-tests/ViGetTests.cs +++ /dev/null @@ -1,274 +0,0 @@ -// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> -// SPDX-License-Identifier: AGPL-3.0-or-later - -using System.IO.Compression; -using System.Net; -using System.Security.Cryptography; -using System.Text.Json; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Options; -using Progmasoft.Progmaweb.Api.Accounts; -using Progmasoft.Progmaweb.Api.ViGet; - -namespace Progmasoft.Progmaweb.Api.Tests; - -/// <summary>The Tazel plugin catalog of ViGet: the descriptor, publishing, the endpoints and the command.</summary> -public sealed class ViGetTests : IDisposable -{ - private readonly string artifactRoot = Path.Combine(Path.GetTempPath(), "viget-" + Guid.NewGuid().ToString("N")); - - /// <inheritdoc/> - public void Dispose() - { - if (Directory.Exists(artifactRoot)) - { - Directory.Delete(artifactRoot, recursive: true); - } - } - - [Fact] - public void PropertiesAreReadAsJavaReadsThem() - { - IReadOnlyDictionary<string, string> properties = JavaProperties.Parse( - "# a comment\n" + - "! another\n" + - "publisher=Progmasoft\n" + - "homepage = https\\://example.com/a\n" + - "description:Builds C \\u0026 C++,\\\n" + - " on every host.\n" + - "key\\ with\\ spaces value\n" + - "empty=\n"); - Assert.Equal("Progmasoft", properties["publisher"]); - Assert.Equal("https://example.com/a", properties["homepage"]); - Assert.Equal("Builds C & C++,on every host.", properties["description"]); - Assert.Equal("value", properties["key with spaces"]); - Assert.Equal(string.Empty, properties["empty"]); - Assert.Throws<FormatException>(() => JavaProperties.Parse("broken=\\u12")); - } - - [Fact] - public void TheDescriptorOfAPluginJarIsReadAndChecked() - { - Assert.Null(TazelPluginDescriptor.TryRead(Jar(), out TazelPluginDescriptor? descriptor)); - Assert.Equal( - new TazelPluginDescriptor( - "Progmasoft", "CMake", "0.1.0", 2, "Builds CMake projects.", ["First Author", "Second Author"], - "MPL-2.0", "https://example.com/cmake", null), - descriptor!, - new DescriptorComparer()); - - Assert.Equal("The JAR has no META-INF/services/com.progmasoft.api.tazel.dsl.plugin.ProjectPlugin.", - TazelPluginDescriptor.TryRead(Jar(service: false), out _)); - Assert.Equal("The descriptor needs an exact version of three to five numbers.", - TazelPluginDescriptor.TryRead(Jar(version: "1.0"), out _)); - Assert.Equal("The descriptor needs an exact version of three to five numbers.", - TazelPluginDescriptor.TryRead(Jar(version: "1.2.3.4.5.6"), out _)); - Assert.True(TazelPluginDescriptor.IsVersion("0.1.1.1")); - Assert.True(TazelPluginDescriptor.IsVersion("0.1.1.1.1")); - Assert.True(TazelPluginDescriptor.IsVersion("0.1.1.1.1-build.2")); - Assert.Equal("The descriptor needs a name that is one identifier.", - TazelPluginDescriptor.TryRead(Jar(name: "c-make"), out _)); - Assert.Equal("The homepage of the descriptor is not an https address.", - TazelPluginDescriptor.TryRead(Jar(homepage: "http\\://example.com"), out _)); - Assert.Equal("The file is not a JAR.", TazelPluginDescriptor.TryRead("not a zip"u8.ToArray(), out _)); - } - - [Fact] - public async Task OnlyAnAllowedPublisherWithAnAccountPublishes() - { - (TazelPluginPublishing publishing, InMemoryAccountStore accounts, ITazelPluginCatalog catalog) = Publishing(); - CancellationToken cancellationToken = TestContext.Current.CancellationToken; - - PublishResult noAccount = await publishing.PublishAsync(Jar(), cancellationToken); - Assert.Equal("No Progmasoft Account is named 'Progmasoft'.", noAccount.Error); - - await AddAccountAsync(accounts, "Progmasoft"); - await AddAccountAsync(accounts, "Someone"); - PublishResult notAllowed = await publishing.PublishAsync(Jar(publisher: "Someone"), cancellationToken); - Assert.Equal( - "Publishing Tazel plugins is open to Progmasoft for now; 'Someone' cannot publish yet.", - notAllowed.Error); - - byte[] jar = Jar(); - PublishResult published = await publishing.PublishAsync(jar, cancellationToken); - Assert.True(published.Published, published.Error); - string file = Path.Combine(artifactRoot, "dslplugins", "tazel", "Progmasoft", "CMake", "0.1.0", "CMake-0.1.0.jar"); - Assert.Equal(jar, await File.ReadAllBytesAsync(file, cancellationToken)); - TazelPlugin plugin = (await catalog.FindAsync("Progmasoft", "CMake", cancellationToken))!; - Assert.Equal(Convert.ToHexStringLower(SHA256.HashData(jar)), plugin.Versions.Single().Sha256); - Assert.Equal("MPL-2.0", plugin.License); - - PublishResult again = await publishing.PublishAsync(Jar(description: "Another build."), cancellationToken); - Assert.Equal("Progmasoft.CMake 0.1.0 is published already.", again.Error); - Assert.Equal(jar, await File.ReadAllBytesAsync(file, cancellationToken)); - - PublishResult folded = await publishing.PublishAsync(Jar(name: "CMAKE", version: "0.2.0"), cancellationToken); - Assert.Equal( - "Progmasoft has a plugin whose name differs from 'CMAKE' only in letter case.", folded.Error); - Assert.False(File.Exists(Path.Combine( - artifactRoot, "dslplugins", "tazel", "Progmasoft", "CMAKE", "0.2.0", "CMAKE-0.2.0.jar"))); - } - - [Fact] - public async Task ViGetNeedsADescriptionAnAuthorAndALicense() - { - (TazelPluginPublishing publishing, InMemoryAccountStore accounts, _) = Publishing(); - await AddAccountAsync(accounts, "Progmasoft"); - PublishResult result = await publishing.PublishAsync(Jar(license: null), TestContext.Current.CancellationToken); - Assert.Equal( - "ViGet needs a description, at least one author and a license in the descriptor.", result.Error); - } - - [Fact] - public async Task TheIndexIsWhatTazelReads() - { - await using AccountApiFactory factory = new(); - ITazelPluginCatalog catalog = factory.Services.GetRequiredService<ITazelPluginCatalog>(); - CancellationToken cancellationToken = TestContext.Current.CancellationToken; - Assert.Null(TazelPluginDescriptor.TryRead(Jar(), out TazelPluginDescriptor? descriptor)); - await catalog.AddVersionAsync(descriptor!, new string('a', 64), 10, DateTimeOffset.UnixEpoch, cancellationToken); - await catalog.AddVersionAsync( - descriptor! with { Version = "0.2.0" }, new string('b', 64), 10, DateTimeOffset.UnixEpoch.AddDays(1), - cancellationToken); - await catalog.SetYankedAsync("Progmasoft", "CMake", "0.2.0", true, cancellationToken); - using HttpClient client = factory.CreateClient(); - - using JsonDocument index = JsonDocument.Parse(await client.GetStringAsync( - "/api/v1/viget/dslplugins/tazel/Progmasoft/CMake/index.json", cancellationToken)); - Assert.Equal("Progmasoft", index.RootElement.GetProperty("publisher").GetString()); - Assert.Equal("CMake", index.RootElement.GetProperty("name").GetString()); - JsonElement[] versions = [.. index.RootElement.GetProperty("versions").EnumerateArray()]; - Assert.Equal(["0.2.0", "0.1.0"], versions.Select(version => version.GetProperty("version").GetString())); - Assert.True(versions[0].GetProperty("yanked").GetBoolean()); - Assert.Equal(2, versions[1].GetProperty("apiVersion").GetInt32()); - Assert.Equal(new string('a', 64), versions[1].GetProperty("sha256").GetString()); - - using JsonDocument detail = JsonDocument.Parse(await client.GetStringAsync( - "/api/v1/viget/dslplugins/tazel/Progmasoft/CMake", cancellationToken)); - Assert.Equal("0.1.0", detail.RootElement.GetProperty("latestVersion").GetString()); - Assert.Equal( - "/dslplugins/tazel/Progmasoft/CMake/0.1.0/CMake-0.1.0.jar", - detail.RootElement.GetProperty("versions")[1].GetProperty("path").GetString()); - - using JsonDocument list = JsonDocument.Parse( - await client.GetStringAsync("/api/v1/viget/dslplugins/tazel", cancellationToken)); - Assert.Equal("CMake", list.RootElement.GetProperty("plugins")[0].GetProperty("name").GetString()); - - Assert.Equal(HttpStatusCode.NotFound, (await client.GetAsync( - "/api/v1/viget/dslplugins/tazel/Progmasoft/Missing/index.json", cancellationToken)).StatusCode); - Assert.Equal(HttpStatusCode.NotFound, (await client.GetAsync( - "/api/v1/viget/dslplugins/tazel/Progmasoft/not-a-name/index.json", cancellationToken)).StatusCode); - } - - [Fact] - public async Task TheCommandPublishesAndYanks() - { - (TazelPluginPublishing publishing, InMemoryAccountStore accounts, ITazelPluginCatalog catalog) = Publishing(); - await AddAccountAsync(accounts, "Progmasoft"); - ServiceProvider services = new ServiceCollection() - .AddSingleton(publishing) - .AddSingleton(catalog) - .BuildServiceProvider(); - string jar = Path.Combine(artifactRoot, "upload.jar"); - Directory.CreateDirectory(artifactRoot); - await File.WriteAllBytesAsync(jar, Jar(), TestContext.Current.CancellationToken); - StringWriter output = new(); - StringWriter errors = new(); - - Assert.Equal(0, await ViGetCommand.RunAsync( - services, ["publish-tazel-plugin", jar], output, errors, TestContext.Current.CancellationToken)); - Assert.Contains("Published Progmasoft.CMake 0.1.0", output.ToString(), StringComparison.Ordinal); - Assert.Equal(0, await ViGetCommand.RunAsync( - services, ["yank-tazel-plugin", "Progmasoft", "CMake", "0.1.0"], output, errors, - TestContext.Current.CancellationToken)); - Assert.True((await catalog.FindAsync("Progmasoft", "CMake", TestContext.Current.CancellationToken))! - .Versions.Single().Yanked); - Assert.Equal(1, await ViGetCommand.RunAsync( - services, ["publish-tazel-plugin", jar], output, errors, TestContext.Current.CancellationToken)); - Assert.Equal(2, await ViGetCommand.RunAsync( - services, ["publish"], output, errors, TestContext.Current.CancellationToken)); - } - - private (TazelPluginPublishing, InMemoryAccountStore, ITazelPluginCatalog) Publishing() - { - InMemoryAccountStore accounts = new(); - InMemoryTazelPluginCatalog catalog = new(); - TazelPluginPublishing publishing = new( - catalog, - accounts, - Options.Create(new ViGetOptions { ArtifactRoot = artifactRoot }), - TimeProvider.System); - return (publishing, accounts, catalog); - } - - private static async Task AddAccountAsync(InMemoryAccountStore accounts, string name) => - await accounts.CreateAsync( - new AccountRecord( - Guid.NewGuid(), - name, - AccountNamePolicy.NormalizeForLookup(name), - $"{name}@example.com", - $"{name}@example.com".ToUpperInvariant(), - null, - null, - DateTimeOffset.UnixEpoch), - TestContext.Current.CancellationToken); - - private static byte[] Jar( - string publisher = "Progmasoft", - string name = "CMake", - string version = "0.1.0", - string? description = "Builds CMake projects.", - string? license = "MPL-2.0", - string homepage = "https\\://example.com/cmake", - bool service = true) - { - using MemoryStream bytes = new(); - using (ZipArchive archive = new(bytes, ZipArchiveMode.Create, leaveOpen: true)) - { - List<string> lines = - [ - "publisher=" + publisher, - "name=" + name, - "version=" + version, - "apiVersion=2", - "author.0=First Author", - "author.1=Second Author", - "homepage=" + homepage - ]; - if (description is not null) - { - lines.Add("description=" + description); - } - - if (license is not null) - { - lines.Add("license=" + license); - } - - using (StreamWriter writer = new(archive.CreateEntry(TazelPluginDescriptor.DescriptorEntry).Open())) - { - writer.Write(string.Join('\n', lines) + "\n"); - } - - if (service) - { - using StreamWriter writer = new(archive.CreateEntry(TazelPluginDescriptor.ServiceEntry).Open()); - writer.Write("com.example.CMakePlugin\n"); - } - } - - return bytes.ToArray(); - } - - /// <summary>Compares descriptors by value, with their authors as sequences.</summary> - private sealed class DescriptorComparer : IEqualityComparer<TazelPluginDescriptor> - { - public bool Equals(TazelPluginDescriptor? left, TazelPluginDescriptor? right) => - left is not null && right is not null && - left with { Authors = [] } == right with { Authors = [] } && - left.Authors.SequenceEqual(right.Authors); - - public int GetHashCode(TazelPluginDescriptor descriptor) => descriptor.Name.GetHashCode(StringComparison.Ordinal); - } -} diff --git a/apps/api/Accounts/AccountNamePolicy.cs b/apps/api/Accounts/AccountNamePolicy.cs index 013ba0a..9c4ebe9 100644 --- a/apps/api/Accounts/AccountNamePolicy.cs +++ b/apps/api/Accounts/AccountNamePolicy.cs @@ -10,7 +10,6 @@ namespace Progmasoft.Progmaweb.Api.Accounts; /// <remarks> /// A name is 8 to 128 ASCII letters or digits and begins with an upper-case letter. Names are unique without regard /// to case, so two names that differ only in case cannot both exist, while each keeps the spelling its owner chose. -/// The same name is the ViGet publisher name. /// </remarks> internal static partial class AccountNamePolicy { diff --git a/apps/api/OAuth/OAuthScopes.cs b/apps/api/OAuth/OAuthScopes.cs index 52b320e..602adb8 100644 --- a/apps/api/OAuth/OAuthScopes.cs +++ b/apps/api/OAuth/OAuthScopes.cs @@ -22,26 +22,11 @@ internal sealed record OAuthScope(string Name, string Consent, string? Resource) /// </remarks> internal static class OAuthScopes { - /// <summary>The audience of the ViGet scopes; ViGet accepts only access tokens issued for it.</summary> - public const string VigetResource = "viget"; - - /// <summary>Reading the packages the account has published.</summary> - public const string VigetPackagesRead = "viget.packages.read"; - - /// <summary>Publishing packages under the account.</summary> - public const string VigetPackagesPublish = "viget.packages.publish"; - - /// <summary>Yanking packages of the account.</summary> - public const string VigetPackagesYank = "viget.packages.yank"; - /// <summary>Every scope an application may request besides <c>openid</c>, in the order the consent page lists them.</summary> public static IReadOnlyList<OAuthScope> All { get; } = [ new(Scopes.Profile, "Read your Progmasoft account name.", null), new(Scopes.Email, "Read the email address you sign in and registered with.", null), - new(VigetPackagesRead, "Read the packages you have published on ViGet.", VigetResource), - new(VigetPackagesPublish, "Publish packages to ViGet under your account.", VigetResource), - new(VigetPackagesYank, "Yank packages you have published on ViGet.", VigetResource), new(Scopes.OfflineAccess, "Keep this access when you are not signed in, until you revoke it.", null), ]; diff --git a/apps/api/Program.cs b/apps/api/Program.cs index 647a964..4653d77 100644 --- a/apps/api/Program.cs +++ b/apps/api/Program.cs @@ -9,14 +9,11 @@ using Microsoft.AspNetCore.HttpOverrides; using Progmasoft.Progmaweb.Api.Accounts; using Progmasoft.OAuth; using Progmasoft.Progmaweb.Api.Security; -using Progmasoft.Progmaweb.Api.ViGet; -// `viget ...` runs a command of ViGet with the configuration of the service instead of the service itself; its -// arguments are not configuration. -// `accounts ...` provisions a reserved account the same way. -bool vigetCommand = ViGetCommand.IsCommand(args); +// `accounts ...` provisions a reserved account with the configuration of the service instead of running the service +// itself; its arguments are not configuration. bool accountCommand = args is ["accounts", ..]; -WebApplicationBuilder builder = WebApplication.CreateBuilder(vigetCommand || accountCommand ? [] : args); +WebApplicationBuilder builder = WebApplication.CreateBuilder(accountCommand ? [] : args); builder.Services.Configure<AccountSessionOptions>(builder.Configuration.GetSection(AccountSessionOptions.SectionName)); builder.Services.AddSingleton(TimeProvider.System); @@ -27,8 +24,6 @@ builder.Services.AddSingleton<AccountService>(); builder.Services.AddSingleton<SessionService>(); // Progmasoft OAuth, the OAuth 2.1 and OpenID Connect provider on its own host; see OAuth/OAuthRegistration.cs. builder.Services.AddProgmasoftOAuth(builder.Configuration, accountStore, builder.Environment.IsProduction()); -// ViGet: the Tazel plugin catalog beside the accounts; see ViGet/ViGetEndpoints.cs. -builder.Services.AddViGet(builder.Configuration, accountStore); builder.Services.AddAuthorization(); AuthenticationBuilder authentication = builder.Services .AddAuthentication() @@ -118,13 +113,6 @@ if (accountCommand) return; } -if (vigetCommand) -{ - Environment.ExitCode = await ViGetCommand.RunAsync( - app.Services, args[1..], Console.Out, Console.Error, CancellationToken.None); - return; -} - if (accountStore is AccountStoreKind.Memory) { AccountStoreRegistration.WarnThatAccountsAreInMemory(app.Logger); @@ -156,7 +144,6 @@ app.MapGet("/api/v1/status", () => Results.Ok(new })); app.MapAccountEndpoints(); app.MapProgmasoftOAuth(); -app.MapViGetEndpoints(); app.Run(); diff --git a/apps/api/ViGet/JavaProperties.cs b/apps/api/ViGet/JavaProperties.cs deleted file mode 100644 index 89eff4b..0000000 --- a/apps/api/ViGet/JavaProperties.cs +++ /dev/null @@ -1,155 +0,0 @@ -// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> -// SPDX-License-Identifier: AGPL-3.0-or-later - -using System.Globalization; -using System.Text; - -namespace Progmasoft.Progmaweb.Api.ViGet; - -/// <summary>Reads the text of a Java <c>.properties</c> file, as <c>java.util.Properties.load</c> does.</summary> -/// <remarks> -/// A logical line may continue over several lines with a trailing backslash; <c>#</c> and <c>!</c> start a comment -/// line; a key ends at the first unescaped <c>=</c>, <c>:</c> or white space; and <c>\t</c>, <c>\n</c>, <c>\r</c>, -/// <c>\f</c> and <c>\uXXXX</c> are escapes, while a backslash before any other character stands for that character. -/// A later line with the same key replaces an earlier one. -/// </remarks> -internal static class JavaProperties -{ - /// <summary>Reads the properties of a text.</summary> - /// <param name="text">The text of the file, already decoded.</param> - /// <returns>The properties by key.</returns> - /// <exception cref="FormatException">A <c>\u</c> escape is not followed by four hexadecimal digits.</exception> - public static IReadOnlyDictionary<string, string> Parse(string text) - { - Dictionary<string, string> properties = new(StringComparer.Ordinal); - foreach (string line in LogicalLines(text)) - { - int index = 0; - while (index < line.Length && IsBlank(line[index])) - { - index++; - } - - if (index == line.Length || line[index] is '#' or '!') - { - continue; - } - - int keyStart = index; - while (index < line.Length && !IsKeyEnd(line[index])) - { - index += line[index] == '\\' ? 2 : 1; - } - - string key = Unescape(line[keyStart..Math.Min(index, line.Length)]); - while (index < line.Length && IsBlank(line[index])) - { - index++; - } - - if (index < line.Length && line[index] is '=' or ':') - { - index++; - while (index < line.Length && IsBlank(line[index])) - { - index++; - } - } - - properties[key] = Unescape(line[index..]); - } - - return properties; - } - - /// <summary>Joins the physical lines that a trailing backslash continues.</summary> - private static IEnumerable<string> LogicalLines(string text) - { - string[] lines = text.Replace("\r\n", "\n", StringComparison.Ordinal).Replace('\r', '\n').Split('\n'); - StringBuilder current = new(); - bool continuing = false; - foreach (string physical in lines) - { - // A continued line loses the white space it starts with. - string line = continuing ? physical.TrimStart(' ', '\t', '\f') : physical; - int backslashes = 0; - for (int position = line.Length - 1; position >= 0 && line[position] == '\\'; position--) - { - backslashes++; - } - - continuing = backslashes % 2 == 1; - current.Append(continuing ? line[..^1] : line); - if (!continuing) - { - yield return current.ToString(); - current.Clear(); - } - } - - if (current.Length > 0) - { - yield return current.ToString(); - } - } - - /// <summary>Whether a character is white space of the format: space, tab or form feed.</summary> - private static bool IsBlank(char character) => character is ' ' or '\t' or '\f'; - - /// <summary>Whether an unescaped character ends a key.</summary> - private static bool IsKeyEnd(char character) => character is '=' or ':' || IsBlank(character); - - /// <summary>Resolves the escapes of a key or a value.</summary> - /// <param name="text">The text as the file writes it.</param> - /// <returns>The text it stands for.</returns> - /// <exception cref="FormatException">A <c>\u</c> escape is not followed by four hexadecimal digits.</exception> - private static string Unescape(string text) - { - StringBuilder result = new(text.Length); - for (int index = 0; index < text.Length; index++) - { - char character = text[index]; - if (character != '\\' || index + 1 == text.Length) - { - result.Append(character); - continue; - } - - char escaped = text[++index]; - switch (escaped) - { - case 't': - result.Append('\t'); - break; - case 'n': - result.Append('\n'); - break; - case 'r': - result.Append('\r'); - break; - case 'f': - result.Append('\f'); - break; - case 'u': - if (text.Length - index - 1 < 4 || - !int.TryParse( - text.AsSpan(index + 1, 4), - NumberStyles.AllowHexSpecifier, - CultureInfo.InvariantCulture, - out int code)) - { - throw new FormatException("A \\u escape needs four hexadecimal digits."); - } - - result.Append((char)code); - index += 4; - break; - default: - result.Append(escaped); - break; - } - } - - return result.ToString(); - } -} diff --git a/apps/api/ViGet/PostgresTazelPluginCatalog.cs b/apps/api/ViGet/PostgresTazelPluginCatalog.cs deleted file mode 100644 index 1fc2df4..0000000 --- a/apps/api/ViGet/PostgresTazelPluginCatalog.cs +++ /dev/null @@ -1,328 +0,0 @@ -// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> -// SPDX-License-Identifier: AGPL-3.0-or-later - -using Npgsql; - -namespace Progmasoft.Progmaweb.Api.ViGet; - -/// <summary>The tables of <see cref="PostgresTazelPluginCatalog"/> and the steps that bring a database to them.</summary> -/// <remarks> -/// The same numbered steps as the account tables, in a version table of their own, <c>viget_schema_versions</c>. -/// A step is never edited after it has been released. -/// </remarks> -internal static class ViGetSchema -{ - /// <summary>Key of the advisory lock that lets one process at a time change these tables.</summary> - private const long MigrationLockKey = 0x5669476574; - - /// <summary>The steps, in order. The version of a step is its position, counted from one.</summary> - private static readonly string[] Steps = - [ - // 1: Tazel plugins and their versions. - // - // A plugin is named by its publisher and its name as they are spelled; the unique index on their upper - // case keeps two plugins from differing only in letter case. A version is never removed, only yanked. - """ - CREATE TABLE viget_tazel_plugins ( - publisher text NOT NULL, - name text NOT NULL, - description text, - authors text[] NOT NULL, - license text, - homepage text, - repository text, - updated_at timestamptz NOT NULL, - PRIMARY KEY (publisher, name) - ); - - CREATE UNIQUE INDEX viget_tazel_plugins_folded_key ON viget_tazel_plugins (upper(publisher), upper(name)); - - CREATE TABLE viget_tazel_plugin_versions ( - publisher text NOT NULL, - name text NOT NULL, - version text NOT NULL, - sha256 text NOT NULL, - api_version integer NOT NULL, - size bigint NOT NULL, - published_at timestamptz NOT NULL, - yanked boolean NOT NULL DEFAULT false, - PRIMARY KEY (publisher, name, version), - FOREIGN KEY (publisher, name) REFERENCES viget_tazel_plugins (publisher, name) - ); - """ - ]; - - /// <summary>The version a database has after every step.</summary> - public static int CurrentVersion => Steps.Length; - - /// <summary>Takes the steps a database has not taken yet, in one transaction.</summary> - /// <returns>The number of steps that were taken.</returns> - /// <exception cref="InvalidOperationException">The database has taken steps this program does not know.</exception> - public static async Task<int> ApplyAsync(NpgsqlDataSource dataSource, CancellationToken cancellationToken) - { - await using NpgsqlConnection connection = await dataSource.OpenConnectionAsync(cancellationToken); - await using NpgsqlTransaction transaction = await connection.BeginTransactionAsync(cancellationToken); - await ExecuteAsync(connection, transaction, $"SELECT pg_advisory_xact_lock({MigrationLockKey})", cancellationToken); - await ExecuteAsync( - connection, - transaction, - """ - CREATE TABLE IF NOT EXISTS viget_schema_versions ( - version integer PRIMARY KEY, - applied_at timestamptz NOT NULL DEFAULT now() - ) - """, - cancellationToken); - - int version; - await using (NpgsqlCommand read = new( - "SELECT coalesce(max(version), 0) FROM viget_schema_versions", connection, transaction)) - { - version = (int)(await read.ExecuteScalarAsync(cancellationToken))!; - } - - if (version > Steps.Length) - { - throw new InvalidOperationException( - $"The ViGet tables are at schema version {version}, and this program knows version {Steps.Length}."); - } - - int taken = 0; - for (int step = version; step < Steps.Length; step++) - { - await ExecuteAsync(connection, transaction, Steps[step], cancellationToken); - await using NpgsqlCommand record = new( - "INSERT INTO viget_schema_versions (version) VALUES ($1)", connection, transaction); - record.Parameters.AddWithValue(step + 1); - await record.ExecuteNonQueryAsync(cancellationToken); - taken++; - } - - await transaction.CommitAsync(cancellationToken); - return taken; - } - - /// <summary>Runs statements that return nothing.</summary> - /// <param name="connection">The connection to run them on.</param> - /// <param name="transaction">The transaction they belong to.</param> - /// <param name="sql">The statements.</param> - /// <param name="cancellationToken">Cancels the operation.</param> - /// <returns>A task that completes when the statements have run.</returns> - private static async Task ExecuteAsync( - NpgsqlConnection connection, - NpgsqlTransaction transaction, - string sql, - CancellationToken cancellationToken) - { - await using NpgsqlCommand command = new(sql, connection, transaction); - await command.ExecuteNonQueryAsync(cancellationToken); - } -} - -/// <summary>The Tazel plugins of ViGet in PostgreSQL, beside the accounts.</summary> -/// <param name="dataSource">Connections to the database of the accounts.</param> -internal sealed class PostgresTazelPluginCatalog(NpgsqlDataSource dataSource) : ITazelPluginCatalog -{ - /// <summary>The columns of a plugin row, in the order <see cref="ReadPlugin"/> reads them.</summary> - private const string PluginColumns = "publisher, name, description, authors, license, homepage, repository"; - - /// <inheritdoc/> - public async ValueTask<IReadOnlyList<TazelPlugin>> ListAsync(CancellationToken cancellationToken) - { - await using NpgsqlConnection connection = await dataSource.OpenConnectionAsync(cancellationToken); - List<TazelPlugin> plugins = []; - await using (NpgsqlCommand command = new( - $"SELECT {PluginColumns} FROM viget_tazel_plugins ORDER BY publisher, name", connection)) - await using (NpgsqlDataReader reader = await command.ExecuteReaderAsync(cancellationToken)) - { - while (await reader.ReadAsync(cancellationToken)) - { - plugins.Add(ReadPlugin(reader, [])); - } - } - - List<TazelPlugin> withVersions = []; - foreach (TazelPlugin plugin in plugins) - { - withVersions.Add(plugin with - { - Versions = await VersionsAsync(connection, null, plugin.Publisher, plugin.Name, cancellationToken) - }); - } - - return withVersions; - } - - /// <inheritdoc/> - public async ValueTask<TazelPlugin?> FindAsync(string publisher, string name, CancellationToken cancellationToken) - { - await using NpgsqlConnection connection = await dataSource.OpenConnectionAsync(cancellationToken); - TazelPlugin? plugin; - await using (NpgsqlCommand command = new( - $"SELECT {PluginColumns} FROM viget_tazel_plugins WHERE publisher = $1 AND name = $2", connection)) - { - command.Parameters.AddWithValue(publisher); - command.Parameters.AddWithValue(name); - await using NpgsqlDataReader reader = await command.ExecuteReaderAsync(cancellationToken); - plugin = await reader.ReadAsync(cancellationToken) ? ReadPlugin(reader, []) : null; - } - - return plugin is null - ? null - : plugin with { Versions = await VersionsAsync(connection, null, publisher, name, cancellationToken) }; - } - - /// <inheritdoc/> - public async ValueTask<AddVersionResult> AddVersionAsync( - TazelPluginDescriptor descriptor, - string sha256, - long size, - DateTimeOffset publishedAt, - CancellationToken cancellationToken) - { - await using NpgsqlConnection connection = await dataSource.OpenConnectionAsync(cancellationToken); - await using NpgsqlTransaction transaction = await connection.BeginTransactionAsync(cancellationToken); - await using (NpgsqlCommand taken = new( - """ - SELECT count(*) FROM viget_tazel_plugins - WHERE upper(publisher) = upper($1) AND upper(name) = upper($2) AND (publisher <> $1 OR name <> $2) - """, - connection, - transaction)) - { - taken.Parameters.AddWithValue(descriptor.Publisher); - taken.Parameters.AddWithValue(descriptor.Name); - if ((long)(await taken.ExecuteScalarAsync(cancellationToken))! > 0) - { - return AddVersionResult.NameTaken; - } - } - - await using (NpgsqlCommand plugin = new( - $""" - INSERT INTO viget_tazel_plugins ({PluginColumns}, updated_at) - VALUES ($1, $2, $3, $4, $5, $6, $7, $8) - ON CONFLICT (publisher, name) DO UPDATE SET - description = excluded.description, - authors = excluded.authors, - license = excluded.license, - homepage = excluded.homepage, - repository = excluded.repository, - updated_at = excluded.updated_at - """, - connection, - transaction)) - { - plugin.Parameters.AddWithValue(descriptor.Publisher); - plugin.Parameters.AddWithValue(descriptor.Name); - plugin.Parameters.AddWithValue((object?)descriptor.Description ?? DBNull.Value); - plugin.Parameters.AddWithValue(descriptor.Authors.ToArray()); - plugin.Parameters.AddWithValue((object?)descriptor.License ?? DBNull.Value); - plugin.Parameters.AddWithValue((object?)descriptor.Homepage ?? DBNull.Value); - plugin.Parameters.AddWithValue((object?)descriptor.Repository ?? DBNull.Value); - plugin.Parameters.AddWithValue(publishedAt); - await plugin.ExecuteNonQueryAsync(cancellationToken); - } - - await using (NpgsqlCommand version = new( - """ - INSERT INTO viget_tazel_plugin_versions (publisher, name, version, sha256, api_version, size, published_at) - VALUES ($1, $2, $3, $4, $5, $6, $7) - ON CONFLICT (publisher, name, version) DO NOTHING - """, - connection, - transaction)) - { - version.Parameters.AddWithValue(descriptor.Publisher); - version.Parameters.AddWithValue(descriptor.Name); - version.Parameters.AddWithValue(descriptor.Version); - version.Parameters.AddWithValue(sha256); - version.Parameters.AddWithValue(descriptor.ApiVersion); - version.Parameters.AddWithValue(size); - version.Parameters.AddWithValue(publishedAt); - if (await version.ExecuteNonQueryAsync(cancellationToken) == 0) - { - // The plugin row is left as it was: the transaction is rolled back with the refusal. - return AddVersionResult.VersionExists; - } - } - - await transaction.CommitAsync(cancellationToken); - return AddVersionResult.Added; - } - - /// <inheritdoc/> - public async ValueTask<bool> SetYankedAsync( - string publisher, - string name, - string version, - bool yanked, - CancellationToken cancellationToken) - { - await using NpgsqlConnection connection = await dataSource.OpenConnectionAsync(cancellationToken); - await using NpgsqlCommand command = new( - """ - UPDATE viget_tazel_plugin_versions SET yanked = $4 - WHERE publisher = $1 AND name = $2 AND version = $3 - """, - connection); - command.Parameters.AddWithValue(publisher); - command.Parameters.AddWithValue(name); - command.Parameters.AddWithValue(version); - command.Parameters.AddWithValue(yanked); - return await command.ExecuteNonQueryAsync(cancellationToken) == 1; - } - - /// <summary>A plugin from a row of <see cref="PluginColumns"/>.</summary> - /// <param name="reader">A reader on the row.</param> - /// <param name="versions">The versions of the plugin.</param> - /// <returns>The plugin.</returns> - private static TazelPlugin ReadPlugin(NpgsqlDataReader reader, IReadOnlyList<TazelPluginVersion> versions) => new( - reader.GetString(0), - reader.GetString(1), - reader.IsDBNull(2) ? null : reader.GetString(2), - reader.GetFieldValue<string[]>(3), - reader.IsDBNull(4) ? null : reader.GetString(4), - reader.IsDBNull(5) ? null : reader.GetString(5), - reader.IsDBNull(6) ? null : reader.GetString(6), - versions); - - /// <summary>The versions of a plugin, newest publication first.</summary> - /// <param name="connection">The connection to read on.</param> - /// <param name="transaction">The transaction to read in, if any.</param> - /// <param name="publisher">The publisher of the plugin.</param> - /// <param name="name">The name of the plugin.</param> - /// <param name="cancellationToken">Cancels the operation.</param> - /// <returns>The versions.</returns> - private static async Task<IReadOnlyList<TazelPluginVersion>> VersionsAsync( - NpgsqlConnection connection, - NpgsqlTransaction? transaction, - string publisher, - string name, - CancellationToken cancellationToken) - { - await using NpgsqlCommand command = new( - """ - SELECT version, sha256, api_version, size, published_at, yanked FROM viget_tazel_plugin_versions - WHERE publisher = $1 AND name = $2 ORDER BY published_at DESC, version DESC - """, - connection, - transaction); - command.Parameters.AddWithValue(publisher); - command.Parameters.AddWithValue(name); - await using NpgsqlDataReader reader = await command.ExecuteReaderAsync(cancellationToken); - List<TazelPluginVersion> versions = []; - while (await reader.ReadAsync(cancellationToken)) - { - versions.Add(new TazelPluginVersion( - reader.GetString(0), - reader.GetString(1), - reader.GetInt32(2), - reader.GetInt64(3), - reader.GetFieldValue<DateTimeOffset>(4), - reader.GetBoolean(5))); - } - - return versions; - } -} diff --git a/apps/api/ViGet/TazelPluginCatalog.cs b/apps/api/ViGet/TazelPluginCatalog.cs deleted file mode 100644 index 72be9ee..0000000 --- a/apps/api/ViGet/TazelPluginCatalog.cs +++ /dev/null @@ -1,179 +0,0 @@ -// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> -// SPDX-License-Identifier: AGPL-3.0-or-later - -namespace Progmasoft.Progmaweb.Api.ViGet; - -/// <summary>One published version of a Tazel plugin.</summary> -/// <param name="Version">The version.</param> -/// <param name="Sha256">The SHA-256 digest of its JAR, in lower-case hex.</param> -/// <param name="ApiVersion">The plugin API of Tazel it was built for.</param> -/// <param name="Size">The size of its JAR in bytes.</param> -/// <param name="PublishedAt">When it was published.</param> -/// <param name="Yanked">Whether it was yanked: Tazel takes it only when a project names it.</param> -internal sealed record TazelPluginVersion( - string Version, - string Sha256, - int ApiVersion, - long Size, - DateTimeOffset PublishedAt, - bool Yanked); - -/// <summary>A Tazel plugin of the catalog, described by the descriptor of its newest publication.</summary> -/// <param name="Publisher">The Progmasoft Account it is published under.</param> -/// <param name="Name">Its name.</param> -/// <param name="Description">What it does.</param> -/// <param name="Authors">Its authors.</param> -/// <param name="License">An SPDX license expression.</param> -/// <param name="Homepage">An https address of the plugin.</param> -/// <param name="Repository">An https address of its sources.</param> -/// <param name="Versions">Its versions, newest publication first.</param> -internal sealed record TazelPlugin( - string Publisher, - string Name, - string? Description, - IReadOnlyList<string> Authors, - string? License, - string? Homepage, - string? Repository, - IReadOnlyList<TazelPluginVersion> Versions) -{ - /// <summary>The newest version that is not yanked, or the newest of all when every one is.</summary> - public TazelPluginVersion Latest => - Versions.Where(version => !version.Yanked).DefaultIfEmpty(Versions[0]).First(); -} - -/// <summary>What adding a version to the catalog did.</summary> -internal enum AddVersionResult -{ - /// <summary>The version was added.</summary> - Added, - - /// <summary>The plugin has this version already; a version is never replaced.</summary> - VersionExists, - - /// <summary>A plugin of the publisher has the same name in other letter case.</summary> - NameTaken, -} - -/// <summary>The Tazel plugins of ViGet: their descriptions and versions. The JARs live in files beside it.</summary> -internal interface ITazelPluginCatalog -{ - /// <summary>Every plugin, ordered by publisher and name.</summary> - ValueTask<IReadOnlyList<TazelPlugin>> ListAsync(CancellationToken cancellationToken); - - /// <summary>A plugin by its exact publisher and name.</summary> - ValueTask<TazelPlugin?> FindAsync(string publisher, string name, CancellationToken cancellationToken); - - /// <summary>Adds a version, and describes the plugin with the descriptor of that version.</summary> - ValueTask<AddVersionResult> AddVersionAsync( - TazelPluginDescriptor descriptor, - string sha256, - long size, - DateTimeOffset publishedAt, - CancellationToken cancellationToken); - - /// <summary>Yanks a version, or takes the yank back.</summary> - /// <returns>Whether the plugin has the version.</returns> - ValueTask<bool> SetYankedAsync( - string publisher, - string name, - string version, - bool yanked, - CancellationToken cancellationToken); -} - -/// <summary>A catalog that lives as long as the process, for development and tests.</summary> -internal sealed class InMemoryTazelPluginCatalog : ITazelPluginCatalog -{ - /// <summary>Guards <see cref="plugins"/>.</summary> - private readonly Lock gate = new(); - /// <summary>The plugins by their exact publisher and name.</summary> - private readonly Dictionary<(string Publisher, string Name), TazelPlugin> plugins = []; - - /// <inheritdoc/> - public ValueTask<IReadOnlyList<TazelPlugin>> ListAsync(CancellationToken cancellationToken) - { - lock (gate) - { - return ValueTask.FromResult<IReadOnlyList<TazelPlugin>>(plugins.Values - .OrderBy(plugin => plugin.Publisher, StringComparer.Ordinal) - .ThenBy(plugin => plugin.Name, StringComparer.Ordinal) - .ToList()); - } - } - - /// <inheritdoc/> - public ValueTask<TazelPlugin?> FindAsync(string publisher, string name, CancellationToken cancellationToken) - { - lock (gate) - { - return ValueTask.FromResult(plugins.GetValueOrDefault((publisher, name))); - } - } - - /// <inheritdoc/> - public ValueTask<AddVersionResult> AddVersionAsync( - TazelPluginDescriptor descriptor, - string sha256, - long size, - DateTimeOffset publishedAt, - CancellationToken cancellationToken) - { - lock (gate) - { - (string, string) key = (descriptor.Publisher, descriptor.Name); - if (!plugins.ContainsKey(key) && plugins.Keys.Any(existing => - string.Equals(existing.Publisher, descriptor.Publisher, StringComparison.OrdinalIgnoreCase) && - string.Equals(existing.Name, descriptor.Name, StringComparison.OrdinalIgnoreCase))) - { - return ValueTask.FromResult(AddVersionResult.NameTaken); - } - - List<TazelPluginVersion> versions = plugins.TryGetValue(key, out TazelPlugin? existingPlugin) - ? [.. existingPlugin.Versions] - : []; - if (versions.Any(version => version.Version == descriptor.Version)) - { - return ValueTask.FromResult(AddVersionResult.VersionExists); - } - - versions.Insert( - 0, new TazelPluginVersion(descriptor.Version, sha256, descriptor.ApiVersion, size, publishedAt, false)); - plugins[key] = new TazelPlugin( - descriptor.Publisher, - descriptor.Name, - descriptor.Description, - descriptor.Authors, - descriptor.License, - descriptor.Homepage, - descriptor.Repository, - versions); - return ValueTask.FromResult(AddVersionResult.Added); - } - } - - /// <inheritdoc/> - public ValueTask<bool> SetYankedAsync( - string publisher, - string name, - string version, - bool yanked, - CancellationToken cancellationToken) - { - lock (gate) - { - if (!plugins.TryGetValue((publisher, name), out TazelPlugin? plugin) || - plugin.Versions.All(existing => existing.Version != version)) - { - return ValueTask.FromResult(false); - } - - plugins[(publisher, name)] = plugin with - { - Versions = [.. plugin.Versions.Select(existing => - existing.Version == version ? existing with { Yanked = yanked } : existing)] - }; - return ValueTask.FromResult(true); - } - } -} diff --git a/apps/api/ViGet/TazelPluginDescriptor.cs b/apps/api/ViGet/TazelPluginDescriptor.cs deleted file mode 100644 index e5b0d68..0000000 --- a/apps/api/ViGet/TazelPluginDescriptor.cs +++ /dev/null @@ -1,138 +0,0 @@ -// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> -// SPDX-License-Identifier: AGPL-3.0-or-later - -using System.IO.Compression; -using System.Text; -using System.Text.RegularExpressions; - -namespace Progmasoft.Progmaweb.Api.ViGet; - -/// <summary> -/// The descriptor of a Tazel plugin, <c>META-INF/tazel-plugin.properties</c> of its JAR, as Tazel reads it, with the -/// fields ViGet shows on the page of the plugin. -/// </summary> -/// <param name="Publisher">The Progmasoft Account the plugin is published under.</param> -/// <param name="Name">The name of the plugin; one identifier.</param> -/// <param name="Version">An exact version of three to five numbers.</param> -/// <param name="ApiVersion">The plugin API of Tazel it was built for.</param> -/// <param name="Description">What the plugin does.</param> -/// <param name="Authors">The authors, in the order of the descriptor.</param> -/// <param name="License">An SPDX license expression.</param> -/// <param name="Homepage">An https address of the plugin.</param> -/// <param name="Repository">An https address of its sources.</param> -internal sealed partial record TazelPluginDescriptor( - string Publisher, - string Name, - string Version, - int ApiVersion, - string? Description, - IReadOnlyList<string> Authors, - string? License, - string? Homepage, - string? Repository) -{ - /// <summary>Where the descriptor lies in the JAR.</summary> - public const string DescriptorEntry = "META-INF/tazel-plugin.properties"; - - /// <summary>The service entry that names the class Tazel loads.</summary> - public const string ServiceEntry = "META-INF/services/com.progmasoft.api.tazel.dsl.plugin.ProjectPlugin"; - - /// <summary>Whether a text is one identifier, as Tazel requires of a publisher and a plugin name.</summary> - public static bool IsIdentifier(string value) => IdentifierPattern().IsMatch(value); - - /// <summary>Whether a text is an exact version of three to five numbers, as Tazel requires of a plugin version.</summary> - public static bool IsVersion(string value) => VersionPattern().IsMatch(value); - - /// <summary>Reads and checks the descriptor of a plugin JAR.</summary> - /// <param name="jar">The bytes of the JAR.</param> - /// <param name="descriptor">The descriptor, when the JAR is a valid plugin.</param> - /// <returns>Why the JAR is refused, or <see langword="null"/> when it is valid.</returns> - public static string? TryRead(byte[] jar, out TazelPluginDescriptor? descriptor) - { - descriptor = null; - IReadOnlyDictionary<string, string> properties; - try - { - using ZipArchive archive = new(new MemoryStream(jar, writable: false), ZipArchiveMode.Read); - ZipArchiveEntry? entry = archive.GetEntry(DescriptorEntry); - if (entry is null) - { - return $"The JAR has no {DescriptorEntry}."; - } - - ZipArchiveEntry? service = archive.GetEntry(ServiceEntry); - if (service is null || service.Length == 0) - { - return $"The JAR has no {ServiceEntry}."; - } - - using StreamReader reader = new(entry.Open(), Encoding.Latin1); - properties = JavaProperties.Parse(reader.ReadToEnd()); - } - catch (InvalidDataException) - { - return "The file is not a JAR."; - } - catch (FormatException error) - { - return $"The descriptor is not a properties file: {error.Message}"; - } - - string? Text(string key) => - properties.TryGetValue(key, out string? value) && !string.IsNullOrWhiteSpace(value) ? value.Trim() : null; - - string? publisher = Text("publisher"); - string? name = Text("name"); - string? version = Text("version"); - if (publisher is null || !IsIdentifier(publisher)) - { - return "The descriptor needs a publisher that is one identifier."; - } - - if (name is null || !IsIdentifier(name)) - { - return "The descriptor needs a name that is one identifier."; - } - - if (version is null || !IsVersion(version)) - { - return "The descriptor needs an exact version of three to five numbers."; - } - - if (!int.TryParse(Text("apiVersion"), out int apiVersion) || apiVersion < 1) - { - return "The descriptor needs an API version."; - } - - List<string> authors = []; - for (int index = 0; Text($"author.{index}") is { } author; index++) - { - authors.Add(author); - } - - string? homepage = Text("homepage"); - string? repository = Text("repository"); - foreach ((string key, string? address) in new[] { ("homepage", homepage), ("repository", repository) }) - { - if (address is not null && - (!Uri.TryCreate(address, UriKind.Absolute, out Uri? uri) || uri.Scheme != Uri.UriSchemeHttps)) - { - return $"The {key} of the descriptor is not an https address."; - } - } - - descriptor = new TazelPluginDescriptor( - publisher, name, version, apiVersion, Text("description"), authors, Text("license"), homepage, repository); - return null; - } - - /// <summary>One identifier: a letter or <c>_</c>, then letters, digits or <c>_</c>.</summary> - /// <returns>The compiled expression.</returns> - [GeneratedRegex("^[A-Za-z_][A-Za-z0-9_]*$")] - private static partial Regex IdentifierPattern(); - - /// <summary>An exact version of three to five numbers without leading zeros, as Tazel accepts it.</summary> - /// <returns>The compiled expression.</returns> - [GeneratedRegex(@"^(?:0|[1-9][0-9]*)(?:\.(?:0|[1-9][0-9]*)){2,4}(?:-[0-9A-Za-z.-]+)?$")] - private static partial Regex VersionPattern(); -} diff --git a/apps/api/ViGet/TazelPluginPublishing.cs b/apps/api/ViGet/TazelPluginPublishing.cs deleted file mode 100644 index 6851457..0000000 --- a/apps/api/ViGet/TazelPluginPublishing.cs +++ /dev/null @@ -1,151 +0,0 @@ -// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> -// SPDX-License-Identifier: AGPL-3.0-or-later - -using System.Security.Cryptography; -using Microsoft.Extensions.Options; -using Progmasoft.Progmaweb.Api.Accounts; - -namespace Progmasoft.Progmaweb.Api.ViGet; - -/// <summary>The settings of ViGet, from the configuration section <c>ViGet</c>.</summary> -internal sealed class ViGetOptions -{ - /// <summary>The name of the configuration section.</summary> - public const string SectionName = "ViGet"; - - /// <summary> - /// The directory the files of ViGet are kept in, which Nginx serves: a JAR lies at - /// <c>dslplugins/tazel/<Publisher>/<Name>/<Version>/<Name>-<Version>.jar</c> below it. - /// </summary> - public string ArtifactRoot { get; set; } = "/srv/viget/files"; - - /// <summary> - /// The accounts that may publish Tazel plugins. ViGet opens publishing in stages: first to Progmasoft alone, - /// later to every account. - /// </summary> - public List<string> TazelPublishers { get; set; } = ["Progmasoft"]; -} - -/// <summary>What publishing a plugin did.</summary> -/// <param name="Plugin">The descriptor of the published version, when it was published.</param> -/// <param name="Error">Why it was refused, when it was.</param> -internal sealed record PublishResult(TazelPluginDescriptor? Plugin, string? Error) -{ - /// <summary>Whether the version was published.</summary> - public bool Published => Error is null; -} - -/// <summary>Publishes Tazel plugins: checks a JAR, keeps its file and adds its version to the catalog.</summary> -/// <param name="catalog">The catalog.</param> -/// <param name="accounts">The accounts, which name the publishers.</param> -/// <param name="options">Where the files go and who may publish.</param> -/// <param name="time">The clock.</param> -internal sealed class TazelPluginPublishing( - ITazelPluginCatalog catalog, - IAccountStore accounts, - IOptions<ViGetOptions> options, - TimeProvider time) -{ - /// <summary>The largest JAR ViGet takes.</summary> - public const long MaximumSize = 64L * 1024 * 1024; - - /// <summary>The path of the JAR of a version, relative to <see cref="ViGetOptions.ArtifactRoot"/>.</summary> - public static string RelativePath(string publisher, string name, string version) => - Path.Combine("dslplugins", "tazel", publisher, name, version, $"{name}-{version}.jar"); - - /// <summary>Publishes the plugin in a JAR.</summary> - /// <param name="jar">The bytes of the JAR.</param> - /// <param name="cancellationToken">Cancels the operation.</param> - /// <returns>The published descriptor, or why the JAR was refused.</returns> - public async Task<PublishResult> PublishAsync(byte[] jar, CancellationToken cancellationToken) - { - if (jar.LongLength > MaximumSize) - { - return Refused($"The JAR is larger than {MaximumSize / 1024 / 1024} MiB."); - } - - if (TazelPluginDescriptor.TryRead(jar, out TazelPluginDescriptor? descriptor) is { } invalid) - { - return Refused(invalid); - } - - // ViGet shows these on the page of the plugin; Tazel itself does not need them. - if (descriptor!.Description is null || descriptor.Authors.Count == 0 || descriptor.License is null) - { - return Refused("ViGet needs a description, at least one author and a license in the descriptor."); - } - - if (!options.Value.TazelPublishers.Contains(descriptor.Publisher, StringComparer.Ordinal)) - { - return Refused( - $"Publishing Tazel plugins is open to {string.Join(", ", options.Value.TazelPublishers)} for now; " + - $"'{descriptor.Publisher}' cannot publish yet."); - } - - AccountRecord? account = await accounts.FindByAccountNameAsync( - AccountNamePolicy.NormalizeForLookup(descriptor.Publisher), cancellationToken); - if (account is null || !string.Equals(account.AccountName, descriptor.Publisher, StringComparison.Ordinal)) - { - return Refused($"No Progmasoft Account is named '{descriptor.Publisher}'."); - } - - TazelPlugin? existing = await catalog.FindAsync(descriptor.Publisher, descriptor.Name, cancellationToken); - if (existing?.Versions.Any(version => version.Version == descriptor.Version) == true) - { - return Refused($"{descriptor.Publisher}.{descriptor.Name} {descriptor.Version} is published already."); - } - - string sha256 = Convert.ToHexStringLower(SHA256.HashData(jar)); - string target = Path.Combine( - options.Value.ArtifactRoot, RelativePath(descriptor.Publisher, descriptor.Name, descriptor.Version)); - bool written = await WriteAsync(target, jar, sha256, cancellationToken); - - AddVersionResult result = await catalog.AddVersionAsync( - descriptor, sha256, jar.LongLength, time.GetUtcNow(), cancellationToken); - if (result is not AddVersionResult.Added) - { - if (written) - { - File.Delete(target); - } - - return Refused(result is AddVersionResult.NameTaken - ? $"{descriptor.Publisher} has a plugin whose name differs from '{descriptor.Name}' only in letter case." - : $"{descriptor.Publisher}.{descriptor.Name} {descriptor.Version} is published already."); - } - - return new PublishResult(descriptor, null); - } - - /// <summary>Writes the JAR of a version; a file that is there already must be the same bytes.</summary> - /// <returns>Whether the file was written now.</returns> - private static async Task<bool> WriteAsync( - string target, - byte[] jar, - string sha256, - CancellationToken cancellationToken) - { - if (File.Exists(target)) - { - byte[] present = await File.ReadAllBytesAsync(target, cancellationToken); - if (Convert.ToHexStringLower(SHA256.HashData(present)) != sha256) - { - throw new InvalidOperationException( - $"{target} exists with other bytes, and no version of the catalog names it."); - } - - return false; - } - - Directory.CreateDirectory(Path.GetDirectoryName(target)!); - string partial = target + ".partial"; - await File.WriteAllBytesAsync(partial, jar, cancellationToken); - File.Move(partial, target); - return true; - } - - /// <summary>The result of a refused publication.</summary> - /// <param name="error">Why it was refused.</param> - /// <returns>The result.</returns> - private static PublishResult Refused(string error) => new(null, error); -} diff --git a/apps/api/ViGet/ViGetCommand.cs b/apps/api/ViGet/ViGetCommand.cs deleted file mode 100644 index a0f1253..0000000 --- a/apps/api/ViGet/ViGetCommand.cs +++ /dev/null @@ -1,85 +0,0 @@ -// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> -// SPDX-License-Identifier: AGPL-3.0-or-later - -using Npgsql; - -namespace Progmasoft.Progmaweb.Api.ViGet; - -/// <summary> -/// The commands that manage the Tazel plugin catalog on the server, while publishing is not open through the API: -/// <c>viget publish-tazel-plugin <jar></c> and <c>viget yank-tazel-plugin <Publisher> <Name> -/// <Version> [--undo]</c>. They run with the configuration of the service, as its user. -/// </summary> -internal static class ViGetCommand -{ - /// <summary>Whether the arguments of the program ask for a ViGet command rather than the web service.</summary> - public static bool IsCommand(string[] args) => args is ["viget", ..]; - - /// <summary>Runs a ViGet command.</summary> - /// <param name="services">The services of the API, not started.</param> - /// <param name="args">The arguments after <c>viget</c>.</param> - /// <param name="output">Where results go.</param> - /// <param name="errors">Where errors go.</param> - /// <param name="cancellationToken">Cancels the command.</param> - /// <returns>The exit code: 0 on success, 1 when the command was refused, 2 for a wrong command line.</returns> - public static async Task<int> RunAsync( - IServiceProvider services, - string[] args, - TextWriter output, - TextWriter errors, - CancellationToken cancellationToken) - { - // The service applies the schema when it starts; a command may run before it ever did. - if (services.GetService<NpgsqlDataSource>() is { } dataSource) - { - await ViGetSchema.ApplyAsync(dataSource, cancellationToken); - } - - switch (args) - { - case ["publish-tazel-plugin", string path]: - { - if (!File.Exists(path)) - { - await errors.WriteLineAsync($"{path} does not exist."); - return 1; - } - - TazelPluginPublishing publishing = services.GetRequiredService<TazelPluginPublishing>(); - PublishResult result = await publishing.PublishAsync( - await File.ReadAllBytesAsync(path, cancellationToken), cancellationToken); - if (!result.Published) - { - await errors.WriteLineAsync(result.Error); - return 1; - } - - TazelPluginDescriptor plugin = result.Plugin!; - await output.WriteLineAsync( - $"Published {plugin.Publisher}.{plugin.Name} {plugin.Version}: " + - $"https://viget.progmasoft.com/dslplugins/tazel/{plugin.Publisher}/{plugin.Name}"); - return 0; - } - case ["yank-tazel-plugin", string publisher, string name, string version, .. var rest] - when rest is [] or ["--undo"]: - { - bool yanked = rest is []; - ITazelPluginCatalog catalog = services.GetRequiredService<ITazelPluginCatalog>(); - if (!await catalog.SetYankedAsync(publisher, name, version, yanked, cancellationToken)) - { - await errors.WriteLineAsync($"{publisher}.{name} has no version {version}."); - return 1; - } - - await output.WriteLineAsync( - $"{publisher}.{name} {version} is {(yanked ? "yanked" : "no longer yanked")}."); - return 0; - } - default: - await errors.WriteLineAsync( - "usage: viget publish-tazel-plugin <jar>\n" + - " viget yank-tazel-plugin <Publisher> <Name> <Version> [--undo]"); - return 2; - } - } -} diff --git a/apps/api/ViGet/ViGetEndpoints.cs b/apps/api/ViGet/ViGetEndpoints.cs deleted file mode 100644 index 6c3b5b6..0000000 --- a/apps/api/ViGet/ViGetEndpoints.cs +++ /dev/null @@ -1,113 +0,0 @@ -// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> -// SPDX-License-Identifier: AGPL-3.0-or-later - -namespace Progmasoft.Progmaweb.Api.ViGet; - -/// <summary>The read endpoints of the Tazel plugin catalog.</summary> -/// <remarks> -/// <para> -/// The pages of ViGet read the catalog from these endpoints on the loopback address of the API; Nginx does not pass -/// <c>/api/</c> of the ViGet host on. What the public reaches is the index of a plugin, which Tazel reads at -/// <c>https://viget.progmasoft.com/dslplugins/tazel/<Publisher>/<Name>/index.json</c>: Nginx passes -/// that address to <c>/api/v1/viget/dslplugins/tazel/<Publisher>/<Name>/index.json</c>, and serves the -/// JARs from the files of ViGet itself. -/// </para> -/// </remarks> -internal static class ViGetEndpoints -{ - /// <summary>Maps the endpoints.</summary> - /// <param name="app">The routes of the API.</param> - public static void MapViGetEndpoints(this IEndpointRouteBuilder app) - { - RouteGroupBuilder tazel = app.MapGroup("/api/v1/viget/dslplugins/tazel"); - - tazel.MapGet("/", async (ITazelPluginCatalog catalog, CancellationToken cancellationToken) => - { - IReadOnlyList<TazelPlugin> plugins = await catalog.ListAsync(cancellationToken); - return Results.Ok(new - { - plugins = plugins.Select(plugin => new - { - plugin.Publisher, - plugin.Name, - plugin.Description, - plugin.License, - latestVersion = plugin.Latest.Version, - updatedAt = plugin.Versions[0].PublishedAt - }) - }); - }); - - tazel.MapGet("/{publisher}/{name}", async ( - string publisher, - string name, - ITazelPluginCatalog catalog, - CancellationToken cancellationToken) => - { - TazelPlugin? plugin = await FindAsync(catalog, publisher, name, cancellationToken); - return plugin is null - ? Results.NotFound() - : Results.Ok(new - { - plugin.Publisher, - plugin.Name, - plugin.Description, - plugin.Authors, - plugin.License, - plugin.Homepage, - plugin.Repository, - latestVersion = plugin.Latest.Version, - versions = plugin.Versions.Select(version => new - { - version.Version, - version.Sha256, - version.ApiVersion, - version.Size, - version.PublishedAt, - version.Yanked, - path = $"/dslplugins/tazel/{plugin.Publisher}/{plugin.Name}/{version.Version}/" + - $"{plugin.Name}-{version.Version}.jar" - }) - }); - }); - - // The index Tazel reads to choose a version and check the JAR it downloads. - tazel.MapGet("/{publisher}/{name}/index.json", async ( - string publisher, - string name, - ITazelPluginCatalog catalog, - CancellationToken cancellationToken) => - { - TazelPlugin? plugin = await FindAsync(catalog, publisher, name, cancellationToken); - return plugin is null - ? Results.NotFound() - : Results.Ok(new - { - plugin.Publisher, - plugin.Name, - versions = plugin.Versions.Select(version => new - { - version.Version, - version.Sha256, - version.ApiVersion, - version.Yanked - }) - }); - }); - } - - /// <summary>A plugin of the catalog, or <see langword="null"/> when a route value is not an identifier.</summary> - /// <param name="catalog">The catalog.</param> - /// <param name="publisher">The publisher from the route.</param> - /// <param name="name">The name from the route.</param> - /// <param name="cancellationToken">Cancels the operation.</param> - /// <returns>The plugin, if there is one.</returns> - private static ValueTask<TazelPlugin?> FindAsync( - ITazelPluginCatalog catalog, - string publisher, - string name, - CancellationToken cancellationToken) => - TazelPluginDescriptor.IsIdentifier(publisher) && TazelPluginDescriptor.IsIdentifier(name) - ? catalog.FindAsync(publisher, name, cancellationToken) - : ValueTask.FromResult<TazelPlugin?>(null); -} diff --git a/apps/api/ViGet/ViGetRegistration.cs b/apps/api/ViGet/ViGetRegistration.cs deleted file mode 100644 index ac98281..0000000 --- a/apps/api/ViGet/ViGetRegistration.cs +++ /dev/null @@ -1,58 +0,0 @@ -// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> -// SPDX-License-Identifier: AGPL-3.0-or-later - -using Npgsql; -using Progmasoft.Progmaweb.Api.Accounts; - -namespace Progmasoft.Progmaweb.Api.ViGet; - -/// <summary>Registers ViGet: its catalog beside the accounts, and the publishing of plugins.</summary> -internal static class ViGetRegistration -{ - /// <summary>Adds the services of ViGet.</summary> - /// <param name="services">The services of the API.</param> - /// <param name="configuration">The configuration, whose section <c>ViGet</c> holds <see cref="ViGetOptions"/>.</param> - /// <param name="accountStore">Where the accounts are kept; the catalog is kept in the same place.</param> - public static void AddViGet( - this IServiceCollection services, - IConfiguration configuration, - AccountStoreKind accountStore) - { - services.Configure<ViGetOptions>(configuration.GetSection(ViGetOptions.SectionName)); - if (accountStore is AccountStoreKind.PostgreSql) - { - services.AddSingleton<ITazelPluginCatalog, PostgresTazelPluginCatalog>(); - services.AddHostedService<ViGetSchemaInitializer>(); - } - else - { - services.AddSingleton<ITazelPluginCatalog, InMemoryTazelPluginCatalog>(); - } - - services.AddSingleton<TazelPluginPublishing>(); - } -} - -/// <summary>Brings the ViGet tables to the current schema before the service accepts requests.</summary> -/// <param name="dataSource">Connections to the database of the accounts.</param> -/// <param name="logger">Receives what was done.</param> -internal sealed class ViGetSchemaInitializer( - NpgsqlDataSource dataSource, - ILogger<ViGetSchemaInitializer> logger) : IHostedService -{ - /// <summary>Writes the schema version and the number of steps taken at this start.</summary> - private static readonly Action<ILogger, int, int, Exception?> SchemaReport = LoggerMessage.Define<int, int>( - LogLevel.Information, - new EventId(1, "ViGetSchema"), - "The ViGet tables are at schema version {Version}; {Taken} step(s) were taken at this start."); - - /// <inheritdoc/> - public async Task StartAsync(CancellationToken cancellationToken) - { - int taken = await ViGetSchema.ApplyAsync(dataSource, cancellationToken); - SchemaReport(logger, ViGetSchema.CurrentVersion, taken, null); - } - - /// <inheritdoc/> - public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask; -} diff --git a/apps/api/appsettings.json b/apps/api/appsettings.json index 401913e..4ddc9e9 100644 --- a/apps/api/appsettings.json +++ b/apps/api/appsettings.json @@ -5,7 +5,7 @@ "Microsoft.AspNetCore": "Warning" } }, - "AllowedHosts": "localhost;127.0.0.1;progmasoft.com;account.progmasoft.com;www.progmasoft.com;credentials.progmasoft.com;authorize.progmasoft.com;console.progmasoft.com;viget.progmasoft.com", + "AllowedHosts": "localhost;127.0.0.1;progmasoft.com;account.progmasoft.com;www.progmasoft.com;credentials.progmasoft.com;authorize.progmasoft.com;console.progmasoft.com", "AccountSessions": { "LifetimeHours": 720, "CookieName": "__Secure-ProgmasoftSession", diff --git a/apps/web/app/layout.tsx b/apps/web/app/layout.tsx index 5c23742..d5af22e 100644 --- a/apps/web/app/layout.tsx +++ b/apps/web/app/layout.tsx @@ -8,7 +8,6 @@ import { nonceHeader } from "@/lib/content-security-policy"; import { getLocale } from "@/lib/locale.server"; import { themeBootstrap } from "@/lib/theme"; import "./globals.css"; -import "./viget.css"; export const metadata: Metadata = { // The apex host is the only public organization canonical. The www host is a diff --git a/apps/web/app/page.tsx b/apps/web/app/page.tsx index 97cc441..88b3df6 100644 --- a/apps/web/app/page.tsx +++ b/apps/web/app/page.tsx @@ -143,8 +143,6 @@ export default async function Homepage() { {" "}/.well-known/openid-configuration {"\n\n"} <b>scope</b> openid profile email - {"\n"} - {" "}viget.packages.read </code> </pre> </div> diff --git a/apps/web/app/robots.ts b/apps/web/app/robots.ts index 93b7ac0..6d26429 100644 --- a/apps/web/app/robots.ts +++ b/apps/web/app/robots.ts @@ -20,7 +20,6 @@ export default async function robots(): Promise<MetadataRoute.Robots> { } // Each host with pages of its own names its own sitemap. const sitemap = - canonicalHost === "viget.progmasoft.com" || canonicalHost === "product.progmasoft.com" || canonicalHost === "license.progmasoft.com" ? `https://${canonicalHost}/sitemap.xml` diff --git a/apps/web/app/sitemap.ts b/apps/web/app/sitemap.ts index 97a6ca0..74e4184 100644 --- a/apps/web/app/sitemap.ts +++ b/apps/web/app/sitemap.ts @@ -15,25 +15,6 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> { ) .split(":", 1)[0] ?.toLowerCase(); - if (host === "viget.progmasoft.com") { - return [ - { - url: "https://viget.progmasoft.com/", - changeFrequency: "weekly", - priority: 1, - }, - ...["c", "cpp", "objc"].map((language) => ({ - url: `https://viget.progmasoft.com/langs/${language}`, - changeFrequency: "weekly" as const, - priority: 0.8, - })), - { - url: "https://viget.progmasoft.com/dslplugins/tazel", - changeFrequency: "weekly", - priority: 0.8, - }, - ]; - } if (host === "license.progmasoft.com") { return [ { diff --git a/apps/web/app/viget.css b/apps/web/app/viget.css deleted file mode 100644 index fe6f196..0000000 --- a/apps/web/app/viget.css +++ /dev/null @@ -1,407 +0,0 @@ -/* SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> */ -/* SPDX-License-Identifier: AGPL-3.0-or-later */ - -/* ViGet shares the organization theme while keeping a denser registry-oriented hierarchy. */ -.viget-surface { - min-height: 100vh; - background: var(--surface); -} - -.viget-brand-lockup { - display: flex; - align-items: center; - gap: 15px; -} - -.viget-brand-lockup > span { - border-left: 2px solid var(--ink-800); - padding-left: 15px; - color: var(--ink-800); - font-size: 16px; - font-weight: 700; -} - -.viget-hero, -.viget-plugin-hero { - border-bottom: 1px solid var(--line); - background: var(--hero-background); -} - -.viget-hero-grid, -.viget-plugin-grid { - min-height: 620px; - display: grid; - grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.75fr); - align-items: center; - gap: 80px; - padding-block: 76px; -} - -.viget-plugin-grid { - min-height: 520px; -} - -.viget-hero-copy h1 { - max-width: 720px; - margin: 0; - font-size: clamp(44px, 6vw, 72px); - letter-spacing: -0.05em; - line-height: 1.04; -} - -.viget-hero-copy > p:not(.eyebrow) { - max-width: 680px; - margin: 24px 0 0; - color: var(--ink-650); - font-size: 18px; -} - -.viget-availability { - border: 1px solid var(--line-strong); - border-radius: var(--radius-lg); - padding: 30px; - background: var(--surface); - box-shadow: var(--shadow-md); -} - -.viget-status { - display: flex; - align-items: center; - gap: 9px; - color: var(--green-600); - font-size: 13px; - font-weight: 750; -} - -.viget-status > span { - width: 9px; - height: 9px; - border-radius: 50%; - background: var(--green-600); - box-shadow: 0 0 0 5px color-mix(in srgb, var(--green-600) 14%, transparent); -} - -.viget-availability h2 { - margin: 17px 0 10px; - font-size: 27px; - letter-spacing: -0.025em; -} - -.viget-availability > p { - margin: 0; - color: var(--ink-650); -} - -.viget-availability dl { - margin: 25px 0 0; -} - -.viget-availability dl > div { - display: flex; - justify-content: space-between; - gap: 24px; - border-top: 1px solid var(--line); - padding-block: 12px; -} - -.viget-availability dt { - color: var(--ink-500); -} - -.viget-availability dd { - margin: 0; - color: var(--ink-800); - font-weight: 700; -} - -.viget-catalog-grid { - display: grid; - grid-template-columns: repeat(2, 1fr); - gap: 24px; -} - -.viget-catalog-card { - min-width: 0; - display: flex; - flex-direction: column; - border: 1px solid var(--line); - border-radius: var(--radius-md); - padding: 30px; - background: var(--surface); - color: var(--ink-950); - box-shadow: var(--shadow-sm); - transition: - border-color 140ms ease, - transform 140ms ease; -} - -a.viget-catalog-card:hover { - border-color: var(--blue-600); - text-decoration: none; - transform: translateY(-2px); -} - -.viget-catalog-card > span { - color: var(--blue-600); - font-family: "Cascadia Code", Consolas, monospace; - font-size: 12px; - font-weight: 750; -} - -.viget-catalog-card > p { - margin: 24px 0 5px; - color: var(--ink-500); - font-size: 13px; - font-weight: 700; - text-transform: uppercase; -} - -.viget-catalog-card h3 { - margin: 0; - font-size: 26px; -} - -.viget-catalog-card code, -.viget-availability code { - overflow-wrap: anywhere; - margin-top: 24px; - border-radius: var(--radius-sm); - padding: 12px; - background: var(--surface-blue); - color: var(--blue-700); - font-family: "Cascadia Code", Consolas, monospace; - font-size: 13px; -} - -.viget-catalog-card small { - margin-top: 19px; - color: var(--ink-650); - font-size: 14px; -} - -.viget-catalog-card > strong:last-child { - margin-top: auto; - padding-top: 25px; - color: var(--blue-700); -} - -.viget-catalog-primary { - border-color: var(--blue-600); -} - -.viget-contract-grid { - display: grid; - grid-template-columns: minmax(280px, 0.7fr) 1.3fr; - gap: 80px; -} - -.viget-contract h2 { - margin: 0; - font-size: clamp(32px, 4vw, 47px); - letter-spacing: -0.04em; - line-height: 1.08; -} - -.viget-contract ol { - display: grid; - gap: 0; - margin: 0; - padding: 0; - list-style: none; -} - -.viget-contract li { - display: grid; - grid-template-columns: 42px 1fr; - gap: 16px; - border-top: 1px solid var(--line); - padding-block: 20px; -} - -.viget-contract li > span { - color: var(--blue-600); - font-family: "Cascadia Code", Consolas, monospace; - font-weight: 700; -} - -.viget-contract li strong { - color: var(--ink-800); - font-size: 18px; -} - -.viget-contract li p { - margin: 5px 0 0; - color: var(--ink-650); -} - -.viget-text-link { - display: inline-flex; - align-items: center; - color: var(--blue-700); - font-weight: 700; -} - -.viget-guidance-grid { - display: grid; - grid-template-columns: repeat(3, 1fr); - gap: 24px; -} - -.viget-guidance-grid article { - display: flex; - flex-direction: column; - border-top: 3px solid var(--blue-500); - padding: 24px; - background: var(--surface); - box-shadow: var(--shadow-sm); -} - -.viget-guidance-grid article > span { - color: var(--blue-700); - font-size: 12px; - font-weight: 750; - letter-spacing: 0.08em; - text-transform: uppercase; -} - -.viget-guidance-grid article > strong { - margin-top: 10px; - color: var(--ink-800); - font-size: 20px; -} - -.viget-guidance-grid article > p { - margin: 8px 0 0; - color: var(--ink-650); -} - -.viget-footer { - margin-top: 0; -} - -@media (max-width: 980px) { - .viget-hero-grid, - .viget-plugin-grid, - .viget-contract-grid { - grid-template-columns: 1fr; - gap: 46px; - } - - .viget-hero-grid, - .viget-plugin-grid { - min-height: auto; - } -} - -@media (max-width: 680px) { - .viget-hero-grid, - .viget-plugin-grid { - padding-block: 56px; - } - - .viget-hero-copy h1 { - font-size: 43px; - } - - .viget-catalog-grid { - grid-template-columns: 1fr; - } - - .viget-guidance-grid { - grid-template-columns: 1fr; - } - - .viget-availability, - .viget-catalog-card { - padding: 24px; - } -} - -/* The two catalog groups of the home page are named in capitals, as the registry names them. */ -.viget-catalog-heading { - margin: 0; - font-size: clamp(22px, 2.6vw, 30px); - letter-spacing: 0.08em; -} - -/* A catalog that is not offered yet: gray, flat and not pressable. */ -.viget-catalog-disabled { - font: inherit; - text-align: start; - border-color: var(--line); - background: var(--surface-muted, var(--surface)); - color: var(--ink-500); - box-shadow: none; - cursor: not-allowed; - opacity: 0.62; -} - -.viget-catalog-disabled h3, -.viget-catalog-disabled small { - color: var(--ink-500); -} - -/* The pages of the Tazel plugins: the usage snippet and the table of versions. */ -.viget-plugin-empty { - margin: 0; - color: var(--ink-650); -} - -.viget-snippet { - overflow-x: auto; - margin: 0; - border-radius: var(--radius-sm); - padding: 18px 20px; - background: var(--surface-blue); - color: var(--blue-700); - font-family: "Cascadia Code", Consolas, monospace; - font-size: 14px; - line-height: 1.6; -} - -.viget-catalog-card .viget-snippet { - margin-top: 20px; -} - -.viget-table-scroll { - overflow-x: auto; -} - -.viget-versions { - width: 100%; - border-collapse: collapse; - font-size: 15px; -} - -.viget-versions th, -.viget-versions td { - border-bottom: 1px solid var(--line); - padding: 12px 14px; - text-align: start; - white-space: nowrap; -} - -.viget-versions th { - color: var(--ink-500); - font-size: 13px; - font-weight: 700; -} - -.viget-versions code { - font-family: "Cascadia Code", Consolas, monospace; - font-size: 13px; -} - -.viget-yanked td { - color: var(--ink-500); -} - -.viget-badge { - margin-inline-start: 10px; - border-radius: 999px; - padding: 2px 9px; - background: var(--line); - color: var(--ink-650); - font-size: 12px; - font-weight: 700; -} diff --git a/apps/web/app/viget/dslplugins/gradle/page.tsx b/apps/web/app/viget/dslplugins/gradle/page.tsx deleted file mode 100644 index 8d13f6a..0000000 --- a/apps/web/app/viget/dslplugins/gradle/page.tsx +++ /dev/null @@ -1,92 +0,0 @@ -// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> -// SPDX-License-Identifier: AGPL-3.0-or-later - -import type { Metadata } from "next"; -import { ViGetFooter } from "@/components/ViGetFooter"; -import { ViGetHeader } from "@/components/ViGetHeader"; -import { getLocale } from "@/lib/locale.server"; -import { catalogText } from "@/lib/viget-catalogs"; -import { gradlePlugins, pluginText } from "@/lib/viget-plugins"; - -export async function generateMetadata(): Promise<Metadata> { - const locale = await getLocale(); - const text = pluginText(locale); - return { - title: `${text.gradleTitle} · ViGet`, - description: text.gradleDescription, - alternates: { - canonical: "https://viget.progmasoft.com/dslplugins/gradle", - }, - robots: { index: true, follow: true }, - }; -} - -/** The Gradle catalog: a list only; Gradle downloads the plugins from the Gradle Plugin Portal. */ -export default async function GradlePluginsPage() { - const locale = await getLocale(); - const text = pluginText(locale); - const catalogs = catalogText(locale); - return ( - <div className="viget-surface"> - <ViGetHeader locale={locale} /> - <main> - <section className="viget-plugin-hero"> - <div className="shell viget-plugin-grid"> - <div className="viget-hero-copy"> - <p className="eyebrow">ViGet · BUILD SYSTEM DSL PLUGINS</p> - <h1>{text.gradleTitle}</h1> - <p>{text.gradleDescription}</p> - <div className="hero-actions"> - <a - className="button button-secondary" - href="https://viget.progmasoft.com/" - > - {catalogs.backToRegistry} - </a> - <a - className="viget-text-link" - href="https://plugins.gradle.org/" - rel="noopener" - > - {text.gradlePortal} → - </a> - </div> - </div> - </div> - </section> - <section className="section" aria-labelledby="gradle-list-title"> - <div className="shell"> - <div className="section-heading"> - <div> - <h2 id="gradle-list-title" className="viget-catalog-heading"> - {text.catalogTitle} - </h2> - </div> - </div> - <div className="viget-catalog-grid"> - {gradlePlugins.map((plugin) => ( - <article key={plugin.id} className="viget-catalog-card"> - <span>Gradle</span> - <h3>{plugin.id}</h3> - <small>{plugin.description[locale]}</small> - <pre className="viget-snippet"> - <code>{plugin.usage}</code> - </pre> - <strong> - <a - href={`https://plugins.gradle.org/plugin/${plugin.id}`} - rel="noopener" - > - {text.gradlePortal} → - </a> - </strong> - </article> - ))} - </div> - </div> - </section> - </main> - <ViGetFooter locale={locale} /> - </div> - ); -} diff --git a/apps/web/app/viget/dslplugins/tazel/[publisher]/[name]/page.tsx b/apps/web/app/viget/dslplugins/tazel/[publisher]/[name]/page.tsx deleted file mode 100644 index 1da6db1..0000000 --- a/apps/web/app/viget/dslplugins/tazel/[publisher]/[name]/page.tsx +++ /dev/null @@ -1,197 +0,0 @@ -// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> -// SPDX-License-Identifier: AGPL-3.0-or-later - -import type { Metadata } from "next"; -import { notFound } from "next/navigation"; -import { ViGetFooter } from "@/components/ViGetFooter"; -import { ViGetHeader } from "@/components/ViGetHeader"; -import { getLocale } from "@/lib/locale.server"; -import { - pluginDeclaration, - pluginText, - tazelPlugin, -} from "@/lib/viget-plugins"; - -// A page shows the versions as they are published and yanked. -export const dynamic = "force-dynamic"; - -type Parameters = { params: Promise<{ publisher: string; name: string }> }; - -export async function generateMetadata({ - params, -}: Parameters): Promise<Metadata> { - const { publisher, name } = await params; - const plugin = await tazelPlugin(publisher, name); - if (!plugin) - return { title: "ViGet", robots: { index: false, follow: false } }; - return { - title: `${plugin.publisher}.${plugin.name} · Tazel DSL plugins · ViGet`, - description: plugin.description ?? undefined, - alternates: { - canonical: `https://viget.progmasoft.com/dslplugins/tazel/${plugin.publisher}/${plugin.name}`, - }, - robots: { index: true, follow: true }, - }; -} - -function formatSize(bytes: number): string { - return bytes < 1024 * 1024 - ? `${(bytes / 1024).toFixed(1)} KiB` - : `${(bytes / 1024 / 1024).toFixed(1)} MiB`; -} - -export default async function TazelPluginPage({ params }: Parameters) { - const { publisher, name } = await params; - const plugin = await tazelPlugin(publisher, name); - if (!plugin) notFound(); - const locale = await getLocale(); - const text = pluginText(locale); - const dates = new Intl.DateTimeFormat(locale, { dateStyle: "medium" }); - return ( - <div className="viget-surface"> - <ViGetHeader locale={locale} /> - <main> - <section className="viget-plugin-hero"> - <div className="shell viget-plugin-grid"> - <div className="viget-hero-copy"> - <p className="eyebrow">ViGet · TAZEL DSL PLUGIN</p> - <h1>{plugin.name}</h1> - {plugin.description ? <p>{plugin.description}</p> : null} - <div className="hero-actions"> - <a - className="button button-secondary" - href="https://viget.progmasoft.com/dslplugins/tazel" - > - {text.backToCatalog} - </a> - {plugin.homepage ? ( - <a - className="viget-text-link" - href={plugin.homepage} - rel="noopener" - > - {text.homepage} → - </a> - ) : null} - {plugin.repository ? ( - <a - className="viget-text-link" - href={plugin.repository} - rel="noopener" - > - {text.repository} → - </a> - ) : null} - </div> - </div> - <aside - className="viget-availability" - aria-labelledby="plugin-facts-title" - > - <h2 id="plugin-facts-title"> - {plugin.publisher}.{plugin.name} - </h2> - <dl> - <div> - <dt>{text.publisherLabel}</dt> - <dd>{plugin.publisher}</dd> - </div> - <div> - <dt>{text.latest}</dt> - <dd>{plugin.latestVersion}</dd> - </div> - {plugin.license ? ( - <div> - <dt>{text.license}</dt> - <dd>{plugin.license}</dd> - </div> - ) : null} - {plugin.authors.length > 0 ? ( - <div> - <dt>{text.authors}</dt> - <dd>{plugin.authors.join(", ")}</dd> - </div> - ) : null} - </dl> - </aside> - </div> - </section> - <section className="section" aria-labelledby="plugin-usage-title"> - <div className="shell"> - <div className="section-heading"> - <div> - <h2 id="plugin-usage-title" className="viget-catalog-heading"> - {text.usage} - </h2> - </div> - <p>{text.usageDescription}</p> - </div> - <pre className="viget-snippet"> - <code>{pluginDeclaration(plugin, plugin.latestVersion)}</code> - </pre> - </div> - </section> - <section - className="section section-muted" - aria-labelledby="plugin-versions-title" - > - <div className="shell"> - <div className="section-heading"> - <div> - <h2 - id="plugin-versions-title" - className="viget-catalog-heading" - > - {text.versions} - </h2> - </div> - </div> - <div className="viget-table-scroll"> - <table className="viget-versions"> - <thead> - <tr> - <th scope="col">{text.version}</th> - <th scope="col">{text.published}</th> - <th scope="col">{text.api}</th> - <th scope="col">{text.size}</th> - <th scope="col">SHA-256</th> - <th scope="col">{text.download}</th> - </tr> - </thead> - <tbody> - {plugin.versions.map((version) => ( - <tr - key={version.version} - className={version.yanked ? "viget-yanked" : undefined} - > - <td> - {version.version} - {version.yanked ? ( - <span className="viget-badge">{text.yanked}</span> - ) : null} - </td> - <td>{dates.format(new Date(version.publishedAt))}</td> - <td>{version.apiVersion}</td> - <td>{formatSize(version.size)}</td> - <td> - <code title={version.sha256}> - {version.sha256.slice(0, 16)}… - </code> - </td> - <td> - <a href={`https://viget.progmasoft.com${version.path}`}> - {plugin.name}-{version.version}.jar - </a> - </td> - </tr> - ))} - </tbody> - </table> - </div> - </div> - </section> - </main> - <ViGetFooter locale={locale} /> - </div> - ); -} diff --git a/apps/web/app/viget/dslplugins/tazel/page.tsx b/apps/web/app/viget/dslplugins/tazel/page.tsx deleted file mode 100644 index b78a8bb..0000000 --- a/apps/web/app/viget/dslplugins/tazel/page.tsx +++ /dev/null @@ -1,129 +0,0 @@ -// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> -// SPDX-License-Identifier: AGPL-3.0-or-later - -import type { Metadata } from "next"; -import { ViGetFooter } from "@/components/ViGetFooter"; -import { ViGetHeader } from "@/components/ViGetHeader"; -import { getLocale } from "@/lib/locale.server"; -import { getMessages } from "@/lib/localization"; -import { catalogText } from "@/lib/viget-catalogs"; -import { pluginText, tazelPlugins } from "@/lib/viget-plugins"; - -// The catalog changes whenever a plugin is published. -export const dynamic = "force-dynamic"; - -export async function generateMetadata(): Promise<Metadata> { - const locale = await getLocale(); - const { metadata } = getMessages(locale); - return { - title: `${catalogText(locale).tazelTitle} · ViGet`, - description: metadata.dslPluginsDescription, - alternates: { - canonical: "https://viget.progmasoft.com/dslplugins/tazel", - }, - robots: { index: true, follow: true }, - }; -} - -export default async function TazelPluginsPage() { - const locale = await getLocale(); - const { viget } = getMessages(locale); - const catalogs = catalogText(locale); - const text = pluginText(locale); - const plugins = await tazelPlugins(); - return ( - <div className="viget-surface"> - <ViGetHeader locale={locale} /> - <main> - <section className="viget-plugin-hero"> - <div className="shell viget-plugin-grid"> - <div className="viget-hero-copy"> - <p className="eyebrow">ViGet · BUILD SYSTEM DSL PLUGINS</p> - <h1>{catalogs.tazelTitle}</h1> - <p>{catalogs.tazelDescription}</p> - <div className="hero-actions"> - <a - className="button button-secondary" - href="https://viget.progmasoft.com/" - > - {catalogs.backToRegistry} - </a> - <a className="viget-text-link" href="https://tazel.net/"> - Tazel → - </a> - </div> - </div> - <aside - className="viget-availability" - aria-labelledby="plugin-availability-title" - > - <div className="viget-status"> - <span aria-hidden="true" /> - {viget.pluginAvailable} - </div> - <h2 id="plugin-availability-title"> - {plugins.length > 0 - ? text.catalogTitle - : viget.pluginEmptyTitle} - </h2> - <p> - {plugins.length > 0 - ? plugins - .map((plugin) => `${plugin.publisher}.${plugin.name}`) - .join(", ") - : viget.pluginEmptyDescription} - </p> - <code>/dslplugins/tazel/<Publisher>/<Name>/</code> - </aside> - </div> - </section> - <section className="section" aria-labelledby="plugin-list-title"> - <div className="shell"> - <div className="section-heading"> - <div> - <h2 id="plugin-list-title" className="viget-catalog-heading"> - {text.catalogTitle} - </h2> - </div> - </div> - {plugins.length === 0 ? ( - <p className="viget-plugin-empty">{text.catalogEmpty}</p> - ) : ( - <div className="viget-catalog-grid"> - {plugins.map((plugin) => ( - <a - key={`${plugin.publisher}/${plugin.name}`} - className="viget-catalog-card viget-catalog-primary" - href={`https://viget.progmasoft.com/dslplugins/tazel/${plugin.publisher}/${plugin.name}`} - > - <span>{plugin.publisher}</span> - <h3>{plugin.name}</h3> - {plugin.description ? ( - <small>{plugin.description}</small> - ) : null} - <strong> - {text.latest} {plugin.latestVersion} - {plugin.license ? ` · ${plugin.license}` : ""} → - </strong> - </a> - ))} - </div> - )} - </div> - </section> - <section className="section section-muted"> - <div className="shell viget-guidance-grid"> - {viget.guidance.map(([label, title, description]) => ( - <article key={label}> - <span>{label}</span> - <strong>{title}</strong> - <p>{description}</p> - </article> - ))} - </div> - </section> - </main> - <ViGetFooter locale={locale} /> - </div> - ); -} diff --git a/apps/web/app/viget/langs/[language]/page.tsx b/apps/web/app/viget/langs/[language]/page.tsx deleted file mode 100644 index e722439..0000000 --- a/apps/web/app/viget/langs/[language]/page.tsx +++ /dev/null @@ -1,99 +0,0 @@ -// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> -// SPDX-License-Identifier: AGPL-3.0-or-later - -import type { Metadata } from "next"; -import { notFound } from "next/navigation"; -import { ViGetFooter } from "@/components/ViGetFooter"; -import { ViGetHeader } from "@/components/ViGetHeader"; -import { getLocale } from "@/lib/locale.server"; -import { getMessages } from "@/lib/localization"; -import { - catalogText, - isLanguageSlug, - languageSlugs, -} from "@/lib/viget-catalogs"; - -type Parameters = { params: Promise<{ language: string }> }; - -// The languages are fixed; any other segment is no catalog. -export const dynamicParams = false; - -export function generateStaticParams() { - return languageSlugs.map((language) => ({ language })); -} - -export async function generateMetadata({ - params, -}: Parameters): Promise<Metadata> { - const { language } = await params; - if (!isLanguageSlug(language)) return { title: "ViGet" }; - const page = catalogText(await getLocale()).languages[language]; - return { - title: `${page.title} · ViGet`, - description: page.description, - alternates: { - canonical: `https://viget.progmasoft.com/langs/${language}`, - }, - robots: { index: true, follow: true }, - }; -} - -export default async function LanguagePackagesPage({ params }: Parameters) { - const { language } = await params; - if (!isLanguageSlug(language)) notFound(); - const locale = await getLocale(); - const { viget } = getMessages(locale); - const catalogs = catalogText(locale); - const page = catalogs.languages[language]; - return ( - <div className="viget-surface"> - <ViGetHeader locale={locale} /> - <main> - <section className="viget-plugin-hero"> - <div className="shell viget-plugin-grid"> - <div className="viget-hero-copy"> - <p className="eyebrow">ViGet · LANGUAGES</p> - <h1>{page.title}</h1> - <p>{page.description}</p> - <div className="hero-actions"> - <a - className="button button-secondary" - href="https://viget.progmasoft.com/" - > - {catalogs.backToRegistry} - </a> - </div> - </div> - <aside - className="viget-availability" - aria-labelledby="package-availability-title" - > - <div className="viget-status"> - <span aria-hidden="true" /> - {viget.available} - </div> - <h2 id="package-availability-title">{page.emptyTitle}</h2> - <p>{catalogs.languageEmptyDescription}</p> - <dl> - <div> - <dt>{viget.packageFormat}</dt> - <dd>.vipkg</dd> - </div> - <div> - <dt>{viget.publisherIdentity}</dt> - <dd>Progmasoft Account</dd> - </div> - <div> - <dt>{viget.publishing}</dt> - <dd>{viget.publishingClosed}</dd> - </div> - </dl> - <code>/langs/{language}/<Publisher>/<Name>/</code> - </aside> - </div> - </section> - </main> - <ViGetFooter locale={locale} /> - </div> - ); -} diff --git a/apps/web/app/viget/page.tsx b/apps/web/app/viget/page.tsx deleted file mode 100644 index d9d3922..0000000 --- a/apps/web/app/viget/page.tsx +++ /dev/null @@ -1,122 +0,0 @@ -// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> -// SPDX-License-Identifier: AGPL-3.0-or-later - -import type { Metadata } from "next"; -import { ViGetCatalogSection } from "@/components/ViGetCatalogSection"; -import { ViGetFooter } from "@/components/ViGetFooter"; -import { ViGetHeader } from "@/components/ViGetHeader"; -import { getLocale } from "@/lib/locale.server"; -import { getMessages } from "@/lib/localization"; -import { - buildSystemCatalogs, - buildSystemsHeading, - catalogText, - languageCatalogs, - languagesHeading, -} from "@/lib/viget-catalogs"; - -export async function generateMetadata(): Promise<Metadata> { - const { metadata } = getMessages(await getLocale()); - return { - title: metadata.vigetTitle, - description: metadata.vigetDescription, - alternates: { canonical: "https://viget.progmasoft.com/" }, - robots: { index: true, follow: true }, - }; -} - -export default async function ViGetPage() { - const locale = await getLocale(); - const { viget } = getMessages(locale); - const catalogs = catalogText(locale); - return ( - <div className="viget-surface"> - <ViGetHeader locale={locale} /> - <main> - {/* The state of the registry comes first: what it holds today and what is open. */} - <section className="viget-hero" aria-labelledby="viget-status-title"> - <div className="shell viget-hero-grid"> - <div className="viget-hero-copy"> - <p className="eyebrow">{catalogs.statusEyebrow}</p> - <h1>{viget.homeTitle}</h1> - <p>{viget.homeDescription}</p> - <div className="hero-actions"> - <a - className="button" - href="https://account.progmasoft.com/register" - > - {viget.createAccount} - </a> - <a - className="button button-secondary" - href="https://tazel.net/" - > - {viget.exploreTazel} - </a> - </div> - </div> - <aside className="viget-availability"> - <div className="viget-status"> - <span aria-hidden="true" /> - {viget.available} - </div> - <h2 id="viget-status-title">{viget.emptyTitle}</h2> - <p>{viget.emptyDescription}</p> - <dl> - <div> - <dt>{viget.packageFormat}</dt> - <dd>.vipkg</dd> - </div> - <div> - <dt>{viget.publisherIdentity}</dt> - <dd>Progmasoft Account</dd> - </div> - <div> - <dt>{viget.publishing}</dt> - <dd>{viget.publishingClosed}</dd> - </div> - </dl> - </aside> - </div> - </section> - - <ViGetCatalogSection - id="languages" - heading={languagesHeading} - description={catalogs.languagesDescription} - catalogs={languageCatalogs} - locale={locale} - muted - /> - <ViGetCatalogSection - id="build-systems" - heading={buildSystemsHeading} - description={catalogs.buildSystemsDescription} - catalogs={buildSystemCatalogs} - locale={locale} - /> - - <section className="section section-muted viget-contract"> - <div className="shell viget-contract-grid"> - <div> - <p className="eyebrow">{viget.contractEyebrow}</p> - <h2>{viget.contractTitle}</h2> - </div> - <ol> - {viget.principles.map(([title, description], index) => ( - <li key={title}> - <span>{String(index + 1).padStart(2, "0")}</span> - <div> - <strong>{title}</strong> - <p>{description}</p> - </div> - </li> - ))} - </ol> - </div> - </section> - </main> - <ViGetFooter locale={locale} /> - </div> - ); -} diff --git a/apps/web/components/DashboardClient.tsx b/apps/web/components/DashboardClient.tsx index 2442f65..f7ddb5d 100644 --- a/apps/web/components/DashboardClient.tsx +++ b/apps/web/components/DashboardClient.tsx @@ -122,7 +122,6 @@ export function DashboardClient({ {dashboard.overview} </a> <a href="#security">{dashboard.security}</a> - <a href="#services">{dashboard.services}</a> </nav> <div className="dashboard-sidebar-preferences"> <PreferenceControls locale={locale} labels={navigation} /> @@ -148,10 +147,6 @@ export function DashboardClient({ <dt>{dashboard.accountName}</dt> <dd>{account.accountName}</dd> </div> - <div> - <dt>{dashboard.publisherName}</dt> - <dd>{account.accountName}</dd> - </div> <div> <dt>{dashboard.email}</dt> <dd>{account.email}</dd> @@ -172,22 +167,6 @@ export function DashboardClient({ {dashboard.changePassword} </button> </section> - <section className="dashboard-card dashboard-card-wide" id="services"> - <span className="card-kicker">{dashboard.services}</span> - <h2>{dashboard.products}</h2> - <div className="service-row"> - <div> - <strong>ViGet Package Registry</strong> - <span> - {dashboard.publisherPrefix}: {account.accountName} ( - {dashboard.sameAccount}) - </span> - </div> - <span className="status-badge status-planned"> - {dashboard.planned} - </span> - </div> - </section> </div> </main> </div> diff --git a/apps/web/components/ViGetCatalogSection.tsx b/apps/web/components/ViGetCatalogSection.tsx deleted file mode 100644 index f62fbfe..0000000 --- a/apps/web/components/ViGetCatalogSection.tsx +++ /dev/null @@ -1,69 +0,0 @@ -// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> -// SPDX-License-Identifier: AGPL-3.0-or-later - -import type { Locale } from "@/lib/localization"; -import { catalogText, type Catalog } from "@/lib/viget-catalogs"; - -/** - * One group of catalogs on the ViGet home page. An open catalog is a link to its page; a catalog - * that is not offered yet is a disabled button: gray, not pressable and leading nowhere. - */ -export function ViGetCatalogSection({ - id, - heading, - description, - catalogs, - locale, - muted = false, -}: { - id: string; - heading: string; - description: string; - catalogs: readonly Catalog[]; - locale: Locale; - muted?: boolean; -}) { - const text = catalogText(locale); - return ( - <section - className={muted ? "section section-muted" : "section"} - aria-labelledby={`${id}-title`} - > - <div className="shell"> - <div className="section-heading"> - <div> - <h2 id={`${id}-title`} className="viget-catalog-heading"> - {heading} - </h2> - </div> - <p>{description}</p> - </div> - <div className="viget-catalog-grid"> - {catalogs.map((catalog) => - catalog.path ? ( - <a - key={catalog.name} - className="viget-catalog-card viget-catalog-primary" - href={`https://viget.progmasoft.com${catalog.path}`} - > - <h3>{catalog.name}</h3> - <small>{text.holds[catalog.name]}</small> - <strong>{text.open} →</strong> - </a> - ) : ( - <button - key={catalog.name} - className="viget-catalog-card viget-catalog-disabled" - type="button" - disabled - > - <h3>{catalog.name}</h3> - <small>{text.notAvailable}</small> - </button> - ), - )} - </div> - </div> - </section> - ); -} diff --git a/apps/web/components/ViGetFooter.tsx b/apps/web/components/ViGetFooter.tsx deleted file mode 100644 index a6f1b65..0000000 --- a/apps/web/components/ViGetFooter.tsx +++ /dev/null @@ -1,39 +0,0 @@ -// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> -// SPDX-License-Identifier: AGPL-3.0-or-later - -import { Brand } from "./Brand"; -import { getMessages, type Locale } from "@/lib/localization"; - -export function ViGetFooter({ locale }: { locale: Locale }) { - const { viget } = getMessages(locale); - return ( - <footer className="site-footer viget-footer"> - <div className="shell footer-grid"> - <div> - <Brand /> - <p>{viget.footerDescription}</p> - </div> - <div> - <strong>{viget.registry}</strong> - <a href="https://viget.progmasoft.com/#languages-title"> - {viget.packages} - </a> - <a href="https://viget.progmasoft.com/dslplugins/tazel"> - {viget.dslPlugins} - </a> - <a href="https://tazel.net/">Tazel</a> - </div> - <div> - <strong>Progmasoft</strong> - <a href="https://account.progmasoft.com/">{viget.account}</a> - <a href="mailto:support@progmasoft.com">{viget.support}</a> - <a href="https://github.com/Progmasoft/progmaweb">{viget.source}</a> - </div> - </div> - <div className="shell footer-bottom"> - <span>© 2026 Progmasoft</span> - <span>{viget.footerClosing}</span> - </div> - </footer> - ); -} diff --git a/apps/web/components/ViGetHeader.tsx b/apps/web/components/ViGetHeader.tsx deleted file mode 100644 index 796ffa1..0000000 --- a/apps/web/components/ViGetHeader.tsx +++ /dev/null @@ -1,42 +0,0 @@ -// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> -// SPDX-License-Identifier: AGPL-3.0-or-later - -import Link from "next/link"; -import { getMessages, type Locale } from "@/lib/localization"; -import { Brand } from "./Brand"; -import { HeaderMenu } from "./HeaderMenu"; -import { PreferenceControls } from "./PreferenceControls"; - -export function ViGetHeader({ locale }: { locale: Locale }) { - const { navigation, viget } = getMessages(locale); - return ( - <header className="site-header viget-header"> - <div className="shell header-inner"> - <div className="viget-brand-lockup"> - <Brand /> - <span>ViGet</span> - </div> - <HeaderMenu - closeLabel={navigation.closeMenu} - label={viget.navigationLabel} - menuLabel={navigation.menu} - > - <Link href="https://viget.progmasoft.com/#languages-title"> - {viget.packages} - </Link> - <Link href="https://viget.progmasoft.com/dslplugins/tazel"> - {viget.dslPlugins} - </Link> - <Link href="https://account.progmasoft.com/login">{viget.login}</Link> - <Link - className="button button-small" - href="https://account.progmasoft.com/register" - > - {viget.register} - </Link> - <PreferenceControls locale={locale} labels={navigation} /> - </HeaderMenu> - </div> - </header> - ); -} diff --git a/apps/web/e2e/languages.spec.ts b/apps/web/e2e/languages.spec.ts index 7c616ef..fa6f518 100644 --- a/apps/web/e2e/languages.spec.ts +++ b/apps/web/e2e/languages.spec.ts @@ -17,7 +17,7 @@ test("a visitor who chose French reads the site in French", async ({ ]); await page.goto("http://progmasoft.com/"); await expect(page.locator("html")).toHaveAttribute("lang", "fr-FR"); - await page.goto("http://viget.progmasoft.com/nope"); + await page.goto("http://product.progmasoft.com/nope"); await expect(page.locator("h1")).toHaveText( "Nous sommes désolés, la page demandée est introuvable.", ); diff --git a/apps/web/e2e/layout.spec.ts b/apps/web/e2e/layout.spec.ts index 984069a..fe8eb35 100644 --- a/apps/web/e2e/layout.spec.ts +++ b/apps/web/e2e/layout.spec.ts @@ -109,7 +109,7 @@ for (const locale of locales) { // can be narrower than the text that spills out of it. const parts = [ ...element.querySelectorAll( - ".brand-name, .brand-product, .viget-brand-lockup > span, .menu-toggle, .primary-nav > *", + ".brand-name, .brand-product, .menu-toggle, .primary-nav > *", ), ] .map((part) => ({ part, box: part.getBoundingClientRect() })) diff --git a/apps/web/e2e/not-found.spec.ts b/apps/web/e2e/not-found.spec.ts index 7be30f5..7e8973c 100644 --- a/apps/web/e2e/not-found.spec.ts +++ b/apps/web/e2e/not-found.spec.ts @@ -6,7 +6,6 @@ import { expect, test } from "@playwright/test"; const hosts = [ "progmasoft.com", "account.progmasoft.com", - "viget.progmasoft.com", "product.progmasoft.com", ]; @@ -44,7 +43,7 @@ test("the page of an unknown address speaks the visitor's language", async ({ path: "/", }, ]); - await page.goto("http://viget.progmasoft.com/nope"); + await page.goto("http://product.progmasoft.com/nope"); await expect(page.locator("h1")).toHaveText( "Es tut uns leid, die angeforderte Seite wurde nicht gefunden.", ); diff --git a/apps/web/e2e/pages.ts b/apps/web/e2e/pages.ts index 9e6b841..a0c4335 100644 --- a/apps/web/e2e/pages.ts +++ b/apps/web/e2e/pages.ts @@ -9,9 +9,6 @@ export const layoutPages = [ "account.progmasoft.com/", "account.progmasoft.com/login", "account.progmasoft.com/register", - "viget.progmasoft.com/", - "viget.progmasoft.com/langs/cpp", - "viget.progmasoft.com/dslplugins/tazel", "product.progmasoft.com/", "product.progmasoft.com/categories", "product.progmasoft.com/languages", diff --git a/apps/web/e2e/preferences.spec.ts b/apps/web/e2e/preferences.spec.ts index cc2bdce..91be994 100644 --- a/apps/web/e2e/preferences.spec.ts +++ b/apps/web/e2e/preferences.spec.ts @@ -32,7 +32,6 @@ test("a theme chosen on progmasoft.com holds on the other hosts", async ({ await page.locator(".preference-controls button").click(); expect(await theme(page)).toBe("dark"); for (const host of [ - "viget.progmasoft.com/", "account.progmasoft.com/", "product.progmasoft.com/", ]) { @@ -50,7 +49,7 @@ test("a language chosen on progmasoft.com holds on the other hosts", async ({ await open(page, "progmasoft.com/"); await page.locator(".preference-controls select").selectOption("de-DE"); await expect(page.locator("html")).toHaveAttribute("lang", "de-DE"); - for (const host of ["viget.progmasoft.com/", "product.progmasoft.com/"]) { + for (const host of ["product.progmasoft.com/"]) { await open(page, host); await expect(page.locator("html"), host).toHaveAttribute("lang", "de-DE"); } @@ -65,7 +64,7 @@ test("a theme of an earlier version in localStorage moves into the shared cookie }); await open(page, "account.progmasoft.com/"); expect(await theme(page)).toBe("dark"); - await open(page, "viget.progmasoft.com/"); + await open(page, "product.progmasoft.com/"); expect(await theme(page)).toBe("dark"); }); @@ -77,7 +76,7 @@ test("a cookie of one host does not shadow the shared language", async ({ { name: "progmasoft_locale", value: "ru-RU", - url: "http://viget.progmasoft.com/", + url: "http://product.progmasoft.com/", }, { name: "progmasoft_locale", @@ -86,10 +85,10 @@ test("a cookie of one host does not shadow the shared language", async ({ path: "/", }, ]); - await open(page, "viget.progmasoft.com/"); - await open(page, "viget.progmasoft.com/"); + await open(page, "product.progmasoft.com/"); + await open(page, "product.progmasoft.com/"); await expect(page.locator("html")).toHaveAttribute("lang", "de-DE"); - const left = (await context.cookies("http://viget.progmasoft.com/")).filter( + const left = (await context.cookies("http://product.progmasoft.com/")).filter( (cookie) => cookie.name === "progmasoft_locale", ); expect(left.map((cookie) => cookie.domain)).toEqual([".progmasoft.com"]); diff --git a/apps/web/lib/credentials-messages.ts b/apps/web/lib/credentials-messages.ts index f7e88b2..587f12b 100644 --- a/apps/web/lib/credentials-messages.ts +++ b/apps/web/lib/credentials-messages.ts @@ -165,7 +165,7 @@ export const credentialsMessages: Record<Locale, CredentialsMessages> = { eyebrow: "OAuth 2.1 · OpenID Connect", title: "Sign in with Progmasoft", description: - "Let people sign in to your application with their Progmasoft account and, with their consent, act on ViGet for them. Any developer can make a token.", + "Let people sign in to your application with their Progmasoft account. Any developer can make a token.", signedOut: "Sign in to make OAuth 2.1 tokens for your applications or to review the applications you have allowed.", developersText: "Make and manage the tokens of your applications.", @@ -285,9 +285,6 @@ export const credentialsMessages: Record<Locale, CredentialsMessages> = { account: "Know which Progmasoft account you use.", profile: "Read your Progmasoft account name.", email: "Read the email address you sign in and registered with.", - "viget.packages.read": "Read the packages you have published on ViGet.", - "viget.packages.publish": "Publish packages to ViGet under your account.", - "viget.packages.yank": "Yank packages you have published on ViGet.", offline_access: "Keep this access when you are not using the application.", }, @@ -348,7 +345,7 @@ export const credentialsMessages: Record<Locale, CredentialsMessages> = { eyebrow: "OAuth 2.1 · OpenID Connect", title: "Mit Progmasoft anmelden", description: - "Lassen Sie Menschen sich mit ihrem Progmasoft-Konto bei Ihrer Anwendung anmelden und mit ihrer Zustimmung auf ViGet für sie handeln. Jede Entwicklerin und jeder Entwickler kann ein Token erstellen.", + "Lassen Sie Menschen sich mit ihrem Progmasoft-Konto bei Ihrer Anwendung anmelden. Jede Entwicklerin und jeder Entwickler kann ein Token erstellen.", signedOut: "Melden Sie sich an, um OAuth-2.1-Tokens für Ihre Anwendungen zu erstellen oder die Anwendungen zu prüfen, denen Sie Zugriff erlaubt haben.", developersText: "Tokens Ihrer Anwendungen erstellen und verwalten.", @@ -470,12 +467,6 @@ export const credentialsMessages: Record<Locale, CredentialsMessages> = { profile: "Ihren Progmasoft-Kontonamen lesen.", email: "Die E-Mail-Adresse lesen, mit der Sie sich angemeldet und registriert haben.", - "viget.packages.read": - "Die Pakete lesen, die Sie auf ViGet veröffentlicht haben.", - "viget.packages.publish": - "Pakete unter Ihrem Konto auf ViGet veröffentlichen.", - "viget.packages.yank": - "Pakete zurückziehen, die Sie auf ViGet veröffentlicht haben.", offline_access: "Diesen Zugriff behalten, wenn Sie die Anwendung nicht verwenden.", }, @@ -536,7 +527,7 @@ export const credentialsMessages: Record<Locale, CredentialsMessages> = { eyebrow: "OAuth 2.1 · OpenID Connect", title: "Вход через Progmasoft", description: - "Позвольте людям входить в ваше приложение с аккаунтом Progmasoft и с их согласия действовать от их имени в ViGet. Создать токен может любой разработчик.", + "Позвольте людям входить в ваше приложение с аккаунтом Progmasoft. Создать токен может любой разработчик.", signedOut: "Войдите, чтобы создавать токены OAuth 2.1 для своих приложений или просмотреть приложения, которым вы дали доступ.", developersText: "Создавайте токены своих приложений и управляйте ими.", @@ -660,11 +651,6 @@ export const credentialsMessages: Record<Locale, CredentialsMessages> = { profile: "Видеть имя вашего аккаунта Progmasoft.", email: "Видеть адрес электронной почты, с которым вы входите и регистрировались.", - "viget.packages.read": "Видеть пакеты, которые вы опубликовали в ViGet.", - "viget.packages.publish": - "Публиковать пакеты в ViGet от имени вашего аккаунта.", - "viget.packages.yank": - "Отзывать (yank) пакеты, которые вы опубликовали в ViGet.", offline_access: "Сохранять этот доступ, когда вы не пользуетесь приложением.", }, @@ -724,7 +710,7 @@ export const credentialsMessages: Record<Locale, CredentialsMessages> = { eyebrow: "OAuth 2.1 · OpenID Connect", title: "Se connecter avec Progmasoft", description: - "Permettez aux gens de se connecter à votre application avec leur compte Progmasoft et, avec leur consentement, d’agir sur ViGet en leur nom. Tout développeur peut créer un jeton.", + "Permettez aux gens de se connecter à votre application avec leur compte Progmasoft. Tout développeur peut créer un jeton.", signedOut: "Connectez-vous pour créer des jetons OAuth 2.1 pour vos applications ou pour revoir les applications que vous avez autorisées.", developersText: "Créez et gérez les jetons de vos applications.", @@ -849,12 +835,6 @@ export const credentialsMessages: Record<Locale, CredentialsMessages> = { profile: "Lire le nom de votre compte Progmasoft.", email: "Lire l’adresse e-mail avec laquelle vous vous connectez et vous êtes inscrit.", - "viget.packages.read": - "Lire les paquets que vous avez publiés sur ViGet.", - "viget.packages.publish": - "Publier des paquets sur ViGet sous votre compte.", - "viget.packages.yank": - "Retirer des paquets que vous avez publiés sur ViGet.", offline_access: "Conserver cet accès lorsque vous n’utilisez pas l’application.", }, diff --git a/apps/web/lib/credentials.ts b/apps/web/lib/credentials.ts index b90bb6d..1e8dfa3 100644 --- a/apps/web/lib/credentials.ts +++ b/apps/web/lib/credentials.ts @@ -33,9 +33,6 @@ export function signsPeopleIn(kind: ApplicationKind): boolean { export const oauthScopes = [ "profile", "email", - "viget.packages.read", - "viget.packages.publish", - "viget.packages.yank", "offline_access", ] as const; export type OAuthScope = (typeof oauthScopes)[number]; diff --git a/apps/web/lib/llms.ts b/apps/web/lib/llms.ts index 40de69a..ce2b329 100644 --- a/apps/web/lib/llms.ts +++ b/apps/web/lib/llms.ts @@ -40,10 +40,7 @@ ${projects.join("\n")} ## Services -- [Progmasoft Account](https://account.progmasoft.com/): one account for the services of Progmasoft; its name is also - the publisher name on ViGet. -- [ViGet](https://viget.progmasoft.com/): the package registry of Progmasoft, for C, C++ and Objective-C packages and - for the DSL plugins of build systems. +- [Progmasoft Account](https://account.progmasoft.com/): one account for the services of Progmasoft. - [Progmasoft Console](https://console.progmasoft.com/): OAuth 2.1 and OpenID Connect clients for applications that sign people in with their Progmasoft Account. - [Progmasoft Git](https://git.progmasoft.com/): read-only mirrors of the public repositories; issues and pull diff --git a/apps/web/lib/localization.ts b/apps/web/lib/localization.ts index 3a233f8..284afc0 100644 --- a/apps/web/lib/localization.ts +++ b/apps/web/lib/localization.ts @@ -145,12 +145,6 @@ export const messages = { recoveryTitle: "Recover your account", recoveryDescription: "Get help regaining access to a Progmasoft account.", dashboardTitle: "Dashboard", - vigetTitle: "ViGet Package Registry by Progmasoft", - vigetDescription: - "The package registry for C, C++ and Objective-C is online, but no packages have been published yet.", - dslPluginsTitle: "DSL Plugins · ViGet Package Registry by Progmasoft", - dslPluginsDescription: - "The ViGet Kotlin DSL plugin catalog is online, but no plugins have been published yet.", }, navigation: { primary: "Primary navigation", @@ -197,7 +191,7 @@ export const messages = { identity: [ [ "Account name", - "Your durable public identity and ViGet publisher name", + "Your durable public identity", ], ["Email", "Recovery and security notices"], ["Session", "Secure, revocable browser access"], @@ -209,7 +203,7 @@ export const messages = { ], [ "Predictable names", - "Canonical account names prevent ambiguous URLs and case-only impersonation. ViGet uses this exact name as the package publisher; it does not create a second identity.", + "Canonical account names prevent ambiguous URLs and case-only impersonation.", ], [ "Service boundaries", @@ -293,7 +287,6 @@ export const messages = { navigation: "Dashboard navigation", overview: "Overview", security: "Security", - services: "Services", signOut: "Sign out", eyebrow: "Account overview", welcome: "Welcome", @@ -301,101 +294,12 @@ export const messages = { profile: "Profile", identity: "Account identity", accountName: "Account name", - publisherName: "ViGet publisher name", email: "Email", created: "Created", passwordSessions: "Password and sessions", securityDescription: "Your browser uses an HttpOnly secure session cookie. Session secrets are never stored as plaintext.", changePassword: "Change password", - products: "Connected Progmasoft products", - publisherPrefix: "Publisher name", - sameAccount: "your Account name", - planned: "Planned", - }, - viget: { - navigationLabel: "Registry navigation", - packages: "Packages", - dslPlugins: "DSL plugins", - account: "Account", - login: "Log in", - register: "Register", - homeEyebrow: "ViGet package registry", - homeTitle: "Packages for C, C++ and Objective-C.", - homeDescription: - "ViGet is the canonical source for C, C++ and Objective-C packages and for the DSL plugins of build systems, operated directly by Progmasoft.", - createAccount: "Create account", - exploreTazel: "Explore Tazel", - available: "Registry available", - emptyTitle: "The public catalog is empty.", - emptyDescription: - "No package releases have been published yet. ViGet will show real packages here as they become available.", - packageFormat: "Package format", - publisherIdentity: "Publisher identity", - publishing: "Publishing", - publishingClosed: "Not open yet", - catalogsEyebrow: "Catalogs", - catalogsTitle: "Two artifact types, one registry.", - catalogsDescription: - "Packages and project DSL plugins have separate, predictable coordinate spaces.", - languagePackages: "Packages", - vipkgCatalog: "ViPkg catalog", - vipkgDescription: - "Libraries and applications in C, C++ and Objective-C, distributed as .vipkg artifacts.", - projectExtensions: "Project extensions", - kotlinPlugins: "Kotlin DSL plugins", - kotlinDescription: - "Kotlin JAR plugins that extend the project file of Tazel.", - openCatalog: "Open catalog", - contractEyebrow: "Registry contract", - contractTitle: "Clear ownership from identity to artifact.", - principles: [ - [ - "One account name", - "Your Progmasoft Account name is also your ViGet publisher name.", - ], - [ - "Case-sensitive coordinates", - "Publisher and package names retain their exact public spelling.", - ], - [ - "No placeholder releases", - "The catalog stays honestly empty until a real signed artifact is published.", - ], - ], - pluginEyebrow: "ViGet · Kotlin DSL plugins", - pluginTitle: "Extend the project model.", - pluginDescription: - "Kotlin DSL plugins are JAR artifacts for the project file of Tazel. They are separate from .vipkg packages.", - backToPackages: "Back to packages", - followDevelopment: "Follow development", - pluginAvailable: "Catalog available", - pluginEmptyTitle: "No public DSL plugins yet.", - pluginEmptyDescription: - "The catalog is ready and intentionally contains no placeholder artifacts.", - guidance: [ - [ - "Format", - "Kotlin JAR", - "DSL plugins run as Kotlin/JVM project extensions.", - ], - [ - "Location", - "Dedicated catalog", - "Plugin coordinates always begin with /dslplugins/tazel.", - ], - [ - "Availability", - "Progmasoft first", - "Progmasoft publishes the first plugins; publishing opens to every account later.", - ], - ], - footerDescription: - "ViGet is the registry of packages for C, C++ and Objective-C and of Kotlin DSL plugins.", - registry: "Registry", - support: "Support", - source: "Source", - footerClosing: "ViGet Package Registry by Progmasoft", }, }, "de-DE": { @@ -411,12 +315,6 @@ export const messages = { recoveryDescription: "Erhalten Sie Hilfe beim Wiederherstellen des Zugriffs auf ein Progmasoft-Konto.", dashboardTitle: "Kontoübersicht", - vigetTitle: "ViGet-Paketregistrierung von Progmasoft", - vigetDescription: - "Die Paketregistrierung für C, C++ und Objective-C ist online, enthält aber noch keine veröffentlichten Pakete.", - dslPluginsTitle: "DSL-Plugins · ViGet-Paketregistrierung von Progmasoft", - dslPluginsDescription: - "Der ViGet-Katalog für Kotlin-DSL-Plugins ist online, enthält aber noch keine veröffentlichten Plugins.", }, navigation: { primary: "Hauptnavigation", @@ -464,7 +362,7 @@ export const messages = { identity: [ [ "Kontoname", - "Ihre beständige öffentliche Identität und Ihr ViGet-Publishername", + "Ihre beständige öffentliche Identität", ], ["E-Mail", "Wiederherstellungs- und Sicherheitshinweise"], ["Sitzung", "Sicherer, widerrufbarer Browserzugriff"], @@ -476,7 +374,7 @@ export const messages = { ], [ "Eindeutige Namen", - "Kanonische Kontonamen verhindern mehrdeutige URLs und Nachahmung nur durch Groß-/Kleinschreibung. ViGet verwendet exakt diesen Namen als Publisher und erstellt keine zweite Identität.", + "Kanonische Kontonamen verhindern mehrdeutige URLs und Nachahmung nur durch Groß-/Kleinschreibung.", ], [ "Klare Dienstgrenzen", @@ -562,7 +460,6 @@ export const messages = { navigation: "Navigation der Kontoübersicht", overview: "Übersicht", security: "Sicherheit", - services: "Dienste", signOut: "Abmelden", eyebrow: "Kontoübersicht", welcome: "Willkommen", @@ -571,101 +468,12 @@ export const messages = { profile: "Profil", identity: "Kontoidentität", accountName: "Kontoname", - publisherName: "ViGet-Publishername", email: "E-Mail", created: "Erstellt", passwordSessions: "Passwort und Sitzungen", securityDescription: "Ihr Browser verwendet ein sicheres HttpOnly-Sitzungs-Cookie. Sitzungsgeheimnisse werden niemals im Klartext gespeichert.", changePassword: "Passwort ändern", - products: "Verbundene Progmasoft-Produkte", - publisherPrefix: "Publishername", - sameAccount: "Ihr Kontoname", - planned: "Geplant", - }, - viget: { - navigationLabel: "Navigation der Paketregistrierung", - packages: "Pakete", - dslPlugins: "DSL-Plugins", - account: "Konto", - login: "Anmelden", - register: "Registrieren", - homeEyebrow: "ViGet-Paketregistrierung", - homeTitle: "Pakete für C, C++ und Objective-C.", - homeDescription: - "ViGet ist die kanonische Quelle für Pakete in C, C++ und Objective-C und für die DSL-Plugins von Build-Systemen und wird direkt von Progmasoft betrieben.", - createAccount: "Konto erstellen", - exploreTazel: "Tazel entdecken", - available: "Paketregistrierung verfügbar", - emptyTitle: "Der öffentliche Katalog ist leer.", - emptyDescription: - "Es wurden noch keine Pakete veröffentlicht. ViGet zeigt hier echte Pakete, sobald sie verfügbar sind.", - packageFormat: "Paketformat", - publisherIdentity: "Publisher-Identität", - publishing: "Veröffentlichung", - publishingClosed: "Noch nicht geöffnet", - catalogsEyebrow: "Kataloge", - catalogsTitle: "Zwei Artefakttypen, eine Paketregistrierung.", - catalogsDescription: - "Pakete und Projekt-DSL-Plugins besitzen getrennte, vorhersehbare Koordinatenräume.", - languagePackages: "Pakete", - vipkgCatalog: "ViPkg-Katalog", - vipkgDescription: - "Bibliotheken und Anwendungen in C, C++ und Objective-C, verteilt als .vipkg-Artefakte.", - projectExtensions: "Projekterweiterungen", - kotlinPlugins: "Kotlin-DSL-Plugins", - kotlinDescription: - "Kotlin-JAR-Plugins, die die Projektdatei von Tazel erweitern.", - openCatalog: "Katalog öffnen", - contractEyebrow: "Vertrag der Paketregistrierung", - contractTitle: "Klare Zuständigkeit von der Identität bis zum Artefakt.", - principles: [ - [ - "Ein Kontoname", - "Ihr Progmasoft-Kontoname ist zugleich Ihr ViGet-Publishername.", - ], - [ - "Groß-/Kleinschreibung in Koordinaten", - "Publisher- und Paketnamen behalten ihre exakte öffentliche Schreibweise.", - ], - [ - "Keine Platzhalter-Releases", - "Der Katalog bleibt ehrlich leer, bis ein echtes signiertes Artefakt veröffentlicht wird.", - ], - ], - pluginEyebrow: "ViGet · Kotlin-DSL-Plugins", - pluginTitle: "Das Projektmodell erweitern.", - pluginDescription: - "Kotlin-DSL-Plugins sind JAR-Artefakte für die Projektdatei von Tazel. Sie sind von .vipkg-Paketen getrennt.", - backToPackages: "Zurück zu den Paketen", - followDevelopment: "Entwicklung verfolgen", - pluginAvailable: "Katalog verfügbar", - pluginEmptyTitle: "Noch keine öffentlichen DSL-Plugins.", - pluginEmptyDescription: - "Der Katalog ist bereit und enthält absichtlich keine Platzhalter-Artefakte.", - guidance: [ - [ - "Format", - "Kotlin JAR", - "DSL-Plugins werden als Kotlin/JVM-Projekterweiterungen ausgeführt.", - ], - [ - "Ort", - "Eigener Katalog", - "Plugin-Koordinaten beginnen immer mit /dslplugins/tazel.", - ], - [ - "Verfügbarkeit", - "Zuerst Progmasoft", - "Progmasoft veröffentlicht die ersten Plugins; später öffnet die Veröffentlichung für jedes Konto.", - ], - ], - footerDescription: - "ViGet ist die Registrierung für Pakete in C, C++ und Objective-C und für Kotlin-DSL-Plugins.", - registry: "Paketregistrierung", - support: "Support", - source: "Quellcode", - footerClosing: "ViGet-Paketregistrierung von Progmasoft", }, }, "ru-RU": { @@ -681,12 +489,6 @@ export const messages = { recoveryDescription: "Получите помощь в восстановлении доступа к аккаунту Progmasoft.", dashboardTitle: "Панель управления", - vigetTitle: "Реестр пакетов ViGet от Progmasoft", - vigetDescription: - "Реестр пакетов для C, C++ и Objective-C работает, но опубликованных пакетов пока нет.", - dslPluginsTitle: "DSL-плагины · Реестр пакетов ViGet от Progmasoft", - dslPluginsDescription: - "Каталог Kotlin DSL-плагинов ViGet работает, но опубликованных плагинов пока нет.", }, navigation: { primary: "Основная навигация", @@ -735,7 +537,7 @@ export const messages = { identity: [ [ "Имя аккаунта", - "Ваше постоянное публичное имя и имя издателя в ViGet", + "Ваше постоянное публичное имя", ], ["Эл. почта", "Восстановление и уведомления безопасности"], ["Сеанс", "Защищённый отзываемый доступ из браузера"], @@ -747,7 +549,7 @@ export const messages = { ], [ "Предсказуемые имена", - "Канонические имена аккаунтов исключают неоднозначные URL и подмену имени, отличающегося только регистром. ViGet использует именно это имя как издателя пакетов и не создаёт вторую учётную запись.", + "Канонические имена аккаунтов исключают неоднозначные URL и подмену имени, отличающегося только регистром.", ], [ "Границы сервисов", @@ -832,7 +634,6 @@ export const messages = { navigation: "Навигация панели управления", overview: "Обзор", security: "Безопасность", - services: "Сервисы", signOut: "Выйти", eyebrow: "Обзор аккаунта", welcome: "Добро пожаловать", @@ -841,101 +642,12 @@ export const messages = { profile: "Профиль", identity: "Учётная запись", accountName: "Имя аккаунта", - publisherName: "Имя издателя в ViGet", email: "Эл. почта", created: "Создан", passwordSessions: "Пароль и сеансы", securityDescription: "Ваш браузер использует защищённый сеансовый cookie с флагом HttpOnly. Секреты сеансов никогда не хранятся в открытом виде.", changePassword: "Сменить пароль", - products: "Подключённые продукты Progmasoft", - publisherPrefix: "Имя издателя", - sameAccount: "ваше имя аккаунта", - planned: "Запланировано", - }, - viget: { - navigationLabel: "Навигация реестра", - packages: "Пакеты", - dslPlugins: "DSL-плагины", - account: "Аккаунт", - login: "Войти", - register: "Регистрация", - homeEyebrow: "Реестр пакетов ViGet", - homeTitle: "Пакеты для C, C++ и Objective-C.", - homeDescription: - "ViGet — канонический источник пакетов для C, C++ и Objective-C и DSL-плагинов систем сборки, которым напрямую управляет Progmasoft.", - createAccount: "Создать аккаунт", - exploreTazel: "Подробнее о Tazel", - available: "Реестр доступен", - emptyTitle: "Публичный каталог пуст.", - emptyDescription: - "Ни один выпуск пакета пока не опубликован. ViGet покажет здесь настоящие пакеты, когда они появятся.", - packageFormat: "Формат пакета", - publisherIdentity: "Имя издателя", - publishing: "Публикация", - publishingClosed: "Пока не открыта", - catalogsEyebrow: "Каталоги", - catalogsTitle: "Два вида артефактов, один реестр.", - catalogsDescription: - "У пакетов и DSL-плагинов проектов отдельные предсказуемые пространства координат.", - languagePackages: "Пакеты", - vipkgCatalog: "Каталог ViPkg", - vipkgDescription: - "Библиотеки и приложения на C, C++ и Objective-C распространяются как артефакты .vipkg.", - projectExtensions: "Расширения проектов", - kotlinPlugins: "Kotlin DSL-плагины", - kotlinDescription: - "Плагины в виде Kotlin JAR, расширяющие файл проекта Tazel.", - openCatalog: "Открыть каталог", - contractEyebrow: "Контракт реестра", - contractTitle: "Ясная ответственность от учётной записи до артефакта.", - principles: [ - [ - "Одно имя аккаунта", - "Имя вашего аккаунта Progmasoft — это и ваше имя издателя в ViGet.", - ], - [ - "Координаты с учётом регистра", - "Имена издателей и пакетов сохраняют точное публичное написание.", - ], - [ - "Никаких выпусков-заглушек", - "Каталог честно остаётся пустым, пока не опубликован настоящий подписанный артефакт.", - ], - ], - pluginEyebrow: "ViGet · Kotlin DSL-плагины", - pluginTitle: "Расширяйте модель проекта.", - pluginDescription: - "Kotlin DSL-плагины — это JAR-артефакты для файла проекта Tazel. Они отделены от пакетов в формате .vipkg.", - backToPackages: "Назад к пакетам", - followDevelopment: "Следить за разработкой", - pluginAvailable: "Каталог доступен", - pluginEmptyTitle: "Публичных DSL-плагинов пока нет.", - pluginEmptyDescription: - "Каталог готов и намеренно не содержит артефактов-заглушек.", - guidance: [ - [ - "Формат", - "Kotlin JAR", - "DSL-плагины работают как расширения проектов на Kotlin/JVM.", - ], - [ - "Расположение", - "Отдельный каталог", - "Координаты плагинов всегда начинаются с /dslplugins/tazel.", - ], - [ - "Доступность", - "Сначала Progmasoft", - "Первые плагины публикует Progmasoft; позже публикация откроется для всех учётных записей.", - ], - ], - footerDescription: - "ViGet — реестр пакетов для C, C++ и Objective-C и Kotlin DSL-плагинов.", - registry: "Реестр", - support: "Поддержка", - source: "Исходный код", - footerClosing: "Реестр пакетов ViGet от Progmasoft", }, }, "fr-FR": { @@ -951,13 +663,6 @@ export const messages = { recoveryDescription: "Obtenez de l’aide pour retrouver l’accès à un compte Progmasoft.", dashboardTitle: "Tableau de bord", - vigetTitle: "ViGet, le registre de paquets de Progmasoft", - vigetDescription: - "Le registre de paquets pour C, C++ et Objective-C est en ligne, mais aucun paquet n’a encore été publié.", - dslPluginsTitle: - "Plugins DSL · ViGet, le registre de paquets de Progmasoft", - dslPluginsDescription: - "Le catalogue des plugins DSL Kotlin de ViGet est en ligne, mais aucun plugin n’a encore été publié.", }, navigation: { primary: "Navigation principale", @@ -1005,7 +710,7 @@ export const messages = { identity: [ [ "Nom de compte", - "Votre identité publique durable et votre nom d’éditeur ViGet", + "Votre identité publique durable", ], ["E-mail", "Récupération et avis de sécurité"], ["Session", "Accès navigateur sécurisé et révocable"], @@ -1017,7 +722,7 @@ export const messages = { ], [ "Des noms prévisibles", - "Les noms de compte canoniques évitent les URL ambiguës et l’usurpation par la seule casse. ViGet utilise exactement ce nom comme éditeur des paquets ; il ne crée pas de seconde identité.", + "Les noms de compte canoniques évitent les URL ambiguës et l’usurpation par la seule casse.", ], [ "Des frontières entre services", @@ -1102,7 +807,6 @@ export const messages = { navigation: "Navigation du tableau de bord", overview: "Vue d’ensemble", security: "Sécurité", - services: "Services", signOut: "Se déconnecter", eyebrow: "Vue d’ensemble du compte", welcome: "Bienvenue", @@ -1110,101 +814,12 @@ export const messages = { profile: "Profil", identity: "Identité du compte", accountName: "Nom de compte", - publisherName: "Nom d’éditeur ViGet", email: "E-mail", created: "Créé le", passwordSessions: "Mot de passe et sessions", securityDescription: "Votre navigateur utilise un cookie de session sécurisé HttpOnly. Les secrets de session ne sont jamais conservés en clair.", changePassword: "Changer le mot de passe", - products: "Produits Progmasoft connectés", - publisherPrefix: "Nom d’éditeur", - sameAccount: "votre nom de compte", - planned: "Prévu", - }, - viget: { - navigationLabel: "Navigation du registre", - packages: "Paquets", - dslPlugins: "Plugins DSL", - account: "Compte", - login: "Se connecter", - register: "S’inscrire", - homeEyebrow: "Registre de paquets ViGet", - homeTitle: "Des paquets pour C, C++ et Objective-C.", - homeDescription: - "ViGet est la source de référence des paquets C, C++ et Objective-C et des plugins DSL des systèmes de build, exploitée directement par Progmasoft.", - createAccount: "Créer un compte", - exploreTazel: "Découvrir Tazel", - available: "Registre disponible", - emptyTitle: "Le catalogue public est vide.", - emptyDescription: - "Aucune version de paquet n’a encore été publiée. ViGet affichera ici de vrais paquets dès qu’ils seront disponibles.", - packageFormat: "Format des paquets", - publisherIdentity: "Identité de l’éditeur", - publishing: "Publication", - publishingClosed: "Pas encore ouverte", - catalogsEyebrow: "Catalogues", - catalogsTitle: "Deux types d’artefacts, un seul registre.", - catalogsDescription: - "Les paquets et les plugins DSL de projet ont des espaces de coordonnées distincts et prévisibles.", - languagePackages: "Paquets", - vipkgCatalog: "Catalogue ViPkg", - vipkgDescription: - "Bibliothèques et applications en C, C++ et Objective-C, distribuées sous forme d’artefacts .vipkg.", - projectExtensions: "Extensions de projet", - kotlinPlugins: "Plugins DSL Kotlin", - kotlinDescription: - "Des plugins JAR Kotlin qui étendent le fichier de projet de Tazel.", - openCatalog: "Ouvrir le catalogue", - contractEyebrow: "Contrat du registre", - contractTitle: "Une propriété claire, de l’identité à l’artefact.", - principles: [ - [ - "Un seul nom de compte", - "Votre nom de compte Progmasoft est aussi votre nom d’éditeur ViGet.", - ], - [ - "Des coordonnées sensibles à la casse", - "Les noms d’éditeur et de paquet gardent leur graphie publique exacte.", - ], - [ - "Aucune version factice", - "Le catalogue reste honnêtement vide jusqu’à la publication d’un véritable artefact signé.", - ], - ], - pluginEyebrow: "ViGet · Plugins DSL Kotlin", - pluginTitle: "Étendez le modèle de projet.", - pluginDescription: - "Les plugins DSL Kotlin sont des artefacts JAR pour le fichier de projet de Tazel. Ils sont distincts des paquets .vipkg.", - backToPackages: "Retour aux paquets", - followDevelopment: "Suivre le développement", - pluginAvailable: "Catalogue disponible", - pluginEmptyTitle: "Aucun plugin DSL public pour l’instant.", - pluginEmptyDescription: - "Le catalogue est prêt et ne contient volontairement aucun artefact factice.", - guidance: [ - [ - "Format", - "JAR Kotlin", - "Les plugins DSL s’exécutent comme des extensions de projet Kotlin/JVM.", - ], - [ - "Emplacement", - "Catalogue dédié", - "Les coordonnées des plugins commencent toujours par /dslplugins/tazel.", - ], - [ - "Disponibilité", - "Progmasoft d’abord", - "Progmasoft publie les premiers plugins ; la publication s’ouvrira ensuite à tous les comptes.", - ], - ], - footerDescription: - "ViGet est le registre des paquets pour C, C++ et Objective-C et des plugins DSL Kotlin.", - registry: "Registre", - support: "Assistance", - source: "Source", - footerClosing: "ViGet, le registre de paquets de Progmasoft", }, }, } as const; diff --git a/apps/web/lib/theme.ts b/apps/web/lib/theme.ts index c819ac8..bbf2bc4 100644 --- a/apps/web/lib/theme.ts +++ b/apps/web/lib/theme.ts @@ -5,8 +5,7 @@ * The theme a visitor chose, shared by every host of Progmasoft. * * It is a cookie of the registrable domain, as the language is, so a choice - * made on progmasoft.com holds on account., viget., product. and console. as - * well. Scripts of the page read and write it, so it is not HttpOnly; it + * made on progmasoft.com holds on account., product. and console. as well. Scripts of the page read and write it, so it is not HttpOnly; it * carries nothing but "light" or "dark". A choice stored by earlier versions * of the site in localStorage, which each host kept for itself, moves into * the cookie the first time a page sees it. diff --git a/apps/web/lib/viget-catalogs.ts b/apps/web/lib/viget-catalogs.ts deleted file mode 100644 index 3f446cb..0000000 --- a/apps/web/lib/viget-catalogs.ts +++ /dev/null @@ -1,253 +0,0 @@ -// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> -// SPDX-License-Identifier: AGPL-3.0-or-later - -import type { Locale } from "./localization"; - -/** - * A catalog ViGet lists. A catalog with a path is open and links to its page; one without is not - * offered yet and is shown disabled. - */ -export type Catalog = { - readonly name: string; - readonly path?: string; -}; - -/** The languages ViGet hosts packages of, by the last segment of their path. */ -export const languageSlugs = ["c", "cpp", "objc"] as const; - -/** One language catalog, such as `c` for /langs/c. */ -export type LanguageSlug = (typeof languageSlugs)[number]; - -/** Whether [value] names a language catalog. */ -export function isLanguageSlug(value: string): value is LanguageSlug { - return (languageSlugs as readonly string[]).includes(value); -} - -/** The name of each language as the catalogs spell it; names are not translated. */ -export const languageNames: Record<LanguageSlug, string> = { - c: "C", - cpp: "C++", - objc: "Objective-C", -}; - -/** The languages whose packages ViGet hosts, in the order the page lists them. */ -export const languageCatalogs: readonly Catalog[] = languageSlugs.map( - (slug) => ({ - name: languageNames[slug], - path: `/langs/${slug}`, - }), -); - -/** The build systems whose DSL plugins ViGet hosts, in the order the page lists them. */ -export const buildSystemCatalogs: readonly Catalog[] = [ - { name: "Tazel", path: "/dslplugins/tazel" }, - { name: "Gradle", path: "/dslplugins/gradle" }, -]; - -// The two section names are the ones the registry uses everywhere; they are -// not translated, like the product names below them. -export const languagesHeading = "LANGUAGES"; -export const buildSystemsHeading = "BUILD SYSTEM DSL PLUGINS"; - -/** The words of the page of one language catalog. */ -type LanguageText = { - title: string; - description: string; - emptyTitle: string; -}; - -type CatalogText = { - statusEyebrow: string; - languagesDescription: string; - buildSystemsDescription: string; - /** What each open catalog holds, by catalog name. */ - holds: Record<string, string>; - notAvailable: string; - open: string; - languages: Record<LanguageSlug, LanguageText>; - languageEmptyDescription: string; - tazelTitle: string; - tazelDescription: string; - backToRegistry: string; -}; - -const text: Record<Locale, CatalogText> = { - "en-US": { - statusEyebrow: "ViGet status", - languagesDescription: - "Packages written in a language, as .vipkg artifacts.", - buildSystemsDescription: - "Plugins that extend the project file of a build system.", - holds: { - C: "Libraries and applications written in C.", - "C++": "Libraries and applications written in C++.", - "Objective-C": - "Libraries and applications written in Objective-C and Objective-C++.", - Tazel: "Kotlin JAR plugins for the project file of Tazel.", - Gradle: "Gradle plugins of Progmasoft, from the Gradle Plugin Portal.", - }, - notAvailable: "Not available yet", - open: "Open catalog", - languages: { - c: { - title: "C packages", - description: - "Libraries and applications written in C, distributed as .vipkg artifacts and published under a Progmasoft Account.", - emptyTitle: "No C packages yet.", - }, - cpp: { - title: "C++ packages", - description: - "Libraries and applications written in C++, distributed as .vipkg artifacts and published under a Progmasoft Account.", - emptyTitle: "No C++ packages yet.", - }, - objc: { - title: "Objective-C packages", - description: - "Libraries and applications written in Objective-C and Objective-C++, distributed as .vipkg artifacts and published under a Progmasoft Account.", - emptyTitle: "No Objective-C packages yet.", - }, - }, - languageEmptyDescription: - "The catalog is ready and intentionally contains no placeholder packages. Publishing opens with the ViGet client of Tazel.", - tazelTitle: "Tazel DSL plugins", - tazelDescription: - "Kotlin JAR plugins that extend the project file of Tazel, the build system for C, C++, Objective-C, Objective-C++ and Zig. They are separate from .vipkg packages.", - backToRegistry: "Back to ViGet", - }, - "de-DE": { - statusEyebrow: "ViGet-Status", - languagesDescription: - "Pakete, die in einer Sprache geschrieben sind, als .vipkg-Artefakte.", - buildSystemsDescription: - "Plugins, die die Projektdatei eines Build-Systems erweitern.", - holds: { - C: "Bibliotheken und Anwendungen, geschrieben in C.", - "C++": "Bibliotheken und Anwendungen, geschrieben in C++.", - "Objective-C": - "Bibliotheken und Anwendungen, geschrieben in Objective-C und Objective-C++.", - Tazel: "Kotlin-JAR-Plugins für die Projektdatei von Tazel.", - Gradle: "Gradle-Plugins von Progmasoft, vom Gradle Plugin Portal.", - }, - notAvailable: "Noch nicht verfügbar", - open: "Katalog öffnen", - languages: { - c: { - title: "C-Pakete", - description: - "Bibliotheken und Anwendungen in C, verteilt als .vipkg-Artefakte und veröffentlicht unter einem Progmasoft-Konto.", - emptyTitle: "Noch keine C-Pakete.", - }, - cpp: { - title: "C++-Pakete", - description: - "Bibliotheken und Anwendungen in C++, verteilt als .vipkg-Artefakte und veröffentlicht unter einem Progmasoft-Konto.", - emptyTitle: "Noch keine C++-Pakete.", - }, - objc: { - title: "Objective-C-Pakete", - description: - "Bibliotheken und Anwendungen in Objective-C und Objective-C++, verteilt als .vipkg-Artefakte und veröffentlicht unter einem Progmasoft-Konto.", - emptyTitle: "Noch keine Objective-C-Pakete.", - }, - }, - languageEmptyDescription: - "Der Katalog ist bereit und enthält bewusst keine Platzhalterpakete. Die Veröffentlichung öffnet mit dem ViGet-Client von Tazel.", - tazelTitle: "Tazel-DSL-Plugins", - tazelDescription: - "Kotlin-JAR-Plugins, die die Projektdatei von Tazel erweitern, dem Build-System für C, C++, Objective-C, Objective-C++ und Zig. Sie sind von .vipkg-Paketen getrennt.", - backToRegistry: "Zurück zu ViGet", - }, - "ru-RU": { - statusEyebrow: "Состояние ViGet", - languagesDescription: - "Пакеты, написанные на языке, в виде артефактов .vipkg.", - buildSystemsDescription: - "Плагины, расширяющие файл проекта системы сборки.", - holds: { - C: "Библиотеки и приложения, написанные на C.", - "C++": "Библиотеки и приложения, написанные на C++.", - "Objective-C": - "Библиотеки и приложения, написанные на Objective-C и Objective-C++.", - Tazel: "Плагины Kotlin JAR для файла проекта Tazel.", - Gradle: "Плагины Gradle от Progmasoft, с Gradle Plugin Portal.", - }, - notAvailable: "Пока недоступно", - open: "Открыть каталог", - languages: { - c: { - title: "Пакеты C", - description: - "Библиотеки и приложения на C, распространяемые как артефакты .vipkg и публикуемые от имени учётной записи Progmasoft.", - emptyTitle: "Пакетов C пока нет.", - }, - cpp: { - title: "Пакеты C++", - description: - "Библиотеки и приложения на C++, распространяемые как артефакты .vipkg и публикуемые от имени учётной записи Progmasoft.", - emptyTitle: "Пакетов C++ пока нет.", - }, - objc: { - title: "Пакеты Objective-C", - description: - "Библиотеки и приложения на Objective-C и Objective-C++, распространяемые как артефакты .vipkg и публикуемые от имени учётной записи Progmasoft.", - emptyTitle: "Пакетов Objective-C пока нет.", - }, - }, - languageEmptyDescription: - "Каталог готов и намеренно не содержит пакетов-заглушек. Публикация откроется вместе с клиентом ViGet в Tazel.", - tazelTitle: "DSL-плагины Tazel", - tazelDescription: - "Плагины Kotlin JAR, расширяющие файл проекта Tazel — системы сборки для C, C++, Objective-C, Objective-C++ и Zig. Они отделены от пакетов .vipkg.", - backToRegistry: "Назад к ViGet", - }, - "fr-FR": { - statusEyebrow: "État de ViGet", - languagesDescription: - "Des paquets écrits dans un langage, sous forme d’artefacts .vipkg.", - buildSystemsDescription: - "Des plugins qui étendent le fichier de projet d’un système de build.", - holds: { - C: "Bibliothèques et applications écrites en C.", - "C++": "Bibliothèques et applications écrites en C++.", - "Objective-C": - "Bibliothèques et applications écrites en Objective-C et en Objective-C++.", - Tazel: "Des plugins JAR Kotlin pour le fichier de projet de Tazel.", - Gradle: - "Les plugins Gradle de Progmasoft, depuis le Gradle Plugin Portal.", - }, - notAvailable: "Pas encore disponible", - open: "Ouvrir le catalogue", - languages: { - c: { - title: "Paquets C", - description: - "Bibliothèques et applications écrites en C, distribuées sous forme d’artefacts .vipkg et publiées sous un compte Progmasoft.", - emptyTitle: "Aucun paquet C pour l’instant.", - }, - cpp: { - title: "Paquets C++", - description: - "Bibliothèques et applications écrites en C++, distribuées sous forme d’artefacts .vipkg et publiées sous un compte Progmasoft.", - emptyTitle: "Aucun paquet C++ pour l’instant.", - }, - objc: { - title: "Paquets Objective-C", - description: - "Bibliothèques et applications écrites en Objective-C et en Objective-C++, distribuées sous forme d’artefacts .vipkg et publiées sous un compte Progmasoft.", - emptyTitle: "Aucun paquet Objective-C pour l’instant.", - }, - }, - languageEmptyDescription: - "Le catalogue est prêt et ne contient volontairement aucun paquet factice. La publication ouvrira avec le client ViGet de Tazel.", - tazelTitle: "Plugins DSL de Tazel", - tazelDescription: - "Des plugins JAR Kotlin qui étendent le fichier de projet de Tazel, le système de build pour C, C++, Objective-C, Objective-C++ et Zig. Ils sont distincts des paquets .vipkg.", - backToRegistry: "Retour à ViGet", - }, -}; - -/** The text of the ViGet catalogs in [locale]. */ -export function catalogText(locale: Locale): CatalogText { - return text[locale]; -} diff --git a/apps/web/lib/viget-plugins.ts b/apps/web/lib/viget-plugins.ts deleted file mode 100644 index 0ceb79e..0000000 --- a/apps/web/lib/viget-plugins.ts +++ /dev/null @@ -1,254 +0,0 @@ -// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> -// SPDX-License-Identifier: AGPL-3.0-or-later - -import type { Locale } from "./localization"; - -/** A Tazel plugin as the list of the catalog shows it. */ -export type TazelPluginSummary = { - readonly publisher: string; - readonly name: string; - readonly description: string | null; - readonly license: string | null; - readonly latestVersion: string; - readonly updatedAt: string; -}; - -/** One published version of a Tazel plugin. */ -export type TazelPluginVersion = { - readonly version: string; - readonly sha256: string; - readonly apiVersion: number; - readonly size: number; - readonly publishedAt: string; - readonly yanked: boolean; - /** The address of the JAR on the ViGet host. */ - readonly path: string; -}; - -/** A Tazel plugin with everything its page shows. */ -export type TazelPlugin = { - readonly publisher: string; - readonly name: string; - readonly description: string | null; - readonly authors: readonly string[]; - readonly license: string | null; - readonly homepage: string | null; - readonly repository: string | null; - readonly latestVersion: string; - readonly versions: readonly TazelPluginVersion[]; -}; - -/** A Gradle plugin the catalog lists; Gradle downloads it from the Gradle Plugin Portal. */ -export type GradlePlugin = { - readonly id: string; - readonly description: Record<Locale, string>; - readonly usage: string; -}; - -/** The Gradle plugins of Progmasoft. */ -export const gradlePlugins: readonly GradlePlugin[] = [ - { - id: "com.progmasoft.tazel.plugin", - description: { - "en-US": - "Builds plugins of the Tazel project file: adds the Tazel API as tazelApi() and writes the descriptor of the plugin from tazelPlugin { }.", - "de-DE": - "Baut Plugins für die Projektdatei von Tazel: stellt die Tazel-API als tazelApi() bereit und schreibt den Deskriptor des Plugins aus tazelPlugin { }.", - "ru-RU": - "Собирает плагины для файла проекта Tazel: добавляет API Tazel как tazelApi() и записывает дескриптор плагина из tazelPlugin { }.", - "fr-FR": - "Construit des plugins pour le fichier de projet de Tazel : ajoute l’API de Tazel sous la forme tazelApi() et écrit le descripteur du plugin à partir de tazelPlugin { }.", - }, - usage: 'plugins {\n id("com.progmasoft.tazel.plugin") version "0.2.0"\n}', - }, -]; - -// The pages run on the server, beside the API on its loopback address. Nginx -// does not pass /api/ of the ViGet host on, so these addresses stay private. -const apiOrigin = process.env.PROGMAWEB_API_ORIGIN ?? "http://127.0.0.1:5085"; - -async function read<T>(path: string): Promise<T | null> { - try { - const response = await fetch( - `${apiOrigin}/api/v1/viget/dslplugins/tazel${path}`, - { - cache: "no-store", - headers: { Accept: "application/json" }, - }, - ); - return response.ok ? ((await response.json()) as T) : null; - } catch { - // An unreachable API shows an empty catalog rather than an error page. - return null; - } -} - -/** Every Tazel plugin of the catalog; empty when the API cannot be reached. */ -export async function tazelPlugins(): Promise<readonly TazelPluginSummary[]> { - const list = await read<{ plugins: TazelPluginSummary[] }>(""); - return list?.plugins ?? []; -} - -/** A Tazel plugin by its exact publisher and name, or null. */ -export async function tazelPlugin( - publisher: string, - name: string, -): Promise<TazelPlugin | null> { - const identifier = /^[A-Za-z_][A-Za-z0-9_]*$/; - if (!identifier.test(publisher) || !identifier.test(name)) return null; - return read<TazelPlugin>(`/${publisher}/${name}`); -} - -/** The declaration a project file writes to use a plugin. */ -export function pluginDeclaration( - plugin: { publisher: string; name: string }, - version: string, -): string { - return `plugins {\n plugin("${plugin.publisher}") {\n name = "${plugin.name}"\n version = "${version}"\n }\n}`; -} - -type PluginText = { - catalogTitle: string; - catalogEmpty: string; - latest: string; - license: string; - authors: string; - homepage: string; - repository: string; - versions: string; - version: string; - published: string; - api: string; - size: string; - yanked: string; - download: string; - usage: string; - usageDescription: string; - publisherLabel: string; - backToCatalog: string; - notFoundTitle: string; - notFoundDescription: string; - gradleTitle: string; - gradleDescription: string; - gradlePortal: string; -}; - -const text: Record<Locale, PluginText> = { - "en-US": { - catalogTitle: "Published plugins", - catalogEmpty: "No plugin is published yet.", - latest: "Latest", - license: "License", - authors: "Authors", - homepage: "Homepage", - repository: "Repository", - versions: "Versions", - version: "Version", - published: "Published", - api: "Plugin API", - size: "Size", - yanked: "Yanked", - download: "JAR", - usage: "Use it", - usageDescription: - "Declare the plugin at the top of BUILD.kts; Tazel downloads it from ViGet and checks its SHA-256.", - publisherLabel: "Publisher", - backToCatalog: "Back to the Tazel catalog", - notFoundTitle: "No such plugin.", - notFoundDescription: - "ViGet has no Tazel plugin with this publisher and name.", - gradleTitle: "Gradle plugins", - gradleDescription: - "Gradle plugins of Progmasoft. ViGet lists them; Gradle downloads them from the Gradle Plugin Portal.", - gradlePortal: "Gradle Plugin Portal", - }, - "de-DE": { - catalogTitle: "Veröffentlichte Plugins", - catalogEmpty: "Noch ist kein Plugin veröffentlicht.", - latest: "Neueste", - license: "Lizenz", - authors: "Autoren", - homepage: "Website", - repository: "Repository", - versions: "Versionen", - version: "Version", - published: "Veröffentlicht", - api: "Plugin-API", - size: "Größe", - yanked: "Zurückgezogen", - download: "JAR", - usage: "Verwenden", - usageDescription: - "Deklarieren Sie das Plugin oben in BUILD.kts; Tazel lädt es von ViGet und prüft seine SHA-256.", - publisherLabel: "Herausgeber", - backToCatalog: "Zurück zum Tazel-Katalog", - notFoundTitle: "Kein solches Plugin.", - notFoundDescription: - "ViGet hat kein Tazel-Plugin mit diesem Herausgeber und Namen.", - gradleTitle: "Gradle-Plugins", - gradleDescription: - "Gradle-Plugins von Progmasoft. ViGet listet sie; Gradle lädt sie vom Gradle Plugin Portal.", - gradlePortal: "Gradle Plugin Portal", - }, - "ru-RU": { - catalogTitle: "Опубликованные плагины", - catalogEmpty: "Пока не опубликовано ни одного плагина.", - latest: "Последняя", - license: "Лицензия", - authors: "Авторы", - homepage: "Сайт", - repository: "Репозиторий", - versions: "Версии", - version: "Версия", - published: "Опубликована", - api: "API плагинов", - size: "Размер", - yanked: "Отозвана", - download: "JAR", - usage: "Использование", - usageDescription: - "Объявите плагин в начале BUILD.kts; Tazel загрузит его из ViGet и проверит SHA-256.", - publisherLabel: "Издатель", - backToCatalog: "Назад к каталогу Tazel", - notFoundTitle: "Такого плагина нет.", - notFoundDescription: - "В ViGet нет плагина Tazel с таким издателем и именем.", - gradleTitle: "Плагины Gradle", - gradleDescription: - "Плагины Gradle от Progmasoft. ViGet перечисляет их; Gradle загружает их с Gradle Plugin Portal.", - gradlePortal: "Gradle Plugin Portal", - }, - "fr-FR": { - catalogTitle: "Plugins publiés", - catalogEmpty: "Aucun plugin n’est encore publié.", - latest: "Dernière", - license: "Licence", - authors: "Auteurs", - homepage: "Page d’accueil", - repository: "Dépôt", - versions: "Versions", - version: "Version", - published: "Publié le", - api: "API des plugins", - size: "Taille", - yanked: "Retiré", - download: "JAR", - usage: "L’utiliser", - usageDescription: - "Déclarez le plugin en tête de BUILD.kts ; Tazel le télécharge depuis ViGet et vérifie son SHA-256.", - publisherLabel: "Éditeur", - backToCatalog: "Retour au catalogue de Tazel", - notFoundTitle: "Ce plugin n’existe pas.", - notFoundDescription: - "ViGet n’a aucun plugin Tazel avec cet éditeur et ce nom.", - gradleTitle: "Plugins Gradle", - gradleDescription: - "Les plugins Gradle de Progmasoft. ViGet les liste ; Gradle les télécharge depuis le Gradle Plugin Portal.", - gradlePortal: "Gradle Plugin Portal", - }, -}; - -/** The text of the plugin pages in [locale]. */ -export function pluginText(locale: Locale): PluginText { - return text[locale]; -} diff --git a/apps/web/next.config.ts b/apps/web/next.config.ts index 37df028..74fdf0c 100644 --- a/apps/web/next.config.ts +++ b/apps/web/next.config.ts @@ -7,8 +7,8 @@ const nextConfig: NextConfig = { output: "standalone", poweredByHeader: false, reactStrictMode: true, - // ViGet's public coordinate contract accepts catalog roots with a trailing - // slash. Host-aware proxy routing owns normalization for those URLs. + // Pages keep the trailing slash they are linked with, as license pages are; + // host-aware proxy routing owns normalization. skipTrailingSlashRedirect: true, typedRoutes: true, async rewrites() { diff --git a/apps/web/playwright.config.ts b/apps/web/playwright.config.ts index 2faad97..8f5568f 100644 --- a/apps/web/playwright.config.ts +++ b/apps/web/playwright.config.ts @@ -9,7 +9,7 @@ import { layoutHosts } from "./e2e/pages"; * tablet and a desktop. * * The site picks its pages by host name, so every public host name resolves - * to the local server: the browser asks for http://viget.progmasoft.com/ and + * to the local server: the browser asks for http://product.progmasoft.com/ and * the request reaches `next start` on 127.0.0.1 with that Host header. No * request leaves the machine. */ diff --git a/apps/web/proxy.ts b/apps/web/proxy.ts index 992eabb..b154cf6 100644 --- a/apps/web/proxy.ts +++ b/apps/web/proxy.ts @@ -19,7 +19,6 @@ import { } from "@/lib/content-security-policy"; const accountHosts = new Set(["account.progmasoft.com", "account.localhost"]); -const vigetHosts = new Set(["viget.progmasoft.com", "viget.localhost"]); interface OwnSite { hosts: Set<string>; /** The internal tree of the site's pages. */ @@ -168,92 +167,6 @@ function route(request: NextRequest, headers: Headers): NextResponse { return rewrite(headers, destination); } - // ViGet is deployed by Progmaweb but keeps short public catalog URLs. The - // internal /viget tree prevents those routes from colliding with the apex - // organization page and the account surface. - if (vigetHosts.has(host)) { - if (pathname === "/") { - return rewrite(headers, internalRoute(request, "/viget")); - } - // Packages are grouped by the language they are written in and DSL - // plugins by the build system they extend. - const language = /^\/langs\/(c|cpp|objc)\/?$/.exec(pathname); - if (language) { - return rewrite( - headers, - internalRoute(request, `/viget/langs/${language[1]}`), - ); - } - if (pathname === "/dslplugins/tazel" || pathname === "/dslplugins/tazel/") { - return rewrite( - headers, - internalRoute(request, "/viget/dslplugins/tazel"), - ); - } - // The page of one plugin. Its index.json and JARs below it are served by - // Nginx, from the API and from the files of ViGet. - const plugin = - /^\/dslplugins\/tazel\/([A-Za-z_][A-Za-z0-9_]*)\/([A-Za-z_][A-Za-z0-9_]*)\/?$/.exec( - pathname, - ); - if (plugin) { - return rewrite( - headers, - internalRoute( - request, - `/viget/dslplugins/tazel/${plugin[1]}/${plugin[2]}`, - ), - ); - } - if ( - pathname === "/dslplugins/gradle" || - pathname === "/dslplugins/gradle/" - ) { - return rewrite( - headers, - internalRoute(request, "/viget/dslplugins/gradle"), - ); - } - // The languages are listed on the home page of ViGet. - if (pathname === "/langs" || pathname === "/langs/") { - return NextResponse.redirect( - new URL("https://viget.progmasoft.com/#languages-title"), - 308, - ); - } - if (pathname === "/dslplugins" || pathname === "/dslplugins/") { - return NextResponse.redirect( - new URL("https://viget.progmasoft.com/dslplugins/tazel"), - 308, - ); - } - if (pathname === "/login" || pathname === "/login/") { - return NextResponse.redirect( - new URL("https://account.progmasoft.com/login"), - ); - } - if (pathname === "/register" || pathname === "/register/") { - return NextResponse.redirect( - new URL("https://account.progmasoft.com/register"), - ); - } - if (pathname === "/recover" || pathname === "/recover/") { - return NextResponse.redirect( - new URL("https://account.progmasoft.com/recover"), - ); - } - } - - if ( - !vigetHosts.has(host) && - (pathname === "/viget" || pathname.startsWith("/viget/")) - ) { - const publicPath = pathname.replace(/^\/viget/, "") || "/"; - return NextResponse.redirect( - new URL(publicPath, "https://viget.progmasoft.com"), - ); - } - // Corporate hosts must not accidentally expose the account-only landing page as a public navigation destination. if (!accountHosts.has(host) && pathname === "/account") { return NextResponse.redirect(new URL("https://account.progmasoft.com/")); diff --git a/apps/web/tests/localization.test.mjs b/apps/web/tests/localization.test.mjs index 974c593..740e259 100644 --- a/apps/web/tests/localization.test.mjs +++ b/apps/web/tests/localization.test.mjs @@ -36,7 +36,7 @@ test("only the published locales are accepted", () => { } }); -test("both locales give the account and ViGet routes distinct page metadata", () => { +test("both locales give the account routes distinct page metadata", () => { const english = messages["en-US"].metadata; const german = messages["de-DE"].metadata; for (const key of [ @@ -44,8 +44,6 @@ test("both locales give the account and ViGet routes distinct page metadata", () "accountTitle", "loginTitle", "registerTitle", - "vigetTitle", - "dslPluginsTitle", ]) { assert.equal(typeof english[key], "string"); assert.equal(typeof german[key], "string"); @@ -54,8 +52,6 @@ test("both locales give the account and ViGet routes distinct page metadata", () } assert.notEqual(english.loginTitle, german.loginTitle); assert.notEqual(english.registerTitle, german.registerTitle); - assert.match(english.vigetTitle, /ViGet/); - assert.match(german.vigetTitle, /ViGet/); }); test("each supported locale resolves to its own complete message tree", () => { @@ -83,13 +79,13 @@ test("the language cookie is shared by production hosts and host-only elsewhere" for (const host of [ "progmasoft.com", "account.progmasoft.com", - "viget.progmasoft.com", + "product.progmasoft.com", ]) { assert.equal(localeCookieOptions(host, true).domain, ".progmasoft.com"); } for (const host of [ "localhost", - "viget.localhost", + "account.localhost", "notprogmasoft.com", "progmasoft.com.example", "", @@ -112,7 +108,7 @@ test("the request host prefers the forwarded host and drops port and case", () = requestHost("Account.Progmasoft.com", "127.0.0.1:3010"), "account.progmasoft.com", ); - assert.equal(requestHost(null, "viget.localhost:3000"), "viget.localhost"); + assert.equal(requestHost(null, "account.localhost:3000"), "account.localhost"); assert.equal(requestHost(null, null), ""); }); @@ -168,7 +164,7 @@ test("the Russian messages are written in Cyrillic", () => { russian.navigation.language, homeMessages["ru-RU"].hero.titleStart, russian.auth.signIn, - russian.viget.emptyTitle, + russian.dashboard.welcome, ]) { assert.match(text, /[А-Яа-яЁё]/); } @@ -183,7 +179,7 @@ test("French is published, and Hebrew is retired", async () => { for (const text of [ french.auth.signIn, french.metadata.homeDescription, - french.viget.emptyTitle, + french.dashboard.welcome, ]) { assert.match(text, /[a-zàâçéèêëîïôûùüÿœ]/); assert.ok(!/[-]/.test(text), text); diff --git a/apps/web/tests/theme.test.mjs b/apps/web/tests/theme.test.mjs index d530657..1ba9116 100644 --- a/apps/web/tests/theme.test.mjs +++ b/apps/web/tests/theme.test.mjs @@ -17,7 +17,7 @@ test("the theme comes from its cookie and nothing else", () => { test("the theme cookie is shared by the Progmasoft hosts and secure over HTTPS", () => { assert.equal( - themeCookie("dark", "viget.progmasoft.com", true), + themeCookie("dark", "product.progmasoft.com", true), "progmasoft_theme=dark; Path=/; Max-Age=31536000; SameSite=Lax; Domain=.progmasoft.com; Secure", ); assert.equal( diff --git a/apps/web/tests/viget-catalogs.test.mjs b/apps/web/tests/viget-catalogs.test.mjs deleted file mode 100644 index f2886d8..0000000 --- a/apps/web/tests/viget-catalogs.test.mjs +++ /dev/null @@ -1,105 +0,0 @@ -// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> -// SPDX-License-Identifier: AGPL-3.0-or-later - -import assert from "node:assert/strict"; -import { readFileSync } from "node:fs"; -import { test } from "node:test"; -import { - buildSystemCatalogs, - buildSystemsHeading, - catalogText, - languageCatalogs, - languageSlugs, - languagesHeading, -} from "../lib/viget-catalogs.ts"; - -const locales = ["en-US", "de-DE", "ru-RU", "fr-FR"]; - -test("the registry lists C, C++ and Objective-C, then Tazel and Gradle, under their own headings", () => { - assert.equal(languagesHeading, "LANGUAGES"); - assert.equal(buildSystemsHeading, "BUILD SYSTEM DSL PLUGINS"); - assert.deepEqual(languageCatalogs, [ - { name: "C", path: "/langs/c" }, - { name: "C++", path: "/langs/cpp" }, - { name: "Objective-C", path: "/langs/objc" }, - ]); - assert.deepEqual(buildSystemCatalogs, [ - { name: "Tazel", path: "/dslplugins/tazel" }, - { name: "Gradle", path: "/dslplugins/gradle" }, - ]); -}); - -test("every open catalog says what it holds in every language", () => { - for (const locale of locales) { - const text = catalogText(locale); - for (const catalog of [...languageCatalogs, ...buildSystemCatalogs]) { - if (catalog.path) - assert.ok( - text.holds[catalog.name]?.length > 0, - `${locale} ${catalog.name}`, - ); - } - for (const [key, value] of Object.entries(text)) { - if (typeof value === "string") - assert.ok(value.trim().length > 0, `${locale} ${key}`); - } - } - for (const slug of languageSlugs) { - for (const locale of locales) { - const page = catalogText(locale).languages[slug]; - for (const value of Object.values(page)) - assert.ok(value.trim().length > 0, `${locale} ${slug}`); - } - assert.notEqual( - catalogText("de-DE").languages[slug].title, - catalogText("en-US").languages[slug].title, - ); - } -}); - -test("a catalog that is not offered yet is a disabled button and links nowhere", () => { - const section = readFileSync( - new URL("../components/ViGetCatalogSection.tsx", import.meta.url), - "utf8", - ); - assert.match(section, /type="button"\s+disabled/); - assert.match( - section, - /href=\{`https:\/\/viget\.progmasoft\.com\$\{catalog\.path\}`\}/, - ); - const styles = readFileSync( - new URL("../app/viget.css", import.meta.url), - "utf8", - ); - assert.match(styles, /\.viget-catalog-disabled \{[^}]*cursor: not-allowed;/s); -}); - -test("the ViGet host serves both catalogs and leads the bare groups to them", () => { - const proxy = readFileSync(new URL("../proxy.ts", import.meta.url), "utf8"); - assert.match(proxy, /\^\\\/langs\\\/\(c\|cpp\|objc\)\\\/\?\$/); - assert.match( - proxy, - /internalRoute\(request, `\/viget\/langs\/\$\{language\[1\]\}`\)/, - ); - assert.match(proxy, /internalRoute\(request, "\/viget\/dslplugins\/tazel"\)/); - assert.match( - proxy, - /"https:\/\/viget\.progmasoft\.com\/#languages-title"\),\s*308/, - ); - assert.match( - proxy, - /"https:\/\/viget\.progmasoft\.com\/dslplugins\/tazel"\),\s*308/, - ); - const home = readFileSync( - new URL("../app/viget/page.tsx", import.meta.url), - "utf8", - ); - const status = home.indexOf("viget-status-title"); - assert.ok( - status >= 0 && status < home.indexOf("<ViGetCatalogSection"), - "the status comes first", - ); - assert.ok( - home.indexOf("languagesHeading}") < home.indexOf("buildSystemsHeading}"), - ); -}); diff --git a/apps/web/tests/viget-plugins.test.mjs b/apps/web/tests/viget-plugins.test.mjs deleted file mode 100644 index 40eaf0c..0000000 --- a/apps/web/tests/viget-plugins.test.mjs +++ /dev/null @@ -1,53 +0,0 @@ -// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> -// SPDX-License-Identifier: AGPL-3.0-or-later - -import assert from "node:assert/strict"; -import { test } from "node:test"; -import { - gradlePlugins, - pluginDeclaration, - pluginText, - tazelPlugin, -} from "../lib/viget-plugins.ts"; - -const locales = ["en-US", "de-DE", "ru-RU", "fr-FR"]; - -test("the plugin pages have every text in every language", () => { - for (const locale of locales) { - for (const [key, value] of Object.entries(pluginText(locale))) { - assert.ok(value.trim().length > 0, `${locale} ${key}`); - } - for (const plugin of gradlePlugins) { - assert.ok( - plugin.description[locale].length > 0, - `${locale} ${plugin.id}`, - ); - } - } -}); - -test("the declaration is the plugins block Tazel reads", () => { - assert.equal( - pluginDeclaration({ publisher: "Progmasoft", name: "CMake" }, "0.1.0"), - [ - "plugins {", - ' plugin("Progmasoft") {', - ' name = "CMake"', - ' version = "0.1.0"', - " }", - "}", - ].join("\n"), - ); -}); - -test("the Gradle catalog lists the Tazel plugin builder", () => { - assert.deepEqual( - gradlePlugins.map((plugin) => plugin.id), - ["com.progmasoft.tazel.plugin"], - ); -}); - -test("a plugin page asks the API only for names that are identifiers", async () => { - assert.equal(await tazelPlugin("../etc", "passwd"), null); - assert.equal(await tazelPlugin("Progmasoft", "c-make"), null); -}); diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 39276c6..fe19db6 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -15,7 +15,7 @@ Both listen on loopback only. Nginx is the only public listener and terminates T browser | HTTPS v -Nginx (progmasoft.com, www, account.progmasoft.com, viget.progmasoft.com) +Nginx (progmasoft.com, www, account.progmasoft.com, ...) | http://127.0.0.1:3010 v Next.js server (apps/web) @@ -33,9 +33,8 @@ One build serves three hosts. The host of a request, not a separate deployment, | `progmasoft.com` | the organization homepage; the only host that is meant to be indexed as the organization | | `www.progmasoft.com` | a permanent redirect to the apex host, issued by Nginx | | `account.progmasoft.com` | the account landing page, sign-in, registration, recovery and the dashboard | -| `viget.progmasoft.com` | the ViGet package catalog and the Kotlin DSL plugin catalog | -`*.localhost` names (`account.localhost`, `viget.localhost`) behave like the production hosts during development. +`*.localhost` names (`account.localhost`, `product.localhost`) behave like the production hosts during development. ## Host-aware routing @@ -45,12 +44,7 @@ One build serves three hosts. The host of a request, not a separate deployment, same URL without the parameter. See [Localization](LOCALIZATION.md). 2. **Account root.** `/` on the account host is rewritten to the internal `/account` page, so the account landing page has the short URL. -3. **ViGet.** On the ViGet host `/` is rewritten to `/viget`, `/langs/c`, `/langs/cpp` and `/langs/objc` to - `/viget/langs/<language>` and `/dslplugins/tazel` to `/viget/dslplugins/tazel`. `/langs` - addresses redirect permanently to - the language list of the home page and `/dslplugins` to the Tazel catalog. `/login`, `/register` and `/recover` redirect to the account host. -4. **Internal trees stay internal.** `/viget/...` on any other host redirects to the ViGet host, and `/account` on any - other host redirects to the account host. +3. **Internal trees stay internal.** `/account` on any other host redirects to the account host. Internal rewrites use `http:` on purpose. TLS ends at Nginx, and Next.js would otherwise try TLS against its own plain-HTTP loopback listener. @@ -65,12 +59,9 @@ The host is read from `X-Forwarded-Host` first and `Host` second, without the po | `/account` (shown as `/` on the account host) | account landing page | no | | `/login`, `/register`, `/recover` | authentication and recovery | no | | `/<Account>/dashboard` | dashboard of the signed-in account | no | -| `/viget` (shown as `/` on the ViGet host) | registry status and the list of catalogs | yes | -| `/viget/langs/<language>` (shown as `/langs/c`, `/langs/cpp`, `/langs/objc`) | catalog of the packages of one language | yes | -| `/viget/dslplugins/tazel` (shown as `/dslplugins/tazel`) | catalog of Tazel DSL plugins | yes | -`robots.txt` and `sitemap.xml` are generated per host: the ViGet host lists its home page and its two catalog pages, -every other host lists the apex homepage only. Nginx additionally sends `X-Robots-Tag: noindex` for the whole account host. +`robots.txt` and `sitemap.xml` are generated per host: the product and license hosts list their own pages, every +other host lists the apex homepage only. Nginx additionally sends `X-Robots-Tag: noindex` for the whole account host. Pages are rendered on the server for every request, because the language depends on the request. Two components run in the browser: the authentication form and the dashboard. @@ -112,12 +103,4 @@ a content security policy that allows nothing, `Cache-Control: no-store`, and no ## Shared account identity -An account name is the public identity of its owner on every Progmasoft service. ViGet does not keep a separate -publisher name: the `<Publisher>` segment of a package coordinate is exactly the canonical account name, with the same -spelling and case. - -## ViGet status route - -`viget.progmasoft.com/api/v1/status` is proxied by Nginx to a separate legacy process on loopback port 5080. It is not -part of this repository's API. Every other `/api/` path on the ViGet host is refused. See -[Known limitations](LIMITATIONS.md). +An account name is the public identity of its owner on every Progmasoft service. diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md index b319ad3..9c297de 100644 --- a/docs/DEVELOPMENT.md +++ b/docs/DEVELOPMENT.md @@ -47,7 +47,6 @@ Open the three surfaces through their development host names: | --- | --- | | `http://localhost:3000/` | organization homepage | | `http://account.localhost:3000/` | account pages | -| `http://viget.localhost:3000/` | ViGet catalogs | Accounts created locally live in the memory of the API process and are gone when it stops. To keep them, point the API at a PostgreSQL database before it starts; it creates its tables itself: diff --git a/docs/LIMITATIONS.md b/docs/LIMITATIONS.md index ad1156d..774714e 100644 --- a/docs/LIMITATIONS.md +++ b/docs/LIMITATIONS.md @@ -49,13 +49,6 @@ password. The dashboard sends a signed-out visitor to `/login?returnTo=...`. The sign-in form does not read the parameter and always continues to the dashboard of the account that signed in. -## ViGet has no packages and no registry API here - -The catalog pages are real and intentionally empty: no package or plugin has been published. Publishing is closed. - -`viget.progmasoft.com/api/v1/status` is answered by a separate legacy process, not by this repository's API. Until -that route moves here, the legacy process has to keep running. - ## The rate limit is per process The authentication rate limit is counted in the memory of one API process, by client address. It is reset by a diff --git a/docs/LOCALIZATION.md b/docs/LOCALIZATION.md index 852b7fd..ee57039 100644 --- a/docs/LOCALIZATION.md +++ b/docs/LOCALIZATION.md @@ -60,7 +60,7 @@ A value that is not a published locale is ignored in both paths. | Attribute | Value | | --- | --- | | Name | `progmasoft_locale` | -| Domain | `.progmasoft.com` on production hosts, so the choice follows the visitor to the account and ViGet hosts; host-only elsewhere | +| Domain | `.progmasoft.com` on production hosts, so the choice follows the visitor to the other Progmasoft hosts; host-only elsewhere | | Lifetime | one year | | Flags | `HttpOnly`, `SameSite=Lax`, and `Secure` over TLS | diff --git a/docs/OAUTH.md b/docs/OAUTH.md index 61cf3b3..91a8ec9 100644 --- a/docs/OAUTH.md +++ b/docs/OAUTH.md @@ -80,17 +80,11 @@ The implicit grant, the resource owner password grant and the device flow are no | `openid` | An OpenID Connect sign-in: the account identifier | `sub` | | `profile` | Reading the Progmasoft account name | `name`, `preferred_username` | | `email` | Reading the email address the account signs in and registered with | `email`, `email_verified` | -| `viget.packages.read` | Reading the packages the account has published on ViGet | — | -| `viget.packages.publish` | Publishing packages to ViGet under the account | — | -| `viget.packages.yank` | Yanking packages of the account on ViGet | — | | `offline_access` | Refresh tokens: access while the account holder is not signed in | — | `sub` is a stable, opaque identifier; use it, not the account name or the address, to recognize an account. Account registration does not verify email addresses, so `email_verified` is always `false`. -Access tokens that carry a ViGet scope have the audience `viget`; ViGet accepts only such tokens for its package -operations. - ## Consent Every application asks for consent, and the consent page lists each requested scope on its own line together with diff --git a/docs/api/filterConfig.yml b/docs/api/filterConfig.yml index 966b435..25a4b3a 100644 --- a/docs/api/filterConfig.yml +++ b/docs/api/filterConfig.yml @@ -12,6 +12,3 @@ apiRules: - exclude: uidRegex: ^Progmasoft\.Progmaweb\.Api\.Accounts\.AccountNamePolicy\.CanonicalPattern$ type: Method - - exclude: - uidRegex: ^Progmasoft\.Progmaweb\.Api\.ViGet\.TazelPluginDescriptor\.(IdentifierPattern|VersionPattern)$ - type: Method diff --git a/docs/api/namespaces/Progmasoft.Progmaweb.Api.ViGet.md b/docs/api/namespaces/Progmasoft.Progmaweb.Api.ViGet.md deleted file mode 100644 index ae96906..0000000 --- a/docs/api/namespaces/Progmasoft.Progmaweb.Api.ViGet.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -uid: Progmasoft.Progmaweb.Api.ViGet -summary: *content ---- - -<!-- SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> --> -<!-- SPDX-License-Identifier: AGPL-3.0-or-later --> - -ViGet's catalog of Tazel plugins: the plugins and their versions in the account database, the descriptor of a plugin -JAR, the rules of publishing, the read endpoints under `/api/v1/viget/dslplugins/tazel` with the index Tazel reads, and -the `viget` commands that publish and yank plugins on the server while publishing is open to Progmasoft alone. diff --git a/ops/README.md b/ops/README.md index b8eeac2..15776fc 100644 --- a/ops/README.md +++ b/ops/README.md @@ -35,7 +35,7 @@ avoids depending on an apphost inode copied from a build machine retaining an ex 2. Verify the API directly on `127.0.0.1:5085` and the frontend on `127.0.0.1:3010` before changing Nginx. 3. Point a temporary symlink at the verified release and rename it over `current` atomically. 4. Run `systemd-analyze verify`, `nginx -t`, then restart the two Progmaweb services and reload Nginx. -5. Verify apex HTTPS, the canonical `www` redirect, account routes, ViGet catalog routes, host-specific robots and +5. Verify apex HTTPS, the canonical `www` redirect, account routes, host-specific robots and sitemaps, `/api/v1/status`, and registration validation. 6. On failure, restore the previous `current` target and restart only the Progmaweb services. @@ -97,8 +97,7 @@ DELETE FROM accounts WHERE id = '<id>'; COMMIT; ``` -The Tazel plugins an account published stay in ViGet under its name: projects depend on them, and a removed name -could be registered by someone else. Delete the dump once the deletion is confirmed. +Delete the dump once the deletion is confirmed. ### Logs without client addresses @@ -141,7 +140,7 @@ There is no scheduled backup yet; see [Known limitations](../docs/LIMITATIONS.md of the frontend service. Every host of this server that Progmaweb serves has its own server block in `ops/nginx/progmaweb.conf`; -`viget.progmasoft.com/api/v1/status` answers from the Progmaweb API like `progmasoft.com/api/v1/status`. +`viget.progmasoft.com` answers 410 Gone on every address: ViGet was closed on 2026-11-18. ## Mail boundary @@ -212,74 +211,28 @@ systemd-run --quiet --wait --pty --uid=progmaweb --gid=progmaweb \ ``` The name, the email address and the password follow the rules of registration; only the reserved names are accepted, -and an existing account is never replaced. The account then signs in on `account.progmasoft.com` like any other, and -is the ViGet publisher of the same name. +and an existing account is never replaced. The account then signs in on `account.progmasoft.com` like any other. -## ViGet: Tazel plugins +## Closing ViGet -ViGet opens in stages. Now only the accounts that `ViGet__TazelPublishers` names (Progmasoft by default) publish Tazel -plugins, and they publish on the server; later every account will publish through the API. The catalog lives in the -account database (`viget_*` tables, created by the API at start) and the JARs in `/srv/viget/files`, which Nginx -serves: - -| Address on `viget.progmasoft.com` | Served by | -| --- | --- | -| `/dslplugins/tazel`, `/dslplugins/tazel/<Publisher>/<Name>`, `/dslplugins/gradle` | the Next.js site | -| `/dslplugins/tazel/<Publisher>/<Name>/index.json` | the account API, `/api/v1/viget/dslplugins/tazel/...` | -| `/dslplugins/tazel/<Publisher>/<Name>/<Version>/<Name>-<Version>.jar` | the files below `/srv/viget/files` | - -The directory belongs to the service user, and Nginx reads it: +ViGet was closed on 2026-11-18. The API no longer has its endpoints, its command or its scopes, and Nginx answers +410 Gone on `viget.progmasoft.com`. What it left on the first server is removed once, as root, after a dump: ```sh -install -d -m 0755 -o progmaweb -g progmaweb /srv/viget /srv/viget/files -semanage fcontext -a -t httpd_sys_content_t '/srv/viget/files(/.*)?' -restorecon -R /srv/viget/files +install -d -m 0700 /root/viget-20261118 +runuser -u progmaweb -- pg_dump --table='viget_*' progmaweb_accounts > /root/viget-20261118/viget.sql +cp -a /srv/viget /root/viget-20261118/files +runuser -u progmaweb -- psql -d progmaweb_accounts -c 'DROP TABLE viget_tazel_plugin_versions, viget_tazel_plugins, viget_schema_versions' +rm -r /srv/viget +semanage fcontext -d -t httpd_sys_content_t '/srv/viget/files(/.*)?' ``` -A plugin JAR is published with the configuration of the service, as its user. `systemd-run` reads the environment -file itself, so no value of it appears on a command line: - -```sh -install -d -m 0750 -o progmaweb -g progmaweb /srv/viget/incoming -install -m 0640 -o progmaweb -g progmaweb CMake-0.1.0.jar /srv/viget/incoming/ -systemd-run --quiet --wait --pipe --uid=progmaweb --gid=progmaweb \ - -p EnvironmentFile=/etc/progmaweb/account.env -p Environment=ASPNETCORE_ENVIRONMENT=Production \ - -p WorkingDirectory=/srv/progmaweb/current/api \ - /usr/bin/dotnet /srv/progmaweb/current/api/Progmaweb.Api.dll \ - viget publish-tazel-plugin /srv/viget/incoming/CMake-0.1.0.jar -rm /srv/viget/incoming/CMake-0.1.0.jar -restorecon -R /srv/viget/files -``` - -The publisher of the descriptor must be the name of an existing Progmasoft Account, spelled the same way. - -The command checks the descriptor of the JAR, the publisher, its account and the version, which is never replaced. -`viget yank-tazel-plugin <Publisher> <Name> <Version>` yanks a version, and `--undo` takes the yank back. - -### Taking malicious software off ViGet - -The Security Policy (progmasoft.com/security) says that malicious software found on ViGet is taken off it and that -the uploader's account is closed. A yank alone does not do that: it marks the version, while Nginx keeps serving the -JAR and Cloudflare keeps its copy for a year. Taking a version off ViGet is four steps, as root: - -1. Yank the version with `viget yank-tazel-plugin`, as above, so Tazel no longer resolves it. -2. Move the JAR out of `/srv/viget/files` into `/root/quarantine/viget/<Publisher>/<Name>/<Version>/` (mode 0700). It - stops being served, and the file stays as evidence for the authorities; it is not deleted. -3. Purge its address from the Cloudflare cache (`POST /zones/<zone>/purge_cache` with - `{"files": ["https://viget.progmasoft.com/dslplugins/tazel/<Publisher>/<Name>/<Version>/<Name>-<Version>.jar"]}`) - and check that the address now answers 404. -4. Close the account that uploaded it, as described under "Deleting an account", once whatever the authorities need - from it has been kept. - -ViGet takes uploads only from the publishers `ViGet__TazelPublishers` names, through the command above. When uploads -open to every account, the upload endpoint has to keep the IP address of each upload with the upload, for as long as -the upload is on ViGet and one year after it is removed: the Privacy Policy promises exactly that, and nothing else -keeps an IP address. +`ViGet__*` values go out of `/etc/progmaweb/account.env`. ## Maven repository `maven.progmasoft.com/tazel` is a static Maven repository: it holds `com.progmasoft.tazel:tazel-api`, which plugins of -Tazel compile against. It lives in `/srv/maven/tazel`, labelled like the files of ViGet: +Tazel compile against. It lives in `/srv/maven/tazel`, labelled so that Nginx may read it: ```sh install -d -m 0755 /srv/maven /srv/maven/tazel diff --git a/ops/nginx/progmaweb.conf b/ops/nginx/progmaweb.conf index 01b733a..7a1fd56 100644 --- a/ops/nginx/progmaweb.conf +++ b/ops/nginx/progmaweb.conf @@ -141,6 +141,8 @@ server { } } +# ViGet, the package registry, was closed on 2026-11-18: every address of it +# answers 410 Gone. server { listen 443 ssl; listen [::]:443 ssl; @@ -151,77 +153,12 @@ server { ssl_certificate_key /etc/letsencrypt/live/progmasoft.com/privkey.pem; include /etc/letsencrypt/options-ssl-nginx.conf; - client_max_body_size 1m; - add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always; add_header X-Content-Type-Options "nosniff" always; - add_header X-Frame-Options "DENY" always; - add_header Referrer-Policy "strict-origin-when-cross-origin" always; - add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always; - - location = /login { - return 308 https://account.progmasoft.com/login$is_args$args; - } - - location = /register { - return 308 https://account.progmasoft.com/register$is_args$args; - } - - location = /recover { - return 308 https://account.progmasoft.com/recover$is_args$args; - } - - location = /api/v1/status { - proxy_http_version 1.1; - proxy_pass http://127.0.0.1:5085; - proxy_set_header Host $host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Host $host; - proxy_set_header X-Forwarded-Proto https; - proxy_set_header X-Real-IP $remote_addr; - } - - # The index of a Tazel plugin, which Tazel reads to choose a version and - # check the JAR it downloads: from the API, under its own path. - location ~ "^/dslplugins/tazel/([A-Za-z_][A-Za-z0-9_]*)/([A-Za-z_][A-Za-z0-9_]*)/index\.json$" { - proxy_http_version 1.1; - proxy_pass http://127.0.0.1:5085/api/v1/viget/dslplugins/tazel/$1/$2/index.json; - proxy_set_header Host $host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Host $host; - proxy_set_header X-Forwarded-Proto https; - proxy_set_header X-Real-IP $remote_addr; - add_header Cache-Control "no-cache" always; - add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always; - add_header X-Content-Type-Options "nosniff" always; - } - - # The JARs of Tazel plugins, from the files of ViGet. A version is never - # replaced, so a JAR is cached for good. - location ~ "^/dslplugins/tazel/[A-Za-z_][A-Za-z0-9_]*/[A-Za-z_][A-Za-z0-9_]*/[0-9A-Za-z.+-]+/[A-Za-z_][A-Za-z0-9_]*-[0-9A-Za-z.+-]+\.jar$" { - root /srv/viget/files; - default_type application/java-archive; - types { } - add_header Cache-Control "public, max-age=31536000, immutable" always; - add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always; - add_header X-Content-Type-Options "nosniff" always; - } - - location ^~ /api/ { - return 404; - } location / { - proxy_pass http://127.0.0.1:3010; - proxy_http_version 1.1; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-Host $host; - proxy_set_header Upgrade $progmaweb_upgrade; - proxy_set_header Connection $progmaweb_connection; - proxy_read_timeout 60s; + default_type text/plain; + return 410 "ViGet was closed.\n"; } }