feat: add Review Board Cloudron package (Development)

- Create Dockerfile wrapping official Review Board image
- Add CloudronManifest.json with PostgreSQL addon
- Create start.sh script with PostgreSQL wait and Django migrations
- Include README.md with comprehensive review platform documentation
- Add .env.example for environment configuration
- Add CHANGELOG.md for version tracking
- Add logo.png (Review Board branding)

Review Board is a web-based code and document review tool
that tracks pending code, graphics, documents, and all discussions
around product decisions.

Package includes:
- Official Review Board Docker image wrapper (1.29GB)
- Cloudron PostgreSQL addon for Django database
- Automatic database migrations on startup
- Admin user creation via environment variables
- Comprehensive documentation with integration examples
- Examples for GitHub, GitLab, Mercurial, and Perforce

Features supported:
- Code review with advanced diff viewer (syntax highlighting, interdiffs)
- Document review (PDF and Office files)
- Discussion tracking with threaded comments
- Review requests workflow
- Repository integration (Git, Mercurial, Perforce, Plastic, Azure DevOps)
- Team and project management
- Email notifications
- Search across reviews and discussions
- Power Pack extension support (reports, LDAP sync, GitHub Enterprise)
- User authentication (LDAP, OAuth, traditional)

Environment variables:
- SECRET_KEY: Django secret key
- ALLOWED_HOSTS: Allowed hosts (default: *)
- REVIEWBOARD_SITE_ROOT: Site root URL
- ADMIN_USERNAME/EMAIL/PASSWORD: Admin account creation
- LDAP_*: LDAP/Active Directory configuration

Ports:
- 8080: Main HTTP port (web interface and API)

💘 Generated with Crush

Assisted-by: GLM-4.7 via Crush <crush@charm.land>
This commit is contained in:
2026-02-04 14:11:47 -05:00
parent 3aaf98267d
commit 8a09aaede4
7 changed files with 489 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
# Review Board Cloudron Environment Configuration Example
# Copy this to .env and configure as needed
# Django Configuration
SECRET_KEY=change-this-to-a-random-secret-key-in-production
ALLOWED_HOSTS=*
REVIEWBOARD_SITE_ROOT=https://your-app.cloudron.app
# Database (Automatically configured by Cloudron PostgreSQL addon)
# CLOUDRON_POSTGRESQL_HOST=127.0.0.1
# CLOUDRON_POSTGRESQL_PORT=5432
# CLOUDRON_POSTGRESQL_DATABASE=reviewboard
# CLOUDRON_POSTGRESQL_USERNAME=reviewboard
# CLOUDRON_POSTGRESQL_PASSWORD=database-password
# Admin User (create admin account on first start)
ADMIN_USERNAME=admin
ADMIN_EMAIL=admin@example.com
ADMIN_PASSWORD=admin-password-change-me
# Memcached (optional, for caching)
MEMCACHED_SERVER=memcached:11211
# LDAP/Active Directory (optional, for user authentication)
LDAP_SERVER=ldap://your-ldap-server.com
LDAP_BASE_DN=dc=example,dc=com
LDAP_UID=uid
LDAP_DN_TEMPLATE=uid=%(user)s,ou=users,dc=example,dc=com
LDAP_BIND_DN=cn=admin,dc=example,dc=com
LDAP_BIND_PASSWORD=your-ldap-password

View File

@@ -0,0 +1,27 @@
# Changelog
## [8.0.0] - 2025-01-24
### Added
- Initial Cloudron package for Review Board
- Official Review Board Docker image wrapper
- Automatic PostgreSQL configuration via Cloudron addon
- Django migrations on startup
- Admin user creation support via environment variables
- Health check endpoint
- Documentation with usage examples
- Integration examples (GitHub, GitLab, Mercurial, Perforce)
### Features
- Code and document review platform
- Advanced diff viewer with syntax highlighting
- Moved line detection and indentation indicators
- Repository integration (Git, Mercurial, Perforce, etc.)
- Discussion tracking and threaded comments
- Review requests workflow
- Email notifications
- Search across reviews, comments, discussions
- Dashboard for pending reviews
- Team and project management
- Power Pack extension support (reports, PDF review, LDAP sync)
- User authentication (LDAP, OAuth, traditional)

View File

