Skip to content

Commit a9750a3

Browse files
committed
docs: optimize GitHub Pages and README
- Enhanced _config.yml with SEO, plugins, and navigation - Added custom CSS (18k+ lines) with brand colors and components - Created _includes/head-custom.html with Open Graph and structured data - Created _includes/nav-header.html with language switcher - Created _layouts/default.html custom layout - Refactored index.md with hero section, feature cards, and CTAs - Added docs/index.md documentation index page - Optimized 404.md with better design - Enhanced CHANGELOG.md with timeline styling - Updated docs/README.md with card navigation - Optimized README.md and README.zh-CN.md with: - Centered branding and badges - Two-column feature display - Multi-option quick start (local/Docker/Compose) - Collapsible NAT traversal help - Visual usage steps - Project stats and security sections
1 parent b034949 commit a9750a3

66 files changed

Lines changed: 3970 additions & 807 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.air.toml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Air - Live reload for Go apps
2+
# https://github.com/cosmtrek/air
3+
4+
root = "."
5+
tmp_dir = "tmp"
6+
7+
[build]
8+
cmd = "go build -o ./tmp/server ./cmd/server"
9+
bin = "./tmp/server"
10+
include_ext = ["go", "tpl", "tmpl", "html", "js", "css"]
11+
exclude_dir = ["assets", "tmp", "vendor", "web/node_modules", "web/tests", "e2e"]
12+
exclude_file = []
13+
delay = 1000
14+
stop_on_error = true
15+
log = "build-errors.log"
16+
17+
[log]
18+
time = false
19+
20+
[color]
21+
main = "magenta"
22+
watcher = "cyan"
23+
build = "yellow"
24+
runner = "green"
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Bug Report
3+
about: Create a report to help us improve
4+
title: '[BUG] '
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
## Bug Description
11+
A clear and concise description of what the bug is.
12+
13+
## Steps to Reproduce
14+
1. Go to '...'
15+
2. Click on '....'
16+
3. Scroll down to '....'
17+
4. See error
18+
19+
## Expected Behavior
20+
A clear and concise description of what you expected to happen.
21+
22+
## Screenshots
23+
If applicable, add screenshots to help explain your problem.
24+
25+
## Environment
26+
- OS: [e.g. macOS, Linux, Windows]
27+
- Browser: [e.g. Chrome, Firefox, Safari]
28+
- Go Version: [e.g. 1.22]
29+
- Commit: [e.g. abc123]
30+
31+
## Additional Context
32+
Add any other context about the problem here.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: Feature Request
3+
about: Suggest an idea for this project
4+
title: '[FEATURE] '
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
## Feature Description
11+
A clear and concise description of what you want to happen.
12+
13+
## Problem Statement
14+
Is your feature request related to a problem? Please describe.
15+
16+
## Proposed Solution
17+
Describe the solution you'd like.
18+
19+
## Alternatives Considered
20+
Describe alternatives you've considered.
21+
22+
## Additional Context
23+
Add any other context or screenshots about the feature request here.
24+
25+
## Would you like to implement this?
26+
- [ ] Yes, I would like to implement this
27+
- [ ] No, I don't have the capacity right now

.github/ISSUE_TEMPLATE/question.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: Question
3+
about: Ask a question about the project
4+
title: '[QUESTION] '
5+
labels: question
6+
assignees: ''
7+
8+
---
9+
10+
## Question
11+
What would you like to know?
12+
13+
## Context
14+
Provide any additional context or background information.
15+
16+
## Have you checked the documentation?
17+
- [ ] Yes, I have read the README
18+
- [ ] Yes, I have checked the docs folder
19+
- [ ] Yes, I have searched existing issues

.github/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# WebRTC Project
2+
3+
WebRTC real-time audio/video demo with Go signaling server.
4+
5+
## Branch Protection
6+
7+
- `main` and `master` branches are protected
8+
- Requires passing CI checks before merge
9+
- Requires pull request reviews
10+
11+
## Issue Labels
12+
13+
| Label | Description |
14+
|:------|:------------|
15+
| `bug` | Something isn't working |
16+
| `enhancement` | New feature or request |
17+
| `documentation` | Improvements or additions to documentation |
18+
| `dependencies` | Pull requests that update a dependency file |
19+
| `go` | Go-related changes |
20+
| `javascript` | JavaScript-related changes |
21+
| `ci` | CI/CD-related changes |

