Skip to content

Commit

Permalink
chore: Remove CurseForge API key from env variables and put it in the…
Browse files Browse the repository at this point in the history
… constants file
  • Loading branch information
LynithDev committed Nov 28, 2024
1 parent cbc7ae8 commit fc834bb
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 240 deletions.
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ jobs:
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }}
with:
tagName: onelauncher-__VERSION__
releaseName: OneLauncher __VERSION__
Expand Down
3 changes: 0 additions & 3 deletions .template.env

This file was deleted.

40 changes: 0 additions & 40 deletions apps/frontend/tsconfig.json

This file was deleted.

10 changes: 0 additions & 10 deletions apps/frontend/tsconfig.node.json

This file was deleted.

139 changes: 0 additions & 139 deletions apps/frontend/uno.config.ts

This file was deleted.

3 changes: 0 additions & 3 deletions apps/frontend/vitest.config.ts

This file was deleted.

40 changes: 0 additions & 40 deletions packages/core/build.rs

This file was deleted.

3 changes: 1 addition & 2 deletions packages/core/src/api/package/content/curseforge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,7 @@ pub async fn fetch_advanced<F: FnOnce(&mut Url)>(
json_body: Option<serde_json::Value>,
) -> Result<Bytes> {
// TODO: Get the API key from settings, fallback to constant, and error if missing
let key = crate::constants::CURSEFORGE_API_KEY
.ok_or(anyhow::anyhow!("missing curseforge api key"))?;
let key = crate::constants::CURSEFORGE_API_KEY;

let mut headers = headers.unwrap_or(HashMap::<&str, &str>::new());
headers.insert("x-api-key", key);
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ pub const MODRINTH_API_URL: &str = "https://api.modrinth.com/v2";
pub const MODRINTH_V3_API_URL: &str = "https://api.modrinth.com/v3";
/// The Curseforge API base url.
pub const CURSEFORGE_API_URL: &str = "https://api.curseforge.com";
/// The Curseforge API key. This is a secret and should not be shared.
pub const CURSEFORGE_API_KEY: Option<&'static str> = option_env!("CURSEFORGE_API_KEY");
/// The Curseforge API key. Reserved for use in OneLauncher projects only. Do not use in other projects without permission from the OneLauncher team.
pub const CURSEFORGE_API_KEY: &str = "$2a$10$6utA1UNSmFPrE/Lh7b7ndeeGmiOkjKNY8kpFB0fsmE/d42ZAfFgCe";
/// The Minecraft game ID on Curseforge.
pub const CURSEFORGE_GAME_ID: u32 = 432;
/// Our metadata API base url.
Expand Down

0 comments on commit fc834bb

Please sign in to comment.