simple-login / app

The SimpleLogin back-end and web app
https://simplelogin.io
GNU Affero General Public License v3.0
4.87k stars 410 forks source link

Docker Image Outdated? #916

Open viveksjain opened 2 years ago

viveksjain commented 2 years ago

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 commented 2 years ago

@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 commented 2 years ago

@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 commented 2 years ago

@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 commented 2 years ago

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 commented 2 years ago

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

alpha-tango-kilo commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

thecosmicfrog commented 2 years ago

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 commented 2 years ago

@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 commented 2 years ago

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

sakearzoo commented 2 years ago

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 commented 2 years ago

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

sakearzoo commented 2 years ago

@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 commented 2 years ago

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 commented 2 years ago

@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 commented 2 years ago

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 commented 1 year ago

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

alpha-tango-kilo commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

Wonderful, I'll also try it

On 9/21/2022 6:15 PM, kylhuk wrote:

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, but replaced the image with |simplelogin/app-ci:v4.14.8|.

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.

ā€” Reply to this email directly, view it on GitHub https://github.com/simple-login/app/issues/916#issuecomment-1253657676, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQWBMYD4NVIOANJ66YD3RTV7L7OPANCNFSM5T52XS4Q. You are receiving this because you commented.Message ID: @.***>

alpha-tango-kilo commented 1 year ago

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 commented 1 year ago

@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 commented 1 year ago

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

lenusch commented 1 year ago

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

awg13 commented 1 year ago

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 commented 1 year ago

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 commented 7 months ago

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 commented 7 months ago

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

nguyenkims commented 6 months ago

@maaaathis which branch you refer to?

maaaathis commented 6 months ago

@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 https://github.com/simple-login/app/issues/916#issuecomment-1185274973 @nguyenkims

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

nguyenkims commented 6 months ago

@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 commented 6 months ago

@maaaathis

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

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

How-to Upgrade

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
./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 commented 2 months ago

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 commented 1 month ago

@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 commented 1 month ago

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 commented 1 week ago

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