Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/src/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export type OtherUserAnnotations = Record<
export type UploadLocation = null | { latitude?: number; longitude?: number; gridCellId?: number };

export const axiosInstance = axios.create({
baseURL: import.meta.env.VITE_APP_API_ROOT as string,
baseURL: `${import.meta.env.VITE_APP_API_ROOT as string}/api/v1`,
});

export interface RecordingFileParameters {
Expand Down
4 changes: 2 additions & 2 deletions client/src/plugins/Oauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { ref } from 'vue';
const CLIENT_ID = 'HSJWFZ2cIpWQOvNyCXyStV9hiOd7DfWeBOCzo4pP';

const redirectUrl = new URL((import.meta.env.VITE_APP_LOGIN_REDIRECT || location.origin) as string);
const baseUrl = new URL(import.meta.env.VITE_APP_OAUTH_API_ROOT as string);
const oauthClient = new OauthClient(baseUrl, CLIENT_ID, { redirectUrl });
const authorizationServerBaseUrl = new URL(`${import.meta.env.VITE_APP_API_ROOT as string}/oauth/`);
const oauthClient = new OauthClient(authorizationServerBaseUrl, CLIENT_ID, { redirectUrl });

export const loggedIn = ref(oauthClient.isLoggedIn);

Expand Down
4 changes: 2 additions & 2 deletions client/src/plugins/S3FileField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ let s3ffClient: S3FileFieldClient;

export function createS3ffClient(axiosInstance: Axios) {
s3ffClient = new S3FileFieldClient({
baseUrl: `${import.meta.env.VITE_APP_API_ROOT}/s3-upload`,
baseUrl: `${import.meta.env.VITE_APP_API_ROOT}/api/v1/s3-upload`,
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
apiConfig: axiosInstance.defaults, // This argument is optional
Expand All @@ -19,4 +19,4 @@ export function getS3ffClient() {
} else {
return s3ffClient;
}
}
}
3 changes: 1 addition & 2 deletions dev/.env.docker-compose
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ DJANGO_INTERNAL_IPS=0.0.0.0/0
SERVERHOSTNAME=localhost

NABAT_API_URL=https://api.sciencebase.gov/nabat-graphql/graphql
VITE_APP_API_ROOT=http://localhost:8000/api/v1
VITE_APP_OAUTH_API_ROOT=http://localhost:8000/oauth/
VITE_APP_API_ROOT=http://localhost:8000
VITE_APP_LOGIN_REDIRECT=http://localhost:3000
3 changes: 1 addition & 2 deletions dev/.env.docker-compose-native
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ DJANGO_MINIO_STORAGE_URL=http://minioAccessKey:minioSecretKey@localhost:9000/dja
SERVERHOSTNAME=localhost

NABAT_API_URL=https://api.sciencebase.gov/nabat-graphql/graphql
VITE_APP_API_ROOT=http://localhost:8000/api/v1
VITE_APP_OAUTH_API_ROOT=http://localhost:8000/oauth/
VITE_APP_API_ROOT=http://localhost:8000
VITE_APP_LOGIN_REDIRECT=http://localhost:3000
3 changes: 1 addition & 2 deletions prod/.env.kitware-production.template
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ SERVERHOSTNAME=batdetectai.kitware.com

# Client
NABAT_API_URL=https://api.sciencebase.gov/nabat-graphql/graphql
VITE_APP_API_ROOT=https://batdetectai.kitware.com/api/v1
VITE_APP_OAUTH_API_ROOT=https://batdetectai.kitware.com/oauth/
VITE_APP_API_ROOT=https://batdetectai.kitware.com
VITE_APP_LOGIN_REDIRECT=https://batdetectai.kitware.com

# nginx/traefik
Expand Down
3 changes: 1 addition & 2 deletions prod/.env.nabat-production.template
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,5 @@ SERVERHOSTNAME=batdetectai.kitware.com

# Client Environment Variables
NABAT_API_URL=https://api.sciencebase.gov/nabat-graphql/graphql
VITE_APP_API_ROOT=https://batdetectai.kitware.com/api/v1
VITE_APP_OAUTH_API_ROOT=https://batdetectai.kitware.com/oauth/
VITE_APP_API_ROOT=https://batdetectai.kitware.com
VITE_APP_LOGIN_REDIRECT=https://batdetectai.kitware.com
1 change: 0 additions & 1 deletion prod/NABat-Deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ docker build\
--build-arg BUILD_ENV=prod\
--build-arg DJANGO_BATAI_URL_PATH=${DJANGO_BATAI_URL_PATH}\
--build-arg VITE_APP_API_ROOT=${VITE_APP_API_ROOT}\
--build-arg VITE_APP_OAUTH_API_ROOT=${VITE_APP_OAUTH_API_ROOT}\
--build-arg VITE_APP_LOGIN_REDIRECT=${VITE_APP_LOGIN_REDIRECT}\
-t ${AWS_IMAGE_LATEST}\
--pull -f ${DOCKER_FILE_LOCATION} .
Expand Down
2 changes: 0 additions & 2 deletions prod/client.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@ FROM node:lts-alpine AS build-stage

# Build-time args
ARG VITE_APP_API_ROOT
ARG VITE_APP_OAUTH_API_ROOT
ARG VITE_APP_LOGIN_REDIRECT
ARG DJANGO_BATAI_URL_PATH
ARG DJANGO_MINIO_STORAGE_URL

# Set environment for build
ENV VITE_APP_API_ROOT=${VITE_APP_API_ROOT}
ENV VITE_APP_OAUTH_API_ROOT=${VITE_APP_OAUTH_API_ROOT}
ENV VITE_APP_LOGIN_REDIRECT=${VITE_APP_LOGIN_REDIRECT}
ENV VITE_APP_SUBPATH=${DJANGO_BATAI_URL_PATH}
ENV DJANGO_MINIO_STORAGE_URL=${DJANGO_MINIO_STORAGE_URL}
Expand Down
1 change: 0 additions & 1 deletion prod/docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ services:
dockerfile: ./prod/client.Dockerfile
args:
VITE_APP_API_ROOT: ${VITE_APP_API_ROOT}
VITE_APP_OAUTH_API_ROOT: ${VITE_APP_OAUTH_API_ROOT}
VITE_APP_LOGIN_REDIRECT: ${VITE_APP_LOGIN_REDIRECT}
DJANGO_BATAI_URL_PATH: ${DJANGO_BATAI_URL_PATH}
DJANGO_MINIO_STORAGE_URL: ${DJANGO_MINIO_STORAGE_URL}
Expand Down
Loading