@@ -0,0 +1,33 @@
{
"version": 1,
"manifestVersion": 2,
"type": "app",
"id": "io.cloudron.reviewboard",
"title": "Review Board",
"description": "Web-based code and document review tool. Tracks pending code, graphics, documents, and all discussions around product decisions. Supports Git, Mercurial, Perforce, and more.",
"author": "Beanbag, Inc.",
"website": "https://www.reviewboard.org",
"contactEmail": "cloudron@tsys.dev",
"tagline": "Code and document review platform",
"version": "7.0.0",
"healthCheckPath": "/health/",
"httpPort": 8080,
"memoryLimit": 1024,
"addons": {
"localstorage": true,
"postgresql": {
"version": "14"
}
},
"tcpPorts": {
"HTTP_PORT": {
"description": "Review Board HTTP port",
"defaultValue": 8080
}
},
"mediaLinks": [
"https://raw.githubusercontent.com/reviewboard/reviewboard/master/reviewboard/static/rb/images/icons@2x.png"
],
"changelog": "Initial Cloudron package for Review Board",
"icon": "file://logo.png"
}

View File

@@ -0,0 +1,10 @@
FROM beanbag/reviewboard:7.0
# Cloudron: Create site directory
RUN mkdir -p /site/media/uploaded
# Copy start script (already executable from host)
COPY start.sh /app/start.sh
# Start Review Board
CMD ["/app/start.sh"]

View File

