diff --git a/apiserver/plane/db/migrations/0059_auto_20240131_1334.py b/apiserver/plane/db/migrations/0059_auto_20240131_1334.py index e8e74a6cc..fe2812d66 100644 --- a/apiserver/plane/db/migrations/0059_auto_20240131_1334.py +++ b/apiserver/plane/db/migrations/0059_auto_20240131_1334.py @@ -5,6 +5,26 @@ from django.conf import settings import django.db.models import plane.db.models.asset +def widgets_filter_change(apps, schema_editor): + Widget = apps.get_model("db", "Widget") + widgets_to_update = [] + + # Define the filter dictionaries for each widget key + filters_mapping = { + "assigned_issues": {"duration": "none", "tab": "pending"}, + "created_issues": {"duration": "none", "tab": "pending"}, + "issues_by_state_groups": {"duration": "none"}, + "issues_by_priority": {"duration": "none"}, + } + + # Iterate over widgets and update filters if applicable + for widget in Widget.objects.all(): + if widget.key in filters_mapping: + widget.filters = filters_mapping[widget.key] + widgets_to_update.append(widget) + + # Bulk update the widgets + Widget.objects.bulk_update(widgets_to_update, ["filters"], batch_size=10) def update_user_urls(apps, schema_editor): # Check if the app is using minio or s3 @@ -245,4 +265,5 @@ class Migration(migrations.Migration): migrations.RunPython(update_user_urls), migrations.RunPython(update_workspace_urls), migrations.RunPython(update_project_urls), + migrations.RunPython(widgets_filter_change), ] diff --git a/apiserver/plane/db/migrations/0059_auto_20240208_0957.py b/apiserver/plane/db/migrations/0059_auto_20240208_0957.py deleted file mode 100644 index c4c43fa4b..000000000 --- a/apiserver/plane/db/migrations/0059_auto_20240208_0957.py +++ /dev/null @@ -1,33 +0,0 @@ -# Generated by Django 4.2.7 on 2024-02-08 09:57 - -from django.db import migrations - - -def widgets_filter_change(apps, schema_editor): - Widget = apps.get_model("db", "Widget") - widgets_to_update = [] - - # Define the filter dictionaries for each widget key - filters_mapping = { - "assigned_issues": {"duration": "none", "tab": "pending"}, - "created_issues": {"duration": "none", "tab": "pending"}, - "issues_by_state_groups": {"duration": "none"}, - "issues_by_priority": {"duration": "none"}, - } - - # Iterate over widgets and update filters if applicable - for widget in Widget.objects.all(): - if widget.key in filters_mapping: - widget.filters = filters_mapping[widget.key] - widgets_to_update.append(widget) - - # Bulk update the widgets - Widget.objects.bulk_update(widgets_to_update, ["filters"], batch_size=10) - -class Migration(migrations.Migration): - dependencies = [ - ('db', '0058_alter_moduleissue_issue_and_more'), - ] - operations = [ - migrations.RunPython(widgets_filter_change) - ] diff --git a/apiserver/plane/db/migrations/0061_issueattachment_asset_key_issueattachment_type.py b/apiserver/plane/db/migrations/0061_issueattachment_asset_key_issueattachment_type.py index 116d2ab4b..78a252864 100644 --- a/apiserver/plane/db/migrations/0061_issueattachment_asset_key_issueattachment_type.py +++ b/apiserver/plane/db/migrations/0061_issueattachment_asset_key_issueattachment_type.py @@ -41,9 +41,9 @@ class Migration(migrations.Migration): migrations.DeleteModel( name="IssueAttachment", ), - migrations.AddField( - model_name='cycle', - name='progress_snapshot', - field=models.JSONField(default=dict), - ), + # migrations.AddField( + # model_name='cycle', + # name='progress_snapshot', + # field=models.JSONField(default=dict), + # ), ] diff --git a/nginx/nginx.conf.dev b/nginx/nginx.conf.dev index 27179e7ce..a512f96bd 100644 --- a/nginx/nginx.conf.dev +++ b/nginx/nginx.conf.dev @@ -16,12 +16,6 @@ http { add_header Permissions-Policy "interest-cohort=()" always; add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; - add_header Host ${dollar}host; - add_header X-Real-IP ${dollar}remote_addr; - add_header X-Forwarded-For ${dollar}proxy_add_x_forwarded_for; - add_header X-Forwarded-Proto ${dollar}scheme; - - location / { proxy_pass http://web:3000/; proxy_http_version 1.1; @@ -30,16 +24,20 @@ http { } location /api/ { + proxy_set_header Host ${dollar}host; + proxy_set_header X-Real-IP ${dollar}remote_addr; + proxy_set_header X-Forwarded-For ${dollar}proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto ${dollar}scheme; proxy_pass http://api:8000/api/; } - + location /spaces/ { rewrite ^/spaces/?$ /spaces/login break; proxy_pass http://space:4000/spaces/; } location /${BUCKET_NAME}/ { - proxy_pass http://plane-minio:9000/uploads/; + proxy_pass http://plane-minio:9000/${BUCKET_NAME}/; } } } diff --git a/nginx/nginx.conf.template b/nginx/nginx.conf.template index 8edef295f..ee2532bf5 100644 --- a/nginx/nginx.conf.template +++ b/nginx/nginx.conf.template @@ -26,6 +26,10 @@ http { } location /api/ { + proxy_set_header Host ${dollar}host; + proxy_set_header X-Real-IP ${dollar}remote_addr; + proxy_set_header X-Forwarded-For ${dollar}proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto ${dollar}scheme; proxy_pass http://api:8000/api/; }