Compare commits
1 commit
main
...
renovate/p
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec16300f47 |
4 changed files with 9 additions and 28 deletions
|
|
@ -4,7 +4,7 @@ name: check-fast
|
||||||
|
|
||||||
services:
|
services:
|
||||||
- name: postgres
|
- name: postgres
|
||||||
image: docker.io/library/postgres:18.1
|
image: docker.io/library/postgres:18.3
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_USER: postgres
|
POSTGRES_USER: postgres
|
||||||
POSTGRES_PASSWORD: postgres
|
POSTGRES_PASSWORD: postgres
|
||||||
|
|
@ -57,7 +57,7 @@ steps:
|
||||||
- mix gettext.extract --check-up-to-date
|
- mix gettext.extract --check-up-to-date
|
||||||
|
|
||||||
- name: wait_for_postgres
|
- name: wait_for_postgres
|
||||||
image: docker.io/library/postgres:18.1
|
image: docker.io/library/postgres:18.3
|
||||||
commands:
|
commands:
|
||||||
# Wait for postgres to become available
|
# Wait for postgres to become available
|
||||||
- |
|
- |
|
||||||
|
|
@ -109,7 +109,7 @@ name: check-full
|
||||||
|
|
||||||
services:
|
services:
|
||||||
- name: postgres
|
- name: postgres
|
||||||
image: docker.io/library/postgres:18.1
|
image: docker.io/library/postgres:18.3
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_USER: postgres
|
POSTGRES_USER: postgres
|
||||||
POSTGRES_PASSWORD: postgres
|
POSTGRES_PASSWORD: postgres
|
||||||
|
|
@ -164,7 +164,7 @@ steps:
|
||||||
- mix gettext.extract --check-up-to-date
|
- mix gettext.extract --check-up-to-date
|
||||||
|
|
||||||
- name: wait_for_postgres
|
- name: wait_for_postgres
|
||||||
image: docker.io/library/postgres:18.1
|
image: docker.io/library/postgres:18.3
|
||||||
commands:
|
commands:
|
||||||
# Wait for postgres to become available
|
# Wait for postgres to become available
|
||||||
- |
|
- |
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ services:
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
db-prod:
|
db-prod:
|
||||||
image: postgres:18.1-alpine
|
image: postgres:18.3-alpine
|
||||||
container_name: mv-prod-db
|
container_name: mv-prod-db
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_USER: postgres
|
POSTGRES_USER: postgres
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ networks:
|
||||||
|
|
||||||
services:
|
services:
|
||||||
db:
|
db:
|
||||||
image: postgres:18.1-alpine
|
image: postgres:18.3-alpine
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_USER: postgres
|
POSTGRES_USER: postgres
|
||||||
POSTGRES_PASSWORD: postgres
|
POSTGRES_PASSWORD: postgres
|
||||||
|
|
|
||||||
|
|
@ -360,29 +360,13 @@ defmodule Mv.Config do
|
||||||
end
|
end
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
Returns the OIDC client secret.
|
Returns the OIDC client secret. ENV first, then Settings.
|
||||||
In production, uses the value from config :mv, :oidc (set by runtime.exs from OIDC_CLIENT_SECRET or OIDC_CLIENT_SECRET_FILE).
|
|
||||||
Otherwise ENV OIDC_CLIENT_SECRET, then Settings.
|
|
||||||
"""
|
"""
|
||||||
@spec oidc_client_secret() :: String.t() | nil
|
@spec oidc_client_secret() :: String.t() | nil
|
||||||
def oidc_client_secret do
|
def oidc_client_secret do
|
||||||
case Application.get_env(:mv, :oidc) do
|
env_or_setting("OIDC_CLIENT_SECRET", :oidc_client_secret)
|
||||||
oidc when is_list(oidc) -> oidc_client_secret_from_config(Keyword.get(oidc, :client_secret))
|
|
||||||
_ -> env_or_setting("OIDC_CLIENT_SECRET", :oidc_client_secret)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
defp oidc_client_secret_from_config(nil),
|
|
||||||
do: env_or_setting("OIDC_CLIENT_SECRET", :oidc_client_secret)
|
|
||||||
|
|
||||||
defp oidc_client_secret_from_config(secret) when is_binary(secret) do
|
|
||||||
s = String.trim(secret)
|
|
||||||
if s != "", do: s, else: env_or_setting("OIDC_CLIENT_SECRET", :oidc_client_secret)
|
|
||||||
end
|
|
||||||
|
|
||||||
defp oidc_client_secret_from_config(_),
|
|
||||||
do: env_or_setting("OIDC_CLIENT_SECRET", :oidc_client_secret)
|
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
Returns the OIDC admin group name (for role sync). ENV first, then Settings.
|
Returns the OIDC admin group name (for role sync). ENV first, then Settings.
|
||||||
"""
|
"""
|
||||||
|
|
@ -442,10 +426,7 @@ defmodule Mv.Config do
|
||||||
def oidc_client_id_env_set?, do: env_set?("OIDC_CLIENT_ID")
|
def oidc_client_id_env_set?, do: env_set?("OIDC_CLIENT_ID")
|
||||||
def oidc_base_url_env_set?, do: env_set?("OIDC_BASE_URL")
|
def oidc_base_url_env_set?, do: env_set?("OIDC_BASE_URL")
|
||||||
def oidc_redirect_uri_env_set?, do: env_set?("OIDC_REDIRECT_URI")
|
def oidc_redirect_uri_env_set?, do: env_set?("OIDC_REDIRECT_URI")
|
||||||
|
def oidc_client_secret_env_set?, do: env_set?("OIDC_CLIENT_SECRET")
|
||||||
def oidc_client_secret_env_set?,
|
|
||||||
do: env_set?("OIDC_CLIENT_SECRET") or env_set?("OIDC_CLIENT_SECRET_FILE")
|
|
||||||
|
|
||||||
def oidc_admin_group_name_env_set?, do: env_set?("OIDC_ADMIN_GROUP_NAME")
|
def oidc_admin_group_name_env_set?, do: env_set?("OIDC_ADMIN_GROUP_NAME")
|
||||||
def oidc_groups_claim_env_set?, do: env_set?("OIDC_GROUPS_CLAIM")
|
def oidc_groups_claim_env_set?, do: env_set?("OIDC_GROUPS_CLAIM")
|
||||||
def oidc_only_env_set?, do: env_set?("OIDC_ONLY")
|
def oidc_only_env_set?, do: env_set?("OIDC_ONLY")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue