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: 2 additions & 1 deletion .vale.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ mdx = md
BasedOnStyles = Vale, WSO2-IAM
spelling = yes
Vale.Spelling = warning

BlockIgnores = (?s)^---.*?---
Copy link
Copy Markdown

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

🏁 Script executed:

#!/bin/bash
# Find .md and .mdx files with multiple --- occurrences

echo "Files with multiple --- occurrences:"
fd -e md -e mdx --type f . docs/content --exec bash -c '
  count=$(grep -c "^---$" "$1" 2>/dev/null || echo 0)
  if [ "$count" -gt 2 ]; then
    echo "$1: $count occurrences"
    echo "  Line numbers:"
    grep -n "^---$" "$1" | head -20
    echo ""
  fi
' _ {} \;

Repository: asgardeo/thunder

Length of output: 693


🏁 Script executed:

cat -n .vale.ini | head -30

Repository: asgardeo/thunder

Length of output: 1005


🏁 Script executed:

#!/bin/bash
# Test the regex pattern behavior with actual content

# Create a test file similar to overview.mdx
cat > /tmp/test_md.txt << 'EOF'
---
title: Test
description: Test doc
---

Some intro content.

---

Section 1 with content that should be checked.

---

Section 2 with more content.

---

Final section.

---
EOF

# Test the current pattern
echo "Testing pattern: (?s)^---.*?---"
python3 << 'PYTHON'
import re

with open('/tmp/test_md.txt', 'r') as f:
    content = f.read()

# Current pattern
pattern1 = r'(?s)^---.*?---'
# Proposed pattern  
pattern2 = r'(?s)\A---.*?---'

print("=== Current Pattern: (?s)^---.*?--- ===")
matches1 = list(re.finditer(pattern1, content, re.MULTILINE))
for i, match in enumerate(matches1, 1):
    print(f"Match {i}: lines {content[:match.start()].count(chr(10))+1}-{content[:match.end()].count(chr(10))+1}")
    print(f"  Content: {repr(match.group()[:50])}")

print(f"\nTotal matches with current pattern: {len(matches1)}")

print("\n=== Proposed Pattern: (?s)\\A---.*?--- ===")
matches2 = list(re.finditer(pattern2, content))
for i, match in enumerate(matches2, 1):
    print(f"Match {i}: lines {content[:match.start()].count(chr(10))+1}-{content[:match.end()].count(chr(10))+1}")
    print(f"  Content: {repr(match.group()[:50])}")

print(f"\nTotal matches with proposed pattern: {len(matches2)}")
PYTHON

Repository: asgardeo/thunder

Length of output: 556


Fix BlockIgnores regex pattern to match only frontmatter, not mid-document rules.

The pattern (?s)^---.*?--- uses ^ which in multiline mode matches the start of any line, not the file start. Combined with DOTALL mode (?s), it matches from any --- separator to the next one, incorrectly excluding mid-document content from Vale checks.

Testing confirms the pattern matches multiple times in files with horizontal rules: in a sample with three --- pairs, it produces three matches instead of one. Files like docs/content/community/contributing/overview.mdx (14 occurrences) and docs/content/community/contributing/contributing-code/documentation-development/writing-documentation.mdx (20 occurrences) would have significant content sections incorrectly ignored.

Replace ^ with \A on lines 12 and 26 to anchor only to the file start:

Recommended fix
-BlockIgnores = (?s)^---.*?---
+BlockIgnores = (?s)\A---.*?---

Apply to both [*.md] (line 12) and [*.mdx] (line 26) sections.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
BlockIgnores = (?s)^---.*?---
BlockIgnores = (?s)\A---.*?---
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.vale.ini at line 12, The BlockIgnores regex `(?s)^---.*?---` in the
.vale.ini settings (the BlockIgnores key) is anchoring to any line start and
thus matches mid-document `---` separators; update the value to use `\A` instead
of `^` (e.g., `(?s)\A---.*?---`) so it only matches frontmatter at the start of
the file, and apply this change for both BlockIgnores entries under the [*.md]
and [*.mdx] sections (the same key name BlockIgnores).


