Skip to content

Commit db52623

Browse files
committed
refactor: remove useless GITHUB_TOKEN env variable
1 parent 6601bc4 commit db52623

File tree

9 files changed

+1
-24
lines changed

9 files changed

+1
-24
lines changed

api/src/core/bootstrap.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ type DbConfig = PgDbConfig;
2323

2424
type ParamsOfBootstrapCore = {
2525
dbConfig: DbConfig;
26-
githubPersonalAccessTokenForApiRateLimit: string;
2726
externalSoftwareDataOrigin: ExternalDataOrigin;
2827
};
2928

api/src/core/updateTools.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ type DbConfig = PgDbConfig;
1717

1818
type ParamsOfUpdateService = {
1919
dbConfig: DbConfig;
20-
githubPersonalAccessTokenForApiRateLimit: string;
2120
externalSoftwareDataOrigin: ExternalDataOrigin;
2221
};
2322

api/src/env.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ const zEnvConfiguration = z.object({
77
"clientId": z.string().nonempty()
88
}),
99
"termsOfServiceUrl": zLocalizedString,
10-
// Only for increasing the rate limit on GitHub API
11-
// we use the GitHub API for pre filling the version when adding a software
12-
"githubPersonalAccessTokenForApiRateLimit": z.string().nonempty(),
1310
//Port we listen to
1411
"port": z.coerce.number().optional().default(8080),
1512
"isDevEnvironnement": z.boolean().optional(),
@@ -28,7 +25,6 @@ const envConfiguration = zEnvConfiguration.parse({
2825
"clientId": process.env.OIDC_CLIENT_ID
2926
},
3027
"termsOfServiceUrl": process.env.TERMS_OF_SERVICE_URL,
31-
"githubPersonalAccessTokenForApiRateLimit": process.env.GITHUB_TOKEN,
3228
"port": parseInt(process.env.API_PORT ?? ""),
3329
"isDevEnvironnement": process.env.IS_DEV_ENVIRONNEMENT?.toLowerCase() === "true",
3430
"externalSoftwareDataOrigin": process.env.EXTERNAL_SOFTWARE_DATA_ORIGIN,

api/src/rpc/createTestCaller.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ export const createTestCaller = async ({ user }: TestCallerConfig = { user: defa
2626

2727
const { dbApi, useCases, uiConfig } = await bootstrapCore({
2828
"dbConfig": { dbKind: "kysely", kyselyDb },
29-
"githubPersonalAccessTokenForApiRateLimit": "fake-token",
3029
"externalSoftwareDataOrigin": externalSoftwareDataOrigin
3130
});
3231

api/src/rpc/start.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ console.info(isAssignable(translationFr) ? "isAssignable : true" : "isAssignable
3131
export async function startRpcService(params: {
3232
oidcParams: OidcParams;
3333
termsOfServiceUrl: LocalizedString;
34-
githubPersonalAccessTokenForApiRateLimit: string;
3534
port: number;
3635
isDevEnvironnement: boolean;
3736
externalSoftwareDataOrigin: ExternalDataOrigin;
@@ -46,7 +45,6 @@ export async function startRpcService(params: {
4645
oidcParams,
4746
termsOfServiceUrl,
4847
port,
49-
githubPersonalAccessTokenForApiRateLimit,
5048
isDevEnvironnement,
5149
externalSoftwareDataOrigin,
5250
databaseUrl,
@@ -68,8 +66,6 @@ export async function startRpcService(params: {
6866
"dbKind": "kysely",
6967
"kyselyDb": kyselyDb
7068
},
71-
githubPersonalAccessTokenForApiRateLimit,
72-
// "doPerPerformPeriodicalCompilation": !isDevEnvironnement && redirectUrl === undefined,
7369
"externalSoftwareDataOrigin": externalSoftwareDataOrigin
7470
}),
7571
createContextFactory({

api/src/rpc/update.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,11 @@ import type { ExternalDataOrigin } from "../core/ports/GetSoftwareExternalData";
77
import { updateTool } from "../core/updateTools";
88

99
export async function startUpdateService(params: {
10-
githubPersonalAccessTokenForApiRateLimit: string;
1110
isDevEnvironnement: boolean;
1211
externalSoftwareDataOrigin: ExternalDataOrigin;
1312
databaseUrl: string;
1413
}) {
15-
const {
16-
githubPersonalAccessTokenForApiRateLimit,
17-
isDevEnvironnement,
18-
externalSoftwareDataOrigin,
19-
databaseUrl,
20-
...rest
21-
} = params;
14+
const { isDevEnvironnement, externalSoftwareDataOrigin, databaseUrl, ...rest } = params;
2215

2316
assert<Equals<typeof rest, {}>>();
2417

@@ -31,7 +24,6 @@ export async function startUpdateService(params: {
3124
"dbKind": "kysely",
3225
"kyselyDb": kyselyDb
3326
},
34-
githubPersonalAccessTokenForApiRateLimit,
3527
"externalSoftwareDataOrigin": externalSoftwareDataOrigin
3628
});
3729

docs/deploying-the-web-app-bare-metal.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ Create a `.env` file with a content like this
5454
OIDC_ISSUER_URI=http://localhost:8081/auth/realms/codegouv
5555
OIDC_CLIENT_ID=sill
5656
TERMS_OF_SERVICE_URL=https://code.gouv.fr/sill/tos_fr.md
57-
GITHUB_TOKEN=ghp_xxxxxx
5857
API_PORT=3084
5958
IS_DEV_ENVIRONNEMENT=true
6059
DATABASE_URL=postgresql://sill:pg_password@localhost:5432/sill

docs/deploying.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,6 @@ SSH_PRIVATE_KEY="-----BEGIN OPENSSH PRIVATE KEY-----\nxxxx\nxxxx\nxxxx\nAxxxx\nx
376376
DATA_REPO_SSH_URL="[email protected]:codegouvfr/sill-data.git" # Replace by the repo you created earlyer
377377
KEYCLOAK_PASSWORD=yyyyyy # Make sure it's the same that the one you defined earlyer
378378
WEBHOOK_SECRET=dSdSPxxxxxx # (optional) Some random caracters
379-
GITHUB_TOKEN=ghp_xxxxxx # A token, just for the GitHub API rate limit.
380379
SOFTWARE_DATA_ORIGIN=wikidata # Can be "wikidata" or "HAL" (See: https://hal.science/)
381380

382381
WEB_VERSION="1.41.2" # To keep up to date with https://github.com/codegouvfr/sill-web/releases/
@@ -433,7 +432,6 @@ api:
433432
"sshPrivateKeyForGitName": "$SSH_PRIVATE_KEY_NAME",
434433
"sshPrivateKeyForGit": "$SSH_PRIVATE_KEY",
435434
"githubWebhookSecret": "$WEBHOOK_SECRET",
436-
"githubPersonalAccessTokenForApiRateLimit": "$GITHUB_TOKEN",
437435
"externalSoftwareDataOrigin": "$SOFTWARE_DATA_ORIGIN"
438436
}
439437

docs/setting-up-a-development-environment.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ Makes sure to put the name of your SSH key and the private key (generated when y
2727
OIDC_ISSUER_URI=http://localhost:8081/auth/realms/codegouv
2828
OIDC_CLIENT_ID=sill
2929
TERMS_OF_SERVICE_URL=https://code.gouv.fr/sill/tos_fr.md
30-
GITHUB_TOKEN=ghp_xxxxxx
3130
API_PORT=3084
3231
IS_DEV_ENVIRONNEMENT=true
3332
DATABASE_URL=postgresql://sill:pg_password@localhost:5432/sill

0 commit comments

Comments
 (0)