Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker Image Outdated? #916

Open
viveksjain opened this issue Apr 21, 2022 · 37 comments
Open

Docker Image Outdated? #916

viveksjain opened this issue Apr 21, 2022 · 37 comments

Comments

@viveksjain
Copy link

Thanks for this great project. I guess this is pretty much same request as #364, it looks like docker image is over a year old. Is it possible to publish a new release? Docker-compose would be useful as well for quickly getting started but I guess that is tracked in #355.

@nguyenkims
Copy link
Contributor

@viveksjain we'll publish the new image in the next coming months. Our calendar is unfortunately packed at the moment but rest assured that releasing new image is in our todo list :).

@henokv
Copy link

henokv commented Apr 26, 2022

@nguyenkims does the site simple checkout a specific commit and runs on this version instead of docker images?
Would it be possible to document somewhere which commit the site is currently working on?
I assume that this version would be stable enough for most use-cases while still giving the new functionality.

@nguyenkims
Copy link
Contributor

@henokv We deploy new versions quite often, you can see the current version running at https://app.simplelogin.io/git

And yes you can run the latest version on your server. This version isn't tested in a self hosted setup though so run it at your own risk :).

@Heziode
Copy link

Heziode commented May 4, 2022

The latest edit in changelog goes back to a year (3.4.0).
You should consider shorter iteration cycles, especially to publish patches (if necessary).

You could also setup a CI/CD, to release at least a simplelogin/app-dev on docker hub, for those who are adventurous 😉

@pocki
Copy link

pocki commented Jun 30, 2022

Any news about a new up-to-date docker image?
Or should now every selfhoster build it's own docker image?

@alpha-tango-kilo
Copy link
Contributor

There's simplelogin/app-ci on Docker Hub which appears to mirror GitHub tags, but I doubt it's 'officially' supported. I haven't tried it myself yet - no migration instructions etc.

@pocki
Copy link

pocki commented Jul 1, 2022

Thanks @alpha-tango-kilo

I used the upgrade infos from here 4.6.2-beta/docs/upgrade.md but used the simplelogin/app-ci:v4.7.3 images instead

At the upgrade and also at starting the containers I am getting some warnings, but it seems everything is working.

Paddle param not set
Upload files to local dir
Symbol 'mailbox_or_url_list' is unreachable
Symbol 'delim' is unreachable
Symbol 'mailbox_or_url' is unreachable
Symbol 'mailbox' is unreachable
Symbol 'url' is unreachable
Symbol 'angle_addr' is unreachable
Symbol 'name_addr' is unreachable
Symbol 'phrase' is unreachable
Symbol 'mailbox_or_url_list' is unreachable
Symbol 'delim' is unreachable
Symbol 'mailbox_or_url' is unreachable
Symbol 'mailbox' is unreachable
Symbol 'addr_spec' is unreachable
Symbol 'angle_addr' is unreachable
Symbol 'name_addr' is unreachable
Symbol 'phrase' is unreachable
Symbol 'local_part' is unreachable
Symbol 'domain' is unreachable
Symbol 'quoted_string' is unreachable
Symbol 'domain_literal' is unreachable
Symbol 'quoted_string_text' is unreachable
Symbol 'domain_literal_text' is unreachable
Symbol 'mailbox_or_url_list' is unreachable
Symbol 'delim' is unreachable

@alpha-tango-kilo
Copy link
Contributor

Nice one! Hadn't thought to check other branches. Might have to try it myself when my stress levels are too low 😛

@thecosmicfrog
Copy link

thecosmicfrog commented Jul 12, 2022

Hi @nguyenkims Any update on a new stable release of the Docker image? It seems odd that there have been numerous 4.x.x releases and no image to deploy this with.

Thanks! :)

@nguyenkims
Copy link
Contributor

@thecosmicfrog we are beta testing the new version on 4.6.2-beta https://github.com/simple-login/app/tree/4.6.2-beta, don't hesitate to check it out.

@thecosmicfrog
Copy link

Thanks @nguyenkims. Looks like you have migration instructions too. I'll take a look this weekend.

@sakearzoo
Copy link

app [4.6.2-beta] is there in docker but its only available for amd64 not for arm64 when we could expect the same for arm64 ??

@nguyenkims
Copy link
Contributor

@sakearzoo I've pushed the image for arm64, can you try now?

@sakearzoo
Copy link

@nguyenkims it would be helpful if you provide me docker-compose template with tls cert (currently using traefik as reverse proxy)

And i couldn't find any way to configure MTA-STS and other security measures on docker using env?

@alpha-tango-kilo
Copy link
Contributor

it would be helpful if you provide me docker-compose template with tls cert (currently using traefik as reverse proxy)

@sakearzoo

There are two ongoing/open PRs for Docker Compose support: #309 & #355. They both take slightly different approaches and have slightly different 'extras' (probably part of the reason why they're not merged yet). Take a look and see what you fancy. You probably should be contributing to the conversation there rather than here given it's a completely separate issue.

I've managed to set up a more barebones config that's just strictly the SimpleLogin containers, reach out to me if you'd prefer that to what's already available.

@nakoo
Copy link

nakoo commented Jul 20, 2022

@alpha-tango-kilo

I've managed to set up a more barebones config that's just strictly the SimpleLogin containers, reach out to me if you'd prefer that to what's already available.

Hi, I'm interested in how you achieved it. I've been used #355 approach but looking for how others do.

@alpha-tango-kilo
Copy link
Contributor

I have a .env file that specifies SIMPLELOGIN_VERSION (only), then my docker-compose.yml is:

version: "2.2"

networks:
  default:
    name: sl-network
    ipam:
      config:
        - subnet: 240.0.0.0/24
          gateway: 240.0.0.1

services:
  postgres:
    image: postgres:12.1
    container_name: sl-db
    ports:
      - "5432:5432"
    volumes:
      - ./sl/db:/var/lib/postgresql/data
    environment:
      - POSTGRES_USER=YOUR_USER
      - POSTGRES_PASSWORD=YOUR_PASSWORD
      - POSTGRES_DB=simplelogin
    restart: unless-stopped
  
  sl-app:
    # The latest tag isn't maintained >:(
    image: simplelogin/app:${SIMPLELOGIN_VERSION:?please specify simplelogin/app version}
    container_name: sl-app
    ports:
      - "7777:7777"
    volumes:
      - ./sl:/sl
      - ./sl/upload:/code/static/upload
      - ./simplelogin.env:/code/.env
      - ./dkim.key:/dkim.key:ro
      - ./dkim.pub.key:/dkim.pub.key:ro
    restart: unless-stopped
  
  sl-email:
    image: simplelogin/app:${SIMPLELOGIN_VERSION:?}
    container_name: sl-email
    command: python email_handler.py
    ports:
      - "20381:20381"
    volumes:
      - ./sl:/sl
      - ./sl/upload:/code/static/upload
      - ./simplelogin.env:/code/.env
      - ./dkim.key:/dkim.key:ro
      - ./dkim.pub.key:/dkim.pub.key:ro
    restart: unless-stopped

  sl-job-runner:
    image: simplelogin/app:${SIMPLELOGIN_VERSION:?}
    container_name: sl-job-runner
    command: python job_runner.py
    volumes:
      - ./sl:/sl
      - ./sl/upload:/code/static/upload
      - ./simplelogin.env:/code/.env
      - ./dkim.key:/dkim.key:ro
      - ./dkim.pub.key:/dkim.pub.key:ro
    restart: unless-stopped

Note: your subnet may be different to mine, as it was changed in the getting started guide at one point
Refer to your /etc/postfix/main.cf and see which subnet is in there, if you followed the guide it'll either be 10.0.0.0/24 or 240.0.0.0/24 (just search within the file and it's whichever one has matches).

@akash07k
Copy link

@alpha-tango-kilo
Why are using version 2.1 for compose file? can I use 3 without any issues?

@alpha-tango-kilo
Copy link
Contributor

Why are using version 2.1 for compose file?

Dunno

Can I use 3 without any issues?

No idea, I'm not providing any technical support for that snippet. Use/Modify at your own risk


My attitude to SimpleLogin is "if it isn't broken, don't fix it" - it's not worth downtime on your email server

@kylhuk
Copy link

kylhuk commented Sep 21, 2022

I just upgraded my docker setup from v3.4.0 to v4.14.8 and everything works like a charm. What I did was upgrading it to the simplelogin/app:4.6.2-beta image according to the upgrade.md manual. After this was up and running, I did the exact same thing again, but this time I used simplelogin/app-ci:v4.14.8 as the new image.

As far as I can see, there are no bugs, everything is working absolutely fine without any modifications to the configuration. But I'll keep an eye on it for the next couple days.

@akash07k
Copy link

akash07k commented Sep 21, 2022 via email

@alpha-tango-kilo
Copy link
Contributor

Good to know @kylhuk, an update after a longer timeframe (at least a week) would be appreciated! I'm very cautious about updated SimpleLogin because my whole (email) life depends on it lol

@kylhuk
Copy link

kylhuk commented Oct 3, 2022

@alpha-tango-kilo up until today, I had no issues at all. You can easily backup everything, just by copying the folder, where you stored all the docker related data. This way you can always revert back to the old (v3.4.0) setup.

@alpha-tango-kilo
Copy link
Contributor

