Skip to content

Commit cac597e

Browse files
committed
New sections:
1. RoadRunner envs configuration 2. Start dev env using docker 3. Start manual dev env
1 parent 9a40b33 commit cac597e

File tree

5 files changed

+191
-22
lines changed

5 files changed

+191
-22
lines changed

β€Ždocs/.vitepress/config.mts

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineConfig } from 'vitepress'
1+
import {defineConfig} from 'vitepress'
22

33
// https://vitepress.dev/reference/site-config
44
export default defineConfig({
@@ -12,7 +12,7 @@ export default defineConfig({
1212
},
1313

1414
nav: [
15-
{ text: 'Docs', link: '/' },
15+
{text: 'Docs', link: '/'},
1616
],
1717

1818
sidebar: [
@@ -42,32 +42,34 @@ export default defineConfig({
4242
{
4343
text: 'Integrations',
4444
items: [
45-
{ text: 'XHProf', link: '/config/xhprof' },
46-
{ text: 'VarDumper', link: '/config/var-dumper' },
47-
{ text: 'Ray', link: '/config/ray' },
48-
{ text: 'Sentry', link: '/config/sentry' },
49-
{ text: 'SMTP server', link: '/config/smtp' },
50-
{ text: 'Monolog', link: '/config/monolog' },
51-
{ text: 'Inspector', link: '/config/inspector' },
52-
{ text: 'Http Dumps', link: '/config/http-dumps' },
45+
{text: 'XHProf', link: '/config/xhprof'},
46+
{text: 'VarDumper', link: '/config/var-dumper'},
47+
{text: 'Ray', link: '/config/ray'},
48+
{text: 'Sentry', link: '/config/sentry'},
49+
{text: 'SMTP server', link: '/config/smtp'},
50+
{text: 'Monolog', link: '/config/monolog'},
51+
{text: 'Inspector', link: '/config/inspector'},
52+
{text: 'Http Dumps', link: '/config/http-dumps'},
5353
]
5454
},
5555

5656
{
5757
text: 'Configuration',
5858
items: [
59-
{ text: 'Projects', link: '/config/projects' },
60-
{ text: 'Webhooks', link: '/config/webhooks' },
61-
{ text: 'Single Sign On (SSO)', link: '/config/sso' },
62-
{ text: 'External Database', link: '/config/external-db' },
63-
{ text: 'Metrics', link: '/config/metrics' },
59+
{text: 'RoadRunner', link: '/config/roadrunner'},
60+
{text: 'Projects', link: '/config/projects'},
61+
{text: 'Webhooks', link: '/config/webhooks'},
62+
{text: 'Single Sign On (SSO)', link: '/config/sso'},
63+
{text: 'External Database', link: '/config/external-db'},
64+
{text: 'Metrics', link: '/config/metrics'},
6465
]
6566
},
6667

6768
{
6869
text: 'Cookbook',
6970
items: [
70-
{ text: 'Dev environment', link: '/cookbook/dev-env' }
71+
{text: 'Dev environment using docker', link: '/cookbook/docker-install'},
72+
{text: 'Dev environment', link: '/cookbook/manual-install'},
7173
]
7274
},
7375

@@ -95,9 +97,9 @@ export default defineConfig({
9597
],
9698

9799
socialLinks: [
98-
{ icon: 'github', link: 'https://github.com/buggregator/server' },
99-
{ icon: 'discord', link: 'https://discord.gg/vDsCD3EKUB' },
100-
{ icon: 'twitter', link: 'https://twitter.com/buggregator' },
100+
{icon: 'github', link: 'https://github.com/buggregator/server'},
101+
{icon: 'discord', link: 'https://discord.gg/vDsCD3EKUB'},
102+
{icon: 'twitter', link: 'https://twitter.com/buggregator'},
101103
]
102104
}
103105
})

β€Ždocs/config/roadrunner.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Configuration β€” RoadRunner
2+
3+
The **Buggregator server** uses the **RoadRunner application server** to handle HTTP and TCP requests efficiently.
4+
RoadRunner is a high-performance server written in Go, designed for PHP applications. In some cases, you might want to
5+
customize its configuration to suit your needs, such as:
6+
7+
- Restricting **CORS rules** for security.
8+
- Increasing **TCP buffer size** for better performance.
9+
- Adjusting **logging settings** for different environments (e.g., development or production).
10+
11+
This guide explains how to configure the Buggregator server using RoadRunner's **environment variables**.
12+
13+
---
14+
15+
### Available ENV Variables
16+
17+
| **Variable Name** | **Description** | **Default Value** |
18+
|----------------------------------|-----------------------------------------------------------------------------------------------------------|--------------------|
19+
| `RR_LOG_MODE` | Logging mode: `development`, `production`, or `raw`. | `production` |
20+
| `RR_LOG_ENCODING` | Log encoding format: `console` or `json`. Recommended `json` for production. | `json` |
21+
| `RR_LOG_LEVEL` | Global logging level: `panic`, `error`, `warn`, `info`, `debug`. | `warn` |
22+
| `RR_LOG_HTTP_LEVEL` | Logging level for HTTP plugin: `panic`, `error`, `warn`, `info`, `debug`. | `warn` |
23+
| `RR_LOG_TCP_LEVEL` | Logging level for TCP plugin: `panic`, `error`, `warn`, `info`, `debug`. | `warn` |
24+
| `RR_LOG_CENTRIFUGE_LEVEL` | Logging level for Centrifuge plugin: `panic`, `error`, `warn`, `info`, `debug`. | `warn` |
25+
| `RR_LOG_SERVER_LEVEL` | Logging level for the server: `panic`, `error`, `warn`, `info`, `debug`. | `warn` |
26+
| `RR_LOG_SERVICE_LEVEL` | Logging level for services: `panic`, `error`, `warn`, `info`, `debug`. | `warn` |
27+
| `RR_HTTP_ALLOWED_ORIGIN` | Allowed origins for CORS. Typically set to specific domains or `*` for all. | `*` |
28+
| `RR_HTTP_ALLOWED_HEADERS` | Allowed headers for CORS. Set `*` for all or specify headers. | `*` |
29+
| `RR_HTTP_ALLOW_CREDENTIALS` | Whether CORS credentials (cookies, authorization) are allowed. | `true` |
30+
| `RR_HTTP_NUM_WORKERS` | Number of workers in the HTTP pool. Determines concurrency for HTTP handling. | (Unset by default) |
31+
| `RR_TCP_MONOLOG_ADDR` | Address for the Monolog TCP server. | `:9913` |
32+
| `RR_TCP_VAR_DUMPER_ADDR` | Address for the Var-Dumper TCP server. | `:9912` |
33+
| `RR_TCP_SMTP_ADDR` | Address for the SMTP TCP server. | `:1025` |
34+
| `RR_TCP_READ_BUF_SIZE` | Buffer size for TCP data reading (in bytes). Higher values reduce `read` system calls for large payloads. | `50485760` (50MB) |
35+
| `RR_TCP_NUM_WORKERS` | Number of workers in the TCP pool. Determines concurrency for TCP handling. | (Unset by default) |
36+
| `RR_CENTRIFUGE_PROXY_ADDRESS` | Proxy address for Centrifuge plugin. | (Unset by default) |
37+
| `RR_CENTRIFUGE_GRPC_API_ADDRESS` | gRPC API address for Centrifuge plugin. | (Unset by default) |
38+
| `RR_CENTRIFUGE_NUM_WORKERS` | Number of workers in the Centrifuge poll. | (Unset by default) |
39+
40+
---
41+
42+
### Example: Using ENV Variables in Docker Compose
43+
44+
To configure RoadRunner through environment variables in `docker-compose.yml`, use the following example:
45+
46+
```yaml
47+
version: '3.9'
48+
49+
services:
50+
buggregator:
51+
image: ghcr.io/buggregator/server:latest
52+
environment:
53+
RR_LOG_MODE: json # Set logging mode to JSON
54+
RR_HTTP_NUM_WORKERS: 4 # Configure the number of HTTP workers
55+
RR_TCP_READ_BUF_SIZE: 10485760 # Set TCP read buffer size to 10MB
56+
RR_HTTP_ALLOWED_ORIGIN: "https://example.com" # Restrict allowed CORS origins
57+
```
58+
59+
### Example: Using ENV Variables with `docker run`
60+
61+
You can also pass environment variables directly when running a Docker container:
62+
63+
```bash
64+
docker run --pull always \
65+
-e RR_LOG_MODE=json \ # Set logging mode to JSON
66+
-e RR_HTTP_NUM_WORKERS=4 \ # Configure the number of HTTP workers
67+
-e RR_TCP_READ_BUF_SIZE=10485760 \ # Set TCP read buffer size to 10MB
68+
-e RR_HTTP_ALLOWED_ORIGIN="https://example.com" \ # Restrict allowed CORS origins
69+
ghcr.io/buggregator/server:latest
70+
```

β€Ždocs/contributing/server.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,8 @@ and Doltdb.
2424

2525
## Installation
2626

27-
To set up environment for local development read the [development environment setup guide](../cookbook/dev-env.md).
27+
Here are two ways to install the server:
28+
29+
1. **Docker:** The easiest way to get started is by using Docker. To set up environment for local development read
30+
the [development environment setup guide](../cookbook/docker-install).
31+
2. **Manual:** If you prefer to install the server manually, follow the [manual installation guide](../cookbook/manual-install.md).

β€Ždocs/cookbook/docker-install.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Cookbook β€” Dev environment using docker compose
2+
3+
Hey, developer! πŸŽ‰ This guide will help you quickly set up a local dev environment for Buggregator.
4+
5+
## 1. Clone the Repository
6+
7+
Start by cloning the repository:
8+
9+
```bash
10+
git clone [email protected]:buggregator/server.git
11+
cd server
12+
```
13+
14+
> **Note:** If you don't have access, fork the repository and clone your fork instead.
15+
16+
## 2. Install Dependencies
17+
18+
Run the following to install PHP dependencies:
19+
20+
```bash
21+
composer install
22+
```
23+
24+
## 3. Build and Start the Docker Environment
25+
26+
The repository includes a Docker Compose setup for a local development environment, including the Buggregator server,
27+
PostgreSQL, and service with examples.
28+
29+
### Build Docker Images
30+
31+
```bash
32+
make build
33+
```
34+
35+
### Start the Server
36+
37+
```bash
38+
make up
39+
```
40+
41+
> **Note:** Make sure you have make installed on your system. If not, you need to install it first.
42+
43+
This will:
44+
45+
- Start the Buggregator server.
46+
- Spin up a PostgreSQL database.
47+
- Launch the example server for testing features.
48+
49+
#### Mounted Directories in Docker Setup
50+
51+
The Docker Compose setup uses **mounted directories** to ensure that changes made to your local files are immediately
52+
reflected inside the running containers. This makes development faster and more seamless.
53+
54+
1. **Application Code**
55+
Local directory: `./app`
56+
Mounted in the container: `/app/app`
57+
58+
2. **Runtime Files**
59+
Local directory: `./runtime`
60+
Mounted in the container: `/app/runtime`
61+
62+
3. **Vendor Directory**
63+
Local directory: `./vendor`
64+
Mounted in the container: `/app/vendor`
65+
66+
## 4. Access the Application
67+
68+
Once the server is up, you can access the following:
69+
70+
- **Buggregator:** [http://buggregator.localhost](http://buggregator.localhost)
71+
- **Examples:** [http://examples.buggregator.localhost](http://examples.buggregator.localhost)
72+
73+
## 5. Environment Configuration (Optional)
74+
75+
The default `.env` file is pre-configured, but you can customize it if needed:
76+
77+
```bash
78+
cp .env.sample .env
79+
```
80+
81+
## 6. Stop the Server
82+
83+
To stop the server and clean up, run:
84+
85+
```bash
86+
make down
87+
```
88+
89+
> **Note:** If any services like PostgreSQL don't stop, you can manually kill them with `docker ps` and `docker kill`.
90+
91+
---
92+
93+
That's it! πŸš€ Your Buggregator dev environment is ready. Happy coding! 😊

β€Ždocs/cookbook/dev-env.md renamed to β€Ždocs/cookbook/manual-install.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Cookbook β€” Dev environment
1+
# Cookbook β€” Manual install dev environment
22

3-
Hello contributors! This cookbook will guide you through setting up your development environment for Buggregator.
3+
Hey, developer! πŸŽ‰ This guide will help you quickly set up a local dev environment for Buggregator.
44

55
## Clone the Repository
66

0 commit comments

Comments
Β (0)