Skip to content

Commit

Permalink
fix: make Algolia and FeedbackFarm variables optional (#2016)
Browse files Browse the repository at this point in the history
* I think this is okay as long as Algolia is purely client-side loaded
  as it is now. I don't think this will work if we need to render
  Algolia server-side
* Also remove them from the GitHub action build for simplicity
* Note this was already the case for Segment
  • Loading branch information
ryscheng authored Aug 28, 2024
1 parent aa899d8 commit 0c5a467
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 21 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/ci-default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ env:
NEXT_PUBLIC_DB_GRAPHQL_URL: ${{ vars.NEXT_PUBLIC_DB_GRAPHQL_URL }}
HASURA_URL: ${{ vars.HASURA_URL }}
OSO_API_KEY: ${{ secrets.OSO_API_KEY }}
NEXT_PUBLIC_ALGOLIA_APPLICATION_ID: "test"
NEXT_PUBLIC_ALGOLIA_API_KEY: "test"
NEXT_PUBLIC_ALGOLIA_INDEX: "test"
NEXT_PUBLIC_FEEDBACK_FARM_ID: "test"
# Docs variables
DOCS_URL: "https://docs.opensource.observer"
DOCS_ALGOLIA_APP_ID: "test"
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/.env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ CLICKHOUSE_URL=
CLICKHOUSE_USERNAME=
CLICKHOUSE_PASSWORD=
CLICKHOUSE_DB_NAME=
### Algolia for search (required)
### Algolia for search (optional)
NEXT_PUBLIC_ALGOLIA_APPLICATION_ID=
NEXT_PUBLIC_ALGOLIA_API_KEY=
NEXT_PUBLIC_ALGOLIA_INDEX=
Expand Down
23 changes: 7 additions & 16 deletions apps/frontend/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,10 @@ export const CLICKHOUSE_USERNAME = process.env.CLICKHOUSE_USERNAME ?? "MISSING";
export const CLICKHOUSE_PASSWORD = process.env.CLICKHOUSE_PASSWORD ?? "MISSING";
export const CLICKHOUSE_DB_NAME = process.env.CLICKHOUSE_DB_NAME ?? "default";

export const ALGOLIA_APPLICATION_ID = requireEnv(
process.env.NEXT_PUBLIC_ALGOLIA_APPLICATION_ID,
"NEXT_PUBLIC_ALGOLIA_APPLICATION_ID",
);
export const ALGOLIA_API_KEY = requireEnv(
process.env.NEXT_PUBLIC_ALGOLIA_API_KEY,
"NEXT_PUBLIC_ALGOLIA_API_KEY",
);
export const ALGOLIA_INDEX = requireEnv(
process.env.NEXT_PUBLIC_ALGOLIA_INDEX,
"NEXT_PUBLIC_ALGOLIA_INDEX",
);
export const FEEDBACK_FARM_ID = requireEnv(
process.env.NEXT_PUBLIC_FEEDBACK_FARM_ID,
"NEXT_PUBLIC_FEEDBACK_FARM_ID",
);
export const ALGOLIA_APPLICATION_ID =
process.env.NEXT_PUBLIC_ALGOLIA_APPLICATION_ID ?? "MISSING";
export const ALGOLIA_API_KEY =
process.env.NEXT_PUBLIC_ALGOLIA_API_KEY ?? "MISSING";
export const ALGOLIA_INDEX = process.env.NEXT_PUBLIC_ALGOLIA_INDEX ?? "MISSING";
export const FEEDBACK_FARM_ID =
process.env.NEXT_PUBLIC_FEEDBACK_FARM_ID ?? "MISSING";

0 comments on commit 0c5a467

Please sign in to comment.