-
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.
- Loading branch information
1 parent
39655d5
commit 0325a16
Showing
16 changed files
with
339 additions
and
68 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Migrations | ||
|
||
* [migrating-from-0.7-to-0.10-beta.md](migrating-from-0.7-to-0.10-beta.md "mention") |
22 changes: 22 additions & 0 deletions
22
docs/advanced/migrations/migrating-from-0.7-to-0.10-beta.md
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Migrating from 0.7 to 0.10 (beta) | ||
|
||
{% hint style="info" %} | ||
v0.10 is currently still in `beta` phase. | ||
{% endhint %} | ||
|
||
Reacher v0.10 introduces the `/v1/*` endpoints, namely: | ||
|
||
* `/v1/check_email`: Performs a single email verification while respecting the optional throttle and concurrency settings set in [reacher-configuration-v0.10.md](reacher-configuration-v0.10.md "mention"). | ||
* `/v1/bulk`, `/v1/bulk/{job_id}`, `/v1/bulk/{job_id}/results`: Create a bulk verification job, and query its progress and status. Docs coming soon. | ||
|
||
The `/v0/check_email` endpoint **DOES NOT** change, neither in API nor in behavior. More specifically, even if you specify throttle and concurrency settings in the newly introduced Reacher Configuration, they will not be taken into account by the `/v0/check_email` endpoint, which will perform email verification as soon as it receives the request. | ||
|
||
## Environment Variables | ||
|
||
With the introduction of [reacher-configuration-v0.10.md](reacher-configuration-v0.10.md "mention"), some of the Environment Variables have changed names. | ||
|
||
<table><thead><tr><th width="220">Old name</th><th width="211">New name</th><th width="264">Description</th></tr></thead><tbody><tr><td><code>RCH_HTTP_HOST</code></td><td><code>RCH__HTTP_HOST</code></td><td>The host name to bind the HTTP server to.</td></tr><tr><td><code>PORT</code></td><td><code>RCH__HTTP_PORT</code></td><td>The port to bind the HTTP server to, often populated by the cloud provider.</td></tr><tr><td><code>RCH_SENTRY_DSN</code></td><td><code>RCH__SENTRY_DSN</code></td><td>If set, bug reports will be sent to this <a href="https://sentry.io">Sentry</a> DSN.</td></tr><tr><td><code>RCH_HEADER_SECRET</code></td><td><code>RCH__HEADER_SECRET</code></td><td>If set, then all HTTP requests must have the <code>x-reacher-secret</code> header set to this value. This is used to protect the backend against public unwanted HTTP requests.</td></tr><tr><td><code>RCH_FROM_EMAIL</code></td><td><code>RCH__FROM_EMAIL</code></td><td>Email to use in the <code><MAIL FROM:></code> SMTP step. Can be overwritten by each API request's <code>from_email</code> field.</td></tr><tr><td><code>RCH_HELLO_NAME</code></td><td><code>RCH__HELLO_NAME</code></td><td>Name to use in the <code><EHLO></code> SMTP step. Can be overwritten by each API request's <code>hello_name</code> field.</td></tr><tr><td><code>RCH_SMTP_TIMEOUT</code></td><td><code>RCH__SMTP_TIMEOUT</code></td><td>Timeout for each SMTP connection.</td></tr><tr><td><code>RCH_WEBDRIVER_ADDR</code></td><td><code>RCH__WEBDRIVER_ADDR</code></td><td>Set to a running WebDriver process endpoint (e.g. <code>http://localhost:9515</code>) to use a headless navigator to password recovery pages to check Yahoo and Hotmail/Outlook addresses. We recommend <code>chromedriver</code> as it allows parallel requests.</td></tr><tr><td><strong>For Bulk Verification:</strong></td><td></td><td></td></tr><tr><td><code>RCH_ENABLE_BULK</code></td><td><code>RCH__WORKER__ENABLE</code></td><td></td></tr><tr><td><code>DATABASE_URL</code></td><td><code>RCH__WORKER__POSTGRES__DB_URL</code></td><td>[Bulk] Database connection string for storing results and task queue</td></tr><tr><td><code>RCH_DATABASE_MAX_CONNECTIONS</code></td><td>Removed</td><td>[Bulk] Connections created for the database pool</td></tr><tr><td><code>RCH_MINIMUM_TASK_CONCURRENCY</code></td><td>Removed</td><td>[Bulk] Minimum number of concurrent running tasks below which more tasks are fetched</td></tr><tr><td><code>RCH_MAXIMUM_CONCURRENT_TASK_FETCH</code></td><td>Removed</td><td>[Bulk] Maximum number of tasks fetched at once</td></tr></tbody></table> | ||
|
||
## Bulk Verification | ||
|
||
The `/v0/bulk` endpoints are deprecated, in favor of a RabbitMQ-based queue system. Docs for `/v1/bulk` endpoints are coming soon. |
178 changes: 178 additions & 0 deletions
178
docs/advanced/migrations/reacher-configuration-v0.10.md
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 |
---|---|---|
@@ -0,0 +1,178 @@ | ||
# Reacher Configuration (v0.10) | ||
|
||
{% hint style="info" %} | ||
This configuration has been introduced in v0.10, which is still in `beta`. For the stable 0.7 version, please see [docker-environment-variables.md](../../self-hosting/docker-environment-variables.md "mention"). | ||
{% endhint %} | ||
|
||
Previously, in v0.7, configuration was done solely via environment variables. Given the growing amount of configurable parameters, we now offer a file-based configuration too, on top of environment variables. | ||
|
||
You can find below the exhaustive list of configurations, as well as their corresponding environment variable. | ||
|
||
```toml | ||
# Backend configuration. | ||
|
||
# Name to identify the backend. | ||
# | ||
# Env variable: RCH__BACKEND_NAME | ||
backend_name = "backend-dev" | ||
|
||
# Host to bind the backend to. | ||
# | ||
# Env variable: RCH__HTTP_HOST | ||
http_host = "127.0.0.1" | ||
|
||
# Port for the backend. | ||
# | ||
# Env variable: RCH__HTTP_PORT | ||
http_port = 8080 | ||
|
||
# Shared secret between a trusted client and the backend, required in the | ||
# `x-reacher-secret` header of all incoming requests. | ||
# | ||
# Env variable: RCH__HEADER_SECRET | ||
# header_secret = "my-secret" | ||
|
||
# Name to use during the EHLO/HELO command in the SMTP conversation. | ||
# Ideally, this should match the reverse DNS of the server's IP address. | ||
# | ||
# Env variable: RCH__HELLO_NAME | ||
hello_name = "localhost" | ||
|
||
# Email to use during the MAIL FROM command in the SMTP conversation. | ||
# Ideally, the domain of this email should match the "hello_name" above. | ||
# | ||
# Env variable: RCH__FROM_EMAIL | ||
from_email = "hello@localhost" | ||
|
||
# Address of the Chrome WebDriver server for headless email verifications. | ||
# | ||
# Env variable: RCH__WEBDRIVER_ADDR | ||
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. | ||
# | ||
# Env variable: RCH__SMTP_TIMEOUT | ||
# smtp_timeout = 45 | ||
|
||
# Uncomment the lines below 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. | ||
# | ||
# Env variables: | ||
# - RCH__PROXY__HOST | ||
# - RCH__PROXY__PORT | ||
# - RCH__PROXY__USERNAME | ||
# - RCH__PROXY__PASSWORD | ||
# | ||
# [proxy] | ||
# host = "my.proxy.com" | ||
# port = 1080 | ||
# username = "my-username" | ||
# password = "my-password" | ||
|
||
# Verification method to use for each email provider. Available methods are: | ||
# "smtp", "headless", and "api". Note that not all methods are supported by | ||
# all email providers. | ||
[verif_method] | ||
# Gmail currently only supports the "smtp" method. | ||
# | ||
# Env variable: RCH__VERIF_METHOD__GMAIL | ||
gmail = "smtp" | ||
# Hotmail B2B currently only supports the "smtp" method. | ||
# | ||
# Env variable: RCH__VERIF_METHOD__HOTMAILB2B | ||
hotmailb2b = "smtp" | ||
# Hotmail B2C supports both "headless" and "smtp" methods. The "headless" | ||
# method is recommended. | ||
hotmailb2c = "headless" | ||
# Yahoo supports both "headless" and "smtp" methods. The "headless" method is | ||
# recommended. | ||
yahoo = "headless" | ||
|
||
[worker] | ||
# Enable the worker to consume emails from the RabbitMQ queues. If set, the | ||
# RabbitMQ configuration below must be set as well. | ||
# | ||
# Env variable: RCH__WORKER__ENABLE | ||
enable = true | ||
|
||
# RabbitMQ configuration. | ||
[worker.rabbitmq] | ||
# Env variable: RCH__WORKER__RABBITMQ__URL | ||
url = "amqp://guest:guest@localhost:5672" | ||
|
||
# Queues to consume emails from. By default, the worker consumes from all | ||
# queues. | ||
# | ||
# To consume from only a subset of queues, uncomment the line `queues = "all"` | ||
# and specify the queues you want to consume from. | ||
# | ||
# Below is the exhaustive list of queue names that the worker can consume from: | ||
# - "check.gmail": subscribe exclusively to Gmail emails. | ||
# - "check.hotmailb2b": subscribe exclusively to Hotmail B2B emails. | ||
# - "check.hotmailb2c": subscribe exclusively to Hotmail B2C emails. | ||
# - "check.yahoo": subscribe exclusively to Yahoo emails. | ||
# - "check.everything_else": subscribe to all emails that are not Gmail, Yahoo, or Hotmail. | ||
# | ||
# Env variable: RCH__WORKER__RABBITMQ__QUEUES | ||
# | ||
# queues = ["check.gmail", "check.hotmail.b2b", "check.hotmail.b2c", "check.yahoo", "check.everything_else"] | ||
queues = "all" | ||
|
||
# Number of concurrent emails to verify for this worker across all queues. | ||
# | ||
# Env variable: RCH__WORKER__RABBITMQ__CONCURRENCY | ||
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. | ||
# | ||
# Env variables: | ||
# - RCH__WORKER__THROTTLE__MAX_REQUESTS_PER_SECOND | ||
# - RCH__WORKER__THROTTLE__MAX_REQUESTS_PER_MINUTE | ||
# - RCH__WORKER__THROTTLE__MAX_REQUESTS_PER_HOUR | ||
# - RCH__WORKER__THROTTLE__MAX_REQUESTS_PER_DAY | ||
[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] | ||
# Env variable: RCH__WORKER__POSTGRES__DB_URL | ||
db_url = "postgresql://localhost/reacherdb" | ||
|
||
# Optional Sentry DSN. If set, all errors will be sent to Sentry. | ||
# | ||
# Env variable: RCH__SENTRY_DSN | ||
# sentry_dsn = "<PASTE_YOUR_DSN_NOW>" | ||
``` | ||
|
||
## Usage with Docker | ||
|
||
You can continue using environment variables with Docker. For example, to overwrite the EHLO/HELO name, simply run: | ||
|
||
```bash | ||
docker run -e RCH__HELLO_NAME=my.company.com -p 8080:8080 reacherhq/backend:beta | ||
``` | ||
|
||
However, if you prefer to pass in a local `backend_config.toml` file instead, run: | ||
|
||
```bash | ||
docker run -e RUST_LOG=reacher=debug -v /path/to/local/backend_config.toml:./backend_config.toml -p 8080:8080 reacherhq/backend:beta | ||
``` | ||
|
||
We recommend passing in `-e RUST_LOG=reacher=debug`, at least on first run, as the debug logs will show the final configuration parsed by Reacher. |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# OpenAPI | ||
|
||
* [v0-check\_email.md](v0-check_email.md "mention") | ||
* [v1-check\_email.md](v1-check_email.md "mention") | ||
* [v1-bulk.md](v1-bulk.md "mention") | ||
|
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# /v0/check\_email | ||
|
||
{% swagger src="https://raw.githubusercontent.com/reacherhq/check-if-email-exists/refs/heads/master/backend/openapi.json" path="/v0/check_email" method="post" %} | ||
[https://raw.githubusercontent.com/reacherhq/check-if-email-exists/refs/heads/master/backend/openapi.json](https://raw.githubusercontent.com/reacherhq/check-if-email-exists/refs/heads/master/backend/openapi.json) | ||
{% endswagger %} | ||
|
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# /v1/bulk | ||
|
||
{% hint style="info" %} | ||
This endpoint is available starting from Reacher v0.10. | ||
{% endhint %} | ||
|
||
{% swagger src="https://raw.githubusercontent.com/reacherhq/check-if-email-exists/refs/heads/master/backend/openapi.json" path="/v1/bulk" method="post" %} | ||
[https://raw.githubusercontent.com/reacherhq/check-if-email-exists/refs/heads/master/backend/openapi.json](https://raw.githubusercontent.com/reacherhq/check-if-email-exists/refs/heads/master/backend/openapi.json) | ||
{% endswagger %} | ||
|
||
{% swagger src="https://raw.githubusercontent.com/reacherhq/check-if-email-exists/refs/heads/master/backend/openapi.json" path="/v1/bulk/{job_id}" method="get" %} | ||
[https://raw.githubusercontent.com/reacherhq/check-if-email-exists/refs/heads/master/backend/openapi.json](https://raw.githubusercontent.com/reacherhq/check-if-email-exists/refs/heads/master/backend/openapi.json) | ||
{% endswagger %} | ||
|
||
{% swagger src="https://raw.githubusercontent.com/reacherhq/check-if-email-exists/refs/heads/master/backend/openapi.json" path="/v1/bulk/{job_id}/results" method="get" %} | ||
[https://raw.githubusercontent.com/reacherhq/check-if-email-exists/refs/heads/master/backend/openapi.json](https://raw.githubusercontent.com/reacherhq/check-if-email-exists/refs/heads/master/backend/openapi.json) | ||
{% endswagger %} | ||
|
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# /v1/check\_email | ||
|
||
{% hint style="info" %} | ||
This endpoint is available starting from Reacher v0.10. | ||
{% endhint %} | ||
|
||
{% swagger src="https://raw.githubusercontent.com/reacherhq/check-if-email-exists/refs/heads/master/backend/openapi.json" path="/v1/check_email" method="post" %} | ||
[https://raw.githubusercontent.com/reacherhq/check-if-email-exists/refs/heads/master/backend/openapi.json](https://raw.githubusercontent.com/reacherhq/check-if-email-exists/refs/heads/master/backend/openapi.json) | ||
{% endswagger %} | ||
|
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
Oops, something went wrong.