-
Notifications
You must be signed in to change notification settings - Fork 351
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Remove ReacherConfig, use CheckEmailInput (#1538)
* feat: Remove ReacherConfig, use CheckEmailInput * Fixed * Fix request * fix build * fic docs * test * remove test
- Loading branch information
1 parent
f2e6c2f
commit f75e0c4
Showing
21 changed files
with
183 additions
and
230 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,12 +24,17 @@ from_email = "[email protected]" | |
# Address of the Chrome WebDriver server for headless email verifications. | ||
webdriver_addr = "http://localhost:9515" | ||
|
||
# Timeout for each SMTP connection, in seconds. Leaving it commented out will | ||
# not set a timeout, i.e. the connection will wait indefinitely. | ||
# smtp_timeout = 45 | ||
|
||
# Uncomment the following lines to route all SMTP verification requests through | ||
# a specified proxy. Note that the proxy must be a SOCKS5 proxy to work with | ||
# the SMTP protocol. This proxy will not be used for headless verifications. | ||
# | ||
# The username and password are optional and only needed if the proxy requires | ||
# authentication. | ||
# | ||
# [proxy] | ||
# host = "my.proxy.com" | ||
# port = 1080 | ||
|
@@ -52,22 +57,9 @@ hotmailb2c = "headless" | |
yahoo = "headless" | ||
|
||
[worker] | ||
enable = false | ||
|
||
# Fields below are only used if the worker is enabled. | ||
|
||
# Throttle the maximum number of requests per second, per minute, per hour, and | ||
# per day for this worker. | ||
# All fields are optional; comment them out to disable the limit. | ||
# | ||
# Important: these throttle configurations only apply to bulk verification and | ||
# not to the single /v0/check_email endpoint. The latter endpoint always | ||
# executes the verification immediately, regardless of the throttle settings. | ||
[worker.throttle] | ||
# max_requests_per_second = 20 | ||
# max_requests_per_minute = 100 | ||
# max_requests_per_hour = 1000 | ||
# max_requests_per_day = 20000 | ||
# Enable the worker to consume emails from the RabbitMQ queues. If set, the | ||
# RabbitMQ configuration below must be set as well. | ||
enable = true | ||
|
||
# RabbitMQ configuration. | ||
[worker.rabbitmq] | ||
|
@@ -92,13 +84,27 @@ queues = "all" | |
# Number of concurrent emails to verify for this worker across all queues. | ||
concurrency = 20 | ||
|
||
# Throttle the maximum number of requests per second, per minute, per hour, and | ||
# per day for this worker. | ||
# All fields are optional; comment them out to disable the limit. | ||
# | ||
# Important: these throttle configurations only apply to /v1/* endpoints, and | ||
# not to the previous /v0/check_email endpoint. The latter endpoint always | ||
# executes the verification immediately, regardless of the throttle settings. | ||
[worker.throttle] | ||
# max_requests_per_second = 20 | ||
# max_requests_per_minute = 100 | ||
# max_requests_per_hour = 1000 | ||
# max_requests_per_day = 20000 | ||
|
||
# Postgres configuration. Currently, a Postgres database is required to store | ||
# the results of the verifications. This might change in the future, allowing | ||
# for pluggable storage. | ||
[worker.postgres] | ||
db_url = "postgresql://localhost/reacherdb" | ||
|
||
# Optional webhook URL to send the results to. This will send one POST request | ||
# per email verification, with the result in the body. | ||
# [worker.webhook.on_each_email] | ||
# url = "http://localhost:8080/webhook" | ||
# Optional Sentry configuration. If set, all errors will be sent to Sentry. | ||
# [sentry] | ||
# dsn = "<PASTE_YOUR_DSN_NOW>" | ||
# Identifier sent to Sentry, usually the same as the the top-level backend_name. | ||
# backend_name = "backend-dev" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,27 +9,27 @@ set -e | |
|
||
# You can change the default values of these variables inline here, or by | ||
# setting them in the environment before running this script, e.g.: | ||
# RCH_BACKEND_NAME="my-own-name" ./debian11.sh | ||
# RCH__BACKEND_NAME="my-own-name" ./debian11.sh | ||
|
||
# An unique identifier for the backend. | ||
RCH_BACKEND_NAME=${RCH_BACKEND_NAME:-"backend1.mycompany.com"} | ||
RCH__BACKEND_NAME=${RCH__BACKEND_NAME:-"backend1.mycompany.com"} | ||
# Docker Hub tag for reacherhq/backend. | ||
RCH_VERSION=${RCH_VERSION:-"v0.7.0"} | ||
RCH_VERSION=${RCH_VERSION:-"v0.10.0-beta.1"} | ||
# Optional: Send bug reports to a Sentry.io dashboard. | ||
RCH_SENTRY_DSN=${RCH_SENTRY_DSN:-} | ||
RCH__SENTRY_DSN=${RCH__SENTRY_DSN:-} | ||
# Protect the backend from the public via a `x-reacher-secret` header. | ||
RCH_HEADER_SECRET=${RCH_HEADER_SECRET:-} | ||
RCH__HEADER_SECRET=${RCH__HEADER_SECRET:-} | ||
# For the "FROM" field in emails. | ||
RCH_FROM_EMAIL=${RCH_FROM_EMAIL:-"[email protected]"} | ||
RCH__FROM_EMAIL=${RCH__FROM_EMAIL:-"[email protected]"} | ||
# For the "EHLO" field in emails. This should ideally match the server's | ||
# reverse DNS entry for optimal results. | ||
RCH_HELLO_NAME=${RCH_HELLO_NAME:-"backend1.mycompany.com"} | ||
RCH__HELLO_NAME=${RCH__HELLO_NAME:-"backend1.mycompany.com"} | ||
# Timeout for SMTP connections in seconds. | ||
RCH_SMTP_TIMEOUT=${RCH_SMTP_TIMEOUT:-"90"} | ||
RCH__SMTP_TIMEOUT=${RCH__SMTP_TIMEOUT:-"90"} | ||
# Logging. Setup to "debug" to show all logs. | ||
RUST_LOG=${RUST_LOG:-"info"} | ||
|
||
echo "Installing Reacher backend $RCH_VERSION on host $RCH_BACKEND_NAME..." | ||
echo "Installing Reacher backend $RCH_VERSION on host $RCH__BACKEND_NAME..." | ||
|
||
# Install Docker | ||
# https://docs.docker.com/engine/install/debian/ | ||
|
@@ -64,12 +64,12 @@ docker rm reacher_backend | |
# Run the backend | ||
docker run -d \ | ||
-e RUST_LOG=$RUST_LOG \ | ||
-e RCH_BACKEND_NAME=$RCH_BACKEND_NAME \ | ||
-e RCH_SENTRY_DSN=$RCH_SENTRY_DSN \ | ||
-e RCH_HEADER_SECRET=$RCH_HEADER_SECRET \ | ||
-e RCH_FROM_EMAIL=$RCH_FROM_EMAIL \ | ||
-e RCH_HELLO_NAME=$RCH_HELLO_NAME \ | ||
-e RCH_SMTP_TIMEOUT=$RCH_SMTP_TIMEOUT \ | ||
-e RCH__BACKEND_NAME=$RCH__BACKEND_NAME \ | ||
-e RCH__SENTRY_DSN=$RCH__SENTRY_DSN \ | ||
-e RCH__HEADER_SECRET=$RCH__HEADER_SECRET \ | ||
-e RCH__FROM_EMAIL=$RCH__FROM_EMAIL \ | ||
-e RCH__HELLO_NAME=$RCH__HELLO_NAME \ | ||
-e RCH__SMTP_TIMEOUT=$RCH__SMTP_TIMEOUT \ | ||
-p 80:8080 \ | ||
--name reacher_backend \ | ||
reacherhq/backend:$RCH_VERSION | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.