A modern and easy to use dashboard. 80+ integrations. 20K+ icons built in. Authentication out of the box. No YAML, drag and drop configuration.
refactor: renamed `GitHubPackages` integration to `GitHubContainerRegistry`, and all related code (#3727)
Andre Silva3f3d31eb6a72
diff --git a/packages/definitions/src/integration.ts b/packages/definitions/src/integration.tsindex bbf0a66ba..2cfd1c26f 100644--- a/packages/definitions/src/integration.ts+++ b/packages/definitions/src/integration.ts@@ -214,8 +214,8 @@ export const integrationDefs = {category: ["releasesProvider"],defaultUrl: "https://api.linuxserver.io",},- githubPackages: {- name: "Github Packages",+ gitHubContainerRegistry: {+ name: "GitHub Container Registry",secretKinds: [[], ["personalAccessToken"]],iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/github.svg",category: ["releasesProvider"],diff --git a/packages/integrations/src/base/creator.ts b/packages/integrations/src/base/creator.tsindex c0dc58462..fa6480180 100644--- a/packages/integrations/src/base/creator.ts+++ b/packages/integrations/src/base/creator.ts@@ -14,7 +14,7 @@ import { QBitTorrentIntegration } from "../download-client/qbittorrent/qbittorreimport { SabnzbdIntegration } from "../download-client/sabnzbd/sabnzbd-integration";import { TransmissionIntegration } from "../download-client/transmission/transmission-integration";import { EmbyIntegration } from "../emby/emby-integration";-import { GithubPackagesIntegration } from "../github-packages/github-packages-integration";+import { GitHubContainerRegistryIntegration } from "../github-container-registry/github-container-registry-integration";import { GithubIntegration } from "../github/github-integration";import { GitlabIntegration } from "../gitlab/gitlab-integration";import { HomeAssistantIntegration } from "../homeassistant/homeassistant-integration";@@ -108,7 +108,7 @@ export const integrationCreators = {npm: NPMIntegration,codeberg: CodebergIntegration,linuxServerIO: LinuxServerIOIntegration,- githubPackages: GithubPackagesIntegration,+ gitHubContainerRegistry: GitHubContainerRegistryIntegration,quay: QuayIntegration,ntfy: NTFYIntegration,mock: MockIntegration,diff --git a/packages/integrations/src/github-packages/github-packages-integration.ts b/packages/integrations/src/github-container-registry/github-container-registry-integration.tssimilarity index 89%rename from packages/integrations/src/github-packages/github-packages-integration.tsrename to packages/integrations/src/github-container-registry/github-container-registry-integration.tsindex 64ef59f85..826de6a2f 100644--- a/packages/integrations/src/github-packages/github-packages-integration.ts+++ b/packages/integrations/src/github-container-registry/github-container-registry-integration.ts@@ -16,14 +16,14 @@ import type {ReleasesResponse,} from "../interfaces/releases-providers/releases-providers-types";-const localLogger = logger.child({ module: "GithubPackagesIntegration" });+const localLogger = logger.child({ module: "GitHubContainerRegistryIntegration" });-export class GithubPackagesIntegration extends Integration implements ReleasesProviderIntegration {- private static readonly userAgent = "Homarr-Lab/Homarr:GithubPackagesIntegration";+export class GitHubContainerRegistryIntegration extends Integration implements ReleasesProviderIntegration {+ private static readonly userAgent = "Homarr-Lab/Homarr:GitHubContainerRegistryIntegration";protected async testingAsync(input: IntegrationTestingInput): Promise<TestingResult> {const headers: RequestInit["headers"] = {- "User-Agent": GithubPackagesIntegration.userAgent,+ "User-Agent": GitHubContainerRegistryIntegration.userAgent,};if (this.hasSecretValue("personalAccessToken"))@@ -46,7 +46,7 @@ export class GithubPackagesIntegration extends Integration implements ReleasesPrconst [owner, name] = repository.identifier.split("/");if (!owner || !name) {localLogger.warn(- `Invalid identifier format. Expected 'owner/name', for ${repository.identifier} with Github Packages integration`,+ `Invalid identifier format. Expected 'owner/name', for ${repository.identifier} with GitHub Container Registry integration`,{identifier: repository.identifier,},@@ -86,7 +86,7 @@ export class GithubPackagesIntegration extends Integration implements ReleasesPr} catch (error) {const errorMessage = error instanceof RequestError ? error.message : String(error);- localLogger.warn(`Failed to get releases for ${owner}\\${name} with Github Packages integration`, {+ localLogger.warn(`Failed to get releases for ${owner}\\${name} with GitHub Container Registry integration`, {owner,name,error: errorMessage,@@ -122,7 +122,7 @@ export class GithubPackagesIntegration extends Integration implements ReleasesPrforksCount: response.data.repository?.forks_count,};} catch (error) {- localLogger.warn(`Failed to get details for ${owner}\\${name} with Github Packages integration`, {+ localLogger.warn(`Failed to get details for ${owner}\\${name} with GitHub Container Registry integration`, {owner,name,error: error instanceof RequestError ? error.message : String(error),@@ -137,7 +137,7 @@ export class GithubPackagesIntegration extends Integration implements ReleasesPrrequest: {fetch: fetchWithTrustedCertificatesAsync,},- userAgent: GithubPackagesIntegration.userAgent,+ userAgent: GitHubContainerRegistryIntegration.userAgent,throttle: { enabled: false }, // Disable throttling for this integration, Octokit will retry by default after a set time, thus delaying the repsonse to the user in case of errors. Errors will be shown to the user, no need to retry the request....(this.hasSecretValue("personalAccessToken") ? { auth: this.getSecretValue("personalAccessToken") } : {}),});