Refactored file structure to fix docker build, fixed Unfold configuration.

This commit is contained in:
2025-11-11 09:08:09 +00:00
parent a82d0a5396
commit c488f18cc6
181 changed files with 46 additions and 4 deletions

View File

@@ -40,7 +40,7 @@ RUN pip install --upgrade pip \
# 4. Collect static assets
# =============================================
WORKDIR /app
COPY . .
COPY ./app .
RUN python manage.py collectstatic --noinput

View File

@@ -23,6 +23,15 @@ class UserAdmin(BaseUserAdmin, ModelAdmin):
add_form = UserCreationForm
change_password_form = AdminPasswordChangeForm
# Set to False, to enable filter as "sidebar"
list_filter_sheet = True
# Display fields in changeform in compressed mode
compressed_fields = True # Default: False
# Warn before leaving unsaved changes in changeform
warn_unsaved_form = True # Default: False
@admin.register(Group)
class GroupAdmin(BaseGroupAdmin, ModelAdmin):

View File

@@ -2,6 +2,9 @@ import os
from pathlib import Path
from dotenv import load_dotenv
from django.urls import reverse_lazy
from django.utils.translation import gettext_lazy as _
load_dotenv()
BASE_DIR = Path(__file__).resolve().parent.parent.parent
@@ -21,6 +24,8 @@ CSRF_COOKIE_SECURE = True
SESSION_COOKIE_SECURE = True
INSTALLED_APPS = [
"unfold", # Admin UI
"unfold.contrib.filters",
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
@@ -31,8 +36,6 @@ INSTALLED_APPS = [
"apps.core",
"apps.dashboard",
"ninja", # Django Ninja API
"unfold", # Admin UI
"unfold.contrib.filters",
"mozilla_django_oidc", # OIDC Client
"tailwind",
"theme"
@@ -113,6 +116,8 @@ UNFOLD = {
"LOGIN_REDIRECT_URL": "/admin/",
"ENVIRONMENT": "Keywarden",
"ENVIRONMENT_COLOR": "#7C3AED",
"SHOW_VIEW_ON_SITE": True,
"THEME": "dark", # Force theme: "dark" or "light". Will disable theme switcher
"SIDEBAR": {
"show_search": True,
"show_all_applications": True,
@@ -138,6 +143,31 @@ UNFOLD = {
"/static/unfold/js/simplebar.js",
"/static/unfold/js/alpine.js",
],
"SITE_DROPDOWN": [
{
"icon": "diamond",
"title": _("Keywarden"),
"link": "https://keywarden.dev.ntbx.io",
"attrs": {
"target": "_blank",
},
},
],
# "TABS": [
# {
# "models": [
# "app_label.Accounts",
# ],
# "items": [
# {
# "title": _("Accounts"),
# "link": reverse_lazy("admin:app_label_model_name_changelist"),
# "permission": "keywarden.settings.permission_callback",
# },
# ],
# },
# ],
}
OIDC_RP_CLIENT_ID = os.getenv("KEYWARDEN_OIDC_CLIENT_ID")
@@ -151,3 +181,6 @@ LOGIN_URL = "/oidc/authenticate/"
LOGOUT_URL = "/oidc/logout/"
LOGIN_REDIRECT_URL = "/"
LOGOUT_REDIRECT_URL = "/"
def permission_callback(request):
return request.user.has_perm("keywarden.change_model")

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 331 B

After

Width:  |  Height:  |  Size: 331 B

View File

Before

Width:  |  Height:  |  Size: 504 B

After

Width:  |  Height:  |  Size: 504 B

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 380 B

After

Width:  |  Height:  |  Size: 380 B

View File

Before

Width:  |  Height:  |  Size: 677 B

After

Width:  |  Height:  |  Size: 677 B

View File

Before

Width:  |  Height:  |  Size: 392 B

After

Width:  |  Height:  |  Size: 392 B

View File

Before

Width:  |  Height:  |  Size: 784 B

After

Width:  |  Height:  |  Size: 784 B

View File

Before

Width:  |  Height:  |  Size: 560 B

After

Width:  |  Height:  |  Size: 560 B

View File

Before

Width:  |  Height:  |  Size: 655 B

After

Width:  |  Height:  |  Size: 655 B

View File

Before

Width:  |  Height:  |  Size: 655 B

After

Width:  |  Height:  |  Size: 655 B

View File

Before

Width:  |  Height:  |  Size: 581 B

After

Width:  |  Height:  |  Size: 581 B

View File

Before

Width:  |  Height:  |  Size: 436 B

After

Width:  |  Height:  |  Size: 436 B

View File

Before

Width:  |  Height:  |  Size: 560 B

After

Width:  |  Height:  |  Size: 560 B

View File

Before

Width:  |  Height:  |  Size: 458 B

After

Width:  |  Height:  |  Size: 458 B

View File

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 331 B

After

Width:  |  Height:  |  Size: 331 B

View File

Before

Width:  |  Height:  |  Size: 280 B

After

Width:  |  Height:  |  Size: 280 B

Some files were not shown because too many files have changed in this diff Show More