Thanks for providing an update, I may give it a go at some point then!

@lenusch
Copy link

lenusch commented Apr 7, 2023

Is it possible to get a new 4.x Docker stable Version? Thx anyways for your good work.

@awg13
Copy link

awg13 commented May 5, 2023

I just upgraded my docker setup from v3.4.0 to v4.14.8 and everything works like a charm. What I did was upgrading it to the simplelogin/app:4.6.2-beta image according to the upgrade.md manual. After this was up and running, I did the exact same thing again, but this time I used simplelogin/app-ci:v4.14.8 as the new image.

Thanks for this. I was able to get the latest version running. One caveat; when running the database migration command, use alembic upgrade head instead of flask db upgrade like this;

docker run --rm \
    --name sl-migration \
    -v $(pwd)/sl:/sl \
    -v $(pwd)/sl/upload:/code/static/upload \
    -v $(pwd)/dkim.key:/dkim.key \
    -v $(pwd)/dkim.pub.key:/dkim.pub.key \
    -v $(pwd)/simplelogin.env:/code/.env \
    --network="sl-network" \
    simplelogin/app:4.6.2-beta alembic upgrade head

@springcomp
Copy link
Contributor

And i couldn't find any way to configure MTA-STS and other security measures on docker using env?

@sakearzoo I setup MTA-STS and TLSRPT manually and tried to document that in #1806. Maybe this will help you. I’m happy for any feedback of course.

@europacafe
Copy link

europacafe commented Dec 6, 2023

Hi,
Thanks for this useful guide.
I already have my self-hosted mail system (using docker-mailserver on my Unraid server) working properly. The mail system does not use postgres database.
Can I somehow run simplelogin dockers on top of it without changing anything on my existing mail system?

@maaaathis
Copy link

Hey @nguyenkims,
the mentioned branch doesn't exists anymore.

@nguyenkims
Copy link
Contributor

@maaaathis which branch you refer to?

@maaaathis
Copy link

@maaaathis which branch you refer to?

