Skip to content

Commit 35986ee

Browse files
committed
docs: fix broken links and replace support with FAQ - Replace support page with FAQ as main navigation item - Remove docs/support/ directory entirely - Fix all broken internal links throughout documentation - Make tutorial a child page of Examples & Tutorials - Ensure clean navigation structure with working links
1 parent 9bb4607 commit 35986ee

File tree

11 files changed

+373
-536
lines changed

11 files changed

+373
-536
lines changed

.devcontainer/README.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Development Container Configuration
2+
3+
This directory contains the configuration for the AI Command Auditor development container.
4+
5+
## Files
6+
7+
- `devcontainer.json` - VS Code devcontainer configuration
8+
- `docker-compose.yml` - Docker Compose service definition
9+
- `Dockerfile` - Container image build instructions
10+
- `show-ports.sh` - Helper script to display dynamic port mappings
11+
12+
## Port Configuration
13+
14+
The devcontainer uses **dynamic port allocation** to avoid conflicts when running multiple devcontainers simultaneously. Instead of fixed port mappings like `3000:3000`, the configuration uses dynamic mappings like `3000`, allowing Docker to automatically assign available host ports.
15+
16+
### Available Container Ports
17+
18+
- `3000` - Node.js/React development server
19+
- `5000` - Flask development server
20+
- `8000` - Python web server
21+
- `8080` - Alternative web server
22+
- `9000` - Additional service port
23+
24+
### Finding Your Assigned Ports
25+
26+
After starting the devcontainer, use the helper script to see which host ports were assigned:
27+
28+
```bash
29+
# From inside the devcontainer
30+
./.devcontainer/show-ports.sh
31+
32+
# Or from the host system
33+
cd /path/to/ai-command-auditor
34+
./.devcontainer/show-ports.sh
35+
```
36+
37+
Example output:
38+
39+
```
40+
[16:42:15] Found devcontainer: ai-command-auditor_devcontainer-devcontainer-1 (a1b2c3d4e5f6)
41+
42+
INFO: Port mappings:
43+
Container Port 3000/tcp -> Host 0.0.0.0:32768
44+
Container Port 5000/tcp -> Host 0.0.0.0:32769
45+
Container Port 8000/tcp -> Host 0.0.0.0:32770
46+
47+
INFO: Access your services at:
48+
React/Node.js Dev Server: http://localhost:32768
49+
Flask Dev Server: http://localhost:32769
50+
Python Web Server: http://localhost:32770
51+
```
52+
53+
### Benefits of Dynamic Port Allocation
54+
55+
1. **No Port Conflicts** - Multiple devcontainers can run simultaneously
56+
2. **Automatic Assignment** - Docker handles port allocation automatically
57+
3. **Easy Discovery** - Use the helper script to find assigned ports
58+
4. **Flexible Development** - Work on multiple projects without conflicts
59+
60+
## Troubleshooting
61+
62+
### Port Discovery Issues
63+
64+
If the `show-ports.sh` script can't find your container:
65+
66+
1. Check if the container is running:
67+
68+
```bash
69+
docker ps | grep ai-command-auditor
70+
```
71+
72+
2. Verify the container name pattern in the script matches your actual container name
73+
74+
3. Manual port checking:
75+
76+
```bash
77+
docker port <container-name-or-id>
78+
```
79+
80+
### Container Startup Issues
81+
82+
If you encounter port binding errors:
83+
84+
1. Stop any conflicting containers:
85+
86+
```bash
87+
docker ps
88+
docker stop <conflicting-container>
89+
```
90+
91+
2. Rebuild the devcontainer:
92+
- In VS Code: `Ctrl+Shift+P` → "Dev Containers: Rebuild Container"
93+
94+
3. Check Docker daemon status:
95+
96+
```bash
97+
sudo systemctl status docker
98+
```

