Skip to content

Commit

Permalink
fix: 'enable' env vars (#577)
Browse files Browse the repository at this point in the history
  • Loading branch information
komninoschatzipapas authored Jun 8, 2021
1 parent 29d6526 commit b4bfaf7
Show file tree
Hide file tree
Showing 45 changed files with 194 additions and 147 deletions.
12 changes: 6 additions & 6 deletions .env.ci
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ REDIRECT_URL_SUCCESS=http://localhost:3000/healthz

JWT_CUSTOM_FIELDS=name

HIBP_ENABLE=true
HIBP_ENABLED=true

# SERVER_PORT=3000
AUTO_ACTIVATE_NEW_USERS=false
VERIFY_EMAILS=true
ALLOW_USER_SELF_DELETE=true
LOST_PASSWORD_ENABLE=true
LOST_PASSWORD_ENABLED=true

# Auth
USER_IMPERSONATION_ENABLE=true
USER_IMPERSONATION_ENABLED=true

# Roles
DEFAULT_ALLOWED_USER_ROLES=user,me,editor
Expand All @@ -29,8 +29,8 @@ REGISTRATION_CUSTOM_FIELDS=name
PROVIDER_SUCCESS_REDIRECT=http://localhost:3000/healthz
PROVIDER_FAILURE_REDIRECT=http://localhost:3000/error

GITHUB_ENABLE=false
GOOGLE_ENABLE=false
GITHUB_ENABLED=false
GOOGLE_ENABLED=false

# JWT_EXPIRES_IN=15
# JWT_REFRESH_EXPIRES_IN=43200
Expand All @@ -45,7 +45,7 @@ S3_ACCESS_KEY_ID=minio_access_key
S3_SECRET_ACCESS_KEY=test_s3_secret_access_key

# SMTP settings (example configuration)
EMAILS_ENABLE=true
EMAILS_ENABLED=true
SMTP_HOST=mailhog
SMTP_PORT=1025
SMTP_PASS=password
Expand Down
40 changes: 20 additions & 20 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ SERVER_URL=
# AUTO_MIGRATE=false

## Hasura Backend Plus modules
# AUTH_ENABLE=true
# STORAGE_ENABLE=true
# AUTH_ENABLED=true
# STORAGE_ENABLED=true

## A url to the frontend app (available on emails as app_url)
# APP_URL=
Expand Down Expand Up @@ -62,7 +62,7 @@ JWT_KEY=
# REGISTRATION_CUSTOM_FIELDS=

## EXPERIMENTAL: Enables anonymous authentication, like Firebase
# ANONYMOUS_USERS_ENABLE=false
# ANONYMOUS_USERS_ENABLED=false

## Allow users to delete their own account
# ALLOW_USER_SELF_DELETE=false
Expand All @@ -86,7 +86,7 @@ JWT_KEY=
# ALLOWED_REDIRECT_URLS=

## Allow User Impersonation via admin secret
# USER_IMPERSONATION_ENABLE=false
# USER_IMPERSONATION_ENABLED=false

## Allow registration only through x-admin-secret
# ADMIN_ONLY_REGISTRATION=false
Expand All @@ -99,10 +99,10 @@ JWT_KEY=
# ALLOWED_EMAIL_DOMAINS=

## Allow users to change their email
# CHANGE_EMAIL_ENABLE=true
# CHANGE_EMAIL_ENABLED=true

## Allow users to reset their passwords from a ticket sent by email
# LOST_PASSWORD_ENABLE=false
# LOST_PASSWORD_ENABLED=false

## Send an email notification to the previous email when changed
# NOTIFY_EMAIL_CHANGE=false
Expand All @@ -115,11 +115,11 @@ JWT_KEY=
# MIN_PASSWORD_LENGTH=3

## Check passwords against HIBP
# HIBP_ENABLE=false
# HIBP_ENABLED=false

#------------ Multi-Factor Authentication ------------#
## Enable Multi-Factor Authentication
# MFA_ENABLE=true
# MFA_ENABLED=true

## One-Time Password issuer
# OTP_ISSUER = 'HBP'
Expand All @@ -134,7 +134,7 @@ JWT_KEY=
# PROVIDER_FAILURE_REDIRECT=

#---------------------- GitHub -----------------------#
# GITHUB_ENABLE=false
# GITHUB_ENABLED=false
# GITHUB_CLIENT_ID=
# GITHUB_CLIENT_SECRET= # Optional
# GITHUB_AUTHORIZATION_URL= # Optional
Expand All @@ -145,43 +145,43 @@ JWT_KEY=
# GITHUB_SCOPE=user:email

#---------------------- Google -----------------------#
# GOOGLE_ENABLE=false
# GOOGLE_ENABLED=false
# GOOGLE_CLIENT_ID=
# GOOGLE_CLIENT_SECRET=
## List of comma-separated OAuth 2.0 scopes
# GOOGLE_SCOPE=email,profile

#--------------------- Facebook ----------------------#
# FACEBOOK_ENABLE=false
# FACEBOOK_ENABLED=false
# FACEBOOK_CLIENT_ID=
# FACEBOOK_CLIENT_SECRET=
## List of comma-separated profile fields
## https://developers.facebook.com/docs/graph-api/reference/user/#fields
# FACEBOOK_PROFILE_FIELDS=email,photos,displayName

#---------------------- Twitter ----------------------#
# TWITTER_ENABLE=false
# TWITTER_ENABLED=false
# TWITTER_CONSUMER_KEY=
# TWITTER_CONSUMER_SECRET=

#--------------------- Linkedin ----------------------#
# LINKEDIN_ENABLE=false
# LINKEDIN_ENABLED=false
# LINKEDIN_CLIENT_ID=
# LINKEDIN_CLIENT_SECRET=
## List of comma-separated OAuth 2.0 scopes
## https://docs.microsoft.com/en-us/linkedin/shared/authentication/authentication?context=linkedin/context#permission-types
# LINKEDIN_SCOPE=r_emailaddress,r_liteprofile

#--------------------- Spotify ----------------------#
# SPOTIFY_ENABLE=false
# SPOTIFY_ENABLED=false
# SPOTIFY_CLIENT_ID=
# SPOTIFY_CLIENT_SECRET=
## List of comma-separated OAuth 2.0 scopes
## https://developer.spotify.com/documentation/general/guides/scopes/
# SPOTIFY_SCOPE=user-read-email,user-read-private

#----------------------- Apple -----------------------#
# APPLE_ENABLE=false
# APPLE_ENABLED=false
# APPLE_CLIENT_ID=
# APPLE_TEAM_ID=
# APPLE_KEY_ID=
Expand All @@ -192,7 +192,7 @@ JWT_KEY=
# APPLE_SCOPE=name,email

#------------------- Windows Live --------------------#
# WINDOWS_LIVE_ENABLE=false
# WINDOWS_LIVE_ENABLED=false
# WINDOWS_LIVE_CLIENT_ID=
# WINDOWS_LIVE_CLIENT_SECRET=
## List of comma-separated OAuth 2.0 scopes
Expand All @@ -201,15 +201,15 @@ JWT_KEY=
# WINDOWS_LIVE_SCOPE=wl.basic,wl.emails,wl.contacts_emails

#---------------------- Gitlab -----------------------#
# GITLAB_ENABLE=false
# GITLAB_ENABLED=false
# GITLAB_CLIENT_ID=
# GITLAB_CLIENT_SECRET=
# Base url is used for self-hosted Gitlab
# GITLAB_BASE_URL=
# GITLAB_SCOPE=read_user

#--------------------- Bitbucket ---------------------#
# BITBUCKET_ENABLE=false
# BITBUCKET_ENABLED=false
# BITBUCKET_CLIENT_ID=
# BITBUCKET_CLIENT_SECRET=
# There is no BITBUCKET_SOPE variable. Instead scopes are defined
Expand All @@ -218,7 +218,7 @@ JWT_KEY=


#################### SMTP options #####################
# EMAILS_ENABLE=false
# EMAILS_ENABLED=false
# SMTP_HOST=
# SMTP_PORT=587
# SMTP_USER=
Expand All @@ -231,7 +231,7 @@ JWT_KEY=
# SMTP_SECURE=false

###################### Gravatar #######################
# GRAVATAR_ENABLE=true
# GRAVATAR_ENABLED=true
## https://en.gravatar.com/site/implement/images#default-image
# GRAVATAR_DEFAULT=blank
## https://en.gravatar.com/site/implement/images#rating
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
graphql-engine:
image: hasura/graphql-engine:v1.3.2
env:
HASURA_GRAPHQL_ENABLE_TELEMETRY: 'false'
HASURA_GRAPHQL_ENABLED_TELEMETRY: 'false'
HASURA_GRAPHQL_ADMIN_SECRET: ${{ env.HASURA_GRAPHQL_ADMIN_SECRET }}
HASURA_GRAPHQL_DATABASE_URL: postgres://postgres:${{ env.POSTGRES_PASSWORD }}@postgres:5432/postgres
HASURA_GRAPHQL_JWT_SECRET: '{"type": "${{ env.JWT_ALGORITHM }}", "key": "${{ env.JWT_KEY }}"}'
Expand Down
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@

## v2.0.0-rc.3

- server: Added S3_SSL_ENABLED env var
- server: Added AUTH_LOCAL_USERS_ENABLE env variable to enable local (email/pw) users to register and login
- server: Added S3_SSL_ENABLEDD env var
- server: Added AUTH_LOCAL_USERS_ENABLED env variable to enable local (email/pw) users to register and login
- server: Added support for multiple default allowed user roles (#246)

## v2.0.0-rc.2
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.development.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ services:
- '8080:8080'
environment:
HASURA_GRAPHQL_JWT_SECRET: '{"type": "HS256", "key": "${JWT_KEY}"}'
HASURA_GRAPHQL_ENABLE_CONSOLE: 'true'
HASURA_GRAPHQL_ENABLED_CONSOLE: 'true'
minio:
ports:
- '9000:9000' # Do not use port 9000 in the host machine as developpers using portainer might already use it
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ services:
- '8080:8080'
environment:
HASURA_GRAPHQL_JWT_SECRET: '{"type": "HS256", "key": "${JWT_KEY}"}'
HASURA_GRAPHQL_ENABLE_CONSOLE: 'true'
HASURA_GRAPHQL_ENABLED_CONSOLE: 'true'
mailhog:
image: mailhog/mailhog
4 changes: 2 additions & 2 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ Change password of an account. The account must be logged in for this endpoint t

### Change Password Request

Request to change password. This endpoint is active if env var `LOST_PASSWORD_ENABLE=true`.
Request to change password. This endpoint is active if env var `LOST_PASSWORD_ENABLED=true`.

::: warning
This endpoint will always return HTTP status code 204 in order to not leak information about the database.
Expand All @@ -218,7 +218,7 @@ This endpoint will always return HTTP status code 204 in order to not leak infor

### Change Password Change

Change password based on a ticket. This endpoint is active if env var `LOST_PASSWORD_ENABLE=true`.
Change password based on a ticket. This endpoint is active if env var `LOST_PASSWORD_ENABLED=true`.

#### Request

Expand Down
Loading

0 comments on commit b4bfaf7

Please sign in to comment.