I mean the "4.6.2-beta" branch (https://github.com/simple-login/app/tree/4.6.2-beta) as said here #916 (comment) @nguyenkims

There is also no "4.6.5-beta" branch, which is the latest released version in Docker Hub.

@nguyenkims
Copy link
Contributor

@maaaathis I see, please use https://github.com/simple-login/app/tree/new-self-host-version instead. As the version changes, we don't want to use the branch 4.6.2-beta.

@springcomp
Copy link
Contributor

springcomp commented Jan 4, 2024

@maaaathis

For the record, by following the instructions in this repository, I was able to successfully:

  • run the official version simplelogin/app:3.4.0
  • upgrade to the latest beta version simplelogin/app:4.6.5-beta
  • upgrade to the latest stable version simplelogin/app-ci:v4.36.6

As a shameless plug let me rephrase the instructions I have on my simple Docker-Compose for self-hosting SimpleLogin.

How-to Upgrade

  • Change the image version in .env
SL_IMAGE=app
SL_VERSION=4.6.5-beta

For instance, to upgrade from 3.4.0 to 4.6.x-beta, the following change must be done in simplelogin-compose.yaml:

    volumes:
      - ./db:/var/lib/postgresql/data
    restart: unless-stopped

  migration:
    image: simplelogin/app:$SL_VERSION
-   command: [ "flask", "db", "upgrade" ]
+   command: [ "alembic", "upgrade", "head" ]
    container_name: sl-migration
    env_file: .env

The following changes must be done in pgsql-transport-maps.cf:

  dbname = simplelogin
  
  query = SELECT 'smtp:127.0.0.1:20381' FROM custom_domain WHERE domain = '%s' AND verified=true
+     UNION SELECT 'smtp:127.0.0.1:20381' FROM public_domain WHERE domain = '%s'
      UNION SELECT 'smtp:127.0.0.1:20381' WHERE '%s' = 'mydomain.com' LIMIT 1;

The following changes must be done in pgsql-relay-maps.cf:

  dbname = simplelogin
  
  query = SELECT domain FROM custom_domain WHERE domain = '%s' AND verified=true
+     UNION SELECT domain FROM public_domain WHERE domain = '%s'
      UNION SELECT '%s' WHERE '%s' = 'mydomain.com' LIMIT 1;

Finally, the following command must be run in the database:

docker exec -it sl-db psql -U myuser simplelogin
> UPDATE email_log SET alias_id=(SELECT alias_id FROM contact WHERE contact.id = email_log.contact_id);
> \q
  • Restart containers
./down.sh && ./up.sh

After successfully upgrading to v4.6.x-beta you might want to upgrade
to the latest stable version. Change the SL_IMAGE and SL_VERSION
variables from the .env file:

SL_VERSION=v4.36.6
SL_IMAGE=app-ci

@loeffelpan
Copy link

loeffelpan commented May 19, 2024

Anyone managed to get a app-ci up and running?
I got this permanently in the logs of sl-app.

[2024-05-19 20:59:43 +0000] [130] [INFO] Booting worker with pid: 130
[2024-05-19 20:59:43 +0000] [131] [INFO] Booting worker with pid: 131
>>> URL: https://app.kbw3.de
MAX_NB_EMAIL_FREE_PLAN is not set, use 5 as default value
Paddle param not set
Upload files to local dir
>>> init logging <<<
>>> URL: https://app.kbw3.de
MAX_NB_EMAIL_FREE_PLAN is not set, use 5 as default value
Paddle param not set
Upload files to local dir
>>> init logging <<<
2024-05-19 20:59:56,036 - SL - DEBUG - 131 - "/code/app/utils.py:17" - <module>() -  - load words file: /code/local_data/words.txt
2024-05-19 20:59:56,577 - SL - DEBUG - 130 - "/code/app/utils.py:17" - <module>() -  - load words file: /code/local_data/words.txt
[2024-05-19 20:59:59 +0000] [1] [CRITICAL] WORKER TIMEOUT (pid:130)
[2024-05-19 20:59:59 +0000] [1] [CRITICAL] WORKER TIMEOUT (pid:131)

@mrehanabbasi
Copy link

@loeffelpan Simplelogin is most probably working for you. It's the web app which isn't running. I got the same error on my web app but it somehow started working after I logged in a couple of days later.

@loeffelpan
Copy link

Correct it was just the web-app. But without it, it's hard to initially register and create aliases ;-)
But I figured it out.
In my case there was only one thing to adjust to prevent sl-app getting worker timeout.
Obviouly I had to adjust the timeout.
sl-app starts gunicorn webserver with this CMD in the Dockerfile:
["gunicorn","wsgi:app","-b","0.0.0.0:7777","-w","2","--timeout","15"]
I simply added command to the service for the web-app in my compose file and changed it to "--timeout","60" and everything works.

@Tresillo2017
Copy link

Tresillo2017 commented Jul 9, 2024

After upgrading following @springcomp instructions I'm getting this error in the sl-job-runner container which lead to sl-app to throw Internal Server Error when trying to load the webpage.
https://hastebin.com/share/daraqohuko.php

docker-compose.yml

version: "2.2"

networks:
  default:
    name: sl-network
    ipam:
      config:
        - subnet: 10.0.0.0/24
          gateway: 10.0.0.1

services:
  postgres:
    image: postgres:12.1
    container_name: sl-db
    ports:
      - "5432:5432"
    volumes:
      - ./sl/db:/var/lib/postgresql/data
    environment:
      - POSTGRES_USER=simpleloginusername
      - POSTGRES_PASSWORD=password
      - POSTGRES_DB=simplelogin
    restart: unless-stopped

  sl-app:
    # The latest tag isn't maintained >:(
    image: simplelogin/${SL_IMAGE:?}:${SL_VERSION:?}
    container_name: sl-app
    ports:
      - "7777:7777"
    volumes:
      - ./sl:/sl
      - ./sl/upload:/code/static/upload
      - ./simplelogin.env:/code/.env
      - ./dkim.key:/dkim.key:ro
      - ./dkim.pub.key:/dkim.pub.key:ro
    restart: unless-stopped

  sl-email:
    image: simplelogin/${SL_IMAGE:?}:${SL_VERSION:?}
    container_name: sl-email
    command: python email_handler.py
    ports:
      - "20381:20381"
    volumes:
      - ./sl:/sl
      - ./sl/upload:/code/static/upload
      - ./simplelogin.env:/code/.env
      - ./dkim.key:/dkim.key:ro
      - ./dkim.pub.key:/dkim.pub.key:ro
    restart: unless-stopped

  sl-job-runner:
    image: simplelogin/${SL_IMAGE:?}:${SL_VERSION:?}
    container_name: sl-job-runner
    command: python job_runner.py
    volumes:
      - ./sl:/sl
      - ./sl/upload:/code/static/upload
      - ./simplelogin.env:/code/.env
      - ./dkim.key:/dkim.key:ro
      - ./dkim.pub.key:/dkim.pub.key:ro
    restart: unless-stopped

I got the webpage to work with simplelogin/app:4.6.5-beta

Edit

I got it to work by starting all over again and deleting the sl folder. I've created the database using simplelogin/app-ci and then used the migration tool with the same docker image. Now it's working. I'm still having the same problem as I mentioned here #2146 but now I'm running the ci

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests