diff --git a/.github/workflows/integration_test.yml b/.github/workflows/integration_test.yml index c719c315..3f0aa5b6 100644 --- a/.github/workflows/integration_test.yml +++ b/.github/workflows/integration_test.yml @@ -40,6 +40,7 @@ jobs: sed -i 's/GOTRUE_EXTERNAL_GOOGLE_ENABLED=.*/GOTRUE_EXTERNAL_GOOGLE_ENABLED=true/' .env sed -i 's/GOTRUE_MAILER_AUTOCONFIRM=.*/GOTRUE_MAILER_AUTOCONFIRM=false/' .env sed -i 's/API_EXTERNAL_URL=http:\/\/your-host/API_EXTERNAL_URL=http:\/\/localhost/' .env + sed -i 's/GOTRUE_RATE_LIMIT_EMAIL_SENT=100/GOTRUE_RATE_LIMIT_EMAIL_SENT=1000/' .env # expose port for tests (postgres, minio) sed -i '38s/$/\n ports:\n - 5432:5432/' docker-compose.yml sed -i '26s/$/\n ports:\n - 9000:9000/' docker-compose.yml diff --git a/deploy.env b/deploy.env index e0e36608..e686c467 100644 --- a/deploy.env +++ b/deploy.env @@ -24,6 +24,8 @@ GOTRUE_JWT_EXP=7200 # to enforce email confirmation or OAuth2 login instead. # If you set this to false, you need to either set up SMTP GOTRUE_MAILER_AUTOCONFIRM=true +# Number of emails that can be per minute +GOTRUE_RATE_LIMIT_EMAIL_SENT=100 # If you intend to use mail confirmation, you need to set the SMTP configuration below # You would then need to set GOTRUE_MAILER_AUTOCONFIRM=false diff --git a/dev.env b/dev.env index 65a4d8ae..1a62d1ce 100644 --- a/dev.env +++ b/dev.env @@ -14,6 +14,8 @@ GOTRUE_JWT_EXP=7200 # if you have OAuth2 set up or smtp configured, you can set this to false # to enforce email confirmation or OAuth2 login instead GOTRUE_MAILER_AUTOCONFIRM=false +# Number of emails that can be per minute +GOTRUE_RATE_LIMIT_EMAIL_SENT=1000 # if you enable mail confirmation, you need to set the SMTP configuration below GOTRUE_SMTP_HOST=smtp.gmail.com diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml index fdca6a22..e707ad33 100644 --- a/docker-compose-dev.yml +++ b/docker-compose-dev.yml @@ -49,14 +49,15 @@ services: - API_EXTERNAL_URL=${API_EXTERNAL_URL} - DATABASE_URL=${GOTRUE_DATABASE_URL} - PORT=9999 - - GOTRUE_SMTP_HOST=${GOTRUE_SMTP_HOST} # e.g. smtp.gmail.com - - GOTRUE_SMTP_PORT=${GOTRUE_SMTP_PORT} # e.g. 465 - - GOTRUE_SMTP_USER=${GOTRUE_SMTP_USER} # email sender, e.g. noreply@appflowy.io - - GOTRUE_SMTP_PASS=${GOTRUE_SMTP_PASS} # email password - - GOTRUE_SMTP_ADMIN_EMAIL=${GOTRUE_SMTP_ADMIN_EMAIL} # email with admin privileges e.g. internal@appflowy.io - - GOTRUE_SMTP_MAX_FREQUENCY=${GOTRUE_SMTP_MAX_FREQUENCY:-1ns} # set to 1ns for running tests - GOTRUE_MAILER_URLPATHS_CONFIRMATION=/verify - - GOTRUE_MAILER_AUTOCONFIRM=${GOTRUE_MAILER_AUTOCONFIRM:-false} # change this to true to skip email confirmation + - GOTRUE_SMTP_HOST=${GOTRUE_SMTP_HOST} # e.g. smtp.gmail.com + - GOTRUE_SMTP_PORT=${GOTRUE_SMTP_PORT} # e.g. 465 + - GOTRUE_SMTP_USER=${GOTRUE_SMTP_USER} # email sender, e.g. noreply@appflowy.io + - GOTRUE_SMTP_PASS=${GOTRUE_SMTP_PASS} # email password + - GOTRUE_SMTP_ADMIN_EMAIL=${GOTRUE_SMTP_ADMIN_EMAIL} # email with admin privileges e.g. internal@appflowy.io + - GOTRUE_SMTP_MAX_FREQUENCY=${GOTRUE_SMTP_MAX_FREQUENCY:-1ns} # set to 1ns for running tests + - GOTRUE_RATE_LIMIT_EMAIL_SENT=${GOTRUE_RATE_LIMIT_EMAIL_SENT:100} # number of email sendable per minute + - GOTRUE_MAILER_AUTOCONFIRM=${GOTRUE_MAILER_AUTOCONFIRM:-false} # change this to true to skip email confirmation # Google OAuth config - GOTRUE_EXTERNAL_GOOGLE_ENABLED=${GOTRUE_EXTERNAL_GOOGLE_ENABLED} - GOTRUE_EXTERNAL_GOOGLE_CLIENT_ID=${GOTRUE_EXTERNAL_GOOGLE_CLIENT_ID} diff --git a/docker-compose.yml b/docker-compose.yml index 99236417..5144019e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -66,9 +66,10 @@ services: - GOTRUE_MAILER_URLPATHS_INVITE=/gotrue/verify - GOTRUE_MAILER_URLPATHS_RECOVERY=/gotrue/verify - GOTRUE_MAILER_URLPATHS_EMAIL_CHANGE=/gotrue/verify - - GOTRUE_SMTP_ADMIN_EMAIL=${GOTRUE_SMTP_ADMIN_EMAIL} # email with admin privileges e.g. internal@appflowy.io - - GOTRUE_SMTP_MAX_FREQUENCY=${GOTRUE_SMTP_MAX_FREQUENCY:-1ns} # set to 1ns for running tests - - GOTRUE_MAILER_AUTOCONFIRM=${GOTRUE_MAILER_AUTOCONFIRM:-false} # change this to true to skip email confirmation + - GOTRUE_SMTP_ADMIN_EMAIL=${GOTRUE_SMTP_ADMIN_EMAIL} # email with admin privileges e.g. internal@appflowy.io + - GOTRUE_SMTP_MAX_FREQUENCY=${GOTRUE_SMTP_MAX_FREQUENCY:-1ns} # set to 1ns for running tests + - GOTRUE_RATE_LIMIT_EMAIL_SENT=${GOTRUE_RATE_LIMIT_EMAIL_SENT:100} # number of email sendable per minute + - GOTRUE_MAILER_AUTOCONFIRM=${GOTRUE_MAILER_AUTOCONFIRM:-false} # change this to true to skip email confirmation # Google OAuth config - GOTRUE_EXTERNAL_GOOGLE_ENABLED=${GOTRUE_EXTERNAL_GOOGLE_ENABLED} - GOTRUE_EXTERNAL_GOOGLE_CLIENT_ID=${GOTRUE_EXTERNAL_GOOGLE_CLIENT_ID} diff --git a/libs/realtime/src/entities.rs b/libs/realtime/src/entities.rs index dd0791d2..a80595de 100644 --- a/libs/realtime/src/entities.rs +++ b/libs/realtime/src/entities.rs @@ -74,7 +74,7 @@ pub struct ClientStreamMessage { } #[derive(Debug, Hash, PartialEq, Eq)] -pub(crate) struct Editing { +pub struct Editing { pub object_id: String, pub origin: CollabOrigin, }