mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-07-06 04:45:10 +02:00
@@ -57,6 +57,8 @@ jobs:
|
|||||||
file: ./docker/prod/django/Dockerfile
|
file: ./docker/prod/django/Dockerfile
|
||||||
push: true
|
push: true
|
||||||
provenance: false
|
provenance: false
|
||||||
|
build-args: |
|
||||||
|
VERSION=nightly
|
||||||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:nightly
|
tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:nightly
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
@@ -70,6 +72,8 @@ jobs:
|
|||||||
file: ./docker/prod/django/Dockerfile
|
file: ./docker/prod/django/Dockerfile
|
||||||
push: true
|
push: true
|
||||||
provenance: false
|
provenance: false
|
||||||
|
build-args: |
|
||||||
|
VERSION=${{ github.event.release.tag_name }}
|
||||||
tags: |
|
tags: |
|
||||||
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:latest
|
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:latest
|
||||||
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ github.event.release.tag_name }}
|
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ github.event.release.tag_name }}
|
||||||
@@ -85,6 +89,8 @@ jobs:
|
|||||||
file: ./docker/prod/django/Dockerfile
|
file: ./docker/prod/django/Dockerfile
|
||||||
push: true
|
push: true
|
||||||
provenance: false
|
provenance: false
|
||||||
|
build-args: |
|
||||||
|
VERSION=${{ github.event.inputs.tag }}
|
||||||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ github.event.inputs.tag }}
|
tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ github.event.inputs.tag }}
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
|
|||||||
@@ -31,10 +31,8 @@ SECRET_KEY = os.getenv("SECRET_KEY", "")
|
|||||||
# SECURITY WARNING: don't run with debug turned on in production!
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||||||
DEBUG = os.getenv("DEBUG", "false").lower() == "true"
|
DEBUG = os.getenv("DEBUG", "false").lower() == "true"
|
||||||
|
|
||||||
ALLOWED_HOSTS = os.environ.get("DJANGO_ALLOWED_HOSTS", "localhost 127.0.0.1").split(" ")
|
ALLOWED_HOSTS = os.getenv("DJANGO_ALLOWED_HOSTS", "localhost 127.0.0.1").split(" ")
|
||||||
CSRF_TRUSTED_ORIGINS = os.environ.get("URL", "http://localhost http://127.0.0.1").split(
|
CSRF_TRUSTED_ORIGINS = os.getenv("URL", "http://localhost http://127.0.0.1").split(" ")
|
||||||
" "
|
|
||||||
)
|
|
||||||
|
|
||||||
# Application definition
|
# Application definition
|
||||||
|
|
||||||
@@ -128,11 +126,11 @@ WSGI_APPLICATION = "WYGIWYH.wsgi.application"
|
|||||||
DATABASES = {
|
DATABASES = {
|
||||||
"default": {
|
"default": {
|
||||||
"ENGINE": "django.db.backends.postgresql",
|
"ENGINE": "django.db.backends.postgresql",
|
||||||
"NAME": os.environ.get("SQL_DATABASE"),
|
"NAME": os.getenv("SQL_DATABASE"),
|
||||||
"USER": os.environ.get("SQL_USER", "user"),
|
"USER": os.getenv("SQL_USER", "user"),
|
||||||
"PASSWORD": os.environ.get("SQL_PASSWORD", "password"),
|
"PASSWORD": os.getenv("SQL_PASSWORD", "password"),
|
||||||
"HOST": os.environ.get("SQL_HOST", "localhost"),
|
"HOST": os.getenv("SQL_HOST", "localhost"),
|
||||||
"PORT": os.environ.get("SQL_PORT", "5432"),
|
"PORT": os.getenv("SQL_PORT", "5432"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -388,3 +386,4 @@ PWA_SERVICE_WORKER_PATH = BASE_DIR / "templates" / "pwa" / "serviceworker.js"
|
|||||||
|
|
||||||
ENABLE_SOFT_DELETE = os.getenv("ENABLE_SOFT_DELETE", "false").lower() == "true"
|
ENABLE_SOFT_DELETE = os.getenv("ENABLE_SOFT_DELETE", "false").lower() == "true"
|
||||||
KEEP_DELETED_TRANSACTIONS_FOR = int(os.getenv("KEEP_DELETED_ENTRIES_FOR", "365"))
|
KEEP_DELETED_TRANSACTIONS_FOR = int(os.getenv("KEEP_DELETED_ENTRIES_FOR", "365"))
|
||||||
|
APP_VERSION = os.getenv("APP_VERSION", "unknown")
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
from django import template
|
||||||
|
from django.conf import settings
|
||||||
|
|
||||||
|
register = template.Library()
|
||||||
|
|
||||||
|
|
||||||
|
@register.simple_tag(name="settings")
|
||||||
|
def settings_value(name):
|
||||||
|
return getattr(settings, name, "")
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
{% load settings %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
<div class="dropdown">
|
<div class="dropdown">
|
||||||
<a class="tw-text-2xl" type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
<a class="tw-text-2xl" type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||||
@@ -40,5 +41,7 @@
|
|||||||
</li>
|
</li>
|
||||||
<li><a class="dropdown-item" href="{% url 'logout' %}"><i class="fa-solid fa-door-open me-2 fa-fw"></i
|
<li><a class="dropdown-item" href="{% url 'logout' %}"><i class="fa-solid fa-door-open me-2 fa-fw"></i
|
||||||
>{% translate 'Logout' %}</a></li>
|
>{% translate 'Logout' %}</a></li>
|
||||||
|
<li><hr class="dropdown-divider"></li>
|
||||||
|
<li><a class="dropdown-item" href="https://github.com/eitchtee/WYGIWYH/releases" target="_blank" rel="nofollow">v. {% settings "APP_VERSION" %}</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ RUN pip wheel --wheel-dir /usr/src/app/wheels -r requirements.txt
|
|||||||
|
|
||||||
FROM python:3.11-slim-bookworm AS python-run-stage
|
FROM python:3.11-slim-bookworm AS python-run-stage
|
||||||
|
|
||||||
|
ARG VERSION=dev
|
||||||
|
ENV APP_VERSION=$VERSION
|
||||||
|
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||||
|
|||||||
@@ -18,6 +18,10 @@ RUN --mount=type=cache,target=/root/.npm \
|
|||||||
npm run build
|
npm run build
|
||||||
|
|
||||||
FROM python:3.11-slim-bookworm AS python-run-stage
|
FROM python:3.11-slim-bookworm AS python-run-stage
|
||||||
|
|
||||||
|
ARG VERSION=dev
|
||||||
|
ENV APP_VERSION=$VERSION
|
||||||
|
|
||||||
COPY --from=webpack_build /usr/src/frontend/build /usr/src/frontend/build
|
COPY --from=webpack_build /usr/src/frontend/build /usr/src/frontend/build
|
||||||
|
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|||||||
Reference in New Issue
Block a user