Skip to content

Commit

Permalink
Merge pull request #1774 from bunkerity/dev
Browse files Browse the repository at this point in the history
Merge branch "dev" into branch "beta"
  • Loading branch information
TheophileDiot authored Dec 3, 2024
2 parents 3c78764 + 2fdbff8 commit 929a9a6
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/common/core/templates/templates/high.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "Advanced security level with focus on robust security measures and comprehensive protection",
"settings": {
"SERVER_NAME": "www.example.com",
"SECURITY_MODE": "block",
"USE_REVERSE_PROXY": "yes",
"REVERSE_PROXY_HOST": "http://upstream-server:8080",
"REVERSE_PROXY_URL": "/",
Expand Down Expand Up @@ -73,6 +74,7 @@
"subtitle": "Configure your web service facing your clients",
"settings": [
"SERVER_NAME",
"SECURITY_MODE",
"AUTO_LETS_ENCRYPT",
"USE_LETS_ENCRYPT_STAGING",
"USE_LETS_ENCRYPT_WILDCARD",
Expand Down
2 changes: 2 additions & 0 deletions src/common/core/templates/templates/low.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "Basic security level that provides essential settings for web application protection",
"settings": {
"SERVER_NAME": "www.example.com",
"SECURITY_MODE": "block",
"USE_REVERSE_PROXY": "yes",
"REVERSE_PROXY_HOST": "http://upstream-server:8080",
"REVERSE_PROXY_URL": "/",
Expand Down Expand Up @@ -71,6 +72,7 @@
"subtitle": "Configure your web service facing your clients",
"settings": [
"SERVER_NAME",
"SECURITY_MODE",
"AUTO_LETS_ENCRYPT",
"USE_LETS_ENCRYPT_STAGING",
"USE_LETS_ENCRYPT_WILDCARD",
Expand Down
2 changes: 2 additions & 0 deletions src/common/core/templates/templates/medium.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "Balanced security level that offers a mix of security features and performance optimizations",
"settings": {
"SERVER_NAME": "www.example.com",
"SECURITY_MODE": "block",
"USE_REVERSE_PROXY": "yes",
"REVERSE_PROXY_HOST": "http://upstream-server:8080",
"REVERSE_PROXY_URL": "/",
Expand Down Expand Up @@ -73,6 +74,7 @@
"subtitle": "Configure your web service facing your clients",
"settings": [
"SERVER_NAME",
"SECURITY_MODE",
"AUTO_LETS_ENCRYPT",
"USE_LETS_ENCRYPT_STAGING",
"USE_LETS_ENCRYPT_WILDCARD",
Expand Down
1 change: 0 additions & 1 deletion src/common/core/templates/templates/ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"CORS_ALLOW_ORIGIN": "self",
"INTERCEPTED_ERROR_CODES": "400 404 405 413 429 500 501 502 503 504",
"MAX_CLIENT_SIZE": "50m",
"GENERATE_SELF_SIGNED_SSL": "yes",
"KEEP_UPSTREAM_HEADERS": "Content-Security-Policy Strict-Transport-Security X-Frame-Options X-Content-Type-Options Referrer-Policy",
"REVERSE_PROXY_KEEPALIVE": "yes"
}
Expand Down
4 changes: 2 additions & 2 deletions src/ui/app/models/ui_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ def get_ui_user(self, *, username: Optional[str] = None, as_dict: bool = False)
"method": ui_user.method,
"theme": ui_user.theme,
"totp_secret": ui_user.totp_secret,
"creation_date": ui_user.creation_date,
"update_date": ui_user.update_date,
"creation_date": ui_user.creation_date.astimezone(),
"update_date": ui_user.update_date.astimezone(),
"roles": [role.role_name for role in ui_user.roles],
"recovery_codes": [recovery_code.code for recovery_code in ui_user.recovery_codes],
}
Expand Down
4 changes: 2 additions & 2 deletions src/ui/app/routes/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ def setup_loading():

db_config = DB.get_config(filtered_settings=("SERVER_NAME", "USE_UI", "REVERSE_PROXY_URL"))
ui_service = {}
ui_admin = DB.get_ui_user()
admin_old_enough = ui_admin and ui_admin.creation_date < datetime.now().astimezone() - timedelta(minutes=5)
ui_admin = DB.get_ui_user(as_dict=True)
admin_old_enough = ui_admin and ui_admin["creation_date"] < datetime.now().astimezone() - timedelta(minutes=5)

for server_name in db_config["SERVER_NAME"].split(" "):
if server_name and db_config.get(f"{server_name}_USE_UI", "no") == "yes":
Expand Down

0 comments on commit 929a9a6

Please sign in to comment.