diff --git a/config/00-realm-config.yaml b/config/00-realm-config.yaml index de635b5..d8e2724 100644 --- a/config/00-realm-config.yaml +++ b/config/00-realm-config.yaml @@ -1,4 +1,6 @@ realm: $(REALM_NAME) +hostname: $(KEYCLOAK_HOSTNAME) +frontendUrl: $(KEYCLOAK_HOSTNAME) enabled: true displayName: $(REALM_DISPLAY_NAME) loginTheme: Blue_stripes @@ -6,30 +8,25 @@ attributes: userProfileEnabled: true registrationAllowed: true registrationEmailAsUsername: false # Set to true if you want email as username -editUsernameAllowed: false # Prevent username changes after registration +editUsernameAllowed: true # Prevent username changes after registration internationalizationEnabled: true defaultLocale: ru supportedLocales: - ru -userProfile: - attributes: - - name: "username" - displayName: ${username} +smtpServer: + # Sender Details + from: $(EMAIL_ADRESS) + fromDisplayName: $(REALM_NAME) - permissions: - view: ["admin", "user"] - edit: ["admin", "user"] + # Connection Settings + host: $(SMTP_HOST) + port: $(SMTP_PORT) # Common ports: 25, 465 (SSL), 587 (TLS) + auth: true + ssl: $(SMTP_SSL) # Enable for port 465 + starttls: $(SMTP_STARTLS) # Enable for port 587 - - name: "email" - displayName: ${email} - required: - roles: ["user"] - permissions: - view: ["admin", "user"] - edit: ["admin", "user"] - validations: - email: {} - - unmanagedAttributePolicy: "ADMIN_VIEW" + # Authentication Credentials (use string values directly) + user: $(SMTP_USER) + password: $(SMTP_PASSWORD) diff --git a/config/02-users-config.yaml b/config/02-users-config.yaml index 482e0b1..142c0c8 100644 --- a/config/02-users-config.yaml +++ b/config/02-users-config.yaml @@ -8,3 +8,24 @@ users: realm-management: - view-users - query-users + +userProfile: + attributes: + - name: "username" + displayName: ${username} + + permissions: + view: ["admin", "user"] + edit: ["admin", "user"] + + - name: "email" + displayName: ${email} + required: + roles: ["user"] + permissions: + view: ["admin", "user"] + edit: ["admin", "user"] + validations: + email: {} + + unmanagedAttributePolicy: "ADMIN_VIEW" diff --git a/docker-compose.yml b/docker-compose.yml index 32e754a..7ec8774 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,6 +13,7 @@ services: KC_HEALTH_ENABLED: "true" KC_LOG_LEVEL: INFO KC_HOSTNAME: ${KEYCLOAK_HOSTNAME} + KC_HOSTNAME_STRICT: false KC_PROXY: edge KC_HTTP_ENABLED: "true" volumes: diff --git a/nginx/keycloak.conf b/nginx/keycloak.conf index 9c61ddd..b617d97 100644 --- a/nginx/keycloak.conf +++ b/nginx/keycloak.conf @@ -24,6 +24,5 @@ server { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto https; } }