Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
_APP_DB_SCHEMA=appwrite
_APP_DB_USER=user
_APP_DB_PASS=password
Comment on lines +1 to +3
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Critical: Ensure .env is protected in .gitignore.

This file contains plaintext database credentials (password). It must be excluded from version control to prevent secrets from being exposed in the repository.

Verify that .env is protected by checking if .gitignore exists and includes this file:


🏁 Script executed:

#!/bin/bash
# Check if .gitignore exists and if .env is listed
if [ -f .gitignore ]; then
  echo "=== .gitignore found ==="
  grep -n "\.env" .gitignore || echo "WARNING: .env not found in .gitignore"
else
  echo "ERROR: .gitignore does not exist"
fi

Length of output: 32


.env must be added to .gitignore immediately to prevent credential exposure.

Verification confirms that .gitignore does not exist in the repository. This means the .env file containing plaintext database credentials (_APP_DB_PASS=password) will be committed to version control and exposed to all repository users. Create a .gitignore file at the repository root and add .env to exclude it from version control:

.env
🧰 Tools
🪛 dotenv-linter (4.0.0)

[warning] 3-3: [EndingBlankLine] No blank line at the end of the file

(EndingBlankLine)


[warning] 3-3: [UnorderedKey] The _APP_DB_PASS key should go before the _APP_DB_SCHEMA key

(UnorderedKey)

🤖 Prompt for AI Agents
.env (lines 1-3): create a .gitignore file at the repository root and add ".env"
to it so the file is excluded from version control; if .env has already been
committed, remove it from the repository index (stop tracking) and commit the
removal, then rotate any exposed credentials immediately.

20 changes: 20 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
version: '3.8'

services:
postgresql:
build:
context: .
restart: unless-stopped
volumes:
- appwrite-postgresql:/var/lib/postgresql/data:rw
ports:
- "5432:5432"
environment:
- POSTGRES_DB=${_APP_DB_SCHEMA}
- POSTGRES_USER=${_APP_DB_USER}
- POSTGRES_PASSWORD=${_APP_DB_PASS}
command: "postgres"

volumes:
appwrite-postgresql:
8 changes: 8 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM postgres:16

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
postgresql-16-postgis-3 \
postgresql-16-postgis-3-scripts \
postgresql-16-pgvector \
&& rm -rf /var/lib/apt/lists/*