Skip to content

Commit fc834bb

Browse files
committed
chore: Remove CurseForge API key from env variables and put it in the constants file
1 parent cbc7ae8 commit fc834bb

File tree

9 files changed

+3
-240
lines changed

9 files changed

+3
-240
lines changed

.github/workflows/release.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ jobs:
3838
- uses: tauri-apps/tauri-action@v0
3939
env:
4040
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41-
CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }}
4241
with:
4342
tagName: onelauncher-__VERSION__
4443
releaseName: OneLauncher __VERSION__

.template.env

Lines changed: 0 additions & 3 deletions
This file was deleted.

apps/frontend/tsconfig.json

Lines changed: 0 additions & 40 deletions
This file was deleted.

apps/frontend/tsconfig.node.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

apps/frontend/uno.config.ts

Lines changed: 0 additions & 139 deletions
This file was deleted.

apps/frontend/vitest.config.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/core/build.rs

Lines changed: 0 additions & 40 deletions
This file was deleted.

packages/core/src/api/package/content/curseforge.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,8 +450,7 @@ pub async fn fetch_advanced<F: FnOnce(&mut Url)>(
450450
json_body: Option<serde_json::Value>,
451451
) -> Result<Bytes> {
452452
// TODO: Get the API key from settings, fallback to constant, and error if missing
453-
let key = crate::constants::CURSEFORGE_API_KEY
454-
.ok_or(anyhow::anyhow!("missing curseforge api key"))?;
453+
let key = crate::constants::CURSEFORGE_API_KEY;
455454

456455
let mut headers = headers.unwrap_or(HashMap::<&str, &str>::new());
457456
headers.insert("x-api-key", key);

packages/core/src/constants.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ pub const MODRINTH_API_URL: &str = "https://api.modrinth.com/v2";
3838
pub const MODRINTH_V3_API_URL: &str = "https://api.modrinth.com/v3";
3939
/// The Curseforge API base url.
4040
pub const CURSEFORGE_API_URL: &str = "https://api.curseforge.com";
41-
/// The Curseforge API key. This is a secret and should not be shared.
42-
pub const CURSEFORGE_API_KEY: Option<&'static str> = option_env!("CURSEFORGE_API_KEY");
41+
/// The Curseforge API key. Reserved for use in OneLauncher projects only. Do not use in other projects without permission from the OneLauncher team.
42+
pub const CURSEFORGE_API_KEY: &str = "$2a$10$6utA1UNSmFPrE/Lh7b7ndeeGmiOkjKNY8kpFB0fsmE/d42ZAfFgCe";
4343
/// The Minecraft game ID on Curseforge.
4444
pub const CURSEFORGE_GAME_ID: u32 = 432;
4545
/// Our metadata API base url.

0 commit comments

Comments
 (0)