Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions evoting.compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
services:
db:
image: postgres:16
container_name: dev-evoting-db
environment:
POSTGRES_USER: evoting
POSTGRES_PASSWORD: evoting
POSTGRES_DB: evoting
Comment on lines +6 to +8
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Weak default credentials for database.

Using evoting as both username and password creates a security vulnerability, even in development environments. For an eVoting system, this is particularly concerning.

Consider using environment variables with stronger defaults:

        environment:
-            POSTGRES_USER: evoting
-            POSTGRES_PASSWORD: evoting
-            POSTGRES_DB: evoting
+            POSTGRES_USER: ${POSTGRES_USER:-evoting}
+            POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-evoting_dev_password_123}
+            POSTGRES_DB: ${POSTGRES_DB:-evoting}

Or add a comment indicating this is for development only:

+    # WARNING: Development only - use strong credentials in production
    db:
        image: postgres:16
🤖 Prompt for AI Agents
In evoting.compose.yml around lines 6 to 8, the database credentials use weak
default values with POSTGRES_USER and POSTGRES_PASSWORD both set to "evoting".
To fix this, replace these hardcoded credentials with environment variables that
can be set externally to stronger, unique values. Alternatively, add a clear
comment indicating these credentials are for development only and should be
changed in production to improve security.

volumes:
- ./db/data:/var/lib/postgresql/data
ports:
- "5432:5432"
1 change: 1 addition & 0 deletions infrastructure/control-panel/project.inlang/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cache

This file was deleted.

This file was deleted.

18 changes: 18 additions & 0 deletions infrastructure/web3-adapter/src/db/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions infrastructure/web3-adapter/src/db/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

132 changes: 132 additions & 0 deletions infrastructure/web3-adapter/src/db/mapping.db.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions infrastructure/web3-adapter/src/db/mapping.db.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading