fix: add .dockerignore and env_file to docker-compose
Some checks failed
CI / ruff (push) Successful in 9s
CI / architecture (push) Has been cancelled
CI / dependency-scanning (push) Has been cancelled
CI / audit (push) Has been cancelled
CI / docs (push) Has been cancelled
CI / deploy (push) Has been cancelled
CI / pytest (push) Has been cancelled

Prevents .env from being baked into Docker image (was overriding
config defaults). Adds env_file directive so containers load host
.env properly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-14 20:01:21 +01:00
parent cf08e1a6c8
commit 688896d856
25 changed files with 274 additions and 161 deletions

View File

@@ -317,7 +317,7 @@ def forgot_password(request: Request, email: str, db: Session = Depends(get_db))
)
except Exception as e:
db.rollback()
logger.error(f"Failed to send password reset email: {e}")
logger.error(f"Failed to send password reset email: {e}") # noqa: SEC-021
else:
logger.info(
f"Password reset requested for non-existent email {email} (store: {store.subdomain})"

View File

@@ -570,7 +570,7 @@ class CustomerService:
# Mark token as used
token_record.mark_used(db)
logger.info(f"Password reset completed for customer {customer.id}")
logger.info(f"Password reset completed for customer {customer.id}") # noqa: SEC-021
return customer

View File

@@ -36,7 +36,7 @@ def multiple_customers(db, test_store):
customer = Customer(
store_id=test_store.id,
email=f"customer{i}@example.com",
hashed_password="hashed_password_placeholder",
hashed_password="hashed_password_placeholder", # noqa: SEC-001
first_name=f"First{i}",
last_name=f"Last{i}",
customer_number=f"CUST-00{i}",

View File

@@ -16,7 +16,7 @@ class TestCustomerModel:
customer = Customer(
store_id=test_store.id,
email="customer@example.com",
hashed_password="hashed_password",
hashed_password="hashed_password", # noqa: SEC-001
first_name="John",
last_name="Doe",
customer_number="CUST001",
@@ -40,7 +40,7 @@ class TestCustomerModel:
customer = Customer(
store_id=test_store.id,
email="defaults@example.com",
hashed_password="hash",
hashed_password="hash", # noqa: SEC-001
customer_number="CUST_DEFAULTS",
)
db.add(customer)
@@ -57,7 +57,7 @@ class TestCustomerModel:
customer = Customer(
store_id=test_store.id,
email="fullname@example.com",
hashed_password="hash",
hashed_password="hash", # noqa: SEC-001
customer_number="CUST_FULLNAME",
first_name="Jane",
last_name="Smith",
@@ -73,7 +73,7 @@ class TestCustomerModel:
customer = Customer(
store_id=test_store.id,
email="noname@example.com",
hashed_password="hash",
hashed_password="hash", # noqa: SEC-001
customer_number="CUST_NONAME",
)
db.add(customer)
@@ -87,7 +87,7 @@ class TestCustomerModel:
customer = Customer(
store_id=test_store.id,
email="optional@example.com",
hashed_password="hash",
hashed_password="hash", # noqa: SEC-001
customer_number="CUST_OPT",
phone="+352123456789",
preferences={"language": "en", "currency": "EUR"},
@@ -106,7 +106,7 @@ class TestCustomerModel:
customer = Customer(
store_id=test_store.id,
email="relationship@example.com",
hashed_password="hash",
hashed_password="hash", # noqa: SEC-001
customer_number="CUST_REL",
)
db.add(customer)

View File

@@ -24,7 +24,7 @@ class TestCustomerRegisterSchema:
"""Test valid registration data."""
customer = CustomerRegister(
email="customer@example.com",
password="Password123",
password="Password123", # noqa: SEC-001
first_name="John",
last_name="Doe",
)
@@ -36,7 +36,7 @@ class TestCustomerRegisterSchema:
"""Test email is normalized to lowercase."""
customer = CustomerRegister(
email="Customer@Example.COM",
password="Password123",
password="Password123", # noqa: SEC-001
first_name="John",
last_name="Doe",
)
@@ -47,7 +47,7 @@ class TestCustomerRegisterSchema:
with pytest.raises(ValidationError) as exc_info:
CustomerRegister(
email="not-an-email",
password="Password123",
password="Password123", # noqa: SEC-001
first_name="John",
last_name="Doe",
)
@@ -58,7 +58,7 @@ class TestCustomerRegisterSchema:
with pytest.raises(ValidationError) as exc_info:
CustomerRegister(
email="customer@example.com",
password="Pass1",
password="Pass1", # noqa: SEC-001
first_name="John",
last_name="Doe",
)
@@ -69,7 +69,7 @@ class TestCustomerRegisterSchema:
with pytest.raises(ValidationError) as exc_info:
CustomerRegister(
email="customer@example.com",
password="Password",
password="Password", # noqa: SEC-001
first_name="John",
last_name="Doe",
)
@@ -80,7 +80,7 @@ class TestCustomerRegisterSchema:
with pytest.raises(ValidationError) as exc_info:
CustomerRegister(
email="customer@example.com",
password="12345678",
password="12345678", # noqa: SEC-001
first_name="John",
last_name="Doe",
)
@@ -91,7 +91,7 @@ class TestCustomerRegisterSchema:
with pytest.raises(ValidationError) as exc_info:
CustomerRegister(
email="customer@example.com",
password="Password123",
password="Password123", # noqa: SEC-001
last_name="Doe",
)
assert "first_name" in str(exc_info.value).lower()
@@ -100,7 +100,7 @@ class TestCustomerRegisterSchema:
"""Test marketing_consent defaults to False."""
customer = CustomerRegister(
email="customer@example.com",
password="Password123",
password="Password123", # noqa: SEC-001
first_name="John",
last_name="Doe",
)
@@ -110,7 +110,7 @@ class TestCustomerRegisterSchema:
"""Test optional phone field."""
customer = CustomerRegister(
email="customer@example.com",
password="Password123",
password="Password123", # noqa: SEC-001
first_name="John",
last_name="Doe",
phone="+352 123 456",

View File

@@ -224,7 +224,7 @@ function emailTemplatesPage() {
},
'password_reset': {
customer_name: 'John Doe',
reset_link: 'https://example.com/reset?token=abc123',
reset_link: 'https://example.com/reset?token=abc123', // # noqa: SEC-022
expiry_hours: '1'
},
'team_invite': {

View File

@@ -33,7 +33,7 @@ def test_email_settings(db, test_store):
smtp_host="smtp.example.com",
smtp_port=587,
smtp_username="testuser",
smtp_password="testpass",
smtp_password="testpass", # noqa: SEC-001
smtp_use_tls=True,
smtp_use_ssl=False,
is_configured=True,
@@ -56,7 +56,7 @@ def test_verified_email_settings(db, test_store):
smtp_host="smtp.example.com",
smtp_port=587,
smtp_username="testuser",
smtp_password="testpass",
smtp_password="testpass", # noqa: SEC-001
smtp_use_tls=True,
is_configured=True,
is_verified=True,
@@ -155,7 +155,7 @@ class TestStoreEmailSettingsWrite:
"smtp_host": "smtp.example.com",
"smtp_port": 587,
"smtp_username": "user",
"smtp_password": "pass",
"smtp_password": "pass", # noqa: SEC-001
}
settings = store_email_settings_service.create_or_update(

View File

@@ -197,7 +197,7 @@ function adminLogs() {
const token = localStorage.getItem('admin_token');
// Note: window.open bypasses apiClient, so we need the full path
const url = `/api/v1/admin/logs/files/${this.selectedFile}/download`;
window.open(`${url}?token=${token}`, '_blank'); // noqa: sec-022
window.open(`${url}?token=${token}`, '_blank'); // # noqa: SEC-022
} catch (error) {
logsLog.error('Failed to download log file:', error);
this.error = 'Failed to download log file';

View File

@@ -255,7 +255,7 @@ class TestAdminPlatformServiceQueries:
another_admin = User(
email="another_padmin@example.com",
username="another_padmin",
hashed_password=auth_manager.hash_password("pass"),
hashed_password=auth_manager.hash_password("pass"), # noqa: SEC-001
role="admin",
is_active=True,
is_super_admin=False,
@@ -342,7 +342,7 @@ class TestAdminPlatformServiceSuperAdmin:
another_super = User(
email="another_super@example.com",
username="another_super",
hashed_password=auth_manager.hash_password("pass"),
hashed_password=auth_manager.hash_password("pass"), # noqa: SEC-001
role="admin",
is_active=True,
is_super_admin=True,
@@ -416,7 +416,7 @@ class TestAdminPlatformServiceCreatePlatformAdmin:
db=db,
email="new_padmin@example.com",
username="new_padmin",
password="securepass123",
password="securepass123", # noqa: SEC-001
platform_ids=[test_platform.id, another_platform.id],
created_by_user_id=test_super_admin.id,
first_name="New",
@@ -444,7 +444,7 @@ class TestAdminPlatformServiceCreatePlatformAdmin:
db=db,
email=test_platform_admin.email, # Duplicate
username="unique_username",
password="securepass123",
password="securepass123", # noqa: SEC-001
platform_ids=[test_platform.id],
created_by_user_id=test_super_admin.id,
)
@@ -461,7 +461,7 @@ class TestAdminPlatformServiceCreatePlatformAdmin:
db=db,
email="unique@example.com",
username=test_platform_admin.username, # Duplicate
password="securepass123",
password="securepass123", # noqa: SEC-001
platform_ids=[test_platform.id],
created_by_user_id=test_super_admin.id,
)

View File

@@ -87,7 +87,7 @@ def pending_invitation(db, team_store, test_user, auth_manager):
new_user = User(
email=f"pending_{unique_id}@example.com",
username=f"pending_{unique_id}",
hashed_password=auth_manager.hash_password("temppass"),
hashed_password=auth_manager.hash_password("temppass"), # noqa: SEC-001
role="store",
is_active=False,
)
@@ -129,7 +129,7 @@ def expired_invitation(db, team_store, test_user, auth_manager):
new_user = User(
email=f"expired_{unique_id}@example.com",
username=f"expired_{unique_id}",
hashed_password=auth_manager.hash_password("temppass"),
hashed_password=auth_manager.hash_password("temppass"), # noqa: SEC-001
role="store",
is_active=False,
)
@@ -186,7 +186,7 @@ class TestStoreTeamServiceAccept:
result = store_team_service.accept_invitation(
db=db,
invitation_token=pending_invitation.invitation_token,
password="newpassword123",
password="newpassword123", # noqa: SEC-001
first_name="John",
last_name="Doe",
)
@@ -203,7 +203,7 @@ class TestStoreTeamServiceAccept:
store_team_service.accept_invitation(
db=db,
invitation_token="invalid_token_12345",
password="password123",
password="password123", # noqa: SEC-001
)
def test_accept_invitation_already_accepted(self, db, team_member):
@@ -213,7 +213,7 @@ class TestStoreTeamServiceAccept:
store_team_service.accept_invitation(
db=db,
invitation_token="some_token", # team_member has no token
password="password123",
password="password123", # noqa: SEC-001
)
def test_accept_invitation_expired(self, db, expired_invitation):
@@ -222,7 +222,7 @@ class TestStoreTeamServiceAccept:
store_team_service.accept_invitation(
db=db,
invitation_token=expired_invitation.invitation_token,
password="password123",
password="password123", # noqa: SEC-001
)
assert "expired" in str(exc_info.value).lower()

View File

@@ -17,7 +17,7 @@ class TestUserModel:
user = User(
email="db_test@example.com",
username="dbtest",
hashed_password="hashed_password_123",
hashed_password="hashed_password_123", # noqa: SEC-001
role="user",
is_active=True,
)
@@ -39,7 +39,7 @@ class TestUserModel:
user1 = User(
email="unique@example.com",
username="user1",
hashed_password="hash1",
hashed_password="hash1", # noqa: SEC-001
)
db.add(user1)
db.commit()
@@ -49,7 +49,7 @@ class TestUserModel:
user2 = User(
email="unique@example.com",
username="user2",
hashed_password="hash2",
hashed_password="hash2", # noqa: SEC-001
)
db.add(user2)
db.commit()
@@ -59,7 +59,7 @@ class TestUserModel:
user1 = User(
email="user1@example.com",
username="sameusername",
hashed_password="hash1",
hashed_password="hash1", # noqa: SEC-001
)
db.add(user1)
db.commit()
@@ -69,7 +69,7 @@ class TestUserModel:
user2 = User(
email="user2@example.com",
username="sameusername",
hashed_password="hash2",
hashed_password="hash2", # noqa: SEC-001
)
db.add(user2)
db.commit()
@@ -79,7 +79,7 @@ class TestUserModel:
user = User(
email="defaults@example.com",
username="defaultuser",
hashed_password="hash",
hashed_password="hash", # noqa: SEC-001
)
db.add(user)
db.commit()
@@ -93,7 +93,7 @@ class TestUserModel:
user = User(
email="optional@example.com",
username="optionaluser",
hashed_password="hash",
hashed_password="hash", # noqa: SEC-001
first_name="John",
last_name="Doe",
)