1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-12-09 21:27:47 +01:00

Compare commits

..

8 Commits

Author SHA1 Message Date
alexismdr
4059efa6c6 Merge branch 'aasa' into 'main'
Apple App-Site Association

See merge request bde/nk20!362
2025-12-09 20:56:51 +01:00
alexismdr
e146548658 Merge branch 'main' into 'aasa'
# Conflicts:
#   .env_example
2025-12-09 20:11:25 +01:00
alexismdr
1c891d6708 fix: import os 2025-12-09 18:51:10 +01:00
alexismdr
f3289de5d8 feat/fix: use env var instead of hardcoded 2025-12-09 18:45:07 +01:00
alexismdr
68ea640736 feat: add App Store app ID in env vars 2025-12-09 18:44:29 +01:00
alexismdr
00176c3cef fix: add aasa import in urls.py 2025-11-28 09:13:32 +01:00
alexismdr
de841c8143 feat: distribute aasa on .well-known/apple-app-site-association 2025-11-28 02:11:10 +01:00
alexismdr
43603d7359 feat: aasa view json distribution
* basic webcredentials config for password managers

See https://developer.apple.com/documentation/xcode/supporting-associated-domains for ref
2025-11-28 02:08:34 +01:00
4 changed files with 25 additions and 3 deletions

View File

@@ -28,3 +28,6 @@ OIDC_RSA_PRIVATE_KEY=CHANGE_ME
# Activity configuration
TRUSTED_ACTIVITY_MAIL=
ACTIVITY_EMAIL_MANAGER=
# App Store App ID
APP_STORE_APP_ID=P5246D3AFQ.org.crans.bde.note

View File

@@ -30,12 +30,16 @@ class ActivityViewSet(ReadProtectedModelViewSet):
The djangorestframework plugin will get all `Activity` objects, serialize it to JSON with the given serializer,
then render it on /api/activity/activity/
"""
queryset = Activity.objects.order_by('-date_start')
queryset = Activity.objects.order_by('id')
serializer_class = ActivitySerializer
filter_backends = [DjangoFilterBackend, RegexSafeSearchFilter]
filterset_fields = ['name', 'description', 'activity_type', 'location', 'creater', 'organizer', 'attendees_club',
'date_start', 'date_end', 'valid', 'open', ]
search_fields = ['$name', '$description', '$location', '$organizer__name', ]
search_fields = ['$name', '$description', '$location', '$creater__last_name', '$creater__first_name',
'$creater__email', '$creater__note__alias__name', '$creater__note__alias__normalized_name',
'$organizer__name', '$organizer__email', '$organizer__note__alias__name',
'$organizer__note__alias__normalized_name', '$attendees_club__name', '$attendees_club__email',
'$attendees_club__note__alias__name', '$attendees_club__note__alias__normalized_name', ]
class GuestViewSet(ReadProtectedModelViewSet):

View File

@@ -8,7 +8,7 @@ from django.views.defaults import bad_request, permission_denied, page_not_found
from member.views import CustomLoginView
from .admin import admin_site
from .views import IndexView
from .views import IndexView, apple_app_site_association
urlpatterns = [
# Dev so redirect to something random
@@ -33,6 +33,9 @@ urlpatterns = [
path('accounts/', include('django.contrib.auth.urls')),
path('api/', include('api.urls')),
path('permission/', include('permission.urls')),
# Apple App Site Association
path('.well-known/apple-app-site-association', apple_app_site_association),
]
# During development, serve static and media files

View File

@@ -6,6 +6,8 @@ from django.urls import reverse
from django.views.generic import RedirectView
from note.models import Alias
from permission.backends import PermissionBackend
from django.http import JsonResponse
import os
class IndexView(LoginRequiredMixin, RedirectView):
@@ -28,3 +30,13 @@ class IndexView(LoginRequiredMixin, RedirectView):
# Non-Kfet members will don't see the transfer page, but their profile page
return reverse("member:user_detail", args=(user.pk,))
def apple_app_site_association(request):
data = {
"webcredentials": {
"apps": [
os.getenv("APP_STORE_APP_ID")
]
}
}
return JsonResponse(data)