# Disable everything except spelling from Vale built-in rules
Vale.Wordiness = NO
Expand All @@ -23,6 +23,7 @@ TokenIgnores = (<(?!\!--)[^>]+>),(\!\[[^\]]*\]\([^)]+\)),(\[[^\]]*\]\([^)]+\)),(
BasedOnStyles = Vale, WSO2-IAM
spelling = yes
Vale.Spelling = warning
BlockIgnores = (?s)^---.*?---

# Disable everything except spelling from Vale built-in rules
Vale.Wordiness = NO
Expand Down
7 changes: 3 additions & 4 deletions .vale/styles/config/vocabularies/vocab/accept.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ OAuth
OAuth2
OpenID
IAM
[Ii][Aa][Mm]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Remove duplicate [Ii][Aa][Mm] pattern.

The case-insensitive regex pattern [Ii][Aa][Mm] appears on both line 8 and line 50. This duplication was introduced in the current changes.

🔧 Suggested fix

Remove the duplicate entry on line 50:

 templated
-[Ii][Aa][Mm]
 OTPs

Also applies to: 50-50

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.vale/styles/config/vocabularies/vocab/accept.txt at line 8, Remove the
duplicate case-insensitive regex pattern `[Ii][Aa][Mm]` so it only appears once
in the vocabulary list; locate the second occurrence of the token `[Ii][Aa][Mm]
in the accept vocabulary and delete that duplicate entry, leaving the original
entry intact.

IdP
PKCE
Thunder
Expand Down Expand Up @@ -45,8 +46,6 @@ DTOs
[Mm]iddleware
[Vv]itest
ESLint
<<<<<<< HEAD
templated
=======
JWTs
>>>>>>> 5337c408 (Add initial quickstarts and guides to Thunder)
[Ii][Aa][Mm]
OTPs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Always use predefined keys from `event.DataKey` for consistency:
| `Error` | Error message for failures |
| `LatencyUs` | Operation latency in microseconds |

See [`event/datakeys.go`](../../../backend/internal/observability/event/datakeys.go) for the complete list.
See [`event/datakeys.go`](https://github.com/asgardeo/thunder/blob/main/backend/internal/observability/event/datakeys.go) for the complete list.

## Distributed Tracing

Expand Down Expand Up @@ -151,4 +151,4 @@ To add a new subscriber (e.g., to send logs to a webhook):
4. **Add Configuration**: Update `backend/internal/system/config/config.go`.

## Further Reading
- [Observability Configuration Guide](../../../guides/observability/configuration.md)
- [Observability source code](https://github.com/asgardeo/thunder/tree/main/backend/internal/observability)
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description: Learn how to set up, develop, and build Thunder documentation local

Before working with the documentation, ensure you have the required development tools installed and configured.

**See**: [Prerequisites - Development Tools](/thunder/docs/community/contributing/contributing-code/prerequisites#development-tools) for complete setup instructions.
**See**: [Prerequisites - Development Tools](../prerequisites#development-tools) for complete setup instructions.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Keep internal links in canonical absolute /docs/... form.

Line 13 switches to a relative link. In this repo, internal docs links in MDX are expected to use absolute /docs/... paths for consistency and stable navigation.

Based on learnings: in docs/content/**/*.mdx, internal doc links consistently use absolute /docs/... paths rather than relative file paths.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@docs/content/community/contributing/contributing-code/documentation-development/development-pipeline.mdx`
at line 13, The MDX file uses a relative internal link
("../prerequisites#development-tools") which violates the repository convention
of using canonical absolute paths; update the link in development-pipeline.mdx
to the canonical absolute form (e.g., "/docs/prerequisites#development-tools")
so internal docs under docs/content/**/*.mdx consistently use /docs/... paths;
locate the link by searching for the text "Prerequisites - Development Tools" or
the fragment "#development-tools" and replace the href accordingly.


## Building Documentation

Expand Down
10 changes: 5 additions & 5 deletions docs/content/community/contributing/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Thunder welcomes different types of contributions, and you can participate at an
| **Minor Improvements** | [Make improvements](#-making-improvements) |
| **Share Ideas & Define Problems** | [Problem definition](#-sharing-ideas--defining-problems) |
| **Design Features** | [Design proposals](#-designing-solutions) |
| **Implement Features** | [Development guide](development.md) |
| **Implement Features** | [Development guide](contributing-code/development-pipeline) |

**You don't need to do everything!** You can:

Expand Down Expand Up @@ -138,7 +138,7 @@ If you spot documentation problems but can't fix them yourself:
6. **Address review feedback** - Work with reviewers to refine your changes
7. **Get merged** - Once approved, your contribution will be merged! 🎉

For detailed development guidelines, see our [development documentation](development.md).
For detailed development guidelines, see our [development documentation](contributing-code/development-pipeline).

---

Expand Down Expand Up @@ -185,7 +185,7 @@ You can either:
| You have a clear problem statement and can provide all details required in the feature template | Create a [Feature Issue](https://github.com/asgardeo/thunder/issues/new?template=feature.yml) |
| You have a basic idea that needs exploration or clarification before creating a formal feature request | Create a [Discussion in Idea Category](https://github.com/asgardeo/thunder/discussions/new?category=ideas) |

**→ Learn more**: [Problem Definition Guide](problem-definition.md)
**→ Learn more**: [Problem Definition Guide](sharing-ideas)

---

Expand All @@ -200,7 +200,7 @@ Assigned to a feature? Time to design the technical solution.
* Writing a formal design proposal
* Getting security and technical review

**→ Learn more**: [Design Guide](design.md)
**→ Learn more**: [Design Guide](proposing-features)

---

Expand All @@ -215,7 +215,7 @@ Ready to build an approved design?
* Documenting the feature
* Deploying with feature flags

**→ Learn more**: [Development Guide](development.md)
**→ Learn more**: [Development Guide](contributing-code/development-pipeline)

---

Expand Down
10 changes: 5 additions & 5 deletions docs/content/community/contributing/proposing-features.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ Create a design discussion when:

**Don't create a design discussion for**:

* ❌ Bug reports → Use [bug report](README.md#-reporting-bugs)
* ❌ Minor improvements → Use [fast track](README.md#-making-improvements)
* ❌ Unclear ideas or feature requests → Use [problem definition guide](problem-definition.md)
* ❌ Features you're not assigned to → Express interest on the feature issue first
* ❌ Bug reports → Use [bug report](./overview#-reporting-bugs)
* ❌ Minor improvements → Use [fast track](./overview#-fast-track-contributions)
* ❌ Unclear ideas or feature requests → Use [problem definition guide](sharing-ideas)
* ❌ Development process → See [development pipeline](contributing-code/development-pipeline)

## Step 1: Create a Design Discussion

Expand Down Expand Up @@ -155,7 +155,7 @@ Maintainers will formally review your design proposal.

**You can**:

* Implement it yourself (move to [Development Guide](development.md))
* Implement it yourself (move to [Development Guide](contributing-code/development-pipeline))
* Let someone else implement it
* Collaborate with multiple implementers

Expand Down
8 changes: 4 additions & 4 deletions docs/content/community/contributing/sharing-ideas.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Use this guide when:

**Don't use this guide for**:

* ❌ Bug reports → Use [bug report](README.md#-reporting-bugs)
* ❌ Minor improvements → Use [fast track](README.md#-making-improvements)
* ❌ Bug reports → Use [bug report](./overview#-reporting-bugs)
* ❌ Minor improvements → Use [fast track](./overview#-fast-track-contributions)

## 📝 Two Ways to Share

Expand Down Expand Up @@ -295,7 +295,7 @@ After your issue is approved, anyone can work on it!
3. Estimate your timeline
4. Wait for maintainer to assign you

**Once assigned**: Move to the [Design Guide](design.md) to start designing the solution.
**Once assigned**: Move to the [Design Guide](proposing-features) to start designing the solution.

**You can stop here!** Let someone else design and implement if you prefer.

Expand Down Expand Up @@ -381,7 +381,7 @@ A: If it requires architectural changes or new capabilities, it's a feature. Whe
* Wait for triage
* Respond to maintainer questions
* Express interest in working on it (optional)
* Move to [Design Guide](design.md) if assigned
* Move to [Design Guide](proposing-features) if assigned

**Thank you for helping shape Thunder's roadmap!** Every problem definition makes Thunder better. 🙏⚡

Expand Down
49 changes: 49 additions & 0 deletions docs/content/community/overview.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
title: Community
sidebar_position: 1
description: Join the Thunder community — get help, share ideas, report bugs, and contribute to the project.
hide_table_of_contents: true
---

import Link from '@docusaurus/Link';

# Community

Thunder is an open-source project and welcomes contributions from everyone. Whether you want to report a bug, propose a feature, improve documentation, or contribute code — you're in the right place.

## Get Involved

<div style={{display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(280px, 1fr))', gap: '1.5rem', marginTop: '2rem', marginBottom: '2rem'}}>
<div style={{border: '1px solid var(--ifm-color-emphasis-300)', borderRadius: '8px', padding: '1.5rem'}}>
<h3>💬 Discussions</h3>
<p>Ask questions, share ideas, and connect with other Thunder users and contributors.</p>
<Link href="https://github.com/asgardeo/thunder/discussions">Join Discussions →</Link>
</div>
<div style={{border: '1px solid var(--ifm-color-emphasis-300)', borderRadius: '8px', padding: '1.5rem'}}>
<h3>🐛 Issues</h3>
<p>Found a bug? Report it on GitHub so the team can track and fix it.</p>
<Link href="https://github.com/asgardeo/thunder/issues">Report an Issue →</Link>
</div>
<div style={{border: '1px solid var(--ifm-color-emphasis-300)', borderRadius: '8px', padding: '1.5rem'}}>
<h3>🤝 Contributing</h3>
<p>Learn how to contribute code, documentation, or ideas to the Thunder project.</p>
<Link href="/docs/next/community/contributing/overview">Contributing Guide →</Link>
</div>
</div>

## Contributing

The [Contributing Guide](/docs/next/community/contributing/overview) covers everything you need to know:

- [Reporting bugs](/docs/next/community/contributing/overview#-reporting-bugs)
- [Sharing ideas and feature requests](/docs/next/community/contributing/sharing-ideas)
- [Proposing features](/docs/next/community/contributing/proposing-features)
- [Contributing code](/docs/next/community/contributing/contributing-code/development-pipeline)

## Code of Conduct

Thunder follows the [Contributor Covenant Code of Conduct](https://github.com/asgardeo/thunder/blob/main/CONTRIBUTING.md). By participating, you are expected to uphold this code.
Copy link
Copy Markdown

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

🏁 Script executed:

#!/bin/bash
# Check if CODE_OF_CONDUCT.md exists and what CONTRIBUTING.md contains
echo "=== Checking for CODE_OF_CONDUCT.md ==="
fd -t f "CODE_OF_CONDUCT.md"

echo -e "\n=== Checking CONTRIBUTING.md for Code of Conduct reference ==="
if [ -f "CONTRIBUTING.md" ]; then
  head -50 CONTRIBUTING.md | grep -i "code of conduct" || echo "No 'code of conduct' mention in first 50 lines"
fi

Repository: asgardeo/thunder

Length of output: 210


🏁 Script executed:

#!/bin/bash
# Check full CONTRIBUTING.md for Code of Conduct content
echo "=== Full CONTRIBUTING.md content ==="
if [ -f "CONTRIBUTING.md" ]; then
  wc -l CONTRIBUTING.md
  cat -n CONTRIBUTING.md | grep -i "covenant\|code of conduct" || echo "No Code of Conduct match found"
  echo -e "\n=== Last 50 lines of CONTRIBUTING.md ==="
  tail -50 CONTRIBUTING.md
else
  echo "CONTRIBUTING.md not found"
fi

# Search entire repo for Contributor Covenant or Code of Conduct
echo -e "\n=== Searching for 'Contributor Covenant' in repo ==="
rg -i "contributor covenant" --type md --type mdx

echo -e "\n=== Searching for 'code of conduct' in repo ==="
rg -i "code of conduct" --type md --type mdx

Repository: asgardeo/thunder

Length of output: 535


🏁 Script executed:

#!/bin/bash
# View the specific file around line 45
echo "=== docs/content/community/overview.mdx around line 45 ==="
if [ -f "docs/content/community/overview.mdx" ]; then
  sed -n '40,50p' docs/content/community/overview.mdx
else
  echo "File not found, searching for overview files:"
  fd -t f "overview.mdx"
fi

Repository: asgardeo/thunder

Length of output: 611


Fix incorrect Code of Conduct link.

The text references the "Contributor Covenant Code of Conduct" but links to CONTRIBUTING.md, which contains only a reference to the Contributing Guide and does not include the Code of Conduct. Either the link should point to where the Code of Conduct actually resides, or a separate CODE_OF_CONDUCT.md file should be created and linked.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/content/community/overview.mdx` at line 45, The link text "Contributor
Covenant Code of Conduct" currently points to the CONTRIBUTING.md URL; update
the link to reference the actual Code of Conduct (e.g., replace the href
`https://github.com/asgardeo/thunder/blob/main/CONTRIBUTING.md` with the real
CODE_OF_CONDUCT.md URL such as
`https://github.com/asgardeo/thunder/blob/main/CODE_OF_CONDUCT.md`), or create a
CODE_OF_CONDUCT.md in the repo and then update the link in the "Contributor
Covenant Code of Conduct" anchor so it points to that new file.


## License

Thunder is licensed under the [Apache License 2.0](https://github.com/asgardeo/thunder/blob/main/LICENSE).
133 changes: 131 additions & 2 deletions docs/content/guides/deployment-patterns/docker.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,136 @@
---
title: Docker
sidebar_position: 1
persona: iam
description: Deploy Thunder using Docker or Docker Compose, from a quick single-container run to a production setup with an external PostgreSQL database.
---

# 🚧 WIP
## This page is under construction. Please check back later.
# Deploy Thunder with Docker

This guide walks you through deploying Thunder using Docker. You can run Thunder as a single container for development or pair it with an external PostgreSQL database for production use.

## Prerequisites

Before you begin, ensure the following tools are installed:

| Tool | Minimum Version | Installation Guide | Version Check |
|------|----------------|--------------------|---------------|
| Docker | 20.10 | [Install Docker](https://docs.docker.com/engine/install/) | `docker --version` |
| Docker Compose | 2.0 | [Install Docker Compose](https://docs.docker.com/compose/install/) | `docker compose version` |

Verify your installation:

```bash
docker --version
docker compose version
docker run hello-world
```

Thunder listens on port `8090` by default. Ensure that port is available on your host.

## Run Thunder with Docker

### Step 1: Pull the Image

```bash
docker pull ghcr.io/asgardeo/thunder:latest
```

### Step 2: Set Up the Server

Run the one-time setup script before starting Thunder for the first time. The setup initializes the configuration and database:

```bash
docker run -it --rm \
ghcr.io/asgardeo/thunder:latest \
./setup.sh
```

The container exits after setup completes. If you are using SQLite as the database, mount a volume to persist the database file so the setup data is available when you start the server.

### Step 3: Start the Server

```bash
docker run --rm \
-p 8090:8090 \
ghcr.io/asgardeo/thunder:latest
```
Comment on lines +41 to +57
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, let's understand the repository structure
find . -type f -name "Dockerfile*" -o -name "setup.sh" | head -20

Repository: asgardeo/thunder

Length of output: 83


🏁 Script executed:

# Look for any configuration or entrypoint files
fd -t f "setup\|docker\|config" -e sh -e yaml -e yml | grep -E "(setup|docker|config)" | head -20

Repository: asgardeo/thunder

Length of output: 42


🏁 Script executed:

# Check the documentation file in question
cat docs/content/guides/deployment-patterns/docker.mdx

Repository: asgardeo/thunder

Length of output: 3941


🏁 Script executed:

cat -n Dockerfile

Repository: asgardeo/thunder

Length of output: 5102


🏁 Script executed:

cat -n setup.sh

Repository: asgardeo/thunder

Length of output: 19102


🏁 Script executed:

# Check if there are any volume or workdir specifications in Dockerfile
grep -n "VOLUME\|WORKDIR\|ENV.*PATH\|/opt/thunder" Dockerfile

Repository: asgardeo/thunder

Length of output: 195


🏁 Script executed:

# Check for any references to database paths or repository in the actual code
rg "repository\|database\|sqlite" --type go -A 2 -B 2 | head -50

Repository: asgardeo/thunder

Length of output: 42


🏁 Script executed:

# Look for any environment variable or configuration related to data storage
grep -r "THUNDER_HOME\|DATABASE\|REPOSITORY" . --include="*.yaml" --include="*.yml" --include="*.go" 2>/dev/null | head -20

Repository: asgardeo/thunder

Length of output: 1551


🏁 Script executed:

# Check the deployment.yaml to understand the data storage paths
find . -name "deployment.yaml" -exec cat {} \;

Repository: asgardeo/thunder

Length of output: 8605


🏁 Script executed:

# Check if setup.sh and start.sh are different scripts
diff setup.sh start.sh

Repository: asgardeo/thunder

Length of output: 17618


🏁 Script executed:

# Look for any volume declarations in Dockerfile or docker-compose examples
grep -r "volume" . --include="Dockerfile*" --include="docker-compose*" --include="*.yml" --include="*.yaml" 2>/dev/null | grep -i thunder

Repository: asgardeo/thunder

Length of output: 726


🏁 Script executed:

# Check if there's a docker-compose file that might show the intended pattern
find . -name "docker-compose*" -type f | head -5

Repository: asgardeo/thunder

Length of output: 147


🏁 Script executed:

cat ./install/local-development/docker-compose.yml

Repository: asgardeo/thunder

Length of output: 756


🏁 Script executed:

cat ./install/quick-start/docker-compose.yml

Repository: asgardeo/thunder

Length of output: 1554


Add volume mounts to persist setup data between containers

The setup and server commands run in separate containers. Without mounting the same volume, setup data (databases and configuration) created by ./setup.sh are discarded when that container exits with --rm.

Mount /opt/thunder/repository in both commands to persist data:

Corrected commands
+docker volume create thunder-data
+
 docker run -it --rm \
+  -v thunder-data:/opt/thunder/repository \
   ghcr.io/asgardeo/thunder:latest \
   ./setup.sh

 docker run --rm \
   -p 8090:8090 \
+  -v thunder-data:/opt/thunder/repository \
   ghcr.io/asgardeo/thunder:latest
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/content/guides/deployment-patterns/docker.mdx` around lines 41 - 57,
Update the two example docker run commands so the setup container and the server
container mount the same persistent volume for /opt/thunder/repository;
specifically modify the setup invocation that runs ./setup.sh and the server
start command (the ghcr.io/asgardeo/thunder:latest run) to include a -v
host_path:/opt/thunder/repository (or named volume) so the data created by
./setup.sh is persisted and available when the server container starts.


Thunder is now running at `https://localhost:8090`.

### Customize the Configuration

To override the default server configuration, mount a custom `deployment.yaml` file. Create a `deployment.yaml` based on the [default configuration](https://github.com/asgardeo/thunder/blob/main/backend/cmd/server/repository/conf/deployment.yaml) and pass it to the container:

```bash
docker run --rm \
-p 8090:8090 \
-v $(pwd)/deployment.yaml:/opt/thunder/repository/conf/deployment.yaml \
ghcr.io/asgardeo/thunder:latest
```

To also use custom TLS certificates, mount them alongside the configuration:

```bash
docker run --rm \
-p 8090:8090 \
-v $(pwd)/deployment.yaml:/opt/thunder/repository/conf/deployment.yaml \
-v $(pwd)/certs/server.cert:/opt/thunder/repository/resources/security/server.cert \
-v $(pwd)/certs/server.key:/opt/thunder/repository/resources/security/server.key \
ghcr.io/asgardeo/thunder:latest
```

## Access Thunder

Once the container is running, access Thunder at the following endpoints:

| Endpoint | URL |
|----------|-----|
| Application | `https://localhost:8090` |
| Sign-in / Register | `https://localhost:8090/signin` |
| Thunder Console | `https://localhost:8090/console` |

## Database Setup

### Embedded SQLite (Default)

Thunder uses SQLite by default. No additional setup is required for development or local testing.

### External PostgreSQL

For production deployments, use an external PostgreSQL database. Thunder ships with a Docker Compose file for running a local PostgreSQL instance.

1. Navigate to the `install/local-development` directory:

```bash
cd install/local-development
```

2. Start PostgreSQL in the background:

```bash
docker compose up -d
```

3. View PostgreSQL logs:

```bash
docker compose logs -f
```

4. Stop PostgreSQL:

```bash
docker compose down
```

To stop PostgreSQL and delete all data:

```bash
docker compose down -v
```
Comment on lines +101 to +131
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, let's understand the repository structure and find relevant deployment files
fd -t f "docker-compose|deployment" --max-one-result install/local-development

Repository: asgardeo/thunder

Length of output: 293


🏁 Script executed:

# Let's explore the install/local-development directory structure
ls -la install/local-development/

Repository: asgardeo/thunder

Length of output: 297


🏁 Script executed:

# Check if there's a Docker compose file and what it contains
cat install/local-development/docker-compose.yml 2>/dev/null || cat install/local-development/docker-compose.yaml 2>/dev/null || ls -la install/local-development/

Repository: asgardeo/thunder

Length of output: 756


🏁 Script executed:

# Find where deployment.yaml is referenced or located
fd -t f "deployment\." --type f | head -20

Repository: asgardeo/thunder

Length of output: 531


🏁 Script executed:

# Search for default database configuration in Thunder
rg -i "default.*database|database.*sqlite|database.*postgres" -A 3 -B 3 --type yaml --type json | head -50

Repository: asgardeo/thunder

Length of output: 3812


🏁 Script executed:

# Check the default deployment.yaml configuration in the main server code
cat backend/cmd/server/repository/conf/deployment.yaml

Repository: asgardeo/thunder

Length of output: 1324


🏁 Script executed:

# Search for database configuration environment variables or defaults
rg -i "database.*type|db.*type|sqlite|postgres" backend/cmd/server/repository/conf/ -A 2 -B 2

Repository: asgardeo/thunder

Length of output: 1287


🏁 Script executed:

# Look at the Dockerfile to see if there's any default configuration
fd -t f "Dockerfile*" install/ | head -5

Repository: asgardeo/thunder

Length of output: 42


🏁 Script executed:

# Check if there are any Docker-specific startup scripts or configuration
rg -i "deployment\.yaml" docs/ --type mdx | head -20

Repository: asgardeo/thunder

Length of output: 87


🏁 Script executed:

# Look at the documentation file being reviewed to understand context
cat docs/content/guides/deployment-patterns/docker.mdx | head -150

Repository: asgardeo/thunder

Length of output: 3941


🏁 Script executed:

# Search for PostgreSQL configuration examples in the documentation
rg -i "postgres.*config|host.*5432|database.*configdb" docs/ --type txt --type md | head -20

Repository: asgardeo/thunder

Length of output: 979


🏁 Script executed:

# Look for any deployment.yaml examples with PostgreSQL configuration
rg -A 20 "type.*postgres" backend/ --type yaml | head -50

Repository: asgardeo/thunder

Length of output: 1251


🏁 Script executed:

# Check if there's documentation about configuring databases in Thunder
fd -t f "*.md*" docs/content/guides/ | xargs grep -l -i "postgres\|database" | head -5

Repository: asgardeo/thunder

Length of output: 344


🏁 Script executed:

# Look at what a PostgreSQL deployment.yaml should look like
cat backend/tests/resources/deployment.yaml | grep -A 10 "database:" | head -30

Repository: asgardeo/thunder

Length of output: 252


🏁 Script executed:

# Check if there are any other guides that show PostgreSQL configuration examples
fd -t f "kubernetes" docs/content/guides/deployment-patterns/ 2>/dev/null | xargs cat 2>/dev/null | grep -A 15 "postgres\|configdb" | head -40

Repository: asgardeo/thunder

Length of output: 1062


🏁 Script executed:

# Check the Helm values to see the PostgreSQL configuration structure
cat install/helm/values.yaml | grep -A 20 "database:"

Repository: asgardeo/thunder

Length of output: 891


🏁 Script executed:

# Search for any example deployment.yaml files in docs
fd -t f "deployment.yaml" docs/ 2>/dev/null

Repository: asgardeo/thunder

Length of output: 42


🏁 Script executed:

# Look for references to how to configure database in Docker context
rg -B 5 -A 10 "deployment.yaml" docs/content/guides/deployment-patterns/docker.mdx

Repository: asgardeo/thunder

Length of output: 1103


🏁 Script executed:

# Check if there's environment variable support for database configuration
rg -i "env\|getenv" backend/cmd/server/ -t go | grep -i "database\|postgres" | head -10

Repository: asgardeo/thunder

Length of output: 42


🏁 Script executed:

# Look at the complete Docker section more carefully
sed -n '70,200p' docs/content/guides/deployment-patterns/docker.mdx

Repository: asgardeo/thunder

Length of output: 1722


🏁 Script executed:

# Verify if the documentation mentions anywhere else how to use PostgreSQL with Docker
rg -i "postgres.*docker|docker.*postgres" docs/content/guides/

Repository: asgardeo/thunder

Length of output: 700


🏁 Script executed:

# Check the docker compose file again and verify network setup
cat install/local-development/docker-compose.yml

Repository: asgardeo/thunder

Length of output: 756


🏁 Script executed:

# Look for networking configuration in the docker guide
rg -i "network\|docker.*compose\|compose.*network" docs/content/guides/deployment-patterns/docker.mdx

Repository: asgardeo/thunder

Length of output: 42


🏁 Script executed:

# Check if there's a complete example deployment.yaml with PostgreSQL
fd -t f "*.yaml" install/local-development/

Repository: asgardeo/thunder

Length of output: 345


🏁 Script executed:

# Look at how the Kubernetes guide handles PostgreSQL configuration to understand expected structure
sed -n '1,300p' docs/content/guides/deployment-patterns/kubernetes.mdx | grep -A 30 "PostgreSQL"

Repository: asgardeo/thunder

Length of output: 3284


🏁 Script executed:

# Let's verify the complete workflow - check if there's a sample deployment.yaml in install/local-development
fd --glob "deployment*" install/local-development/

Repository: asgardeo/thunder

Length of output: 42


🏁 Script executed:

# Check if the init.sql or other files in postgres-init give us hints about expected config
cat install/local-development/postgres-init/init.sql 2>/dev/null || echo "File not found"

Repository: asgardeo/thunder

Length of output: 443


🏁 Script executed:

# Verify the networking - does Docker Compose auto-network or need manual setup?
rg "networks:" install/local-development/docker-compose.yml

Repository: asgardeo/thunder

Length of output: 42


🏁 Script executed:

# Check if there's any mention of how to connect Thunder container to postgres container
rg -i "depends_on\|link\|network" install/local-development/

Repository: asgardeo/thunder

Length of output: 42


🏁 Script executed:

# Let's verify one more thing - check if there's a way to test the complete workflow
# by looking at integration tests or CI/CD that uses docker-compose
rg -i "docker-compose\|install/local-development" .github/ backend/tests/ --type yaml | head -10

Repository: asgardeo/thunder

Length of output: 42


🏁 Script executed:

# Check if the documentation elsewhere mentions how to provide a deployment.yaml config for PostgreSQL
rg -B 5 -A 5 "hostname.*localhost\|host.*postgres" docs/content/ | grep -A 10 -B 10 "deployment.yaml"

Repository: asgardeo/thunder

Length of output: 42


External PostgreSQL section requires configuration step to connect Thunder to PostgreSQL

The section shows starting PostgreSQL but omits the critical step of configuring Thunder to use it. Users following these steps would start the database but Thunder would still use SQLite by default. Add a step showing how to create and mount a deployment.yaml file with PostgreSQL credentials that match the docker-compose configuration (hostname: postgres, port: 5432, username: asgthunder, password: asgthunder).

Suggested addition
 2. Start PostgreSQL in the background:

     ```bash
     docker compose up -d
     ```

+3. Create a `deployment.yaml` file with PostgreSQL configuration:
+
+    ```yaml
+    database:
+      config:
+        type: postgres
+        hostname: postgres
+        port: 5432
+        name: configdb
+        username: asgthunder
+        password: asgthunder
+        sslmode: disable
+      runtime:
+        type: postgres
+        hostname: postgres
+        port: 5432
+        name: runtimedb
+        username: asgthunder
+        password: asgthunder
+        sslmode: disable
+      user:
+        type: postgres
+        hostname: postgres
+        port: 5432
+        name: userdb
+        username: asgthunder
+        password: asgthunder
+        sslmode: disable
+    ```
+
+4. Start Thunder with the PostgreSQL configuration:
+
+    ```bash
+    docker run --rm \
+      -p 8090:8090 \
+      -v $(pwd)/deployment.yaml:/opt/thunder/repository/conf/deployment.yaml \
+      ghcr.io/asgardeo/thunder:latest
+    ```
+
+5. View PostgreSQL logs:
-3. View PostgreSQL logs:

Note: The hostname is postgres (the docker-compose service name), not localhost, since Thunder runs in Docker.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/content/guides/deployment-patterns/docker.mdx` around lines 101 - 131,
The docs start a PostgreSQL container but omit configuring Thunder to use it;
add a step that tells users to create a deployment.yaml containing database
sections (database.config, database.runtime, database.user) with type: postgres
and the credentials hostname: postgres, port: 5432, username: asgthunder,
password: asgthunder, sslmode: disable, then show how to mount that file into
the Thunder container (e.g., -v
$(pwd)/deployment.yaml:/opt/thunder/repository/conf/deployment.yaml) when
running the ghcr.io/asgardeo/thunder:latest image so Thunder uses the external
Postgres instead of SQLite.


## Next Steps

- [Deploy Thunder on Kubernetes](./kubernetes) — Deploy Thunder to a Kubernetes cluster using Helm.
- [Deploy Thunder on OpenChoreo](./openchoreo) — Deploy Thunder on the OpenChoreo platform.
Loading
Loading