Skip to content

Commit f120283

Browse files
authored
Minor config fixes and enhancements (#805)
While reconfiguring my local Hyperion, a couple difficulties arose...
1 parent efaa64a commit f120283

File tree

4 files changed

+55
-11
lines changed

4 files changed

+55
-11
lines changed

.env.template

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@
66
POSTGRES_HOST="hyperion-db"
77
POSTGRES_USER=""
88
POSTGRES_PASSWORD=""
9-
POSTGRES_DB=""
9+
POSTGRES_DB="hyperion"
1010
POSTGRES_TZ="Etc/UTC"
1111

12-
1312
########################
1413
# Redis configuration #
1514
########################

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ data/
1111

1212
# Dotenv file
1313
.env
14-
.env.yaml
1514
config.yaml
1615

1716

app/core/utils/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def settings_customise_sources(
141141
# Configure AuthClients, to allow services to authenticate users using OAuth2 or Openid connect
142142
# The following format should be used in yaml config files:
143143
# ```yml
144-
# AUTH_CLIENTS_DICT:
144+
# AUTH_CLIENTS:
145145
# <ClientId>:
146146
# secret: <ClientSecret>
147147
# redirect_uri:

config.template.yaml

Lines changed: 53 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,40 @@
44
# ACCESS_TOKEN_SECRET_KEY should contain a random string with enough entropy (at least 32 bytes long) to securely sign all access_tokens for OAuth and Openid connect
55
ACCESS_TOKEN_SECRET_KEY: ""
66
# RSA_PRIVATE_PEM_STRING should be a string containing the PEM certificate of a private RSA key. It will be used to sign id_tokens for Openid connect authentication
7-
# In the pem certificates newlines can be replaced by `\n`
8-
RSA_PRIVATE_PEM_STRING: ""
7+
# The example below was generated using a 2048-bit RSA key generator
8+
RSA_PRIVATE_PEM_STRING: |
9+
#-----BEGIN RSA PRIVATE KEY-----
10+
#MIIEpQIBAAKCAQEA1tpj3TZDkJakp2RygsM392pQ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CUYOw3cSgZOSEddL5Wf00CgYEA7JlIlDmMwtFR+jqSmJ3c
27+
#//Kr8zZvAnb/Xa/IZ0MrK4yyLsYR1m48o06Ztx9iO4lKIFAZx1+563QL5P7hzOEC
28+
#kqev90GA8hzD2AXksKEgdOrymAvjq3hSEm0YBN+qS1ldzxYmec0TL7L2wq7lqJnr
29+
#kQuZUAG1g2OUYKZ3WSUDvKECgYEAv24NSkFuG/avfiD7w9xtYNCye2KekskROLG2
30+
#6FltfsWQTEQDdNkekChaF2WHqRAKwaBlNymRuNZpsuhnMerZCQ9rDWwbDF86RnyA
31+
#0MuCr7/kxJQ6XQcY/GnTIydu7F5bOlM0gzqKcW2f6m4fUohczf+0N0QmbDsQAJOi
32+
#1lwadgkCgYEA3tkCBJIPTQecfjWiLqSocS6SrwXU+r3Jw6kI3/IB6ban/nsFdHSb
33+
#nADST7f2zZatN6XALwsLU7f2R09R39ub0AJPyfToxo7MngR1rvaUYooF3rLlaU32
34+
#8DqGvGpLkZkwbtcDmcX1zQoHjUo7RvoShZoapr59ihfrkiiEsXOkuGw=
35+
#-----END RSA PRIVATE KEY-----
936
1037
# Host or url of the instance of Hyperion
1138
# This url will be especially used for oidc/oauth2 discovery endpoint and links send by email
1239
# NOTE: A trailing / is required
13-
CLIENT_URL: "http://127.0.0.1:8000/"
40+
CLIENT_URL: http://127.0.0.1:8000/
1441

1542
# Sometimes, when running third services with oidc inside Docker containers, and running Hyperion on your local device
1643
# you may need to use a different url for call made from docker and call made from your device
@@ -23,7 +50,7 @@ CLIENT_URL: "http://127.0.0.1:8000/"
2350
# Configure AuthClients, to allow services to authenticate users using OAuth2 or Openid connect
2451
# The following format should be used in yaml config files:
2552
# ```yml
26-
# AUTH_CLIENTS_DICT:
53+
# AUTH_CLIENTS:
2754
# <ClientId>:
2855
# secret: <ClientSecret>
2956
# redirect_uri:
@@ -34,22 +61,41 @@ CLIENT_URL: "http://127.0.0.1:8000/"
3461
# `AuthClientClassName` should be a class from `app.utils.auth.providers`
3562
# `secret` may be omitted to use PKCE instead of a client secret
3663
AUTH_CLIENTS:
64+
Titan:
65+
secret:
66+
redirect_uri:
67+
- http://localhost:3000/static.html
68+
- http://127.0.0.1:3000/static.html
69+
auth_client: AppAuthClient
70+
Postman:
71+
secret: PostmanSecret
72+
redirect_uri:
73+
- https://oauth.pstmn.io/v1/callback
74+
- http://postman
75+
- http://localhost:8000/docs/oauth2-redirect
76+
- http://127.0.0.1:8000/docs/oauth2-redirect
77+
auth_client: APIToolAuthClient
3778

3879
#####################
3980
# Hyperion settings #
4081
#####################
4182

42-
LOG_DEBUG_MESSAGES: true
83+
LOG_DEBUG_MESSAGES: True
4384

4485
# Origins for the CORS middleware. `["http://localhost"]` can be used for development.
4586
# See https://fastapi.tiangolo.com/tutorial/cors/
4687
# It should begin with 'http://' or 'https:// and should never end with a '/'
47-
CORS_ORIGINS: ["http://localhost"]
88+
CORS_ORIGINS:
89+
- http://localhost:3000
90+
- http://127.0.0.1:3000
91+
# - *
4892

4993
# If set, the application use a SQLite database instead of PostgreSQL, for testing or development purposes (if possible Postgresql should be used instead)
50-
SQLITE_DB: "app.db"
94+
SQLITE_DB: app.db
5195
# If True, will print all SQL queries in the console
5296
DATABASE_DEBUG: False
97+
# if True and the database is empty, it will be seeded with mocked data
98+
USE_FACTORIES: True
5399

54100
#####################################
55101
# SMTP configuration using starttls #

0 commit comments

Comments
 (0)