Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Mastodon
  3. Mastodon .env.production resets after update or restart

Mastodon .env.production resets after update or restart

Scheduled Pinned Locked Moved Mastodon
feature-requestmail
8 Posts 2 Posters 66 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    yossi6206
    wrote last edited by
    #1

    Hi,
    I’m running Mastodon on my server (Cloudron-based setup), and I’ve noticed that after every app update or container restart, the file
    /app/data/.env.production — which I edit via nano — gets reset to its default values.

    Because of this, all my custom mail server (SMTP) settings are lost each time the app restarts or updates.

    Is there a way to make these environment variables persistent across updates and restarts in Mastodon?
    Should I store them in another location (like cloudron.env) or configure them differently so they won’t be overwritten?

    Thanks in advance for your help!

    1 Reply Last reply
    1
    • jamesJ Online
      jamesJ Online
      james
      Staff
      wrote last edited by james
      #2

      Hello @yossi6206
      Currently, the Mastodon app does not have the option to disable the automatic mail configuration in /app/data/env.production.
      I will take this topic as a feature request to make the automated mail config optional.

      1 Reply Last reply
      0
      • jamesJ Online
        jamesJ Online
        james
        Staff
        wrote last edited by
        #3

        Hello @yossi6206
        Can you elaborate why you need to configure a custom mail server in the config file?
        Since you can configure Cloudron to use Relay outbound mails that would handle it for you.

        1 Reply Last reply
        0
        • Y Offline
          Y Offline
          yossi6206
          wrote last edited by yossi6206
          #4

          @james

          Hi,
          I configured the SMTP directly inside the app so that registration emails could be sent.
          In the Mail FROM Address section, the app is configured to send mails using the address below and examplemail.com’s Outbound Email settings.

          When I test with “Send test email” from the Mastodon admin panel, it works — I receive the test email successfully.
          However, inside the application itself (for example, when a new user registers), the confirmation email is not sent.

          So it seems that the SMTP settings work for the test function but not for real registration emails, which is why I tried setting it directly in .env.production.

          1 Reply Last reply
          2
          • jamesJ Online
            jamesJ Online
            james
            Staff
            wrote last edited by
            #5

            Hello @yossi6206
            Thanks for the details. We will look into it.

            1 Reply Last reply
            0
            • Y Offline
              Y Offline
              yossi6206
              wrote last edited by
              #6

              @james
              Hi,
              I’ve resolved the issue. I realized registration emails are sent via Sidekiq (background jobs), not via the test mail path. Checking the Sidekiq logs pointed me to the misconfiguration and I fixed it.

              For reference, I used:

              systemd:

              sudo journalctl -u mastodon-sidekiq -f

              Docker Compose:

              docker-compose logs -f sidekiq

              1 Reply Last reply
              0
              • jamesJ Online
                jamesJ Online
                james
                Staff
                wrote last edited by
                #7

                Hello @yossi6206
                I am a little confused.

                You state here:
                @yossi6206 said in Mastodon .env.production resets after update or restart:

                I’m running Mastodon on my server (Cloudron-based setup)

                and now:
                @yossi6206 said in Mastodon .env.production resets after update or restart:

                docker-compose logs -f sidekiq

                So, are you hosting Mastodon on Cloudron or custom with docker-compose?

                1 Reply Last reply
                0
                • Y Offline
                  Y Offline
                  yossi6206
                  wrote last edited by
                  #8

                  @james
                  I have a Cloudron license, and that’s where I install and manage all our applications. Sorry for the confusion!

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Bookmarks
                  • Search