modernizing the dependencies

This commit is contained in:
finn committed 2026-10-19 18:53:59 +02:00
1 parent a1c6b656d7
commit 2bd853e9b5
12 files changed
+33 -36

No files matched your search

+4 -9
View File
@@ -1,12 +1,7 @@
FROM python:3.8.12-slim-buster
FROM python:3.15-slim-trixie
RUN apt-get -y update && apt-get -y upgrade && \
apt-get install --no-install-recommends -y wait-for-it lsb-release wget gnupg2 gcc libpq-dev libc-dev
# install psql 13 (11 is the default with debian)
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list
RUN apt-get update && apt-get --no-install-recommends -y install postgresql-client-13 && apt-get clean all
RUN apt -y update && apt -y upgrade && \
apt install --no-install-recommends -y wait-for-it lsb-release wget gnupg2 gcc libpq-dev libc-dev vim postgresql-client && apt clean all
WORKDIR /app
@@ -15,7 +10,7 @@ RUN pip install -U -r requirements.txt
RUN mkdir log
ENV PYTHONPATH /app/
ENV PYTHONPATH=/app/
ENV FLASK_APP=max.app
ENV FLASK_ENV=production
+4 -9
View File
@@ -1,12 +1,7 @@
FROM python:3.8.12-slim-buster
FROM python:3.15-slim-trixie
RUN apt-get -y update && apt-get -y upgrade && \
apt-get install --no-install-recommends -y wait-for-it lsb-release wget gnupg2 gcc libpq-dev libc-dev vim
# install psql 13 (11 is the default with debian)
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list
RUN apt-get update && apt-get --no-install-recommends -y install postgresql-client-13 && apt-get clean all
RUN apt -y update && apt -y upgrade && \
apt install --no-install-recommends -y wait-for-it lsb-release wget gnupg2 gcc libpq-dev libc-dev vim postgresql-client && apt clean all
WORKDIR /app
@@ -16,7 +11,7 @@ RUN pip install -U -r requirements.txt -r requirements-dev.txt
RUN mkdir log
ENV PYTHONPATH /app/
ENV PYTHONPATH=/app/
ENV FLASK_APP=max.app
ENV FLASK_ENV=development
+2 -2
View File
@@ -1,7 +1,7 @@
# DEVELOPMENT SERVER
build-dev:
docker build -t max-dev -f Dockerfile.dev .
docker build -t max:dev -f Dockerfile.dev .
run-dev: | build-dev
# bash -c "trap 'docker-compose -f dc.dev.yml down' EXIT; MAX_COMMAND=\"flask run --host 0.0.0.0 --port 8000\" docker-compose -f dc.dev.yml up --build"
@@ -29,7 +29,7 @@ run-cleanup: | build-dev
# PROD
build-prod:
docker build -t max .
docker build -t max:$(shell cat VERSION) .
run-prod:
docker-compose up -d
+6
View File
@@ -3,3 +3,9 @@
A small little program to manage emails.
The proxy should add X-Real-IP to get a better logging.
## Setup
Requirements: Docker, Make
Start with `make run-dev`
+1
View File
@@ -0,0 +1 @@
1.1.0
+1 -2
View File
@@ -1,7 +1,6 @@
version: '3'
services:
max:
image: max-dev
image: max:dev
volumes:
- ./max:/app/max
depends_on:
+1 -2
View File
@@ -1,7 +1,6 @@
version: '3'
services:
max:
image: max
image: max:1.1.0
depends_on:
- postgresql
ports:
+3 -3
View File
@@ -74,9 +74,9 @@ def main():
app.jinja_env.lstrip_blocks = True
app.url_rule_class = Rule
app.config.update(
SECRET_KEY="123456"
if app.debug
else base64.b64encode(os.urandom(64)).decode("utf-8"),
SECRET_KEY=(
"123456" if app.debug else base64.b64encode(os.urandom(64)).decode("utf-8")
),
SESSION_COOKIE_SECURE=not app.debug,
SESSION_COOKIE_SAMESITE=False,
)
+3 -3
View File
@@ -85,9 +85,9 @@ class AliasCreate(
for key in ("email", "domain", "enabled", "note"):
if hasattr(self, key):
context[key] = getattr(self, key)
context[
"can_use_different_alias_domain"
] = self.user.can_use_different_alias_domain
context["can_use_different_alias_domain"] = (
self.user.can_use_different_alias_domain
)
if self.user.can_use_different_alias_domain:
context["domains"] = get_domains()
else:
+1 -1
View File
@@ -16,7 +16,7 @@ class Favicon(AllowAnyAccess, BaseView):
def get(self):
random_favicon = self.get_random_favicon_filename()
return send_from_directory(FAVICON_FOLDER, random_favicon, add_etags=False)
return send_from_directory(FAVICON_FOLDER, random_favicon, etag=False)
def ensure_favicons(self):
if STATE_FAVICON_ATTR not in self._state:
+4 -2
View File
@@ -81,7 +81,7 @@ class SessionInterface(FlaskSessionInterface):
return Signer(app.secret_key, salt="flask-session", key_derivation="hmac")
def get_cookie_name(self, app):
return app.session_cookie_name
return app.config["SESSION_COOKIE_NAME"]
def make_session_object(self, session_id=None, data=None):
return Session(session_id, data=data)
@@ -119,7 +119,9 @@ class SessionInterface(FlaskSessionInterface):
secure = self.get_cookie_secure(app)
expires = self.get_expiration_time(app, session)
session_storage[session.id] = dict(session)
session_id = self._get_signer(app).sign(want_bytes(session.id))
session_id = (
self._get_signer(app).sign(want_bytes(session.id)).decode("utf-8")
)
response.set_cookie(
cookie_name,
session_id,
+3 -3
View File
@@ -1,3 +1,3 @@
flask
psycopg2
gunicorn
Flask==3.1.3
psycopg2==2.9.13
gunicorn==26.2.0