Refactored file structure to fix docker build, fixed Unfold configuration.
This commit is contained in:
1 parent
a82d0a5396
commit
c488f18cc6
181 files changed
+45
-3
No files matched your search
+1
-1
@@ -40,7 +40,7 @@ RUN pip install --upgrade pip \
|
|||||||
# 4. Collect static assets
|
# 4. Collect static assets
|
||||||
# =============================================
|
# =============================================
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY . .
|
COPY ./app .
|
||||||
|
|
||||||
RUN python manage.py collectstatic --noinput
|
RUN python manage.py collectstatic --noinput
|
||||||
|
|
||||||
|
|||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -23,6 +23,15 @@ class UserAdmin(BaseUserAdmin, ModelAdmin):
|
|||||||
add_form = UserCreationForm
|
add_form = UserCreationForm
|
||||||
change_password_form = AdminPasswordChangeForm
|
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)
|
@admin.register(Group)
|
||||||
class GroupAdmin(BaseGroupAdmin, ModelAdmin):
|
class GroupAdmin(BaseGroupAdmin, ModelAdmin):
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -2,6 +2,9 @@ import os
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
|
|
||||||
|
from django.urls import reverse_lazy
|
||||||
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
|
||||||
BASE_DIR = Path(__file__).resolve().parent.parent.parent
|
BASE_DIR = Path(__file__).resolve().parent.parent.parent
|
||||||
@@ -21,6 +24,8 @@ CSRF_COOKIE_SECURE = True
|
|||||||
SESSION_COOKIE_SECURE = True
|
SESSION_COOKIE_SECURE = True
|
||||||
|
|
||||||
INSTALLED_APPS = [
|
INSTALLED_APPS = [
|
||||||
|
"unfold", # Admin UI
|
||||||
|
"unfold.contrib.filters",
|
||||||
"django.contrib.admin",
|
"django.contrib.admin",
|
||||||
"django.contrib.auth",
|
"django.contrib.auth",
|
||||||
"django.contrib.contenttypes",
|
"django.contrib.contenttypes",
|
||||||
@@ -31,8 +36,6 @@ INSTALLED_APPS = [
|
|||||||
"apps.core",
|
"apps.core",
|
||||||
"apps.dashboard",
|
"apps.dashboard",
|
||||||
"ninja", # Django Ninja API
|
"ninja", # Django Ninja API
|
||||||
"unfold", # Admin UI
|
|
||||||
"unfold.contrib.filters",
|
|
||||||
"mozilla_django_oidc", # OIDC Client
|
"mozilla_django_oidc", # OIDC Client
|
||||||
"tailwind",
|
"tailwind",
|
||||||
"theme"
|
"theme"
|
||||||
@@ -113,6 +116,8 @@ UNFOLD = {
|
|||||||
"LOGIN_REDIRECT_URL": "/admin/",
|
"LOGIN_REDIRECT_URL": "/admin/",
|
||||||
"ENVIRONMENT": "Keywarden",
|
"ENVIRONMENT": "Keywarden",
|
||||||
"ENVIRONMENT_COLOR": "#7C3AED",
|
"ENVIRONMENT_COLOR": "#7C3AED",
|
||||||
|
"SHOW_VIEW_ON_SITE": True,
|
||||||
|
"THEME": "dark", # Force theme: "dark" or "light". Will disable theme switcher
|
||||||
"SIDEBAR": {
|
"SIDEBAR": {
|
||||||
"show_search": True,
|
"show_search": True,
|
||||||
"show_all_applications": True,
|
"show_all_applications": True,
|
||||||
@@ -138,6 +143,31 @@ UNFOLD = {
|
|||||||
"/static/unfold/js/simplebar.js",
|
"/static/unfold/js/simplebar.js",
|
||||||
"/static/unfold/js/alpine.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")
|
OIDC_RP_CLIENT_ID = os.getenv("KEYWARDEN_OIDC_CLIENT_ID")
|
||||||
@@ -151,3 +181,6 @@ LOGIN_URL = "/oidc/authenticate/"
|
|||||||
LOGOUT_URL = "/oidc/logout/"
|
LOGOUT_URL = "/oidc/logout/"
|
||||||
LOGIN_REDIRECT_URL = "/"
|
LOGIN_REDIRECT_URL = "/"
|
||||||
LOGOUT_REDIRECT_URL = "/"
|
LOGOUT_REDIRECT_URL = "/"
|
||||||
|
|
||||||
|
def permission_callback(request):
|
||||||
|
return request.user.has_perm("keywarden.change_model")
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Vendored
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Vendored
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Vendored
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loaded 100 of 181 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user