fix: ci and use static file for template
This commit is contained in:
parent
9d6a335be8
commit
9a25b92e57
|
|
@ -62,21 +62,19 @@ jobs:
|
||||||
- name: Run Docker-Compose
|
- name: Run Docker-Compose
|
||||||
run: |
|
run: |
|
||||||
docker compose -f docker-compose-ci.yml up -d
|
docker compose -f docker-compose-ci.yml up -d
|
||||||
sleep 5
|
docker compose logs appflowy_cloud -f &
|
||||||
docker ps -a
|
|
||||||
docker compose logs appflowy_cloud
|
|
||||||
|
|
||||||
# - name: Run tests
|
- name: Run tests
|
||||||
# run: |
|
run: |
|
||||||
# RUST_LOG="info" DISABLE_CI_TEST_LOG="true" cargo test --workspace
|
RUST_LOG="info" DISABLE_CI_TEST_LOG="true" cargo test --workspace
|
||||||
|
|
||||||
# - name: Install Node.js
|
- name: Install Node.js
|
||||||
# uses: actions/setup-node@v2
|
uses: actions/setup-node@v2
|
||||||
# with:
|
with:
|
||||||
# node-version: '14'
|
node-version: '14'
|
||||||
|
|
||||||
# - name: Run WASM tests
|
- name: Run WASM tests
|
||||||
# working-directory: ./libs/wasm-test
|
working-directory: ./libs/wasm-test
|
||||||
# run: |
|
run: |
|
||||||
# cargo install wasm-pack
|
cargo install wasm-pack
|
||||||
# wasm-pack test --headless --firefox
|
wasm-pack test --headless --firefox
|
||||||
|
|
|
||||||
12
deploy.env
12
deploy.env
|
|
@ -79,6 +79,11 @@ APPFLOWY_S3_SECRET_KEY=minioadmin
|
||||||
APPFLOWY_S3_BUCKET=appflowy
|
APPFLOWY_S3_BUCKET=appflowy
|
||||||
#APPFLOWY_S3_REGION=us-east-1
|
#APPFLOWY_S3_REGION=us-east-1
|
||||||
|
|
||||||
|
# AppFlowy Cloud Mailer
|
||||||
|
APPFLOWY_MAILER_SMTP_HOST=smtp.gmail.com
|
||||||
|
APPFLOWY_MAILER_SMTP_USERNAME=email_sender@some_company.com
|
||||||
|
APPFLOWY_MAILER_SMTP_PASSWORD=email_sender_password
|
||||||
|
|
||||||
# Log level for the appflowy-cloud service
|
# Log level for the appflowy-cloud service
|
||||||
RUST_LOG=info
|
RUST_LOG=info
|
||||||
|
|
||||||
|
|
@ -106,10 +111,3 @@ OPENAI_API_KEY=
|
||||||
APPFLOWY_HISTORY_URL=http://history:50051
|
APPFLOWY_HISTORY_URL=http://history:50051
|
||||||
APPFLOWY_HISTORY_REDIS_URL=redis://redis:6379
|
APPFLOWY_HISTORY_REDIS_URL=redis://redis:6379
|
||||||
APPFLOWY_HISTORY_DATABASE_URL=postgres://postgres:password@postgres:5432/postgres
|
APPFLOWY_HISTORY_DATABASE_URL=postgres://postgres:password@postgres:5432/postgres
|
||||||
|
|
||||||
|
|
||||||
# AppFlowy Cloud Mailer
|
|
||||||
APPFLOWY_MAILER_SMTP_HOST=smtp.gmail.com
|
|
||||||
APPFLOWY_MAILER_SMTP_USERNAME=email_sender@some_company.com
|
|
||||||
APPFLOWY_MAILER_SMTP_PASSWORD=email_sender_password
|
|
||||||
APPFLOWY_MAILER_WORKSPACE_INVITE_TEMPLATE_URL=https://raw.githubusercontent.com/AppFlowy-IO/Appflowy-Cloud/main/assets/mailer_templates/build_production/workspace_invitation.html
|
|
||||||
|
|
|
||||||
1
dev.env
1
dev.env
|
|
@ -79,7 +79,6 @@ APPFLOWY_S3_BUCKET=appflowy
|
||||||
APPFLOWY_MAILER_SMTP_HOST=smtp.gmail.com
|
APPFLOWY_MAILER_SMTP_HOST=smtp.gmail.com
|
||||||
APPFLOWY_MAILER_SMTP_USERNAME=notify@appflowy.io
|
APPFLOWY_MAILER_SMTP_USERNAME=notify@appflowy.io
|
||||||
APPFLOWY_MAILER_SMTP_PASSWORD=email_sender_password
|
APPFLOWY_MAILER_SMTP_PASSWORD=email_sender_password
|
||||||
APPFLOWY_MAILER_WORKSPACE_INVITE_TEMPLATE_URL=https://raw.githubusercontent.com/AppFlowy-IO/Appflowy-Cloud/main/assets/mailer_templates/build_production/workspace_invitation.html
|
|
||||||
|
|
||||||
RUST_LOG=info
|
RUST_LOG=info
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -244,7 +244,6 @@ pub async fn init_state(config: &Config, rt_cmd_tx: RTCommandSender) -> Result<A
|
||||||
config.mailer.smtp_username.clone(),
|
config.mailer.smtp_username.clone(),
|
||||||
config.mailer.smtp_password.expose_secret().clone(),
|
config.mailer.smtp_password.expose_secret().clone(),
|
||||||
&config.mailer.smtp_host,
|
&config.mailer.smtp_host,
|
||||||
&config.mailer.workspace_invite_template_url,
|
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,6 @@ pub struct MailerSetting {
|
||||||
pub smtp_host: String,
|
pub smtp_host: String,
|
||||||
pub smtp_username: String,
|
pub smtp_username: String,
|
||||||
pub smtp_password: Secret<String>,
|
pub smtp_password: Secret<String>,
|
||||||
pub workspace_invite_template_url: String,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(serde::Deserialize, Clone, Debug)]
|
#[derive(serde::Deserialize, Clone, Debug)]
|
||||||
|
|
@ -175,7 +174,6 @@ pub fn get_configuration() -> Result<Config, anyhow::Error> {
|
||||||
smtp_host: get_env_var("APPFLOWY_MAILER_SMTP_HOST", "smtp.gmail.com"),
|
smtp_host: get_env_var("APPFLOWY_MAILER_SMTP_HOST", "smtp.gmail.com"),
|
||||||
smtp_username: get_env_var("APPFLOWY_MAILER_SMTP_USERNAME", "sender@example.com"),
|
smtp_username: get_env_var("APPFLOWY_MAILER_SMTP_USERNAME", "sender@example.com"),
|
||||||
smtp_password: get_env_var("APPFLOWY_MAILER_SMTP_PASSWORD", "password").into(),
|
smtp_password: get_env_var("APPFLOWY_MAILER_SMTP_PASSWORD", "password").into(),
|
||||||
workspace_invite_template_url: get_env_var("APPFLOWY_MAILER_WORKSPACE_INVITE_TEMPLATE_URL", "https://raw.githubusercontent.com/AppFlowy-IO/Appflowy-Cloud/main/assets/mailer_templates/build_production/workspace_invitation.html"),
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
Ok(config)
|
Ok(config)
|
||||||
|
|
|
||||||
|
|
@ -21,26 +21,19 @@ impl Mailer {
|
||||||
smtp_username: String,
|
smtp_username: String,
|
||||||
smtp_password: String,
|
smtp_password: String,
|
||||||
smtp_host: &str,
|
smtp_host: &str,
|
||||||
workspace_invite_template_url: &str,
|
|
||||||
) -> Result<Self, anyhow::Error> {
|
) -> Result<Self, anyhow::Error> {
|
||||||
let creds = Credentials::new(smtp_username, smtp_password);
|
let creds = Credentials::new(smtp_username, smtp_password);
|
||||||
let smtp_transport = AsyncSmtpTransport::<lettre::Tokio1Executor>::relay(smtp_host)?
|
let smtp_transport = AsyncSmtpTransport::<lettre::Tokio1Executor>::relay(smtp_host)?
|
||||||
.credentials(creds)
|
.credentials(creds)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
let http_client = reqwest::Client::new();
|
let workspace_invite_template =
|
||||||
let workspace_invite_template = http_client
|
include_str!("../assets/mailer_templates/build_production/workspace_invitation.html");
|
||||||
.get(workspace_invite_template_url)
|
|
||||||
.send()
|
|
||||||
.await?
|
|
||||||
.error_for_status()?
|
|
||||||
.text()
|
|
||||||
.await?;
|
|
||||||
|
|
||||||
HANDLEBARS
|
HANDLEBARS
|
||||||
.write()
|
.write()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.register_template_string("workspace_invite", &workspace_invite_template)
|
.register_template_string("workspace_invite", workspace_invite_template)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
Ok(Self { smtp_transport })
|
Ok(Self { smtp_transport })
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue