18 Commits

Author SHA1 Message Date
root
3b4e42c119 Removed the fucking file volume 2025-12-16 15:02:14 +01:00
root
a1cbd66da6 Merge branch 'master' of https://git.fet.at/bofh/fet2020 2025-12-16 14:40:34 +01:00
sebivh
4d8a7a68f4 Add default env file 2025-12-16 14:40:23 +01:00
root
acc8375d2b Merge branch 'master' of https://git.fet.at/bofh/fet2020 2025-12-16 14:37:53 +01:00
sebivh
dac53d2d06 Change compose layout to use env file 2025-11-25 15:42:47 +01:00
sebivh
7613f3a547 Remove uneccesary gitignore subdir 2025-11-25 15:41:24 +01:00
root
bba8ac4703 Merge branch 'master' of https://git.fet.at/bofh/fet2020 2025-11-19 00:38:37 +01:00
28d3d99754 update account holder in wiref file 2025-11-17 12:17:46 +01:00
78c2860cca update etherpad to 2.5.2; fix charset and add auth method 2025-11-04 22:02:07 +01:00
2024466a48 Fix the help text 2025-11-04 18:49:03 +01:00
72570e25c2 add firstname and surname to search field 2025-11-03 18:46:24 +01:00
root
54c344d262 Merge branch 'master' of https://git.fet.at/bofh/fet2020 2025-10-31 15:13:00 +01:00
root
047dfcb147 Renamed Asset 2025-10-31 15:05:34 +01:00
a3b252c9be Fix: Find the current last day; Use the correct get now time function 2025-10-31 13:30:43 +01:00
b0e686245a Merge branch 'master' of https://git.fet.at/bofh/fet2020 2025-10-31 13:04:28 +01:00
sebivh
b50c010b3b Add persistant Storage to Container Databases 2025-10-30 23:21:25 +01:00
root
1e71779c6d Merge branch 'master' of https://git.fet.at/bofh/fet2020 2025-10-23 19:21:40 +02:00
root
d01dde658f change mode to +x 2025-10-21 17:56:33 +02:00
12 changed files with 539 additions and 506 deletions

14
.env.default Normal file
View File

@@ -0,0 +1,14 @@
HOSTNAME="fet.at" # Hostname that will be used to filter requests
DEBUG="false" # Debug flag ( disables ldap integration )
LDAP="True" # Ldap flag ( enables connection with fet ldap )
#SECRET_KEY="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" # Secret key for the Website encryption
ETHERPAD_GROUP="g.snlbqn7S6ksRbom3" # The Etherpad Group to use
EMAIL_HOST_USER="verleih@fet.at" # The user to be used for rental Emails
#EMAIL_HOST_PASSWORD="password" # The password for the smtp account for the rental Email
#ETHERPAD_DB_USER="user" # User for the Eterpad MySql Database
#ETHERPAD_DB_PASSWORD="password" # Password for the Etherpad MySql Database
#DJANGO_MYSQL_USER="user" # The MySql User used for Database
#DJANGO_MYSQL_PASSWORD"="password" # The Password for the MySql Database

3
.gitignore vendored
View File

