@r8s/forgejo 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +127 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +369 -0
- package/dist/index.js.map +1 -0
- package/package.json +45 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { type DatabaseProps } from '@r8s/recipes';
|
|
2
|
+
export interface ForgejoActionsProps {
|
|
3
|
+
/** Runner replicas (default 1 — runners are stateless, scale freely) */
|
|
4
|
+
replicas?: number;
|
|
5
|
+
/** forgejo-runner image tag (default '6.3.1' — pinned, 'latest' rejected) */
|
|
6
|
+
version?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Pre-created Secret holding the runner registration token (key:
|
|
9
|
+
* `registration-token`). Copy the token from Forgejo (Site administration
|
|
10
|
+
* → Actions → Runners → Create registration token) into your secrets
|
|
11
|
+
* store at `<path>/<name>/runner-registration-token` — the backend then
|
|
12
|
+
* provisions the Secret — or reference an existing Secret here.
|
|
13
|
+
*/
|
|
14
|
+
registrationTokenSecretName?: string;
|
|
15
|
+
/** Runner job labels (default: forgejo runner-images ubuntu-latest) */
|
|
16
|
+
labels?: string[];
|
|
17
|
+
}
|
|
18
|
+
export interface ForgejoProps {
|
|
19
|
+
/** Resource name (defaults to 'forgejo') */
|
|
20
|
+
name?: string;
|
|
21
|
+
/** Kubernetes namespace (inherited from <Platform>/<Namespace> unless set) */
|
|
22
|
+
namespace?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Forgejo image tag (defaults to '11' — tracks patch releases within the
|
|
25
|
+
* major). PINNED VERSION REQUIRED — 'latest' is rejected.
|
|
26
|
+
*/
|
|
27
|
+
version?: string;
|
|
28
|
+
/** Public hostname (required) — web UI, git-over-HTTPS and the advertised SSH host */
|
|
29
|
+
host: string;
|
|
30
|
+
/**
|
|
31
|
+
* Repository data on an RWO PVC mounted at /data. Defaults to '20Gi'.
|
|
32
|
+
* Pass `false` to manage storage yourself. Forgejo is single-replica:
|
|
33
|
+
* repos, LFS (pvc mode) and attachments live on this volume.
|
|
34
|
+
*/
|
|
35
|
+
storage?: string | {
|
|
36
|
+
size?: string;
|
|
37
|
+
storageClass?: string;
|
|
38
|
+
} | false;
|
|
39
|
+
/** CNPG cluster name (also the database and user name). Defaults to 'forgejo-db' */
|
|
40
|
+
dbName?: string;
|
|
41
|
+
/** Number of CNPG instances (defaults to 2) */
|
|
42
|
+
dbInstances?: number;
|
|
43
|
+
/** CNPG data volume size (defaults to '20Gi') */
|
|
44
|
+
dbStorage?: string;
|
|
45
|
+
/** CNPG storage class (defaults to cluster default) */
|
|
46
|
+
dbStorageClass?: string;
|
|
47
|
+
/** CNPG backup passthrough — defaults to **enabled** via the platform's S3Provider; `false` opts out */
|
|
48
|
+
backup?: DatabaseProps['backup'];
|
|
49
|
+
/**
|
|
50
|
+
* LFS storage. `'s3'` derives bucket and credentials from the S3Provider
|
|
51
|
+
* (the default when one is in scope), `'pvc'` keeps large files on the
|
|
52
|
+
* data volume (the fallback without an S3Provider), `false` disables LFS.
|
|
53
|
+
*/
|
|
54
|
+
lfs?: 's3' | 'pvc' | false;
|
|
55
|
+
/**
|
|
56
|
+
* Actions runners — enabled by default (a GitHub-like forge ships
|
|
57
|
+
* Actions). Each runner is a forgejo-runner Deployment with a
|
|
58
|
+
* docker-in-docker sidecar (privileged — run untrusted-code runners in a
|
|
59
|
+
* dedicated namespace/node pool). `false` opts out.
|
|
60
|
+
*/
|
|
61
|
+
actions?: ForgejoActionsProps | true | false;
|
|
62
|
+
/** Open registration (default false — private forge; open deliberately) */
|
|
63
|
+
registration?: boolean;
|
|
64
|
+
/** Expose Prometheus /metrics (default false) */
|
|
65
|
+
metrics?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Reference a pre-created Secret holding `SECRET_KEY`, `INTERNAL_TOKEN`
|
|
68
|
+
* and `LFS_JWT_SECRET` instead of backend provisioning.
|
|
69
|
+
*/
|
|
70
|
+
credentialsSecretName?: string;
|
|
71
|
+
/** Extra annotations merged onto the Endpoint */
|
|
72
|
+
endpointAnnotations?: Record<string, string>;
|
|
73
|
+
/** TLS configuration (defaults to letsencrypt-prod cluster issuer) */
|
|
74
|
+
tls?: {
|
|
75
|
+
secretName: string;
|
|
76
|
+
clusterIssuer: string;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* SSH over a dedicated LoadBalancer Service (default: enabled, port 22).
|
|
80
|
+
* `port` changes the external port AND the port advertised in clone
|
|
81
|
+
* URLs; `annotations` merge onto the Service (MetalLB pools etc.).
|
|
82
|
+
* `false` = git over HTTPS only.
|
|
83
|
+
*/
|
|
84
|
+
ssh?: {
|
|
85
|
+
port?: number;
|
|
86
|
+
annotations?: Record<string, string>;
|
|
87
|
+
} | false;
|
|
88
|
+
/** Operator version override (CNPG) */
|
|
89
|
+
operatorVersion?: string;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Forgejo — self-hosted git forge (GitHub-like: repos, PRs, Actions
|
|
93
|
+
* runners, LFS).
|
|
94
|
+
*
|
|
95
|
+
* @title Forgejo
|
|
96
|
+
* @category Developer Tools
|
|
97
|
+
*
|
|
98
|
+
* Composes:
|
|
99
|
+
* - Forgejo Deployment (single replica + Recreate — repos live on an RWO
|
|
100
|
+
* PVC at /data) with env-to-ini wiring (FORGEJO__section__KEY)
|
|
101
|
+
* - CNPG Postgres cluster (2 instances) with backups on by default via the
|
|
102
|
+
* platform S3Provider
|
|
103
|
+
* - LFS on S3 when an S3Provider is in scope (PVC fallback otherwise)
|
|
104
|
+
* - Actions runners by default: forgejo-runner + docker-in-docker sidecar,
|
|
105
|
+
* registered via a token from the secrets backend
|
|
106
|
+
* - Credential bundle (SECRET_KEY, INTERNAL_TOKEN, LFS_JWT_SECRET)
|
|
107
|
+
* provisioned through the Platform secrets backend with rotation restart
|
|
108
|
+
* - Endpoint with TLS + generous proxy limits (LFS uploads, repo pushes)
|
|
109
|
+
* - SSH over a dedicated LoadBalancer Service (git clone git@…)
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* import { Platform, Namespace, S3Provider, MinIO } from '@r8s/recipes'
|
|
113
|
+
* import { Forgejo } from '@r8s/forgejo'
|
|
114
|
+
*
|
|
115
|
+
* // Backups + LFS derive from the S3Provider; runners ship by default
|
|
116
|
+
* export default (
|
|
117
|
+
* <S3Provider provider={<MinIO endpoint="https://rustfs:9000" bucket="infra" credentialsSecret="infra-s3-creds" />}>
|
|
118
|
+
* <Platform secrets={{ backend: 'openbao', mount: 'kv', path: 'forgejo' }}>
|
|
119
|
+
* <Namespace name="git">
|
|
120
|
+
* <Forgejo host="git.example.com" />
|
|
121
|
+
* </Namespace>
|
|
122
|
+
* </Platform>
|
|
123
|
+
* </S3Provider>
|
|
124
|
+
* )
|
|
125
|
+
*/
|
|
126
|
+
export declare function Forgejo(props: ForgejoProps): import("@r8s/core").r8sElement;
|
|
127
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAQL,KAAK,aAAa,EACnB,MAAM,cAAc,CAAA;AAErB,MAAM,WAAW,mBAAmB;IAClC,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;;;OAMG;IACH,2BAA2B,CAAC,EAAE,MAAM,CAAA;IACpC,uEAAuE;IACvE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,4CAA4C;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,8EAA8E;IAC9E,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,sFAAsF;I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wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,kCAoY1C"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Forgejo = Forgejo;
|
|
4
|
+
const core_1 = require("@r8s/core");
|
|
5
|
+
const defaults_1 = require("@r8s/core/defaults");
|
|
6
|
+
const recipes_1 = require("@r8s/recipes");
|
|
7
|
+
/** Default runner job label — Forgejo's own runner images */
|
|
8
|
+
const DEFAULT_RUNNER_LABELS = [
|
|
9
|
+
'docker:docker://code.forgejo.org/forgejo/runner-images:ubuntu-latest',
|
|
10
|
+
];
|
|
11
|
+
/**
|
|
12
|
+
* Forgejo — self-hosted git forge (GitHub-like: repos, PRs, Actions
|
|
13
|
+
* runners, LFS).
|
|
14
|
+
*
|
|
15
|
+
* @title Forgejo
|
|
16
|
+
* @category Developer Tools
|
|
17
|
+
*
|
|
18
|
+
* Composes:
|
|
19
|
+
* - Forgejo Deployment (single replica + Recreate — repos live on an RWO
|
|
20
|
+
* PVC at /data) with env-to-ini wiring (FORGEJO__section__KEY)
|
|
21
|
+
* - CNPG Postgres cluster (2 instances) with backups on by default via the
|
|
22
|
+
* platform S3Provider
|
|
23
|
+
* - LFS on S3 when an S3Provider is in scope (PVC fallback otherwise)
|
|
24
|
+
* - Actions runners by default: forgejo-runner + docker-in-docker sidecar,
|
|
25
|
+
* registered via a token from the secrets backend
|
|
26
|
+
* - Credential bundle (SECRET_KEY, INTERNAL_TOKEN, LFS_JWT_SECRET)
|
|
27
|
+
* provisioned through the Platform secrets backend with rotation restart
|
|
28
|
+
* - Endpoint with TLS + generous proxy limits (LFS uploads, repo pushes)
|
|
29
|
+
* - SSH over a dedicated LoadBalancer Service (git clone git@…)
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* import { Platform, Namespace, S3Provider, MinIO } from '@r8s/recipes'
|
|
33
|
+
* import { Forgejo } from '@r8s/forgejo'
|
|
34
|
+
*
|
|
35
|
+
* // Backups + LFS derive from the S3Provider; runners ship by default
|
|
36
|
+
* export default (
|
|
37
|
+
* <S3Provider provider={<MinIO endpoint="https://rustfs:9000" bucket="infra" credentialsSecret="infra-s3-creds" />}>
|
|
38
|
+
* <Platform secrets={{ backend: 'openbao', mount: 'kv', path: 'forgejo' }}>
|
|
39
|
+
* <Namespace name="git">
|
|
40
|
+
* <Forgejo host="git.example.com" />
|
|
41
|
+
* </Namespace>
|
|
42
|
+
* </Platform>
|
|
43
|
+
* </S3Provider>
|
|
44
|
+
* )
|
|
45
|
+
*/
|
|
46
|
+
function Forgejo(props) {
|
|
47
|
+
const { name = 'forgejo', namespace: namespaceProp, version = '11', host, storage = '20Gi', dbName = 'forgejo-db', dbInstances = 2, dbStorage = '20Gi', dbStorageClass, backup, lfs, actions = true, registration = false, metrics = false, credentialsSecretName, endpointAnnotations = {}, tls = { secretName: `${name}-tls`, clusterIssuer: 'letsencrypt-prod' }, ssh = {}, operatorVersion, } = props;
|
|
48
|
+
const namespace = (0, defaults_1.useNamespace)(namespaceProp);
|
|
49
|
+
const secretProvider = (0, core_1.useContext)(defaults_1.SecretContext);
|
|
50
|
+
const s3 = (0, recipes_1.useS3)();
|
|
51
|
+
const resources_ = [];
|
|
52
|
+
if (version === 'latest') {
|
|
53
|
+
throw new Error(`Forgejo "${name}" requires a pinned version.\n` +
|
|
54
|
+
`\n` +
|
|
55
|
+
`A git forge holds your entire history — an untested floating tag can\n` +
|
|
56
|
+
`break migrations on upgrade.\n` +
|
|
57
|
+
`\n` +
|
|
58
|
+
`Fix: <Forgejo version="11" ... />`);
|
|
59
|
+
}
|
|
60
|
+
// --- Credential bundle (SECRET_KEY, INTERNAL_TOKEN, LFS_JWT_SECRET) --------
|
|
61
|
+
const credentialsName = credentialsSecretName ?? `${name}-credentials`;
|
|
62
|
+
if (!credentialsSecretName) {
|
|
63
|
+
if (!(0, recipes_1.canProvisionSecrets)(secretProvider)) {
|
|
64
|
+
throw (0, recipes_1.secretsRequiredError)('Forgejo', name, 'the instance credential bundle (SECRET_KEY, INTERNAL_TOKEN, LFS_JWT_SECRET)', {
|
|
65
|
+
propName: 'credentialsSecretName',
|
|
66
|
+
exampleValue: `${name}-credentials`,
|
|
67
|
+
keys: ['SECRET_KEY', 'INTERNAL_TOKEN', 'LFS_JWT_SECRET'],
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
resources_.push((0, core_1.jsx)(recipes_1.StaticSecret, {
|
|
71
|
+
name: `${name}-credentials`,
|
|
72
|
+
namespace,
|
|
73
|
+
path: `${secretProvider.path ?? name}/${name}`,
|
|
74
|
+
secretName: credentialsName,
|
|
75
|
+
keys: ['SECRET_KEY', 'INTERNAL_TOKEN', 'LFS_JWT_SECRET'],
|
|
76
|
+
restart: [{ kind: 'Deployment', name }],
|
|
77
|
+
}));
|
|
78
|
+
}
|
|
79
|
+
// --- LFS storage: S3 when a provider is in scope, PVC otherwise ------------
|
|
80
|
+
const lfsMode = lfs === undefined ? (s3 ? 's3' : 'pvc') : lfs;
|
|
81
|
+
if (lfsMode === 's3' && !s3) {
|
|
82
|
+
throw new Error(`Forgejo "${name}": lfs='s3' requires an <S3Provider> in scope.\n` +
|
|
83
|
+
`\n` +
|
|
84
|
+
`Add one to the Platform (bucket and credentials derive from it):\n` +
|
|
85
|
+
` <S3Provider provider={<MinIO endpoint="https://rustfs:9000" bucket="infra" credentialsSecret="infra-s3-creds" />}>\n` +
|
|
86
|
+
`\n` +
|
|
87
|
+
`or keep LFS on the data volume: <Forgejo lfs="pvc" />`);
|
|
88
|
+
}
|
|
89
|
+
if (lfsMode === 's3' && !s3.credentialsSecret) {
|
|
90
|
+
throw new Error(`Forgejo "${name}": the S3Provider has no credentialsSecret — LFS on S3 needs the bucket credentials.`);
|
|
91
|
+
}
|
|
92
|
+
if (lfsMode === 'pvc' && !storage) {
|
|
93
|
+
throw new Error(`Forgejo "${name}": lfs='pvc' with storage={false} writes LFS files to ephemeral\n` +
|
|
94
|
+
`container storage — they would be lost on pod restart. LFS on PVC lives on the /data volume.\n` +
|
|
95
|
+
`\n` +
|
|
96
|
+
`Fix: give the instance storage (<Forgejo storage="20Gi" />),\n` +
|
|
97
|
+
`put LFS on S3 via an <S3Provider>, or disable LFS explicitly:\n` +
|
|
98
|
+
` <Forgejo storage={false} lfs={false} />`);
|
|
99
|
+
}
|
|
100
|
+
const lfsEnabled = lfsMode !== false;
|
|
101
|
+
// MinIO clients want host:port without scheme + an explicit SSL flag
|
|
102
|
+
const minioEndpoint = s3 ? s3.endpoint.replace(/^https?:\/\//, '') : '';
|
|
103
|
+
const minioUseSsl = s3 ? (s3.endpoint.startsWith('https') ? 'true' : 'false') : 'false';
|
|
104
|
+
// --- Actions runners (default on) ------------------------------------------
|
|
105
|
+
const actionsEnabled = actions !== false;
|
|
106
|
+
const actionsCfg = actions === true || actions === false ? {} : actions;
|
|
107
|
+
const runnerName = `${name}-runner`;
|
|
108
|
+
const runnerTokenSecret = actionsCfg.registrationTokenSecretName ?? `${name}-runner-registration`;
|
|
109
|
+
if (actionsEnabled && !actionsCfg.registrationTokenSecretName) {
|
|
110
|
+
if (!(0, recipes_1.canProvisionSecrets)(secretProvider)) {
|
|
111
|
+
throw (0, recipes_1.secretsRequiredError)('Forgejo', name, 'an Actions runner registration token (Forgejo admin UI → Actions → Runners → Create registration token)', {
|
|
112
|
+
propName: 'actions.registrationTokenSecretName',
|
|
113
|
+
exampleValue: `${name}-runner-registration`,
|
|
114
|
+
keys: ['registration-token'],
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
resources_.push((0, core_1.jsx)(recipes_1.StaticSecret, {
|
|
118
|
+
name: `${name}-runner-registration`,
|
|
119
|
+
namespace,
|
|
120
|
+
path: `${secretProvider.path ?? name}/${name}/runner-registration-token`,
|
|
121
|
+
secretName: runnerTokenSecret,
|
|
122
|
+
keys: ['registration-token'],
|
|
123
|
+
}));
|
|
124
|
+
}
|
|
125
|
+
// --- Env-to-ini wiring -------------------------------------------------------
|
|
126
|
+
// Every credential is delivered via secretKeyRef — no plaintext in the
|
|
127
|
+
// manifest. FORGEJO__section__KEY maps onto app.ini at boot.
|
|
128
|
+
const sshEnabled = ssh !== false;
|
|
129
|
+
const sshCfg = ssh === false ? {} : ssh;
|
|
130
|
+
const env = {
|
|
131
|
+
FORGEJO__server__DOMAIN: host,
|
|
132
|
+
FORGEJO__server__ROOT_URL: `https://${host}`,
|
|
133
|
+
FORGEJO__server__HTTP_PORT: '3000',
|
|
134
|
+
...(sshEnabled
|
|
135
|
+
? {
|
|
136
|
+
FORGEJO__server__SSH_DOMAIN: host,
|
|
137
|
+
FORGEJO__server__SSH_LISTEN_PORT: '22',
|
|
138
|
+
FORGEJO__server__SSH_PORT: String(sshCfg.port ?? 22),
|
|
139
|
+
}
|
|
140
|
+
: { FORGEJO__server__DISABLE_SSH: 'true' }),
|
|
141
|
+
FORGEJO__database__DB_TYPE: 'postgres',
|
|
142
|
+
FORGEJO__database__HOST: `${dbName}-rw.${namespace}.svc.cluster.local:5432`,
|
|
143
|
+
FORGEJO__database__NAME: dbName,
|
|
144
|
+
FORGEJO__database__USER: dbName,
|
|
145
|
+
FORGEJO__database__SSL_MODE: 'disable',
|
|
146
|
+
FORGEJO__security__INSTALL_LOCK: 'true',
|
|
147
|
+
FORGEJO__service__DISABLE_REGISTRATION: registration ? 'false' : 'true',
|
|
148
|
+
...(lfsEnabled ? { FORGEJO__lfs__ENABLED: 'true' } : {}),
|
|
149
|
+
...(lfsMode === 's3'
|
|
150
|
+
? {
|
|
151
|
+
'FORGEJO__storage.lfs__STORAGE_TYPE': 'minio',
|
|
152
|
+
'FORGEJO__storage.lfs__MINIO_ENDPOINT': minioEndpoint,
|
|
153
|
+
'FORGEJO__storage.lfs__MINIO_USE_SSL': minioUseSsl,
|
|
154
|
+
'FORGEJO__storage.lfs__MINIO_BUCKET_LOOKUP_TYPE': s3.forcePathStyle ? 'path' : 'dns',
|
|
155
|
+
'FORGEJO__storage.lfs__MINIO_BUCKET': s3.bucket,
|
|
156
|
+
}
|
|
157
|
+
: {}),
|
|
158
|
+
...(metrics ? { FORGEJO__metrics__ENABLED: 'true' } : {}),
|
|
159
|
+
...(actionsEnabled ? { FORGEJO__actions__ENABLED: 'true' } : {}),
|
|
160
|
+
};
|
|
161
|
+
const secrets = {
|
|
162
|
+
FORGEJO__database__PASSWD: { secret: `${dbName}-db-credentials`, key: 'password' },
|
|
163
|
+
FORGEJO__security__SECRET_KEY: { secret: credentialsName, key: 'SECRET_KEY' },
|
|
164
|
+
FORGEJO__security__INTERNAL_TOKEN: { secret: credentialsName, key: 'INTERNAL_TOKEN' },
|
|
165
|
+
...(lfsEnabled
|
|
166
|
+
? { FORGEJO__lfs__LFS_JWT_SECRET: { secret: credentialsName, key: 'LFS_JWT_SECRET' } }
|
|
167
|
+
: {}),
|
|
168
|
+
...(lfsMode === 's3'
|
|
169
|
+
? {
|
|
170
|
+
'FORGEJO__storage.lfs__MINIO_ACCESS_KEY_ID': {
|
|
171
|
+
secret: s3.credentialsSecret,
|
|
172
|
+
key: 'access-key-id',
|
|
173
|
+
},
|
|
174
|
+
'FORGEJO__storage.lfs__MINIO_SECRET_ACCESS_KEY': {
|
|
175
|
+
secret: s3.credentialsSecret,
|
|
176
|
+
key: 'secret-access-key',
|
|
177
|
+
},
|
|
178
|
+
}
|
|
179
|
+
: {}),
|
|
180
|
+
};
|
|
181
|
+
// --- Repository data volume --------------------------------------------------
|
|
182
|
+
if (storage) {
|
|
183
|
+
const size = typeof storage === 'string' ? storage : (storage.size ?? '20Gi');
|
|
184
|
+
const storageClass = typeof storage === 'object' ? storage.storageClass : undefined;
|
|
185
|
+
resources_.push((0, core_1.jsx)('PersistentVolumeClaim', {
|
|
186
|
+
apiVersion: 'v1',
|
|
187
|
+
kind: 'PersistentVolumeClaim',
|
|
188
|
+
metadata: { name: `${name}-data`, namespace },
|
|
189
|
+
spec: {
|
|
190
|
+
accessModes: ['ReadWriteOnce'],
|
|
191
|
+
...(storageClass ? { storageClassName: storageClass } : {}),
|
|
192
|
+
resources: { requests: { storage: size } },
|
|
193
|
+
},
|
|
194
|
+
}));
|
|
195
|
+
}
|
|
196
|
+
resources_.push((0, core_1.jsx)(recipes_1.Database, {
|
|
197
|
+
name: dbName,
|
|
198
|
+
namespace,
|
|
199
|
+
instances: dbInstances,
|
|
200
|
+
storage: dbStorage,
|
|
201
|
+
...(dbStorageClass ? { storageClass: dbStorageClass } : {}),
|
|
202
|
+
backup: backup ?? true,
|
|
203
|
+
operatorVersion,
|
|
204
|
+
}), (0, core_1.jsx)(recipes_1.WebService, {
|
|
205
|
+
name,
|
|
206
|
+
namespace,
|
|
207
|
+
image: `codeberg.org/forgejo/forgejo:${version}`,
|
|
208
|
+
port: 3000,
|
|
209
|
+
replicas: 1,
|
|
210
|
+
strategy: 'Recreate',
|
|
211
|
+
resources: {
|
|
212
|
+
requests: { memory: '512Mi', cpu: '250m' },
|
|
213
|
+
limits: { memory: '2Gi', cpu: '2' },
|
|
214
|
+
},
|
|
215
|
+
env,
|
|
216
|
+
secrets,
|
|
217
|
+
volumes: storage
|
|
218
|
+
? [{ name: 'data', persistentVolumeClaim: { claimName: `${name}-data` } }]
|
|
219
|
+
: [],
|
|
220
|
+
volumeMounts: storage ? [{ name: 'data', mountPath: '/data' }] : [],
|
|
221
|
+
probes: {
|
|
222
|
+
// Upgrades run schema migrations — give the startup probe room
|
|
223
|
+
startup: { path: '/api/healthz', periodSeconds: 5, failureThreshold: 60 },
|
|
224
|
+
readiness: { path: '/api/healthz', periodSeconds: 10, failureThreshold: 3 },
|
|
225
|
+
liveness: { path: '/api/healthz', periodSeconds: 30, failureThreshold: 3 },
|
|
226
|
+
},
|
|
227
|
+
}), (0, core_1.jsx)(recipes_1.Endpoint, {
|
|
228
|
+
name: `${name}-endpoint`,
|
|
229
|
+
namespace,
|
|
230
|
+
host,
|
|
231
|
+
serviceName: name,
|
|
232
|
+
servicePort: 80,
|
|
233
|
+
annotations: {
|
|
234
|
+
// LFS uploads and repo pushes can be large and slow
|
|
235
|
+
'nginx.ingress.kubernetes.io/proxy-body-size': '512m',
|
|
236
|
+
'nginx.ingress.kubernetes.io/proxy-read-timeout': '900',
|
|
237
|
+
'nginx.ingress.kubernetes.io/proxy-send-timeout': '900',
|
|
238
|
+
...endpointAnnotations,
|
|
239
|
+
},
|
|
240
|
+
tls,
|
|
241
|
+
}));
|
|
242
|
+
// --- SSH over a dedicated LoadBalancer (git clone git@…) ---------------------
|
|
243
|
+
if (sshEnabled) {
|
|
244
|
+
resources_.push((0, core_1.jsx)('Service', {
|
|
245
|
+
apiVersion: 'v1',
|
|
246
|
+
kind: 'Service',
|
|
247
|
+
metadata: {
|
|
248
|
+
name: `${name}-ssh`,
|
|
249
|
+
namespace,
|
|
250
|
+
...(sshCfg.annotations ? { annotations: sshCfg.annotations } : {}),
|
|
251
|
+
},
|
|
252
|
+
spec: {
|
|
253
|
+
type: 'LoadBalancer',
|
|
254
|
+
selector: { app: name },
|
|
255
|
+
ports: [{ name: 'ssh', port: sshCfg.port ?? 22, targetPort: 22, protocol: 'TCP' }],
|
|
256
|
+
},
|
|
257
|
+
}));
|
|
258
|
+
}
|
|
259
|
+
// --- Actions runner: forgejo-runner + docker-in-docker ----------------------------
|
|
260
|
+
if (actionsEnabled) {
|
|
261
|
+
const runnerLabels = actionsCfg.labels ?? DEFAULT_RUNNER_LABELS;
|
|
262
|
+
const runnerConfig = [
|
|
263
|
+
'runner:',
|
|
264
|
+
' file: /runner/.runner',
|
|
265
|
+
' capacity: 2',
|
|
266
|
+
' timeout: 3h',
|
|
267
|
+
' labels:',
|
|
268
|
+
...runnerLabels.map((l) => ` - '${l}'`),
|
|
269
|
+
'container:',
|
|
270
|
+
' docker_host: unix:///var/run/docker.sock',
|
|
271
|
+
' privileged: false',
|
|
272
|
+
].join('\n');
|
|
273
|
+
resources_.push((0, core_1.jsx)('ConfigMap', {
|
|
274
|
+
apiVersion: 'v1',
|
|
275
|
+
kind: 'ConfigMap',
|
|
276
|
+
metadata: { name: `${name}-runner-config`, namespace },
|
|
277
|
+
data: { 'config.yaml': runnerConfig },
|
|
278
|
+
}), (0, core_1.jsx)('Deployment', {
|
|
279
|
+
apiVersion: 'apps/v1',
|
|
280
|
+
kind: 'Deployment',
|
|
281
|
+
metadata: { name: runnerName, namespace },
|
|
282
|
+
spec: {
|
|
283
|
+
replicas: actionsCfg.replicas ?? 1,
|
|
284
|
+
selector: { matchLabels: { app: runnerName } },
|
|
285
|
+
template: {
|
|
286
|
+
metadata: { labels: { app: runnerName } },
|
|
287
|
+
spec: {
|
|
288
|
+
// the runner talks to Forgejo over HTTPS, never the kube API —
|
|
289
|
+
// don't hand a privileged (dind) pod API credentials for free
|
|
290
|
+
automountServiceAccountToken: false,
|
|
291
|
+
volumes: [
|
|
292
|
+
{ name: 'runner', emptyDir: {} },
|
|
293
|
+
{ name: 'config', configMap: { name: `${name}-runner-config` } },
|
|
294
|
+
{ name: 'docker-sock', emptyDir: {} },
|
|
295
|
+
],
|
|
296
|
+
initContainers: [
|
|
297
|
+
{
|
|
298
|
+
name: 'runner-register',
|
|
299
|
+
image: `code.forgejo.org/forgejo/runner:${actionsCfg.version ?? '6.3.1'}`,
|
|
300
|
+
command: ['sh', '-c'],
|
|
301
|
+
args: [
|
|
302
|
+
'forgejo-runner register --instance "$INSTANCE_URL" --token "$REGISTRATION_TOKEN" --name "$RUNNER_NAME" --no-interactive',
|
|
303
|
+
],
|
|
304
|
+
env: [
|
|
305
|
+
// In-cluster URL: registration and job polling must not
|
|
306
|
+
// depend on ingress DNS or hairpinning through the LB —
|
|
307
|
+
// the Service exposes port 80 → the container's 3000.
|
|
308
|
+
{
|
|
309
|
+
name: 'INSTANCE_URL',
|
|
310
|
+
value: `http://${name}.${namespace}.svc.cluster.local`,
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
name: 'RUNNER_NAME',
|
|
314
|
+
valueFrom: { fieldRef: { fieldPath: 'metadata.name' } },
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
name: 'REGISTRATION_TOKEN',
|
|
318
|
+
valueFrom: {
|
|
319
|
+
secretKeyRef: { name: runnerTokenSecret, key: 'registration-token' },
|
|
320
|
+
},
|
|
321
|
+
},
|
|
322
|
+
],
|
|
323
|
+
workingDir: '/runner',
|
|
324
|
+
volumeMounts: [{ name: 'runner', mountPath: '/runner' }],
|
|
325
|
+
},
|
|
326
|
+
],
|
|
327
|
+
containers: [
|
|
328
|
+
{
|
|
329
|
+
name: 'runner',
|
|
330
|
+
image: `code.forgejo.org/forgejo/runner:${actionsCfg.version ?? '6.3.1'}`,
|
|
331
|
+
command: ['forgejo-runner', 'daemon', '--config', '/runner-config/config.yaml'],
|
|
332
|
+
env: [{ name: 'DOCKER_HOST', value: 'unix:///var/run/docker.sock' }],
|
|
333
|
+
volumeMounts: [
|
|
334
|
+
{ name: 'runner', mountPath: '/runner' },
|
|
335
|
+
{ name: 'config', mountPath: '/runner-config' },
|
|
336
|
+
{ name: 'docker-sock', mountPath: '/var/run' },
|
|
337
|
+
],
|
|
338
|
+
resources: {
|
|
339
|
+
requests: { memory: '256Mi', cpu: '100m' },
|
|
340
|
+
limits: { memory: '1Gi', cpu: '1' },
|
|
341
|
+
},
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
name: 'dind',
|
|
345
|
+
image: 'docker:27-dind',
|
|
346
|
+
// dockerd creates the socket as root; the runner sidecar
|
|
347
|
+
// runs as a non-root uid — open the socket once it appears
|
|
348
|
+
// (2-min budget) or the runner CrashLoops on permission
|
|
349
|
+
command: ['sh', '-c'],
|
|
350
|
+
args: [
|
|
351
|
+
'dockerd-entrypoint.sh & DOCKERD=$!; for i in $(seq 1 240); do [ -S /var/run/docker.sock ] && break; sleep 0.5; done; chmod 666 /var/run/docker.sock 2>/dev/null || true; wait $DOCKERD',
|
|
352
|
+
],
|
|
353
|
+
env: [{ name: 'DOCKER_TLS_CERTDIR', value: '' }],
|
|
354
|
+
securityContext: { privileged: true },
|
|
355
|
+
volumeMounts: [{ name: 'docker-sock', mountPath: '/var/run' }],
|
|
356
|
+
resources: {
|
|
357
|
+
requests: { memory: '512Mi', cpu: '250m' },
|
|
358
|
+
limits: { memory: '4Gi', cpu: '2' },
|
|
359
|
+
},
|
|
360
|
+
},
|
|
361
|
+
],
|
|
362
|
+
},
|
|
363
|
+
},
|
|
364
|
+
},
|
|
365
|
+
}));
|
|
366
|
+
}
|
|
367
|
+
return (0, core_1.jsx)(core_1.Fragment, { children: resources_ });
|
|
368
|
+
}
|
|
369
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":";;AA0IA,0BAoYC;AA9gBD,oCAAqD;AACrD,iDAAgE;AAChE,0CASqB;AAuFrB,6DAA6D;AAC7D,MAAM,qBAAqB,GAAG;IAC5B,sEAAsE;CACvE,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,SAAgB,OAAO,CAAC,KAAmB;IACzC,MAAM,EACJ,IAAI,GAAG,SAAS,EAChB,SAAS,EAAE,aAAa,EACxB,OAAO,GAAG,IAAI,EACd,IAAI,EACJ,OAAO,GAAG,MAAM,EAChB,MAAM,GAAG,YAAY,EACrB,WAAW,GAAG,CAAC,EACf,SAAS,GAAG,MAAM,EAClB,cAAc,EACd,MAAM,EACN,GAAG,EACH,OAAO,GAAG,IAAI,EACd,YAAY,GAAG,KAAK,EACpB,OAAO,GAAG,KAAK,EACf,qBAAqB,EACrB,mBAAmB,GAAG,EAAE,EACxB,GAAG,GAAG,EAAE,UAAU,EAAE,GAAG,IAAI,MAAM,EAAE,aAAa,EAAE,kBAAkB,EAAE,EACtE,GAAG,GAAG,EAAE,EACR,eAAe,GAChB,GAAG,KAAK,CAAA;IAET,MAAM,SAAS,GAAG,IAAA,uBAAY,EAAC,aAAa,CAAC,CAAA;I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ACE,IAAI,EAAE,MAAM;gCACZ,KAAK,EAAE,gBAAgB;gCACvB,yDAAyD;gCACzD,2DAA2D;gCAC3D,wDAAwD;gCACxD,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;gCACrB,IAAI,EAAE;oCACJ,wLAAwL;iCACzL;gCACD,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,oBAAoB,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;gCAChD,eAAe,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;gCACrC,YAAY,EAAE,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;gCAC9D,SAAS,EAAE;oCACT,QAAQ,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE;oCAC1C,MAAM,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE;iCACpC;6BACF;yBACF;qBACF;iBACF;aACF;SACF,CAAC,CACH,CAAA;IACH,CAAC;IAED,OAAO,IAAA,UAAG,EAAC,eAAQ,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,CAAA;AAChD,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@r8s/forgejo",
|
|
3
|
+
"version": "0.3.2",
|
|
4
|
+
"description": "Forgejo git forge \u2014 repos, PRs, Actions runners (forgejo-runner + dind), LFS on S3, CNPG persistence, SSH via LoadBalancer",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Berget AI AB",
|
|
7
|
+
"homepage": "https://r8s.berget.ai",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/berget-ai/r8s.git",
|
|
11
|
+
"directory": "packages/forgejo"
|
|
12
|
+
},
|
|
13
|
+
"bugs": "https://github.com/berget-ai/r8s/issues",
|
|
14
|
+
"keywords": [
|
|
15
|
+
"forgejo",
|
|
16
|
+
"git",
|
|
17
|
+
"ci",
|
|
18
|
+
"actions",
|
|
19
|
+
"lfs"
|
|
20
|
+
],
|
|
21
|
+
"r8s": {
|
|
22
|
+
"category": "Developer Tools"
|
|
23
|
+
},
|
|
24
|
+
"main": "./dist/index.js",
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "tsc --build",
|
|
28
|
+
"test": "vitest run",
|
|
29
|
+
"clean": "rm -rf dist tsconfig.tsbuildinfo"
|
|
30
|
+
},
|
|
31
|
+
"category": "Developer Tools",
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@r8s/core": "^0.3.0",
|
|
34
|
+
"@r8s/crds": "^0.3.0",
|
|
35
|
+
"@r8s/k8s-types": "^0.3.0",
|
|
36
|
+
"@r8s/recipes": "^0.3.0"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"typescript": "^5.3.0",
|
|
40
|
+
"vitest": "^1.0.0"
|
|
41
|
+
},
|
|
42
|
+
"files": [
|
|
43
|
+
"dist"
|
|
44
|
+
]
|
|
45
|
+
}
|