From 403b980574670f9b2f47f7b818ab410ba87292f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rojen=20Arda=20=C5=9Ee=C5=9Fen?= Date: Fri, 20 Sep 2024 22:56:59 +0300 Subject: [PATCH 01/18] Trigger pipeline --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 930556d..c4686a0 100644 --- a/README.md +++ b/README.md @@ -203,4 +203,4 @@ The email templates are in `./backend/app/email-templates/`. Here, there are two Before continuing, ensure you have the [MJML extension](https://marketplace.visualstudio.com/items?itemName=attilabuti.vscode-mjml) installed in your VS Code. -Once you have the MJML extension installed, you can create a new email template in the `src` directory. After creating the new email template and with the `.mjml` file open in your editor, open the command palette with `Ctrl+Shift+P` and search for `MJML: Export to HTML`. This will convert the `.mjml` file to a `.html` file and now you can save it in the build directory. +Once you have the MJML extension installed, you can create a new email template in the `src` directory. After creating the new email template and with the `.mjml` file open in your editor, open the command palette with `Ctrl+Shift+P` and search for `MJML: Export to HTML`. This will convert the `.mjml` file to a `.html` file and now you can save it in the build directory. \ No newline at end of file From 8e5797f47f3f5a41cf878b846d66f1dca39120c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rojen=20Arda=20=C5=9Ee=C5=9Fen?= Date: Fri, 20 Sep 2024 23:05:14 +0300 Subject: [PATCH 02/18] Trigger pipeline --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c4686a0..930556d 100644 --- a/README.md +++ b/README.md @@ -203,4 +203,4 @@ The email templates are in `./backend/app/email-templates/`. Here, there are two Before continuing, ensure you have the [MJML extension](https://marketplace.visualstudio.com/items?itemName=attilabuti.vscode-mjml) installed in your VS Code. -Once you have the MJML extension installed, you can create a new email template in the `src` directory. After creating the new email template and with the `.mjml` file open in your editor, open the command palette with `Ctrl+Shift+P` and search for `MJML: Export to HTML`. This will convert the `.mjml` file to a `.html` file and now you can save it in the build directory. \ No newline at end of file +Once you have the MJML extension installed, you can create a new email template in the `src` directory. After creating the new email template and with the `.mjml` file open in your editor, open the command palette with `Ctrl+Shift+P` and search for `MJML: Export to HTML`. This will convert the `.mjml` file to a `.html` file and now you can save it in the build directory. From 892286a850bf3ff10736df38a3fd79527487019d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rojen=20Arda=20=C5=9Ee=C5=9Fen?= Date: Fri, 20 Sep 2024 23:24:38 +0300 Subject: [PATCH 03/18] Update workflow --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2504dec..d7c06b6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,4 +14,5 @@ jobs: - name: Checkout uses: actions/checkout@v4 - run: docker compose -f docker-compose.yml build + - run: cp /home/hasan/ituacm_website_backend/.env /home/hasan/actions-runner/_work/ituacm_website_backend/ituacm_website_backend/ - run: docker compose -f docker-compose.yml up -d \ No newline at end of file From a994b5190c37b673b7aea64c9bda1487f50603cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rojen=20Arda=20=C5=9Ee=C5=9Fen?= Date: Sat, 21 Sep 2024 00:00:10 +0300 Subject: [PATCH 04/18] Update workflow --- .github/workflows/main.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d7c06b6..4b0d40e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,6 +13,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - run: docker compose -f docker-compose.yml build - - run: cp /home/hasan/ituacm_website_backend/.env /home/hasan/actions-runner/_work/ituacm_website_backend/ituacm_website_backend/ - - run: docker compose -f docker-compose.yml up -d \ No newline at end of file + - run: whoami + # - run: docker compose -f docker-compose.yml build + # - run: cp /home/hasan/ituacm_website_backend/.env /home/hasan/actions-runner/_work/ituacm_website_backend/ituacm_website_backend/ + # - run: docker compose -f docker-compose.yml up -d \ No newline at end of file From 4fdb1bd76c129cb26eaebccd40c445c5b5dc1216 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rojen=20Arda=20=C5=9Ee=C5=9Fen?= Date: Sat, 21 Sep 2024 00:09:36 +0300 Subject: [PATCH 05/18] UPDATE WORKFLOW????? --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4b0d40e..7e60e9d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,6 +14,6 @@ jobs: - name: Checkout uses: actions/checkout@v4 - run: whoami - # - run: docker compose -f docker-compose.yml build - # - run: cp /home/hasan/ituacm_website_backend/.env /home/hasan/actions-runner/_work/ituacm_website_backend/ituacm_website_backend/ - # - run: docker compose -f docker-compose.yml up -d \ No newline at end of file + - run: docker compose -f docker-compose.yml build + - run: cp /home/hasan/ituacm_website_backend/.env /home/hasan/actions-runner/_work/ituacm_website_backend/ituacm_website_backend/ + - run: docker compose -f docker-compose.yml up -d \ No newline at end of file From 2e7a3d2d730d738e1c66d2fc84ada66d83fd77f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rojen=20Arda=20=C5=9Ee=C5=9Fen?= Date: Sat, 21 Sep 2024 00:15:55 +0300 Subject: [PATCH 06/18] UPDATE WORKFLOW :(((( --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7e60e9d..dee4141 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - run: whoami - run: docker compose -f docker-compose.yml build - run: cp /home/hasan/ituacm_website_backend/.env /home/hasan/actions-runner/_work/ituacm_website_backend/ituacm_website_backend/ + - run: cat .env - run: docker compose -f docker-compose.yml up -d \ No newline at end of file From 97594a9fcada34c2928b23f8be8cd727434cc729 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rojen=20Arda=20=C5=9Ee=C5=9Fen?= Date: Sat, 21 Sep 2024 00:25:26 +0300 Subject: [PATCH 07/18] EVET --- .github/workflows/main.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dee4141..7b98319 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - run: docker compose -f docker-compose.yml build - run: cp /home/hasan/ituacm_website_backend/.env /home/hasan/actions-runner/_work/ituacm_website_backend/ituacm_website_backend/ - - run: cat .env + - run: docker compose -f docker-compose.yml build - run: docker compose -f docker-compose.yml up -d \ No newline at end of file From ac117bea6a259a32c9da608d3072f51b8a84880d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rojen=20Arda=20=C5=9Ee=C5=9Fen?= Date: Sat, 21 Sep 2024 01:39:58 +0300 Subject: [PATCH 08/18] Print allowed origins, disable cache on docker build --- .github/workflows/main.yml | 2 +- backend/app/main.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7b98319..a8ef6fd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,5 +14,5 @@ jobs: - name: Checkout uses: actions/checkout@v4 - run: cp /home/hasan/ituacm_website_backend/.env /home/hasan/actions-runner/_work/ituacm_website_backend/ituacm_website_backend/ - - run: docker compose -f docker-compose.yml build + - run: docker compose -f docker-compose.yml build --no-cache - run: docker compose -f docker-compose.yml up -d \ No newline at end of file diff --git a/backend/app/main.py b/backend/app/main.py index 4c252a1..b735ae9 100644 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -22,6 +22,7 @@ def custom_generate_unique_id(route: APIRoute) -> str: # Set all CORS enabled origins if settings.BACKEND_CORS_ORIGINS: + print(settings.BACKEND_CORS_ORIGINS) app.add_middleware( CORSMiddleware, allow_origins=[ From 799c5f79f9c0dae5994833a3f842cd5422252566 Mon Sep 17 00:00:00 2001 From: hasanaliozdemir <68190862+hasanaliozdemir@users.noreply.github.com> Date: Mon, 23 Sep 2024 20:35:23 +0300 Subject: [PATCH 09/18] Update config.py --- backend/app/core/config.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/app/core/config.py b/backend/app/core/config.py index 1e3a440..06168a4 100644 --- a/backend/app/core/config.py +++ b/backend/app/core/config.py @@ -46,6 +46,9 @@ def server_host(self) -> str: list[AnyUrl] | str, BeforeValidator(parse_cors) ] = [] + BACKEND_CORS_ORIGINS.append(Url("http://admin.ituacm.com)) + BACKEND_CORS_ORIGINS.append(Url("https://admin.ituacm.com)) + PROJECT_NAME: str SENTRY_DSN: HttpUrl | None = None POSTGRES_SERVER: str From 7894167edbfc554e2a9bbf62d3eef57cc5602c25 Mon Sep 17 00:00:00 2001 From: hasanaliozdemir <68190862+hasanaliozdemir@users.noreply.github.com> Date: Mon, 23 Sep 2024 20:38:41 +0300 Subject: [PATCH 10/18] Update config.py --- backend/app/core/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/app/core/config.py b/backend/app/core/config.py index 06168a4..9fe96c2 100644 --- a/backend/app/core/config.py +++ b/backend/app/core/config.py @@ -46,8 +46,8 @@ def server_host(self) -> str: list[AnyUrl] | str, BeforeValidator(parse_cors) ] = [] - BACKEND_CORS_ORIGINS.append(Url("http://admin.ituacm.com)) - BACKEND_CORS_ORIGINS.append(Url("https://admin.ituacm.com)) + BACKEND_CORS_ORIGINS.append(Url("http://admin.ituacm.com")) + BACKEND_CORS_ORIGINS.append(Url("https://admin.ituacm.com")) PROJECT_NAME: str SENTRY_DSN: HttpUrl | None = None From 38fe9ff796c20fa0ecde45b28555e55307e40f84 Mon Sep 17 00:00:00 2001 From: hasanaliozdemir <68190862+hasanaliozdemir@users.noreply.github.com> Date: Mon, 23 Sep 2024 20:42:10 +0300 Subject: [PATCH 11/18] Update config.py --- backend/app/core/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/app/core/config.py b/backend/app/core/config.py index 9fe96c2..4810a50 100644 --- a/backend/app/core/config.py +++ b/backend/app/core/config.py @@ -46,8 +46,8 @@ def server_host(self) -> str: list[AnyUrl] | str, BeforeValidator(parse_cors) ] = [] - BACKEND_CORS_ORIGINS.append(Url("http://admin.ituacm.com")) - BACKEND_CORS_ORIGINS.append(Url("https://admin.ituacm.com")) + BACKEND_CORS_ORIGINS.append("http://admin.ituacm.com") + BACKEND_CORS_ORIGINS.append("https://admin.ituacm.com") PROJECT_NAME: str SENTRY_DSN: HttpUrl | None = None From 43bdbe358cb36fb5d551ee5b17736ba1e73146ba Mon Sep 17 00:00:00 2001 From: hasanaliozdemir <68190862+hasanaliozdemir@users.noreply.github.com> Date: Mon, 23 Sep 2024 21:25:27 +0300 Subject: [PATCH 12/18] Update config.py --- backend/app/core/config.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/backend/app/core/config.py b/backend/app/core/config.py index 4810a50..1e3a440 100644 --- a/backend/app/core/config.py +++ b/backend/app/core/config.py @@ -46,9 +46,6 @@ def server_host(self) -> str: list[AnyUrl] | str, BeforeValidator(parse_cors) ] = [] - BACKEND_CORS_ORIGINS.append("http://admin.ituacm.com") - BACKEND_CORS_ORIGINS.append("https://admin.ituacm.com") - PROJECT_NAME: str SENTRY_DSN: HttpUrl | None = None POSTGRES_SERVER: str From 46167bf1b5b66819bcb489b62e77b5c64d45eb1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rojen=20Arda=20=C5=9Ee=C5=9Fen?= Date: Mon, 23 Sep 2024 23:43:51 +0300 Subject: [PATCH 13/18] Update workflow --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a8ef6fd..9d3f6d7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,6 +13,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - run: cp /home/hasan/ituacm_website_backend/.env /home/hasan/actions-runner/_work/ituacm_website_backend/ituacm_website_backend/ + - run: docker buildx prune -f + - run: cp /home/hasan/ituacm_website_backend/.env ./ - run: docker compose -f docker-compose.yml build --no-cache - run: docker compose -f docker-compose.yml up -d \ No newline at end of file From b40a3611ddb451029dcfdb490fc574f9aab7f4e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rojen=20Arda=20=C5=9Ee=C5=9Fen?= Date: Mon, 23 Sep 2024 23:52:19 +0300 Subject: [PATCH 14/18] Test --- .github/workflows/main.yml | 1 - backend/Dockerfile | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9d3f6d7..9ee9594 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - run: docker buildx prune -f - run: cp /home/hasan/ituacm_website_backend/.env ./ - run: docker compose -f docker-compose.yml build --no-cache - run: docker compose -f docker-compose.yml up -d \ No newline at end of file diff --git a/backend/Dockerfile b/backend/Dockerfile index c3187ae..0da1dbf 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -26,3 +26,5 @@ COPY ./prestart.sh /app/ COPY ./tests-start.sh /app/ COPY ./app /app/app + +RUN echo $BACKEND_CORS_ORIGINS \ No newline at end of file From 2836d45ddc3f4da2b8a674b8c1ef8a18a53a3801 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rojen=20Arda=20=C5=9Ee=C5=9Fen?= Date: Tue, 24 Sep 2024 00:00:03 +0300 Subject: [PATCH 15/18] TEST --- backend/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 0da1dbf..42de248 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -27,4 +27,4 @@ COPY ./tests-start.sh /app/ COPY ./app /app/app -RUN echo $BACKEND_CORS_ORIGINS \ No newline at end of file +COPY ../.env /app/.env \ No newline at end of file From 1858c9318fa890cd42caed845ff890a34cfa8b69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rojen=20Arda=20=C5=9Ee=C5=9Fen?= Date: Tue, 24 Sep 2024 00:01:44 +0300 Subject: [PATCH 16/18] TEST --- .github/workflows/main.yml | 1 + backend/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9ee9594..012d0cc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,5 +14,6 @@ jobs: - name: Checkout uses: actions/checkout@v4 - run: cp /home/hasan/ituacm_website_backend/.env ./ + - run: cp /home/hasan/ituacm_website_backend/.env ./backend/ - run: docker compose -f docker-compose.yml build --no-cache - run: docker compose -f docker-compose.yml up -d \ No newline at end of file diff --git a/backend/Dockerfile b/backend/Dockerfile index 42de248..b569dd3 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -27,4 +27,4 @@ COPY ./tests-start.sh /app/ COPY ./app /app/app -COPY ../.env /app/.env \ No newline at end of file +COPY ./.env /app/.env \ No newline at end of file From 2be0937ddc7e2d3985addf9841c02d593f6d053b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rojen=20Arda=20=C5=9Ee=C5=9Fen?= Date: Tue, 24 Sep 2024 00:09:51 +0300 Subject: [PATCH 17/18] sikerler --- .github/workflows/main.yml | 1 - backend/Dockerfile | 4 +--- backend/app/main.py | 11 +++++++++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 012d0cc..1597a0a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - run: cp /home/hasan/ituacm_website_backend/.env ./ - run: cp /home/hasan/ituacm_website_backend/.env ./backend/ - run: docker compose -f docker-compose.yml build --no-cache - run: docker compose -f docker-compose.yml up -d \ No newline at end of file diff --git a/backend/Dockerfile b/backend/Dockerfile index b569dd3..f7a8cd3 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -25,6 +25,4 @@ COPY ./prestart.sh /app/ COPY ./tests-start.sh /app/ -COPY ./app /app/app - -COPY ./.env /app/.env \ No newline at end of file +COPY ./app /app/app \ No newline at end of file diff --git a/backend/app/main.py b/backend/app/main.py index b735ae9..00d51cb 100644 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -22,6 +22,17 @@ def custom_generate_unique_id(route: APIRoute) -> str: # Set all CORS enabled origins if settings.BACKEND_CORS_ORIGINS: + settings.BACKEND_CORS_ORIGINS = [ + 'http://localhost', + 'http://localhost:5173', + 'https://localhost', + 'https://localhost:5173', + 'https://ituacm.com', + 'https://api.ituacm.com', + 'https://adminer.ituacm.com', + 'https://admin.ituacm.com', + 'http://admin.ituacm.com' + ] print(settings.BACKEND_CORS_ORIGINS) app.add_middleware( CORSMiddleware, From 9d39128edc0f9cdc9950e73849ebae2976864146 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rojen=20Arda=20=C5=9Ee=C5=9Fen?= Date: Tue, 24 Sep 2024 00:13:03 +0300 Subject: [PATCH 18/18] oops --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1597a0a..9ee9594 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,6 +13,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - run: cp /home/hasan/ituacm_website_backend/.env ./backend/ + - run: cp /home/hasan/ituacm_website_backend/.env ./ - run: docker compose -f docker-compose.yml build --no-cache - run: docker compose -f docker-compose.yml up -d \ No newline at end of file