.devcontainer/show-ports.sh

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
#!/bin/bash
2+
#
3+
# Script Name: show-ports.sh
4+
# Description: Show the dynamically assigned ports for the AI Command Auditor devcontainer
5+
# Author: AI Assistant
6+
# Date: $(date +%Y-%m-%d)
7+
# Version: 1.0
8+
#
9+
# Usage: ./show-ports.sh
10+
#
11+
12+
set -euo pipefail
13+
14+
# Constants
15+
readonly SCRIPT_NAME="$(basename "$0")"
16+
readonly CONTAINER_NAME_PATTERN="ai-command-auditor.*devcontainer"
17+
18+
# Colors for output
19+
readonly RED='\033[0;31m'
20+
readonly GREEN='\033[0;32m'
21+
readonly YELLOW='\033[1;33m'
22+
readonly BLUE='\033[0;34m'
23+
readonly NC='\033[0m' # No Color
24+
25+
# Functions
26+
log() {
27+
echo -e "${GREEN}[$(date +'%H:%M:%S')] $*${NC}"
28+
}
29+
30+
error() {
31+
echo -e "${RED}ERROR: $*${NC}" >&2
32+
exit 1
33+
}
34+
35+
warning() {
36+
echo -e "${YELLOW}WARNING: $*${NC}" >&2
37+
}
38+
39+
info() {
40+
echo -e "${BLUE}INFO: $*${NC}"
41+
}
42+
43+
show_container_ports() {
44+
local container_id
45+
container_id=$(docker ps --filter "name=${CONTAINER_NAME_PATTERN}" --format "{{.ID}}" | head -1)
46+
47+
if [[ -z "$container_id" ]]; then
48+
error "No running devcontainer found matching pattern: ${CONTAINER_NAME_PATTERN}"
49+
fi
50+
51+
local container_name
52+
container_name=$(docker ps --filter "id=${container_id}" --format "{{.Names}}")
53+
54+
log "Found devcontainer: ${container_name} (${container_id})"
55+
echo
56+
57+
info "Port mappings:"
58+
docker port "$container_id" | while read -r line; do
59+
if [[ -n "$line" ]]; then
60+
local container_port host_mapping
61+
container_port=$(echo "$line" | cut -d' ' -f1)
62+
host_mapping=$(echo "$line" | cut -d' ' -f3)
63+
64+
echo -e " ${YELLOW}Container Port ${container_port}${NC} -> ${GREEN}Host ${host_mapping}${NC}"
65+
fi
66+
done
67+
68+
echo
69+
info "Access your services at:"
70+
docker port "$container_id" | while read -r line; do
71+
if [[ -n "$line" ]]; then
72+
local container_port host_port
73+
container_port=$(echo "$line" | cut -d' ' -f1 | cut -d'/' -f1)
74+
host_port=$(echo "$line" | cut -d' ' -f3 | cut -d':' -f2)
75+
76+
case "$container_port" in
77+
3000)
78+
echo -e " ${BLUE}React/Node.js Dev Server:${NC} http://localhost:${host_port}"
79+
;;
80+
5000)
81+
echo -e " ${BLUE}Flask Dev Server:${NC} http://localhost:${host_port}"
82+
;;
83+
8000)
84+
echo -e " ${BLUE}Python Web Server:${NC} http://localhost:${host_port}"
85+
;;
86+
8080)
87+
echo -e " ${BLUE}Alternative Web Server:${NC} http://localhost:${host_port}"
88+
;;
89+
9000)
90+
echo -e " ${BLUE}Additional Service:${NC} http://localhost:${host_port}"
91+
;;
92+
*)
93+
echo -e " ${BLUE}Port ${container_port}:${NC} http://localhost:${host_port}"
94+
;;
95+
esac
96+
fi
97+
done
98+
}
99+
100+
usage() {
101+
cat << EOF
102+
Usage: $SCRIPT_NAME [OPTIONS]
103+
104+
Show the dynamically assigned ports for the AI Command Auditor devcontainer.
105+
106+
OPTIONS:
107+
-h, --help Show this help message
108+
109+
EXAMPLES:
110+
$SCRIPT_NAME
111+
112+
EOF
113+
}
114+
115+
# Parse command line arguments
116+
while [[ $# -gt 0 ]]; do
117+
case $1 in
118+
-h|--help)
119+
usage
120+
exit 0
121+
;;
122+
*)
123+
error "Unknown option: $1"
124+
;;
125+
esac
126+
done
127+
128+
# Main execution
129+
main() {
130+
log "Checking for AI Command Auditor devcontainer..."
131+
show_container_ports
132+
}
133+
134+
main "$@"

docs/api/index.md

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,25 @@ ai-auditor --help # Show help
3434

3535
Validate individual commands or scripts for security
3636

37-
[View Commands]({{ site.baseurl }}/api/cli/#command-validation){: .btn .btn-outline }
37+
[View Commands]({{ site.baseurl }}/api/#command-validation){: .btn .btn-outline }
3838

3939
### ⚙️ Configuration
4040

4141
Manage configuration settings and templates
4242

43-
[View Commands]({{ site.baseurl }}/api/cli/#configuration){: .btn .btn-outline }
43+
[View Commands]({{ site.baseurl }}/api/#configuration){: .btn .btn-outline }
4444

4545
### 🔗 Git Integration
4646

4747
Setup and manage git hooks integration
4848

49-
[View Commands]({{ site.baseurl }}/api/cli/#git-integration){: .btn .btn-outline }
49+
[View Commands]({{ site.baseurl }}/api/#git-integration){: .btn .btn-outline }
5050

5151
### 📊 Reporting
5252

5353
Generate reports and view analysis results
5454

55-
[View Commands]({{ site.baseurl }}/api/cli/#reporting){: .btn .btn-outline }
55+
[View Commands]({{ site.baseurl }}/api/#reporting){: .btn .btn-outline }
5656

5757
## 🐍 Python API
5858

@@ -78,25 +78,25 @@ auditor.update_rules(rules)
7878

7979
Main classes and functions for command analysis
8080

81-
[View API]({{ site.baseurl }}/api/python/#core-api){: .btn .btn-outline }
81+
[View API]({{ site.baseurl }}/api/#core-api){: .btn .btn-outline }
8282

8383
### 🛡️ Security API
8484

8585
Security rules, validation, and policy management
8686

87-
[View API]({{ site.baseurl }}/api/python/#security-api){: .btn .btn-outline }
87+
[View API]({{ site.baseurl }}/api/#security-api){: .btn .btn-outline }
8888

8989
### 🤖 AI Integration
9090

9191
AI model configuration and prompt management
9292

93-
[View API]({{ site.baseurl }}/api/python/#ai-integration){: .btn .btn-outline }
93+
[View API]({{ site.baseurl }}/api/#ai-integration){: .btn .btn-outline }
9494

9595
### 🔌 Extensions
9696

9797
Plugin system and custom validators
9898

99-
[View API]({{ site.baseurl }}/api/python/#extensions){: .btn .btn-outline }
99+
[View API]({{ site.baseurl }}/api/#extensions){: .btn .btn-outline }
100100

101101
## 🚀 Getting Started Examples
102102

@@ -151,23 +151,23 @@ The complete CLI reference covers all commands, options, and use cases:
151151

152152
| Section | Description | Link |
153153
|---------|-------------|------|
154-
| **Command Validation** | Validate commands and scripts | [CLI Commands →]({{ site.baseurl }}/api/cli/#command-validation) |
155-
| **Configuration Management** | Manage settings and templates | [Config Commands →]({{ site.baseurl }}/api/cli/#configuration) |
156-
| **Git Integration** | Setup hooks and automation | [Git Commands →]({{ site.baseurl }}/api/cli/#git-integration) |
157-
| **Reporting & Analysis** | Generate reports and insights | [Report Commands →]({{ site.baseurl }}/api/cli/#reporting) |
158-
| **Utility Commands** | Helper and diagnostic commands | [Utility Commands →]({{ site.baseurl }}/api/cli/#utilities) |
154+
| **Command Validation** | Validate commands and scripts | [CLI Commands →]({{ site.baseurl }}/api/#command-validation) |
155+
| **Configuration Management** | Manage settings and templates | [Config Commands →]({{ site.baseurl }}/api/#configuration) |
156+
| **Git Integration** | Setup hooks and automation | [Git Commands →]({{ site.baseurl }}/api/#git-integration) |
157+
| **Reporting & Analysis** | Generate reports and insights | [Report Commands →]({{ site.baseurl }}/api/#reporting) |
158+
| **Utility Commands** | Helper and diagnostic commands | [Utility Commands →]({{ site.baseurl }}/api/#utilities) |
159159

160160
### Python API Documentation
161161

162162
Complete Python API reference with examples:
163163

164164
| Module | Description | Link |
165165
|--------|-------------|------|
166-
| **`CommandAuditor`** | Main auditor class and methods | [Core API →]({{ site.baseurl }}/api/python/#commandauditor) |
167-
| **`SecurityRules`** | Security policy management | [Security API →]({{ site.baseurl }}/api/python/#securityrules) |
168-
| **`AIAnalyzer`** | AI-powered analysis engine | [AI API →]({{ site.baseurl }}/api/python/#aianalyzer) |
169-
| **`Configuration`** | Configuration management | [Config API →]({{ site.baseurl }}/api/python/#configuration) |
170-
| **`Validators`** | Custom validation framework | [Validators →]({{ site.baseurl }}/api/python/#validators) |
166+
| **`CommandAuditor`** | Main auditor class and methods | [Core API →]({{ site.baseurl }}/api/#commandauditor) |
167+
| **`SecurityRules`** | Security policy management | [Security API →]({{ site.baseurl }}/api/#securityrules) |
168+
| **`AIAnalyzer`** | AI-powered analysis engine | [AI API →]({{ site.baseurl }}/api/#aianalyzer) |
169+
| **`Configuration`** | Configuration management | [Config API →]({{ site.baseurl }}/api/#configuration) |
170+
| **`Validators`** | Custom validation framework | [Validators →]({{ site.baseurl }}/api/#validators) |
171171

172172
## 🔗 Integration Patterns
173173

@@ -353,14 +353,13 @@ auditor.apply_policy(policy)
353353

354354
### Complete Documentation
355355

356-
- 🖥️ [**Complete CLI Reference**]({{ site.baseurl }}/api/cli/) - All CLI commands and options
357-
- 🐍 [**Complete Python API**]({{ site.baseurl }}/api/python/) - Full Python API documentation
358-
- 🔗 [**Integration Guide**]({{ site.baseurl }}/api/integration/) - Integration patterns and examples
359-
- 👩‍💻 [**Developer Guide**]({{ site.baseurl }}/api/developer/) - Contributing and development
356+
- 🖥️ [**Complete CLI Reference**]({{ site.baseurl }}/api/) - All CLI commands and options
357+
- 🐍 [**Complete Python API**]({{ site.baseurl }}/api/) - Full Python API documentation
358+
- 💡 [**Examples & Tutorials**]({{ site.baseurl }}/examples/) - Integration patterns and examples
360359

361360
### Quick Links
362361

363362
- [Installation Guide]({{ site.baseurl }}/installation/) - Get started quickly
364363
- [Configuration Reference]({{ site.baseurl }}/configuration/) - Configure for your needs
365364
- [Examples & Tutorials]({{ site.baseurl }}/examples/) - Learn with practical examples
366-
- [Support & FAQ]({{ site.baseurl }}/support/) - Get help and find answers
365+
- [Support & FAQ]({{ site.baseurl }}/faq/) - Get help and find answers

0 commit comments

Comments
 (0)