Automated server reboot
-
@nebulon did you mean manual configuration for that service?
https://ubuntu.com/tutorials/enable-the-livepatch-service#1-overview -
@potemkin_ai yes I was referring to this, but I haven't really had a deeper look into that topic yet and to which extent this is free or a paid addon in ubuntu.
-
@potemkin_ai said in Automated server reboot:
-> $TOKEN==
<** 535 5.7.8 Authentication failed
-> AUTH PLAIN AGFsZXhAcG90ZW1raW4uY28A$TOKEN==
<** 535 5.7.8 Authentication failed
*** No authentication type succeededSomething wrong in the script. It's sending
$TOKEN
-
@nebulon got it, makes sense, but from what I see it requires extra configuration anyway and most probably won't be available out of the box, so an automatic reboot would be of great help; especially for the next two years while 18.04LTS is supported
-
@potemkin_ai command below works for me. One thing is the
no-reply@mydomain.com
is important! You cannot change the mailbox name. The mail server does not allow sending emails as any other name for security from localhost.# swaks -s `docker inspect --format '{{ .NetworkSettings.Networks.cloudron.IPAddress }}' mail` -p 2525 --au no-reply@cloudron.space --ap `docker inspect --format '{{ .Config.Env }}' mail | tr ' ' '\n' | grep CLOUDRON_RELAY_TOKEN | sed 's/^.*=//'` -f no-reply@cloudron.space -t 'test@cloudron.io' --h-Subject "Test mail" === Trying 172.18.0.3:2525... === Connected to 172.18.0.3. <- 220 my.cloudron.space ESMTP Haraka/2.8.28 ready -> EHLO upgrade-test <- 250-my.cloudron.space Hello [172.18.0.1]Haraka is at your service. <- 250-PIPELINING <- 250-8BITMIME <- 250-SMTPUTF8 <- 250-SIZE 26214400 <- 250 AUTH LOGIN PLAIN -> AUTH LOGIN <- 334 VXNlcm5hbWU6 -> bm8tcmVwbHlAY2xvdWRyb24uc3BhY2U= <- 334 UGFzc3dvcmQ6 -> OWZmOGU4MWI4NTJmNjMxOWVlNWI4NjM0NDQ1ZDE1ZTliYTI5ZWY3NjE5N2UwZWE0MmM5OGJlMTI0ZjQ4NjFhM2EzZmEyNDQ2Yzk2MzVmODYzMDNiNTUwNjRiMDRjOGYwNjc1M2U3NjIxZGJhOGFmZGY1YWJlODUyYmVmMTVmZWVjNmFiOTVjYmE1MDJhNGY5OGZiMjBjMWZiZDA3YjBlMDFjOTBhOTE4NTRhOGY4ZDNhYWI2ZmYyMGJkMjUzZjY1NDAwNmE0YmRjZGVhMmM2ZGYzYTY0YjcxMWRjZmQxODE5Y2FiZDJhMmMyMTY2YTJhYmE5MjA4NGNjNDhmN2E1ZQ== <- 235 2.7.0 Authentication successful -> MAIL FROM:<no-reply@cloudron.space> <- 250 sender <no-reply@cloudron.space> OK -> RCPT TO:<test@cloudron.io> <- 250 recipient <test@cloudron.io> OK -> DATA <- 354 go ahead, make my day -> Date: Fri, 22 Oct 2021 18:59:51 +0000 -> To: test@cloudron.io -> From: no-reply@cloudron.space -> Subject: Test mail -> Message-Id: <20211022185951.169923@upgrade-test> -> X-Mailer: swaks v20190914.0 jetmore.org/john/code/swaks/ -> -> This is a test mailing -> -> -> . <- 250 Message Queued (0741EB98-48BA-4A23-AB22-FB67C176AF7B.1) -> QUIT <- 221 my.cloudron.space closing connection. Have a jolly good day. === Connection closed with remote host.
-
@girish thank you - tried that, but authentification is still failing at 334 step.
My primary concern remains token, because mine is muuuuch longer than yours (hope it sounds right in the context of token comparison....), and authentication is failing right after mail service gets it.
Any way to troubleshoot that?
-
@potemkin_ai Can't you use something like "Uptime Kuma" to monitor site status instead?
It has "Notifications via Webhook, Telegram, Discord and email (SMTP)" so it should work for your use-case.
-
@humptydumpty I probably could, but what's the point?
There is a working solution from Cloudron, we just need to figure out where exactly it's failing. -
@potemkin_ai the long token is fine, i had just pruned it for pasting here.
-
@potemkin_ai said in Automated server reboot:
I probably could, but what's the point?
It's two birds with one stone. You end up having app/site monitoring too but I'm not against your method. I'm just suggesting alternatives for consideration.
-
@humptydumpty thank you, but my server is already monitored - both from inside (with the monitoring agent) and from the outside (via http ping), so my only task now, itโs to ensure I can drop an e-mail notification to myself, so that if my monitoring shows that the server is not available, I can see an e-mail next to the monitoring saying, that the server was going to reboot itself, which will help me to understand and fix that in no time, instead of guessing what could went wrong.
-
@potemkin_ai We can try it step by step:
docker inspect --format '{{ .Config.Env }}' mail | tr ' ' '\n' | grep CLOUDRON_RELAY_TOKEN CLOUDRON_RELAY_TOKEN=71df0df31cb3512bfe8fad02561cda813c6db4f94d2cb7137bbc162e9c1775058887606e5c37b8013df08498e3c609f52f1147cbb5a9ad96b7f4c5e848a235c44569510c37ab25eaaa67d50641481843cad93c7221893a869e34411d3e8edf6f55e3b7d8fa3ab1ce7632e0fd3bf65a8050549fe4d43d50e3ddb1c2c6b0eaca0d root@upgrade-test:~# echo "71df0df31cb3512bfe8fad02561cda813c6db4f94d2cb7137bbc162e9c1775058887606e5c37b8013df08498e3c609f52f1147cbb5a9ad96b7f4c5e848a235c44569510c37ab25eaaa67d50641481843cad93c7221893a869e34411d3e8edf6f55e3b7d8fa3ab1ce7632e0fd3bf65a8050549fe4d43d50e3ddb1c2c6b0eaca0d" | wc -c 257
So, mine is also 257 characters long.
# docker inspect --format '{{ .NetworkSettings.Networks.cloudron.IPAddress }}' mail 172.18.0.3
The final command:
# swaks -s 172.18.0.3 -p 2525 --au no-reply@cloudron.space --ap "71df0df31cb3512bfe8fad02561cda813c6db4f94d2cb7137bbc162e9c1775058887606e5c37b8013df08498e3c609f52f1147cbb5a9ad96b7f4c5e848a235c44569510c37ab25eaaa67d50641481843cad93c7221893a869e34411d3e8edf6f55e3b7d8fa3ab1ce7632e0fd3bf65a8050549fe4d43d50e3ddb1c2c6b0eaca0d" -f no-reply@cloudron.space -t 'test@cloudron.io' --h-Subject "Test mail"
Can you paste your entire sequence like above? Note that it has to be
no-reply@yourdomain.com
for both the --au argument and the -f argument. -
@girish I can confirm that the following works for me:
swaks -s `docker inspect --format '{{ .NetworkSettings.Networks.cloudron.IPAddress }}' mail` -p 2525 --au no-reply@9wd.eu --ap `docker inspect --format '{{ .Config.Env }}' mail | tr ' ' '\n' | grep CLOUDRON_RELAY_TOKEN | sed 's/^.*=//'` -f no-reply@9wd.eu -t 'test@9wd.eu' --h-Subject "Test mail"
-
@fbartels @girish something is wrong here..
Note that it has to be no-reply@yourdomain.com for both the --au argument and the -f argument.
--au no-reply@9wd.eu ... -f no-reply@9wd.eu
those two contradicts to each other...
@fbartels does this command actually deliver an e-mail to test@9wd.eu?
-
@girish sure, here it is:
root@anabelle:~# docker inspect --format '{{ .Config.Env }}' mail | tr ' ' '\n' | grep CLOUDRON_RELAY_TOKEN CLOUDRON_RELAY_TOKEN=818e705168cd0605a63ee69228bdcdec7def1d170054c14281f27c3b986486adcdd447bf161f1f6b4eb858037abc19558cf8877bc1603c4a152db20c94aa9dd7eabb68a9da950b8e54684fcb75a531c808254c0a60165f20a825170b24b1b06bb833955750412d769257a3607cc5637e40dca57402be4ef67a1d4f91df329c22 root@anabelle:~# echo "818e705168cd0605a63ee69228bdcdec7def1d170054c14281f27c3b986486adcdd447bf161f1f6b4eb858037abc19558cf8877bc1603c4a152db20c94aa9dd7eabb68a9da950b8e54684fcb75a531c808254c0a60165f20a825170b24b1b06bb833955750412d769257a3607cc5637e40dca57402be4ef67a1d4f91df329c22" | wc -c 257 root@anabelle:~# docker inspect --format '{{ .NetworkSettings.Networks.cloudron.IPAddress }}' mail 172.18.0.5 root@anabelle:~# swaks -s 172.18.0.5 -p 2525 --au no-reply@cloudron.space --ap "818e705168cd0605a63ee69228bdcdec7def1d170054c14281f27c3b986486adcdd447bf161f1f6b4eb858037abc19558cf8877bc1603c4a152db20c94aa9dd7eabb68a9da950b8e54684fcb75a531c808254c0a60165f20a825170b24b1b06bb833955750412d769257a3607cc5637e40dca57402be4ef67a1d4f91df329c22" -f no-reply@cloudron.space -t 'mypersonal@email.com' --h-Subject "Test mail" === Trying 172.18.0.5:2525... === Connected to 172.18.0.5. <- 220 my.serveddomain.com ESMTP Haraka/2.8.27 ready -> EHLO localhost <- 250-my.serveddomain.com Hello [172.18.0.1]Haraka is at your service. <- 250-PIPELINING <- 250-8BITMIME <- 250-SMTPUTF8 <- 250-SIZE 26214400 <- 250 AUTH LOGIN PLAIN -> AUTH LOGIN <- 334 VXNlcm5hbWU6 -> bm8tcmVwbHlAY2xvdWRyb24uc3BhY2U= <- 334 UGFzc3dvcmQ6 -> ODE4ZTcwNTE2OGNkYTYwMTY1ZjIwYTgyNTE3MGIyM2IxYjA2YmI4MzM5NTU3NTA0MTQwMmJlNGVmNjdhMWQ0ZjkxZGYyZDc2OTI1N2EzNjA3Y2M1NjM3ZTQwZGNhNTc4YmRjZGVjN2RlZjFkMTcwMDUyMjU1OGNmODg3N2JjMTYwMmM0YTE1MmNiMjljOTRhYTlkZDdlYTRjMTQyODFmMjdjM2I5ODY0ODZhZDA2MDVhNjNlZTY5YmI2OGE5ZGE5NTBiOGU1NDU4NGVjYjc1YTUzMGM4MDgyNTRjMGNkZDQ0N2JmMTYxZjFmNmI0ZWI4NTgwMzdhYmMxODMyOWMyMg== <** 535 5.7.8 Authentication failed -> AUTH PLAIN AG5vLXJlcGx5QGNsb3Vkcm9uLnNwYWNlADgxOGU3MDUxNjhjZGE2MDE2NWYyMGE4MjUxNzBiMjNiMWIwNmJiODMzOTU1NzUwNDE0MDJiZTRlZjY3YTFkNGY5MWRmMmQ3NjkyNTdhMzYwN2NjNTYzN2U0MGRjYTU3OGJkY2RlYzdkZWYxZDE3MDA1MjI1NThjZjg4NzdiYzE2MDJjNGExNTJjYjI5Yzk0YWE5ZGQ3ZWE0YzE0MjgxZjI3YzNiOTg2NDg2YWQwNjA1YTYzZWU2OWJiNjhhOWRhOTUwYjhlNTQ1ODRlY2I3NWE1MzBjODA4MjU0YzBjZGQ0NDdiZjE2MWYxZjZiNGViODU4MDM3YWJjMTgzMjljMjI= <** 535 5.7.8 Authentication failed *** No authentication type succeeded -> QUIT <- 221 my.serveddomain.com closing connection. Have a jolly good day. === Connection closed with remote host.
-
@potemkin_ai the
no-reply@cloudron.space
in the swaks command is not correct. you have to replace this withno-reply@yourdashboarddomain.com
(in 2 places in the command line) -
@potemkin_ai said in Automated server reboot:
@fbartels does this command actually deliver an e-mail to test@9wd.eu?
Yes, just like Girish said, you only need to make sure that your from (the
-f
parameter) and the login user (the-au
parameter) match your main cloudron domain. The-t
is the parameter for the recipient, this can be on the cloudron system or another mailbox.