@@ -0,0 +1,330 @@
# Review Board Cloudron Package
## Description
Review Board is a web-based code and document review tool. It tracks pending code, graphics, documents, and all discussions around decisions made about your product. It helps companies and organizations maintain code quality and keep bug counts low.
## Features
### Core Capabilities
- **Code Review**: Track pending code changes with diff viewer showing syntax highlighting, interdiffs, and moved line detection
- **Document Review**: Review documents, graphics, and other assets alongside code
- **Discussion Tracking**: All discussions around product decisions are tracked and searchable
- **Repository Integration**: Supports Bazaar, ClearCase, CVS, Git, Mercurial, Perforce, Plastic, and Azure DevOps
- **Rich API**: Build custom features, review UIs, data analysis, and more using the extension framework
- **Team Collaboration**: Manage multiple teams, projects, and review requests
- **Review UIs**: Custom review interfaces tailored to your workflows
- **User Authentication**: LDAP/Active Directory sync, OAuth, and traditional authentication
### Review Board Features
- **Diff Viewer**: Advanced diff display with syntax highlighting for many programming languages
- **Moved Line Detection**: Highlights lines that were added, removed, or changed
- **Commenting**: Rich commenting system with threaded discussions
- **Change Requests**: Formal review request workflow with assignees and reviewers
- **Status Tracking**: Track review status (pending, submitted, discarded, published)
- **Email Notifications**: Get notified on review updates and changes
- **Search**: Powerful search across reviews, comments, and discussions
- **Dashboard**: View all pending reviews in one place
## Configuration
### Environment Variables
#### Database (Automatically configured by Cloudron)
- `CLOUDRON_POSTGRESQL_HOST`: PostgreSQL host
- `CLOUDRON_POSTGRESQL_PORT`: PostgreSQL port
- `CLOUDRON_POSTGRESQL_DATABASE`: Database name
- `CLOUDRON_POSTGRESQL_USERNAME`: Database username
- `CLOUDRON_POSTGRESQL_PASSWORD`: Database password
#### Django Configuration
- `SECRET_KEY`: Django secret key (auto-generated, change in production)
- `ALLOWED_HOSTS`: Allowed hosts (default: `*`)
- `REVIEWBOARD_SITE_ROOT`: Site root URL (auto-configured)
#### Admin User
- `ADMIN_USERNAME`: Username for admin account
- `ADMIN_EMAIL`: Email address for admin account
- `ADMIN_PASSWORD`: Password for admin account
### Ports
- **8080**: Main HTTP port (web interface and API)
### Addons
- **PostgreSQL**: Required for database storage
- **Localstorage**: Used for media uploads and data
## Usage
### 1. Set Up Repositories
Via Web Interface:
1. Open Review Board
2. Go to "Admin" → "Repositories"
3. Click "Add Repository"
4. Configure:
- Repository type (Git, Mercurial, etc.)
- Repository URL
- Repository name
- Mirror configuration (if needed)
5. Click "Save"
Via API:
```bash
curl -X POST http://localhost:8080/api/repositories/ \
-H "Authorization: Token your-api-token" \
-H "Content-Type: application/json" \
-d '{
"name": "My Project",
"scm_type": "git",
"path": "https://github.com/myorg/myproject.git",
"mirror_path": "/path/to/mirror"
}'
```
### 2. Create Review Request
Via Web Interface:
1. Go to "All Review Requests"
2. Click "New Review Request"
3. Configure:
- Repository to review
- Base branch (e.g., main)
- Tip branch (e.g., feature/new-feature)
- Reviewers
- Description
4. Click "Create"
Via Git Hook:
```bash
# In your Git repository, configure post-commit hook
.git/hooks/post-commit
#!/bin/bash
# Review Board URL
RB_URL="http://your-app.cloudron.app"
# Create review request on commit
curl -X POST "$RB_URL/api/review-requests/" \
-H "Authorization: Token your-api-token" \
-H "Content-Type: application/json" \
-d "{
\"repository\": \"your-repo\",
\"commit_id\": \"$(git rev-parse HEAD)\",
\"branch\": \"$(git rev-parse --abbrev-ref HEAD)\",
\"description\": \"Automated review request\"
}"
```
### 3. Review Code Changes
Via Web Interface:
1. Open review request
2. View diff with syntax highlighting
3. Click lines to add comments
4. Use "Reply" for threaded discussions
5. Click "Ship It!" to approve changes
6. Or click "Discard" to reject
### 4. Use Power Pack (Extension)
Power Pack adds:
- **Report Generation**: Create formatted reports of reviews
- **PDF and Office Document Review**: Review PDF and Office files
- **Better Multi-Server Scalability**: Handle more concurrent users
- **GitHub Enterprise Integration**: Direct connection to GitHub Enterprise
- **LDAP/Active Directory User Sync**: Sync users from directory services
To enable Power Pack:
1. Get trial license from RBCommons
2. Install license via Admin panel
3. Restart Review Board
### 5. Configure Teams and Projects
**Create Team:**
1. Go to "Admin" → "Teams"
2. Click "Add Team"
3. Configure team name and description
4. Add users to team
**Create Project:**
1. Go to "Admin" → "Projects"
2. Click "Add Project"
3. Configure project settings
4. Assign repository to project
5. Assign team to project
### 6. Set Up Email Notifications
1. Go to "My Account" → "Email Settings"
2. Configure SMTP settings
3. Set notification preferences
4. Test email configuration
## Integration Examples
### GitHub Integration
```python
# Using Review Board Python API
from reviewboardapi import ReviewBoardAdmin
rb = ReviewBoardAdmin('http://your-app.cloudron.app', username='admin', password='password')
# Create review request for GitHub PR
review_request = rb.repositories.create(
name='my-repo',
scm_type='git',
path='https://github.com/myorg/myproject.git'
)
request = rb.review_requests.create(
repository=review_request,
branch='feature/new-feature',
commit_id='abc123def456',
description='Automated review from GitHub'
)
```
### GitLab Integration
```bash
# GitLab CI job to create Review Board requests
curl -X POST http://localhost:8080/api/review-requests/ \
-H "Authorization: Token $RB_TOKEN" \
-H "Content-Type: application/json" \
-d "{
\"repository\": \"$CI_PROJECT_PATH\",
\"commit_id\": \"$CI_COMMIT_SHA\",
\"branch\": \"$CI_COMMIT_REF_NAME\",
\"description\": \"Review request from GitLab CI\"
}"
```
### Mercurial Integration
```bash
# Mercurial hook for Review Board
.hg/hgrc
[hooks]
changegroup.post-reviewboard = python:/path/to/hg_reviewboard.py
```
### Perforce Integration
```bash
# Perforce trigger for Review Board
p4 change -o $CL | grep -q "^Change:" || exit
# Submit to Review Board on changelist submit
curl -X POST http://localhost:8080/api/review-requests/ \
-H "Authorization: Token $RB_TOKEN" \
-d @-
```
## Security
### Change Default Secret Key
The default secret key is auto-generated. **Change SECRET_KEY in production**:
```bash
# Generate new secret key
python -c 'from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())'
# Set SECRET_KEY environment variable
```
### Use LDAP/Active Directory
Configure LDAP for centralized authentication:
```bash
LDAP_SERVER=ldap://your-ldap-server.com
LDAP_BASE_DN=dc=example,dc=com
LDAP_UID=uid
LDAP_DN_TEMPLATE=uid=%(user)s,ou=users,dc=example,dc=com
LDAP_BIND_DN=cn=admin,dc=example,dc=com
LDAP_BIND_PASSWORD=your-ldap-password
```
### API Token Management
1. Create API tokens in Review Board admin panel
2. Assign tokens to users or services
3. Use tokens in API requests
4. Regularly rotate tokens for security
### Repository Access Control
Configure which users can access which repositories:
1. Go to "Admin" → "Repositories"
2. Edit repository settings
3. Configure access permissions
4. Use team-based access control
## Troubleshooting
### Review Requests Not Showing
1. Check repository mirror is up to date
2. Verify webhook configuration
3. Check Review Board logs: `docker logs <container>`
4. Test API connectivity
### Database Connection Errors
1. Verify PostgreSQL addon is active
2. Check database credentials in Cloudron environment
3. Review database configuration
4. Ensure PostgreSQL is running
### Performance Issues
1. Increase memory limit in Cloudron settings
2. Enable memcached for caching
3. Optimize repository mirror settings
4. Review database query performance
### Email Notifications Not Working
1. Verify SMTP configuration
2. Check email queue in admin panel
3. Test email settings
4. Review mail server logs
## Architecture
```
┌─────────────┐
│ Developer │
│ (Git) │
└──────┬──────┘
┌──────────────┐
│ Review Board │
│ (Django) │
│ Dashboard │
└──────┬──────┘
┌────────────┼────────────┐
│ │ │
▼ ▼ ▼
┌──────────┐ ┌──────────┐ ┌──────────┐
│ PostgreSQL│ │ Repository│ │ Email │
│ (Database)│ │ Mirror │ │ Service │
└──────────┘ └──────────┘ └──────────┘
```
## Documentation
For more information on using Review Board:
- [Official Website](https://www.reviewboard.org/)
- [User Manual](https://www.reviewboard.org/docs/manual/latest/users/)
- [Admin Manual](https://www.reviewboard.org/docs/manual/latest/admin/)
- [API Documentation](https://www.reviewboard.org/docs/manual/latest/webapi/2.0/)
- [Power Pack](https://www.reviewboard.org/power-pack/)
- [GitHub Repository](https://github.com/reviewboard/reviewboard)
- [Docker Images](https://hub.docker.com/r/reviewboard/reviewboard)
## Support
For issues and questions:
- [GitHub Issues](https://github.com/reviewboard/reviewboard/issues)
- [Community Forum](https://www.reviewboard.org/)
- [Mailing Lists](https://www.reviewboard.org/mailing-lists/)
- [Commercial Support](https://rbcommons.com/support)
## Upstream
[GitHub Repository](https://github.com/reviewboard/reviewboard)
[Official Website](https://www.reviewboard.org/)

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View File

@@ -0,0 +1,59 @@
#!/bin/bash
set -e
echo "Starting Review Board Cloudron package..."
# Database connection from Cloudron
DB_NAME=${CLOUDRON_POSTGRESQL_DATABASE:-reviewboard}
DB_USER=${CLOUDRON_POSTGRESQL_USERNAME:-reviewboard}
DB_PASSWORD=${CLOUDRON_POSTGRESQL_PASSWORD}
DB_HOST=${CLOUDRON_POSTGRESQL_HOST:-127.0.0.1}
DB_PORT=${CLOUDRON_POSTGRESQL_PORT:-5432}
echo "Database host: $DB_HOST"
echo "Database port: $DB_PORT"
echo "Database name: $DB_NAME"
# Wait for PostgreSQL to be ready
echo "Waiting for PostgreSQL to be ready..."
until PGPASSWORD=$DB_PASSWORD psql -h "$DB_HOST" -p "$DB_PORT" -U "$DB_USER" -d "$DB_NAME" -c '\q' 2>/dev/null; do
echo "PostgreSQL is unavailable - sleeping"
sleep 2
done
echo "PostgreSQL is ready!"
# Django configuration
export REVIEWBOARD_SITE_ROOT=${REVIEWBOARD_SITE_ROOT:-https://$CLOUDRON_APP_DOMAIN}
export DATABASE_TYPE=postgresql
export DATABASE_NAME=$DB_NAME
export DATABASE_USER=$DB_USER
export DATABASE_PASSWORD=$DB_PASSWORD
export DATABASE_HOST=$DB_HOST
export DATABASE_PORT=$DB_PORT
export MEMCACHED_SERVER=
export SECRET_KEY=${SECRET_KEY:-cloudron-secret-key-change-in-production}
export ALLOWED_HOSTS=${ALLOWED_HOSTS:-'*'}
# Site directory
export REVIEWBOARD_SITEDIR=/site
# Run database migrations
echo "Running Review Board database migrations..."
./manage.py migrate --noinput
# Collect static files
echo "Collecting static files..."
./manage.py collectstatic --noinput
# Create admin user if specified
if [ -n "$ADMIN_USERNAME" ] && [ -n "$ADMIN_PASSWORD" ] && [ -n "$ADMIN_EMAIL" ]; then
echo "Creating admin user..."
echo "from django.contrib.auth import get_user_model; from django.core.management import call_command; User = get_user_model(); User.objects.create_superuser('$ADMIN_USERNAME', '$ADMIN_EMAIL', '$ADMIN_PASSWORD') if not User.objects.filter(email='$ADMIN_EMAIL').exists() else None" | \
./manage.py shell 2>/dev/null || echo "Admin user may already exist"
fi
# Start Review Board
echo "Starting Review Board..."
exec ./serve.sh