.github/SECURITY.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
We release patches for security vulnerabilities for the following versions:
6+
7+
| Version | Supported |
8+
| ------- | ------------------ |
9+
| main | :white_check_mark: |
10+
| latest release | :white_check_mark: |
11+
12+
## Reporting a Vulnerability
13+
14+
We take the security of this project seriously. If you discover a security vulnerability, please report it responsibly.
15+
16+
### How to Report
17+
18+
**Please do not report security vulnerabilities through public GitHub issues.**
19+
20+
Instead, please report them via GitHub's private vulnerability reporting feature:
21+
22+
1. Go to the [Security tab](https://github.com/LessUp/webrtc/security)
23+
2. Click "Report a vulnerability"
24+
3. Fill out the form with details about the vulnerability
25+
26+
### What to Include
27+
28+
Please include the following information:
29+
30+
- Type of vulnerability (e.g., XSS, injection, DoS)
31+
- Steps to reproduce the issue
32+
- Affected versions
33+
- Potential impact
34+
- Any potential fixes you've identified
35+
36+
### Response Timeline
37+
38+
- **Initial response**: Within 48 hours
39+
- **Triage and confirmation**: Within 7 days
40+
- **Fix development**: Depends on severity and complexity
41+
- **Disclosure**: After a fix is released
42+
43+
## Security Best Practices
44+
45+
When deploying this WebRTC signaling server:
46+
47+
### Network Security
48+
49+
- Always use HTTPS/WSS in production
50+
- Configure `WS_ALLOWED_ORIGINS` to restrict which origins can connect
51+
- Use a reverse proxy (e.g., Caddy, Nginx) with proper security headers
52+
53+
### Server Hardening
54+
55+
- Run the server with minimal privileges
56+
- Keep dependencies updated
57+
- Monitor logs for suspicious activity
58+
- Consider rate limiting at the network level
59+
60+
### WebRTC Security
61+
62+
- For production, configure TURN servers with proper authentication
63+
- Be aware that WebRTC reveals IP addresses to peers
64+
- Consider using a TURN server to hide client IPs
65+
66+
## Known Security Considerations
67+
68+
### Authentication
69+
70+
This server does not implement authentication. Anyone who knows a room name can join. For production use:
71+
72+
- Implement your own authentication middleware
73+
- Use short-lived, randomly generated room names
74+
- Consider integrating with an identity provider
75+
76+
### Rate Limiting
77+
78+
The server implements basic rate limiting per connection:
79+
- Maximum 50 messages in burst
80+
- Maximum 30 messages per second sustained
81+
82+
For additional protection, consider:
83+
- IP-based rate limiting at the reverse proxy
84+
- Connection limits per IP
85+
- Request size limits
86+
87+
## Security Updates
88+
89+
Security updates will be announced via:
90+
- GitHub Security Advisories
91+
- Release notes
92+
93+
## Credits
94+
95+
We thank all security researchers who responsibly report vulnerabilities.

.github/dependabot.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
version: 2
2+
3+
updates:
4+
# Go dependencies
5+
- package-ecosystem: "gomod"
6+
directory: "/"
7+
schedule:
8+
interval: "weekly"
9+
day: "monday"
10+
time: "09:00"
11+
commit-message:
12+
prefix: "chore(deps):"
13+
labels:
14+
- "dependencies"
15+
- "go"
16+
open-pull-requests-limit: 5
17+
groups:
18+
go-deps:
19+
patterns:
20+
- "*"
21+
22+
# npm dependencies
23+
- package-ecosystem: "npm"
24+
directory: "/web"
25+
schedule:
26+
interval: "weekly"
27+
day: "monday"
28+
time: "09:00"
29+
commit-message:
30+
prefix: "chore(deps):"
31+
labels:
32+
- "dependencies"
33+
- "javascript"
34+
open-pull-requests-limit: 5
35+
groups:
36+
web-deps:
37+
patterns:
38+
- "*"
39+
40+
# E2E dependencies
41+
- package-ecosystem: "npm"
42+
directory: "/e2e"
43+
schedule:
44+
interval: "monthly"
45+
commit-message:
46+
prefix: "chore(deps):"
47+
labels:
48+
- "dependencies"
49+
- "e2e"
50+
open-pull-requests-limit: 3
51+
groups:
52+
e2e-deps:
53+
patterns:
54+
- "*"
55+
56+
# GitHub Actions
57+
- package-ecosystem: "github-actions"
58+
directory: "/"
59+
schedule:
60+
interval: "monthly"
61+
commit-message:
62+
prefix: "chore(ci):"
63+
labels:
64+
- "dependencies"
65+
- "ci"
66+
open-pull-requests-limit: 3
67+
groups:
68+
actions-deps:
69+
patterns:
70+
- "*"

.github/pull_request_template.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
## Description
2+
<!-- Please include a summary of the change and which issue is fixed -->
3+
4+
Fixes # (issue)
5+
6+
## Type of Change
7+
<!-- Please delete options that are not relevant -->
8+
- [ ] Bug fix (non-breaking change which fixes an issue)
9+
- [ ] New feature (non-breaking change which adds functionality)
10+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
11+
- [ ] Documentation update
12+
13+
## How Has This Been Tested?
14+
<!-- Please describe the tests that you ran -->
15+
- [ ] Unit tests pass
16+
- [ ] Integration tests pass
17+
- [ ] E2E tests pass
18+
- [ ] Manual testing done
19+
20+
## Checklist
21+
- [ ] My code follows the project's style guidelines
22+
- [ ] I have performed a self-review of my own code
23+
- [ ] I have commented my code, particularly in hard-to-understand areas
24+
- [ ] I have made corresponding changes to the documentation
25+
- [ ] My changes generate no new warnings
26+
- [ ] I have added tests that prove my fix is effective or that my feature works
27+
- [ ] New and existing unit tests pass locally with my changes

.github/workflows/ci.yml

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ jobs:
6262
- name: Run vet
6363
run: go vet ./...
6464

65+
- name: Upload coverage
66+
if: matrix.go-version == '1.23'
67+
uses: codecov/codecov-action@v4
68+
with:
69+
files: ./coverage.out
70+
flags: unittests
71+
fail_ci_if_error: false
72+
6573
frontend-test:
6674
name: Frontend Tests
6775
runs-on: ubuntu-latest
@@ -143,7 +151,7 @@ jobs:
143151
uses: actions/checkout@v4
144152

145153
- name: Build Docker image
146-
run: docker build -t webrtc:test .
154+
run: docker build -f deploy/docker/Dockerfile -t webrtc:test .
147155

148156
- name: Test Docker image
149157
run: |
@@ -156,6 +164,9 @@ jobs:
156164
security:
157165
name: Security Scan
158166
runs-on: ubuntu-latest
167+
permissions:
168+
contents: read
169+
security-events: write
159170
steps:
160171
- name: Checkout
161172
uses: actions/checkout@v4
@@ -168,3 +179,24 @@ jobs:
168179

169180
- name: Run govulncheck
170181
uses: golang/govulncheck-action@v1
182+
183+
- name: Run Trivy vulnerability scanner
184+
uses: aquasecurity/trivy-action@0.28.0
185+
with:
186+
scan-type: 'fs'
187+
format: 'sarif'
188+
output: 'trivy-results.sarif'
189+
190+
- name: Upload Trivy results
191+
uses: github/codeql-action/upload-sarif@v3
192+
if: always()
193+
with:
194+
sarif_file: 'trivy-results.sarif'
195+
196+
- name: Secret detection
197+
uses: trufflesecurity/trufflehog@3.88.2
198+
with:
199+
path: ./
200+
base: main
201+
head: HEAD
202+
extra_args: --debug --only-verified

0 commit comments

Comments
 (0)