Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(keygen): Add host property to support self-hosted Keygen instances #8711

Merged
merged 8 commits into from
Dec 6, 2024
8 changes: 8 additions & 0 deletions .changeset/kind-poems-joke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"app-builder-lib": minor
"builder-util-runtime": minor
"electron-publish": minor
"electron-updater": minor
---

add host option for keycloak provider
hrueger marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 4 additions & 0 deletions packages/app-builder-lib/scheme.json
Original file line number Diff line number Diff line change
Expand Up @@ -1578,6 +1578,10 @@
"default": "stable",
"description": "The channel."
},
"host": {
"description": "Keygen host",
"type": "string"
},
"platform": {
"description": "The target Platform. Is set programmatically explicitly during publishing.",
"type": [
Expand Down
5 changes: 5 additions & 0 deletions packages/builder-util-runtime/src/publishOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,11 @@ export interface KeygenOptions extends PublishConfiguration {
*/
readonly provider: "keygen"

/**
* Keygen host
hrueger marked this conversation as resolved.
Show resolved Hide resolved
*/
readonly host?: string

/**
* Keygen account's UUID
*/
Expand Down
3 changes: 2 additions & 1 deletion packages/electron-publish/src/keygenPublisher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export interface KeygenArtifact {

export class KeygenPublisher extends HttpPublisher {
readonly providerName = "keygen"
readonly hostname = "api.keygen.sh"
readonly hostname: string = "api.keygen.sh"

private readonly info: KeygenOptions
private readonly auth: string
Expand All @@ -96,6 +96,7 @@ export class KeygenPublisher extends HttpPublisher {
}

this.info = info
if (info.host) this.hostname = info.host
hrueger marked this conversation as resolved.
Show resolved Hide resolved
this.auth = `Bearer ${token.trim()}`
this.version = version
this.basePath = `/v1/accounts/${this.info.account}`
Expand Down
2 changes: 1 addition & 1 deletion packages/electron-updater/src/providers/KeygenProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class KeygenProvider extends Provider<UpdateInfo> {
...runtimeOptions,
isUseMultipleRangeRequest: false,
})
this.baseUrl = newBaseUrl(`https://api.keygen.sh/v1/accounts/${this.configuration.account}/artifacts?product=${this.configuration.product}`)
this.baseUrl = newBaseUrl(`https://${this.configuration.host || "api.keygen.sh"}/v1/accounts/${this.configuration.account}/artifacts?product=${this.configuration.product}`)
hrueger marked this conversation as resolved.
Show resolved Hide resolved
}

private get channel(): string {
Expand Down