@@ -1,4 +1,4 @@
.env/*
.env*
*.pyc
*_design1
fet2020/.env/*
@@ -19,3 +19,4 @@ flowbite
gallery/*
tailwind
whoosh_index
databases

Binary file not shown.

View File

@@ -9,7 +9,7 @@ services:
depends_on:
- django-homepage
volumes:
- files-volume:/usr/src/app/files
- ./fet2020/files:/usr/src/app/files
- ./gallery:/usr/src/app/files/uploads/gallery
- ./assets:/usr/src/app/assets:ro
networks:
@@ -18,15 +18,15 @@ services:
container_name: django-container
image: django-image:latest
environment:
HOST_NAME: "fet.at"
DEBUG: "False"
LDAP: "True"
SECRET_KEY: "sae34sADfrFr89E!Gl#f!34hdjGR#!jopi4qFEr#4R56rT56zT2#wE1!feGp"
MYSQL_USER: "user"
MYSQL_PASSWORD: "hgu"
ETHERPAD_GROUP: "g.snlbqn7S6ksRbom3"
EMAIL_HOST_USER: "verleih@fet.at"
EMAIL_HOST_PASSWORD: ""
HOST_NAME: ${HOSTNAME}
DEBUG: ${DEBUG}
LDAP: ${LDAP}
SECRET_KEY: ${SECRET_KEY}
MYSQL_USER: ${DJANGO_MYSQL_USER}
MYSQL_PASSWORD: ${DJANGO_MYSQL_PASSWORD}
ETHERPAD_GROUP: ${ETHERPAD_GROUP}
EMAIL_HOST_USER: ${EMAIL_HOST_USER}
EMAIL_HOST_PASSWORD: ${EMAIL_HOST_PASSWORD}
depends_on:
mysql:
condition: service_healthy
@@ -35,7 +35,7 @@ services:
volumes:
- ./fet2020:/usr/src/app
- ./gallery:/usr/src/app/files/uploads/gallery:shared
- files-volume:/usr/src/app/files
- ./fet2020/files:/usr/src/app/files
- ./assets:/usr/src/app/assets:ro
networks:
- fet-network
@@ -47,7 +47,7 @@ services:
retries: 20
etherpad:
container_name: etherpad-container
image: etherpad/etherpad:1.8.17
image: etherpad/etherpad:2.5.2
# ports:
# - 9001:9001
environment:
@@ -55,10 +55,11 @@ services:
DB_HOST: etherpadsql
DB_PORT: 3306
DB_NAME: etherpaddb
DB_USER: user
DB_PASS: "hgu"
DB_CHARSET: utf8
DB_USER: ${ETHERPAD_DB_USER}
DB_PASS: ${ETHERPAD_DB_PASSWORD}
DB_CHARSET: "utf8mb4"
TRUST_PROXY: false
AUTHENTICATION_METHOD: "apikey"
depends_on:
etherpadsql:
condition: "service_healthy"
@@ -78,13 +79,14 @@ services:
image: mariadb:10.7
environment:
MYSQL_DATABASE: fet2020db
MYSQL_USER: user
MYSQL_PASSWORD: hgu
MYSQL_USER: ${DJANGO_MYSQL_USER}
MYSQL_PASSWORD: ${DJANGO_MYSQL_PASSWORD}
MYSQL_COLLATION: utf8_general_ci
MYSQL_CHARSET: utf8
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
volumes:
- mysql-volume:/docker-entrypoint-initdb.d/
- ./inits/django:/docker-entrypoint-initdb.d/
- ./databases/django:/var/lib/mysql:Z
networks:
- django-db-network
healthcheck:
@@ -96,13 +98,14 @@ services:
image: mariadb:10.7
environment:
MYSQL_DATABASE: etherpaddb
MYSQL_USER: user
MYSQL_PASSWORD: "hgu"
MYSQL_USER: ${ETHERPAD_DB_USER}
MYSQL_PASSWORD: ${ETHERPAD_DB_PASSWORD}
MYSQL_COLLATION: utf8_general_ci
MYSQL_CHARSET: utf8
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
volumes:
- etherpad-mysql-volume:/docker-entrypoint-initdb.d/
- ./init/etherpad:/docker-entrypoint-initdb.d/
- ./databases/etherpad:/var/lib/mysql:Z
networks:
- etherpad-db-network
healthcheck:

View File

@@ -204,7 +204,12 @@ class BillAdmin(admin.ModelAdmin):
actions = ["make_cleared", "make_finished"]
autocomplete_fields = ["resolution"]
list_filter = ["status", "affiliation", "payer", BillPeriodeFilter]
search_fields = ["purpose", "bankdata__name"]
search_fields = [
"purpose",
"bankdata__name",
"bill_creator__firstname",
"bill_creator__surname",
]
show_facets = admin.ShowFacets.ALWAYS
ordering = ["-id"]

View File

@@ -6,6 +6,7 @@ from django import forms
from django.core.validators import ValidationError
from django.db.models import Count, Q
from django.forms import DateInput
from django.utils import timezone
from members.models import Member
@@ -412,7 +413,7 @@ class BillAdminForm(forms.ModelForm):
self.fields["resolution"].queryset = self.fields["resolution"].queryset.filter(
(
Q(option=Resolution.Option.FINANCE)
& Q(date__gt=datetime.datetime.now(tz=datetime.UTC).date() - relativedelta(years=2))
& Q(date__gt=timezone.now().date() - relativedelta(years=2))
)
| Q(option=Resolution.Option.PERMANENT)
)

View File

@@ -1,8 +1,8 @@
import datetime
import io
from pathlib import Path
from django.core.files import File
from django.utils import timezone
from pypdf import PdfReader, PdfWriter
from pypdf.constants import FieldDictionaryAttributes as FA # noqa: N814
@@ -34,7 +34,7 @@ def generate_pdf(wiref):
)
# Get budget year
today = datetime.datetime.now(tz=datetime.UTC).date()
today = timezone.now().date()
if today.month < 7:
budget_year = f"{today.year - 1}-{today.year}"
else:

View File

@@ -77,7 +77,7 @@ class EventForm(PostForm):
"image": "Verwendbare Formate: Bildformate",
"is_pinned": (
"Dieses Event soll als erstes auf der Startseite angeheftet werden und sich "
"automatisch einen Monat nach der Veröffentlichung wieder lösen."
"automatisch ein Tag nach dem Eventende wieder lösen."
),
}

View File

@@ -1,7 +1,9 @@
import calendar
import datetime
from django.db import models
from django.db.models import Case, Q, When
from django.utils import timezone
from .choices import PostType, Status
@@ -81,21 +83,26 @@ class ArticleManager(PublishedManager, models.Manager):
def pinned(self, public=True):
# Get date for pinned news that is max 1 month old.
post_date = datetime.datetime.now(tz=datetime.UTC).date()
__month = post_date.month
__year = post_date.year
post_date = timezone.now().date()
_day = post_date.day
_month = post_date.month
_year = post_date.year
if __month != 1:
__month -= 1
if _month != 1:
_month -= 1
else:
# If the current month is January, you get the date from December of previous year.
__month = 12
__year -= 1
_month = 12
_year -= 1
post_date = post_date.replace(year=__year, month=__month)
# Clamp day to last day of target month (handles 30/31 and Feb)
last_day = calendar.monthrange(_year, _month)[1]
safe_day = min(_day, last_day)
post_date = post_date.replace(year=_year, month=_month, day=safe_day)
# Get date for event posts that is max 1 day old.
event_date = datetime.datetime.now(tz=datetime.UTC).date() - datetime.timedelta(1)
event_date = timezone.now().date() - datetime.timedelta(1)
return (
self.published(public)
@@ -145,7 +152,7 @@ class AllEventManager(PublishedManager, models.Manager):
return qs.order_by("-date")
def future_events(self, public=True):
date_today = datetime.datetime.now(tz=datetime.UTC).date()
date_today = timezone.now().date()
qs = self.published(public).filter(event_start__gt=date_today)
return qs.reverse()
@@ -166,12 +173,12 @@ class EventManager(PublishedManager, models.Manager):
return qs.order_by("-date")
def future_events(self, public=True):
date_today = datetime.datetime.now(tz=datetime.UTC).date()
date_today = timezone.now().date()
qs = self.published(public).filter(event_start__gt=date_today)
return qs.reverse()
def past_events(self, public=True):
date_today = datetime.datetime.now(tz=datetime.UTC).date()
date_today = timezone.now().date()
qs = self.published(public).filter(event_start__lt=date_today)
return qs
@@ -191,11 +198,11 @@ class FetMeetingManager(PublishedManager, models.Manager):
return qs.order_by("-date")
def future_events(self):
date_today = datetime.datetime.now(tz=datetime.UTC).date()
date_today = timezone.now().date()
qs = self.published().filter(event_start__gt=date_today)
return qs.reverse()
def past_events(self):
date_today = datetime.datetime.now(tz=datetime.UTC).date()
date_today = timezone.now().date()
qs = self.published().filter(event_start__lt=date_today)
return qs

View File

@@ -6,6 +6,7 @@ from django.db.models import Q
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.urls import reverse
from django.utils import timezone
from django.views.generic import ListView, TemplateView
from django.views.generic.detail import DetailView
from django.views.generic.edit import CreateView
@@ -64,7 +65,7 @@ def _get_display_period(view_type: str, period: str) -> date:
)
except Exception:
# Get first day of the current week
today = datetime.datetime.now(tz=datetime.UTC).date()
today = timezone.now().date()
display_date = today - datetime.timedelta(days=today.weekday())
# Handle month view
@@ -76,7 +77,7 @@ def _get_display_period(view_type: str, period: str) -> date:
)
except Exception:
# Get the first day of the current month
display_date = datetime.datetime.now(tz=datetime.UTC).date().replace(day=1)
display_date = timezone.now().date().replace(day=1)
return display_date
@@ -170,7 +171,7 @@ class RentalListView(ListView):
context["week_num"] = week_num
# Get the current date for the calendar
context["today"] = datetime.datetime.now(tz=datetime.UTC).date()
context["today"] = timezone.now().date()
# Add rental items to the context for the filter
context["rentalitems"] = RentalItem.objects.all()
@@ -234,7 +235,7 @@ class RentalCreateView(CreateView):
selected_items = sorted(items, key=lambda x: x.name.lower())
for i in range(0, len(selected_items), RENTAL_ITEMS_MAX):
batch = selected_items[i:i + RENTAL_ITEMS_MAX]
batch = selected_items[i : i + RENTAL_ITEMS_MAX]
# Clone base_rental — copying all its field values
new_rental = Rental.objects.create(
@@ -266,6 +267,7 @@ class RentalCreateView(CreateView):
def get_success_url(self):
return reverse("rental:rental_create_done")
class RentalCreateDoneView(TemplateView):
template_name = "rental/create_done.html"