Skip to content

Commit a8c79d2

Browse files
JamesPecksrpiatt
andauthored
[ALS-6655 & ALS-6699] Login, Themes, & Dynamic authentication providers (#62)
ALS-6655 & ALS-6699 Includes changes from #73 This PR is to allow for admins of pic-sure to easily add new auth providers. We currently Support: - Gen3 Fence - Auth0 - RAS Admin can edit values in their .env files. `VITE_AUTH_PROVIDER_MODULE` is the prefix for any authorization providers you want to use. We currently support 3 types of authorization providers: AUTH0, Gen3 FENCE, and RAS. You can add as many authorization providers as you want by adding more` VITE_AUTH_PROVIDER_MODULE_` variables. You can have n number of each type of authorization provider. When the server starts it will automatically add the authorization providers to the login page if they are enabled.The pattern for adding authorization providers is as follows: `VITE_AUTH_PROVIDER_MODULE_<PROVIDER_NAME>_<FIELD>=<VALUE>` See `.env.example` Adds new themes & logos --------- Co-authored-by: Samantha <21109191+srpiatt@users.noreply.github.com>
1 parent c7b9cdf commit a8c79d2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1661
-263
lines changed

.env.example

+16-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
11
# This is an example of what your env file should look like.
22
# You can copy this file and rename it to .env and fill in the values.
3+
VITE_PROJECT_HOSTNAME=pic-sure.org
34

4-
PROJECT_HOSTNAME=example.com
5+
# VITE_AUTH_PROVIDER_MODULE is the prefix for any authorization providers you want to use.
6+
# We currently support 3 types of authorization providers: AUTH0, Gen3 FENCE, and RAS.
7+
# You can add as many authorization providers as you want by adding more VITE_AUTH_PROVIDER_MODULE_ variables.
8+
# You can have n number of each type of authorization provider.
9+
# When the server starts it will automatically add the authorization providers to the login page if they are enabled.
10+
# VITE_AUTH_PROVIDER_MODULE_GOOGLE_ALT is an optional field that can be used to specify if the provider should be displayed as an alternative login option.
11+
# The pattern for adding authorization providers is as follows:
12+
# VITE_AUTH_PROVIDER_MODULE_<PROVIDER_NAME>_<FIELD>=<VALUE>
13+
VITE_AUTH_PROVIDER_MODULE_GOOGLE=true
14+
VITE_AUTH_PROVIDER_MODULE_GOOGLE_TYPE=AUTH0
15+
VITE_AUTH_PROVIDER_MODULE_GOOGLE_CLIENTID=12345ABCD
16+
VITE_AUTH_PROVIDER_MODULE_GOOGLE_CONNECTION=oauth2
17+
VITE_AUTH_PROVIDER_MODULE_GOOGLE_DESCRIPTION="Login with Auth0"
18+
VITE_AUTH_PROVIDER_MODULE_GOOGLE_HELPTEXT='Login with your <a href="https://google.com">Google</a> account'
19+
VITE_AUTH_PROVIDER_MODULE_GOOGLE_ALT=false

.env.test

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This is an example of what your env file should look like.
2+
# You can copy this file and rename it to .env and fill in the values.
3+
VITE_PROJECT_HOSTNAME=pic-sure.org
4+
5+
# VITE_AUTH_PROVIDER_MODULE is the prefix for any authorization providers you want to use.
6+
# We currently support 3 types of authorization providers: AUTH0, Gen3 FENCE, and RAS.
7+
# You can add as many authorization providers as you want by adding more VITE_AUTH_PROVIDER_MODULE_ variables.
8+
# You can have n number of each type of authorization provider.
9+
# When the server starts it will automatically add the authorization providers to the login page if they are enabled.
10+
# The pattern for adding authorization providers is as follows:
11+
# VITE_AUTH_PROVIDER_MODULE_<PROVIDER_NAME>_<FIELD>=<VALUE>
12+
VITE_AUTH_PROVIDER_MODULE_AUTH0=true
13+
VITE_AUTH_PROVIDER_MODULE_AUTH0_TYPE=AUTH0
14+
VITE_AUTH_PROVIDER_MODULE_AUTH0_CLIENTID=12345ABCD
15+
VITE_AUTH_PROVIDER_MODULE_AUTH0_CONNECTION=oauth2
16+
VITE_AUTH_PROVIDER_MODULE_AUTH0_DESCRIPTION="Login with Auth0"
17+
VITE_AUTH_PROVIDER_MODULE_AUTH0_HELPTEXT='Login with your <a href="https://google.com">Google</a> account'
18+
19+
VITE_AUTH_PROVIDER_MODULE_RAS=true
20+
VITE_AUTH_PROVIDER_MODULE_RAS_TYPE=RAS
21+
VITE_AUTH_PROVIDER_MODULE_RAS_CLIENTID=12345ABCD
22+
VITE_AUTH_PROVIDER_MODULE_RAS_URI=http://pic-sure.org/ras
23+
VITE_AUTH_PROVIDER_MODULE_RAS_DESCRIPTION="Login with RAS"
24+
25+
VITE_AUTH_PROVIDER_MODULE_FENCE=true
26+
VITE_AUTH_PROVIDER_MODULE_FENCE_TYPE=FENCE
27+
VITE_AUTH_PROVIDER_MODULE_FENCE_URI=http://pic-sure.org/fence
28+
VITE_AUTH_PROVIDER_MODULE_FENCE_CLIENTID=abcd1234
29+
VITE_AUTH_PROVIDER_MODULE_FENCE_IDP=google
30+
VITE_AUTH_PROVIDER_MODULE_FENCE_DESCRIPTION="Login as a developer"
31+
VITE_AUTH_PROVIDER_MODULE_FENCE_ALT=true

Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
FROM node:21.7.3-alpine3.18 AS builder
33
WORKDIR /app
44
COPY package*.json .
5+
COPY .env .
56
RUN npm ci
67
COPY . .
78
RUN npm run build
@@ -28,6 +29,7 @@ RUN sed -i '/^#LoadModule socache_shmcb_module modules\/mod_socache_shmcb.so/s/^
2829
RUN mkdir -p /usr/local/apache2/logs/ssl_mutex
2930

3031
WORKDIR /app
32+
RUN mkdir -p logs
3133
COPY --from=builder /app/build build/
3234
COPY --from=builder /app/node_modules node_modules/
3335
COPY package.json .

pic-sure-theme.ts

-101
This file was deleted.

0 commit comments

Comments
 (0)