mirror of
https://github.com/goauthentik/authentik.git
synced 2026-08-30 18:51:39 -07:00
switchup
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"""authentik database backend"""
|
||||
|
||||
from django.core.checks import Error, Warning
|
||||
from django.core.checks import Warning
|
||||
from django.db.backends.base.validation import BaseDatabaseValidation
|
||||
from django_tenants.postgresql_backend.base import DatabaseWrapper as BaseDatabaseWrapper
|
||||
|
||||
@@ -15,7 +15,7 @@ class DatabaseValidation(BaseDatabaseValidation):
|
||||
return self._check_encoding()
|
||||
|
||||
def _check_encoding(self):
|
||||
"""Fail when the server_encoding is not UTF8, and warn when
|
||||
"""Warn when the server_encoding is not UTF8, or when
|
||||
server_encoding and client_encoding are mismatched"""
|
||||
messages = []
|
||||
with self.connection.cursor() as cursor:
|
||||
@@ -33,12 +33,13 @@ class DatabaseValidation(BaseDatabaseValidation):
|
||||
)
|
||||
if server_encoding != "UTF8":
|
||||
messages.append(
|
||||
Error(
|
||||
f"PostgreSQL Server encoding is not UTF8: {server_encoding}",
|
||||
hint="authentik requires a UTF8 database. Dump the database, "
|
||||
"re-create it with `ENCODING 'UTF8'` and restore the dump. "
|
||||
f"See {ENCODING_DOCS_URL}",
|
||||
id="ak.db.E001",
|
||||
Warning(
|
||||
f"PostgreSQL Server encoding is not UTF8: {server_encoding}. "
|
||||
"Support for other encodings is deprecated and will be removed "
|
||||
"in an upcoming version.",
|
||||
hint="Dump the database, re-create it with `ENCODING 'UTF8'` "
|
||||
f"and restore the dump. See {ENCODING_DOCS_URL}",
|
||||
id="ak.db.W002",
|
||||
)
|
||||
)
|
||||
return messages
|
||||
|
||||
@@ -67,7 +67,7 @@ To check if your config has been applied correctly, you can run the following co
|
||||
|
||||
authentik requires PostgreSQL for application data, configuration, sessions, and background task coordination. authentik supports PostgreSQL 14 - 18.
|
||||
|
||||
The database must use the `UTF8` encoding, which is PostgreSQL's default. Unless a different encoding was explicitly chosen when the database was created, no change is needed. Run `SHOW server_encoding;` to check; authentik refuses to start on any other encoding. Converting an existing database means dumping it, re-creating it with `ENCODING 'UTF8'`, and restoring the dump.
|
||||
The database should use the `UTF8` encoding, which is PostgreSQL's default. Unless a different encoding was explicitly chosen when the database was created, no change is needed. Run `SHOW server_encoding;` to check; authentik logs a warning on any other encoding, and support for them will be removed in an upcoming version. Converting an existing database means dumping it, re-creating it with `ENCODING 'UTF8'`, and restoring the dump.
|
||||
|
||||
Use the settings in this section to configure:
|
||||
|
||||
|
||||
@@ -6,13 +6,7 @@ draft: true
|
||||
|
||||
## Highlights
|
||||
|
||||
## Breaking changes
|
||||
|
||||
### Databases that are not `UTF8` are now rejected
|
||||
|
||||
authentik has required the PostgreSQL database to use the `UTF8` encoding [since 2025.8](../2025/v2025.8.mdx#database-encoding-requirements), and logged a warning on startup when it did not. That warning is now an error, so authentik no longer starts against a database with any other encoding.
|
||||
|
||||
Run `SHOW server_encoding;` to check. Converting an existing database means dumping it, re-creating it with `ENCODING 'UTF8'`, and restoring the dump.
|
||||
<!-- ## Breaking changes -->
|
||||
|
||||
## New features and improvements
|
||||
|
||||
@@ -46,6 +40,14 @@ helm repo update
|
||||
helm upgrade authentik authentik/authentik -f values.yaml --version ^xxxx.x
|
||||
```
|
||||
|
||||
## Deprecations
|
||||
|
||||
### Databases that are not `UTF8` are deprecated
|
||||
|
||||
authentik has required the PostgreSQL database to use the `UTF8` encoding [since 2025.8](../2025/v2025.8.mdx#database-encoding-requirements). Support for other encodings is deprecated and will be removed in an upcoming version, at which point authentik will no longer start against such a database.
|
||||
|
||||
Run `SHOW server_encoding;` to check. Converting an existing database means dumping it, re-creating it with `ENCODING 'UTF8'`, and restoring the dump.
|
||||
|
||||
## Minor changes/fixes
|
||||
|
||||
<!-- _Insert the output of `make gen-changelog` here_ -->
|
||||
|
||||
Reference in New Issue
Block a user