Skip to content

Check if an email address exists without sending any email, written in Rust. Comes with a ⚙️ HTTP backend.

fix: Support queues in env var

Amaury39655d51afe5
diff --git a/backend/backend_config.toml b/backend/backend_config.toml
index ee794ace..f009a5ac 100644
--- a/backend/backend_config.toml
+++ b/backend/backend_config.toml
@@ -110,7 +110,7 @@ url = "amqp://guest:guest@localhost:5672"
#
# Env variable: RCH__WORKER__RABBITMQ__QUEUES
#
-# queues = ["check.gmail", "check.hotmail.b2b", "check.hotmail.b2c", "check.yahoo", "check.everything_else"]
+# queues = ["check.gmail", "check.hotmailb2b", "check.hotmailb2c", "check.yahoo", "check.everything_else"]
queues = "all"
# Number of concurrent emails to verify for this worker across all queues.
diff --git a/backend/src/config.rs b/backend/src/config.rs
index 4afdc103..4c4e1f8c 100644
--- a/backend/src/config.rs
+++ b/backend/src/config.rs
@@ -366,7 +366,12 @@ impl ThrottleConfig {
pub async fn load_config() -> Result<BackendConfig, anyhow::Error> {
let cfg = Config::builder()
.add_source(config::File::with_name("backend_config"))
- .add_source(config::Environment::with_prefix("RCH").separator("__"))
+ .add_source(
+ config::Environment::with_prefix("RCH")
+ .separator("__")
+ .try_parsing(true)
+ .list_separator(","),
+ )
.build()?;
let mut cfg = cfg.try_deserialize::<BackendConfig>()?;
diff --git a/docker-compose.local.yaml b/docker-compose.local.yaml
index af695d89..47e5abbc 100644
--- a/docker-compose.local.yaml
+++ b/docker-compose.local.yaml
@@ -27,18 +27,18 @@ services:
- ./backend/postgres_data:/var/lib/postgresql/data
restart: always
- worker1:
+ worker_smtp:
build:
context: .
dockerfile: backend/Dockerfile
- container_name: worker1
+ container_name: worker_smtp
ports:
- "8080:8080"
depends_on:
- postgres
- rabbitmq
environment:
- RCH__BACKEND_NAME: worker1
+ RCH__BACKEND_NAME: worker_smtp
RUST_LOG: reacher=info
RCH__HTTP_HOST: 0.0.0.0
RCH__WORKER__ENABLE: true
@@ -46,18 +46,18 @@ services:
RCH__WORKER__POSTGRES__DB_URL: postgres://postgres:postgres@postgres:5432/reacher_db
restart: always
- worker2:
+ worker_headless:
build:
context: .
dockerfile: backend/Dockerfile
- container_name: worker2
+ container_name: worker_headless
ports:
- "8081:8080"
depends_on:
- postgres
- rabbitmq
environment:
- RCH__BACKEND_NAME: worker2
+ RCH__BACKEND_NAME: worker_headless
RUST_LOG: reacher=info
RCH__HTTP_HOST: 0.0.0.0
RCH__WORKER__ENABLE: true
diff --git a/docker-compose.yaml b/docker-compose.yaml
index 31099923..fe207e6c 100644
--- a/docker-compose.yaml
+++ b/docker-compose.yaml
@@ -23,38 +23,40 @@ services:
POSTGRES_DB: reacher_db
restart: always
- worker1:
+ worker_smtp:
image: reacherhq/backend:beta
- container_name: worker1
+ container_name: worker_smtp
ports:
- "8080:8080"
depends_on:
- postgres
- rabbitmq
environment:
- RCH__BACKEND_NAME: worker1
+ RCH__BACKEND_NAME: worker_smtp
RUST_LOG: reacher=info
RCH__HTTP_HOST: 0.0.0.0
RCH__WORKER__ENABLE: true
RCH__WORKER__RABBITMQ__URL: amqp://guest:guest@rabbitmq:5672
+ RCH__WORKER__RABBITMQ__QUEUES: check.gmail,check.hotmailb2b,check.everything_else
RCH__WORKER__POSTGRES__DB_URL: postgres://postgres:postgres@postgres:5432/reacher_db
- RCH__WORKER__THROTTLE__MAX_REQUESTS_PER_DAY: 10000 # Recommended limit per IP per day
+ RCH__WORKER__THROTTLE__MAX_REQUESTS_PER_DAY: 10000 # Recommended limit per IP per day for SMTP requests
restart: always
- worker2:
+ worker_headless:
image: reacherhq/backend:beta
- container_name: worker2
+ container_name: worker_headless
ports:
- "8081:8080"
depends_on:
- postgres
- rabbitmq
environment:
- RCH__BACKEND_NAME: worker2
+ RCH__BACKEND_NAME: worker_headless
RUST_LOG: reacher=info
RCH__HTTP_HOST: 0.0.0.0
RCH__WORKER__ENABLE: true
RCH__WORKER__RABBITMQ__URL: amqp://guest:guest@rabbitmq:5672
+ RCH__WORKER__RABBITMQ__QUEUES: check.hotmailb2c,check.yahoo
RCH__WORKER__POSTGRES__DB_URL: postgres://postgres:postgres@postgres:5432/reacher_db
- RCH__WORKER__THROTTLE__MAX_REQUESTS_PER_DAY: 10000 # Recommended limit per IP per day
+ RCH__WORKER__THROTTLE__MAX_REQUESTS_PER_MINUTE: 100 # Recommended limit for headless verifications
restart: always