Open pperle opened 4 years ago
fwiw - As I understand this -- this is not related to mailgun.
the error no match of right hand side value: {:error, :enoent}
is thrown https://github.com/tmate-io/tmate-websocket/blob/master/lib/tmate/session.ex#L183
no match of right hand side value
is thrown because of == :ok
(i.e error case is not checked)The root cause of this error: the sessions directory /tmp/tmate/sessions is mounted and shared between two containers tmate-websocket
and tmate-ssh-server
. I suspect your setup may not have had it shared/mounted.
Hi, Mailgun is not mandatory to send emails. I've had some success tweaking the configuration to use my SMTP server with these changes:
diff --git a/config/prod.exs b/config/prod.exs
index 4566092..b029444 100644
--- a/config/prod.exs
+++ b/config/prod.exs
@@ -76,6 +76,8 @@ config :tmate, Tmate.Scheduler,
]
config :tmate, Tmate.Mailer,
- adapter: Bamboo.MailgunAdapter,
- api_key: System.get_env("MAILGUN_API_KEY"),
- domain: System.get_env("MAILGUN_DOMAIN")
+ adapter: Bamboo.SMTPAdapter,
+ server: System.get_env("SMTP_HOST"),
+ port: System.get_env("SMTP_PORT"),
+ hostname: System.get_env("SMTP_DOMAIN"),
+ from: System.get_env("EMAIL_FROM")
diff --git a/lib/tmate_web/emails/email.ex b/lib/tmate_web/emails/email.ex
index fd89786..1dd9a5c 100644
--- a/lib/tmate_web/emails/email.ex
+++ b/lib/tmate_web/emails/email.ex
@@ -12,7 +12,7 @@ defmodule Tmate.Email do
defp base_email do
new_email()
- |> from("tmate <support@tmate.io>")
+ |> from(Application.fetch_env!(:tmate, Tmate.Mailer)[:from])
|> put_html_layout({TmateWeb.LayoutView, "email.html"})
end
end
diff --git a/mix.exs b/mix.exs
index e829b21..77f4789 100644
--- a/mix.exs
+++ b/mix.exs
@@ -54,6 +54,7 @@ defmodule Tmate.MixProject do
{:timex, "~> 3.0"},
{:httpoison, ">= 0.0.0"},
{:bamboo, "~> 1.3"},
+ {:bamboo_smtp, "~> 3.0.0"},
]
end
Hey, I am trying to host my own tmate server.
Everything expect named sessions is working fine.
When I register for an API key I get an error that my mailgun API key is not working. This is right because I do not own a mailgun API key.
When I look in postgres a user has been created with an API key.
When I try to use this
api_key
to create a named session usingtmate -k tmk-JpeKMdFDH21ogA5ekHbfWwN6Jn -n session-name
I get this error message:https://github.com/tmate-io/tmate-websocket/blob/628cd912393c504fa53a58955ad5f4f76e5174e9/lib/tmate/session.ex#L183
Is this related to the mailgun API error? Maybe the user was not full created?
Thank you for your help