Skip to content
Merged
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
30 changes: 27 additions & 3 deletions .docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,37 @@ ARG ROAD_RUNNER_IMAGE=2024.2.1
ARG CENTRIFUGO_IMAGE=v4
ARG DOLT_IMAGE=1.42.8
ARG FRONTEND_IMAGE_TAG=latest
ARG GH_TOKEN

# Build centrifugo binary
FROM centrifugo/centrifugo:$CENTRIFUGO_IMAGE as centrifugo
# Build dolt binary
FROM dolthub/dolt:$DOLT_IMAGE as dolt
# Build rr binary
FROM ghcr.io/roadrunner-server/roadrunner:$ROAD_RUNNER_IMAGE as rr
FROM ghcr.io/roadrunner-server/velox:2025.1.1 as velox
#FROM ghcr.io/roadrunner-server/roadrunner:$ROAD_RUNNER_IMAGE as rr

FROM golang:1.25-alpine as rr

ARG APP_VERSION="2025.1.1"
ARG VELOX_CONFIG="velox.toml"
ARG GH_TOKEN

# copy required files from builder image
COPY --from=velox /usr/bin/vx /usr/bin/vx
COPY ${VELOX_CONFIG} .

# we don't need CGO
ENV CGO_ENABLED=0
ENV RT_TOKEN=${GH_TOKEN}
ENV VELOX_CONFIG=${VELOX_CONFIG}
ARG CACHE_BUST=1

RUN echo $CACHE_BUST

# RUN build
RUN vx build -c ${VELOX_CONFIG} -o /usr/bin/

# Build JS files
FROM ghcr.io/buggregator/frontend:$FRONTEND_IMAGE_TAG as frontend
# Clone the project
Expand All @@ -23,7 +47,7 @@ FROM ghcr.io/buggregator/docker:latest as backend

COPY --from=git /app /app
COPY --from=frontend /app /app/frontend
COPY --from=rr /usr/bin/rr /app
COPY --from=rr /usr/bin/rr /usr/bin/rr
COPY --from=centrifugo /usr/local/bin/centrifugo /app/bin
COPY --from=dolt /usr/local/bin/dolt /app/bin

Expand Down Expand Up @@ -65,4 +89,4 @@ LABEL org.opencontainers.image.source=$REPOSITORY
LABEL org.opencontainers.image.description="Buggregator"
LABEL org.opencontainers.image.licenses=MIT

CMD ./rr serve -c .rr-prod.yaml
CMD /usr/bin/rr serve -c .rr-prod.yaml -w /app
96 changes: 96 additions & 0 deletions .docker/velox.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
[roadrunner]
ref = "v2025.1.1"

[log]
level = "info"
mode = "production"

[github]
[github.token]
token = "${GH_TOKEN}"

[github.plugins]
[github.plugins.logger]
ref = "v5.1.8"
owner = "roadrunner-server"
repository = "logger"

[github.plugins.server]
ref = "v5.2.9"
owner = "roadrunner-server"
repository = "server"

[github.plugins.rpc]
ref = "v5.1.8"
owner = "roadrunner-server"
repository = "rpc"

[github.plugins.service]
ref = "v5.1.8"
owner = "roadrunner-server"
repository = "service"

[github.plugins.lock]
ref = "v5.1.8"
owner = "roadrunner-server"
repository = "lock"

[github.plugins.http]
ref = "v5.2.7"
owner = "roadrunner-server"
repository = "http"

[github.plugins.gzip]
ref = "v5.1.8"
owner = "roadrunner-server"
repository = "gzip"

[github.plugins.headers]
ref = "v5.1.8"
owner = "roadrunner-server"
repository = "headers"

[github.plugins.jobs]
ref = "v5.1.8"
owner = "roadrunner-server"
repository = "jobs"

[github.plugins.kv]
ref = "v5.2.8"
owner = "roadrunner-server"
repository = "kv"

[github.plugins.memory]
ref = "v5.2.8"
owner = "roadrunner-server"
repository = "memory"

[github.plugins.metrics]
ref = "v5.1.8"
owner = "roadrunner-server"
repository = "metrics"

[github.plugins.status]
ref = "v5.1.8"
owner = "roadrunner-server"
repository = "status"

[github.plugins.appLogger]
ref = "v5.1.8"
owner = "roadrunner-server"
repository = "app-logger"

[github.plugins.centrifuge]
ref = "v5.1.8"
owner = "roadrunner-server"
repository = "centrifuge"

[github.plugins.tcp]
ref = "v5.0.0"
owner = "roadrunner-server"
repository = "tcp"

[github.plugins.smtp-server]
ref = "2.0.0"
owner = "buggregator"
repository = "smtp-server"
1 change: 1 addition & 0 deletions .github/workflows/docker-dev-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@ jobs:
APP_VERSION=${{ steps.previoustag.outputs.tag }}
FRONTEND_IMAGE_TAG=latest
BRANCH=${{ steps.previoustag.outputs.tag }}
GH_TOKEN=${{ secrets.GHCR_PASSWORD }}
tags:
ghcr.io/${{ github.repository }}:dev, ghcr.io/${{ github.repository }}:${{ steps.previoustag.outputs.tag }}
1 change: 1 addition & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ jobs:
APP_VERSION=${{ github.ref_name }}
FRONTEND_IMAGE_TAG=${{ secrets.FRONTEND_IMAGE_TAG }}
BRANCH=${{ github.ref_name }}
GH_TOKEN=${{ secrets.GHCR_PASSWORD }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
cache-from: type=gha
Expand Down
22 changes: 16 additions & 6 deletions .rr-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ logs:
level: ${RR_LOG_TCP_LEVEL:-warn}
jobs:
# JOBS plugin logging level can be "panic", "error", "warn", "info", "debug".
level: ${RR_LOG_TCP_LEVEL:-warn}
level: ${RR_LOG_JOBS_LEVEL:-warn}
centrifuge:
# Centrifuge plugin logging level can be "panic", "error", "warn", "info", "debug".
level: ${RR_LOG_CENTRIFUGE_LEVEL:-warn}
Expand Down Expand Up @@ -64,9 +64,6 @@ tcp:
# Address to listen.
addr: ${RR_TCP_VAR_DUMPER_ADDR:-:9912}
delimiter: "\n"
smtp:
# Address to listen.
addr: ${RR_TCP_SMTP_ADDR:-:1025}
# Chunks that RR uses to read the data. In bytes.
# If you expect big payloads on a TCP server, to reduce `read` syscalls,
# would be a good practice to use a fairly big enough buffer.
Expand All @@ -81,10 +78,23 @@ kv:
config: { }

jobs:
consume: [ ]
consume:
- smtp
pipelines:
smtp:
driver: memory
config:
priority: 10
prefetch: 10
pool:
num_workers: ${RR_JOBS_NUM_WORKERS:-1}

smtp:
addr: ${RR_SMTP_ADDR:-:1025}
hostname: "buggregator.local"
jobs:
pipeline: smtp

service:
nginx:
service_name_in_log: true
Expand All @@ -106,4 +116,4 @@ centrifuge:
proxy_address: ${RR_CENTRIFUGE_PROXY_ADDRESS}
grpc_api_address: ${RR_CENTRIFUGE_GRPC_API_ADDRESS}
pool:
num_workers: ${RR_CENTRIFUGE_NUM_WORKERS:-2}
num_workers: ${RR_CENTRIFUGE_NUM_WORKERS:-2}
8 changes: 8 additions & 0 deletions .rr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ jobs:
pool:
num_workers: 1


smtp:
addr: ${RR_SMTP_ADDR:-:1025}
hostname: "buggregator.local"
include_raw: true
jobs:
pipeline: "smtp"

service:
centrifuge:
service_name_in_log: true
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ See the [documentation](https://docs.buggregator.dev/) for detailed installati
We enthusiastically invite you to contribute to Buggregator Server! Whether you've uncovered a bug, have innovative feature suggestions, or wish to contribute in any other capacity, we warmly welcome your participation. Simply open an issue or submit a pull request on our GitHub repository to get started.

> **Note**
> Read more how to contribute [here](https://docs.buggregator.dev/contributing/architecture.html)
> Read more how to contribute [here](https://docs.buggregator.dev/contributing.html)

---

Expand Down
5 changes: 4 additions & 1 deletion app/config/queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

declare(strict_types=1);

use Modules\Smtp\Interfaces\Jobs\EmailHandler;
use Modules\Webhooks\Interfaces\Job\WebhookHandler;
use Spiral\Queue\Driver\SyncDriver;
use Spiral\RoadRunner\Jobs\Queue\MemoryCreateInfo;
Expand Down Expand Up @@ -36,7 +37,9 @@
'roadrunner' => Queue::class,
],
'registry' => [
'handlers' => [],
'handlers' => [
'smtp.email' => EmailHandler::class,
],
'serializers' => [
WebhookHandler::class => 'symfony-json',
],
Expand Down
2 changes: 0 additions & 2 deletions app/config/tcp.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
use App\Application\TCP\ExceptionHandlerInterceptor;
use Modules\VarDumper\Interfaces\TCP\Service as VarDumperService;
use Modules\Monolog\Interfaces\TCP\Service as MonologService;
use Modules\Smtp\Interfaces\TCP\Service as SmtpService;

return [
'services' => [
'var-dumper' => VarDumperService::class,
'monolog' => MonologService::class,
'smtp' => SmtpService::class,
],

'interceptors' => [
Expand Down
108 changes: 0 additions & 108 deletions app/modules/Smtp/Application/Mail/Parser.php

This file was deleted.

Loading
Loading