Compare commits

...

10 Commits

Author SHA1 Message Date
f86396107d Fix bkp in aws 2026-01-26 16:55:58 +02:00
c581fa5e1c Fix bkp in aws 2026-01-26 16:28:16 +02:00
4310623ece Fix db_utils 2026-01-26 05:58:15 +02:00
7e81f6ed88 Fix db_utils 2026-01-26 05:45:52 +02:00
d5be5d1c40 Fix db_utils 2026-01-26 05:35:43 +02:00
20491c8113 Fix db_utils 2026-01-26 05:31:31 +02:00
c3ac8cd83f Fix db_utils 2026-01-26 05:23:08 +02:00
abc9e94104 Update cors origin 2026-01-26 04:06:16 +02:00
167b1becbc Update cors origin 2026-01-26 04:04:50 +02:00
dvirlabs
daedc67e7a Update db_utils 2026-01-06 00:57:34 +02:00
5 changed files with 34 additions and 21 deletions

View File

@ -3,7 +3,7 @@ steps:
name: Build & Push Frontend
image: woodpeckerci/plugin-kaniko
when:
branch: [ master, develop ]
branch: [ master, develop, aws ]
event: [ push, pull_request, tag ]
path:
include: [ frontend/** ]
@ -24,7 +24,7 @@ steps:
name: Build & Push Backend
image: woodpeckerci/plugin-kaniko
when:
branch: [ master, develop ]
branch: [ master, develop, aws ]
event: [ push, pull_request, tag ]
path:
include: [ backend/** ]

View File

@ -101,8 +101,10 @@ def upload_to_r2(file_path):
endpoint_url=R2_ENDPOINT,
aws_access_key_id=R2_ACCESS_KEY,
aws_secret_access_key=R2_SECRET_KEY,
config=Config(signature_version='s3v4'),
region_name='auto'
config=Config(
signature_version='s3v4',
s3={'addressing_style': 'path'}
)
)
# Upload file
@ -134,8 +136,10 @@ def list_r2_backups():
endpoint_url=R2_ENDPOINT,
aws_access_key_id=R2_ACCESS_KEY,
aws_secret_access_key=R2_SECRET_KEY,
config=Config(signature_version='s3v4'),
region_name='auto'
config=Config(
signature_version='s3v4',
s3={'addressing_style': 'path'}
)
)
try:

View File

@ -9,6 +9,7 @@ import shutil
from datetime import datetime
from typing import List
import boto3
from botocore.config import Config
from botocore.exceptions import ClientError
from dotenv import load_dotenv
@ -49,7 +50,10 @@ def get_r2_client():
endpoint_url=os.getenv('R2_ENDPOINT'),
aws_access_key_id=os.getenv('R2_ACCESS_KEY'),
aws_secret_access_key=os.getenv('R2_SECRET_KEY'),
region_name='auto'
config=Config(
signature_version='s3v4',
s3={'addressing_style': 'path'}
)
)

View File

@ -81,9 +81,9 @@ def update_recipe_db(recipe_id: int, recipe_data: Dict[str, Any]) -> Optional[Di
SET name = %s,
meal_type = %s,
time_minutes = %s,
tags = %s,
ingredients = %s,
steps = %s,
tags = %s::text[],
ingredients = %s::text[],
steps = %s::text[],
image = %s,
made_by = %s
WHERE id = %s
@ -93,9 +93,9 @@ def update_recipe_db(recipe_id: int, recipe_data: Dict[str, Any]) -> Optional[Di
recipe_data["name"],
recipe_data["meal_type"],
recipe_data["time_minutes"],
json.dumps(recipe_data.get("tags", [])),
json.dumps(recipe_data.get("ingredients", [])),
json.dumps(recipe_data.get("steps", [])),
recipe_data.get("tags", []),
recipe_data.get("ingredients", []),
recipe_data.get("steps", []),
recipe_data.get("image"),
recipe_data.get("made_by"),
recipe_id,
@ -136,16 +136,16 @@ def create_recipe_db(recipe_data: Dict[str, Any]) -> Dict[str, Any]:
cur.execute(
"""
INSERT INTO recipes (name, meal_type, time_minutes, tags, ingredients, steps, image, made_by, user_id)
VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)
VALUES (%s, %s, %s, %s::text[], %s::text[], %s::text[], %s, %s, %s)
RETURNING id, name, meal_type, time_minutes, tags, ingredients, steps, image, made_by, user_id
""",
(
recipe_data["name"],
recipe_data["meal_type"],
recipe_data["time_minutes"],
json.dumps(recipe_data.get("tags", [])),
json.dumps(recipe_data.get("ingredients", [])),
json.dumps(recipe_data.get("steps", [])),
recipe_data.get("tags", []),
recipe_data.get("ingredients", []),
recipe_data.get("steps", []),
recipe_data.get("image"),
recipe_data.get("made_by"),
recipe_data.get("user_id"),
@ -189,3 +189,4 @@ def get_recipes_by_filters_db(
return rows
finally:
conn.close()

View File

@ -38,8 +38,10 @@ def list_r2_backups():
endpoint_url=R2_ENDPOINT,
aws_access_key_id=R2_ACCESS_KEY,
aws_secret_access_key=R2_SECRET_KEY,
config=Config(signature_version='s3v4'),
region_name='auto'
config=Config(
signature_version='s3v4',
s3={'addressing_style': 'path'}
)
)
try:
@ -67,8 +69,10 @@ def download_from_r2(backup_name):
endpoint_url=R2_ENDPOINT,
aws_access_key_id=R2_ACCESS_KEY,
aws_secret_access_key=R2_SECRET_KEY,
config=Config(signature_version='s3v4'),
region_name='auto'
config=Config(
signature_version='s3v4',
s3={'addressing_style': 'path'}
)
)
try: