فهرست منبع

fix color option in docker

Nick Sweeting 4 سال پیش
والد
کامیت
ae43d35e65
2فایلهای تغییر یافته به همراه7 افزوده شده و 4 حذف شده
  1. 4 2
      archivebox/core/views.py
  2. 3 2
      docker-compose.yml

+ 4 - 2
archivebox/core/views.py

@@ -213,12 +213,14 @@ class PublicIndexView(ListView):
         }
         }
 
 
     def get_queryset(self, **kwargs): 
     def get_queryset(self, **kwargs): 
-        qs = super().get_queryset(**kwargs) 
+        qs = super().get_queryset(**kwargs)
         query = self.request.GET.get('q')
         query = self.request.GET.get('q')
         if query:
         if query:
             qs = qs.filter(Q(title__icontains=query) | Q(url__icontains=query) | Q(timestamp__icontains=query) | Q(tags__name__icontains=query))
             qs = qs.filter(Q(title__icontains=query) | Q(url__icontains=query) | Q(timestamp__icontains=query) | Q(tags__name__icontains=query))
+        
         for snapshot in qs:
         for snapshot in qs:
-            snapshot.icons = snapshot_icons(snapshot)
+            # lazy load snapshot icons, otherwise it will load icons for entire index at once
+            snapshot.icons = lambda: snapshot_icons(snapshot)
         return qs
         return qs
 
 
     def get(self, *args, **kwargs):
     def get(self, *args, **kwargs):

+ 3 - 2
docker-compose.yml

@@ -19,8 +19,9 @@ services:
         ports:
         ports:
             - 8000:8000
             - 8000:8000
         environment:
         environment:
-            - USE_COLOR=True
-            - SHOW_PROGRESS=False
+            - ALLOWED_HOSTS=*                   # add any config options you want as env vars
+            - MEDIA_MAX_SIZE=750m
+            # - SHOW_PROGRESS=False
             # - SEARCH_BACKEND_ENGINE=sonic     # uncomment these if you enable sonic below
             # - SEARCH_BACKEND_ENGINE=sonic     # uncomment these if you enable sonic below
             # - SEARCH_BACKEND_HOST_NAME=sonic
             # - SEARCH_BACKEND_HOST_NAME=sonic
             # - SEARCH_BACKEND_PASSWORD=SecretPassword
             # - SEARCH_BACKEND_PASSWORD=SecretPassword