Skip to content

Commit

Permalink
try updated env file name for vite (#4683)
Browse files Browse the repository at this point in the history
  • Loading branch information
ianedwards authored May 22, 2024
1 parent f9b8183 commit ed607ee
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/actions/build-npm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ runs:
shell: bash
run: |
touch dashboard/.env
echo '${{ inputs.env_vars }}' > dashboard/.env
echo '${{ inputs.env_vars }}' > dashboard/.env.production
- name: Run NPM Build
shell: bash
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.DS_Store
.env
.env.local
docker/.env
docker/github_app_private_key.pem
app
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ export const ProjectComplianceProvider: React.FC<
return;
}

const cidrAllowList = import.meta.env.PORTER_CIDRS
? import.meta.env.PORTER_CIDRS.split(",")
const cidrAllowList = import.meta.env.VITE_PORTER_CIDRS
? import.meta.env.VITE_PORTER_CIDRS.split(",")
: [];

const updatedKindValues = match(latestContractProto.cluster.kindValues)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ export const ProjectComplianceProvider: React.FC<
return;
}

const cidrAllowList = import.meta.env.PORTER_CIDRS
? import.meta.env.PORTER_CIDRS.split(",")
const cidrAllowList = import.meta.env.VITE_PORTER_CIDRS
? import.meta.env.VITE_PORTER_CIDRS.split(",")
: [];

const updatedKindValues = match(latestContractProto.cluster.kindValues)
Expand Down
3 changes: 1 addition & 2 deletions dashboard/src/shared/auth/ory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import { Configuration, FrontendApi } from "@ory/client";
import { type AxiosError } from "axios";
import { useHistory } from "react-router-dom";

export const basePath =
import.meta.env.REACT_APP_ORY_URL || "http://localhost:4000";
export const basePath = import.meta.env.VITE_ORY_URL || "http://localhost:4000";

export const ory = new FrontendApi(
new Configuration({
Expand Down
3 changes: 3 additions & 0 deletions dashboard/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ export default defineConfig(({ mode }) => ({
build: {
outDir: "build",
},
...(mode === "development" && {
envDir: "../zarf/helm",
}),
server: {
port: 8081,
proxy: {
Expand Down
4 changes: 2 additions & 2 deletions zarf/helm/.dashboardenv → zarf/helm/.envlocal
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ API_SERVER=http://localhost:8080

TRUST_ARN=arn:aws:iam::MY_AWS_DEV_ACCOUNT_ID:role/CAPIManagement

# PORTER_CIDRS are a comma-separated list of CIDRs mapping to Porter infra. Used for restricting access to a customer's control plane endpoint
# VITE_PORTER_CIDRS are a comma-separated list of CIDRs mapping to Porter infra. Used for restricting access to a customer's control plane endpoint
# below example is for the office IP
PORTER_CIDRS="135.84.167.61/32"
VITE_PORTER_CIDRS="135.84.167.61/32"

0 comments on commit ed607ee

Please sign in to comment.