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
|
||||
run: |
|
||||
docker compose -f docker-compose-ci.yml up -d
|
||||
sleep 5
|
||||
docker ps -a
|
||||
docker compose logs appflowy_cloud
|
||||
docker compose logs appflowy_cloud -f &
|
||||
|
||||
# - name: Run tests
|
||||
# run: |
|
||||
# RUST_LOG="info" DISABLE_CI_TEST_LOG="true" cargo test --workspace
|
||||
- name: Run tests
|
||||
run: |
|
||||
RUST_LOG="info" DISABLE_CI_TEST_LOG="true" cargo test --workspace
|
||||
|
||||
# - name: Install Node.js
|
||||
# uses: actions/setup-node@v2
|
||||
# with:
|
||||
# node-version: '14'
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '14'
|
||||
|
||||
# - name: Run WASM tests
|
||||
# working-directory: ./libs/wasm-test
|
||||
# run: |
|
||||
# cargo install wasm-pack
|
||||
# wasm-pack test --headless --firefox
|
||||
- name: Run WASM tests
|
||||
working-directory: ./libs/wasm-test
|
||||
run: |
|
||||
cargo install wasm-pack
|
||||
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_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
|
||||
RUST_LOG=info
|
||||
|
||||
|
|
@ -106,10 +111,3 @@ OPENAI_API_KEY=
|
|||
APPFLOWY_HISTORY_URL=http://history:50051
|
||||
APPFLOWY_HISTORY_REDIS_URL=redis://redis:6379
|
||||
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_USERNAME=notify@appflowy.io
|
||||
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
|
||||
|
||||
|
|
|
|||
|
|
@ -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_password.expose_secret().clone(),
|
||||
&config.mailer.smtp_host,
|
||||
&config.mailer.workspace_invite_template_url,
|
||||
)
|
||||
.await?;
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ pub struct MailerSetting {
|
|||
pub smtp_host: String,
|
||||
pub smtp_username: String,
|
||||
pub smtp_password: Secret<String>,
|
||||
pub workspace_invite_template_url: String,
|
||||
}
|
||||
|
||||
#[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_username: get_env_var("APPFLOWY_MAILER_SMTP_USERNAME", "sender@example.com"),
|
||||
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)
|
||||
|
|
|
|||
|
|
@ -21,26 +21,19 @@ impl Mailer {
|
|||
smtp_username: String,
|
||||
smtp_password: String,
|
||||
smtp_host: &str,
|
||||
workspace_invite_template_url: &str,
|
||||
) -> Result<Self, anyhow::Error> {
|
||||
let creds = Credentials::new(smtp_username, smtp_password);
|
||||
let smtp_transport = AsyncSmtpTransport::<lettre::Tokio1Executor>::relay(smtp_host)?
|
||||
.credentials(creds)
|
||||
.build();
|
||||
|
||||
let http_client = reqwest::Client::new();
|
||||
let workspace_invite_template = http_client
|
||||
.get(workspace_invite_template_url)
|
||||
.send()
|
||||
.await?
|
||||
.error_for_status()?
|
||||
.text()
|
||||
.await?;
|
||||
let workspace_invite_template =
|
||||
include_str!("../assets/mailer_templates/build_production/workspace_invitation.html");
|
||||
|
||||
HANDLEBARS
|
||||
.write()
|
||||
.unwrap()
|
||||
.register_template_string("workspace_invite", &workspace_invite_template)
|
||||
.register_template_string("workspace_invite", workspace_invite_template)
|
||||
.unwrap();
|
||||
|
||||
Ok(Self { smtp_transport })
|
||||
|
|
|
|||
Loading…
Reference in New Issue