rename forest.py and email.py to fit execution

This commit is contained in:
deflax 2024-03-31 18:22:08 +03:00
parent e84396fc28
commit 5c8597a957
10 changed files with 18 additions and 12 deletions

4
.gitignore vendored
View file

@ -13,6 +13,10 @@ data/db/*
data/dbadmin/*
!data/dbadmin/.placeholder
# ignore pgadmin volumes
data/pgadmin/*
!data/pgadmin/.placeholder
# ignore osmtile postgresql volume
data/osmtile/*
!data/osmtile/.placeholder

View file

@ -14,9 +14,10 @@ services:
pgadmin:
image: dpage/pgadmin4
volumes:
- "./data/pgadmin/lib:/var/lib/pgadmin"
- "./data/pgadmin:/var/lib/pgadmin"
env_file:
- ./.env
user: '$UID:$GID'
ports:
- 5050:80
restart: always
@ -39,6 +40,8 @@ services:
- internal
labels:
- meta.role=forest
#profiles:
# - donotstart
# osmtile:
# image: overv/openstreetmap-tile-server:2.3.0

View file

@ -20,6 +20,4 @@ COPY . $APP_HOME
RUN --mount=type=cache,target=/root/.cache \
pip3 install -r requirements.txt
EXPOSE 8080
CMD [ "waitress-serve", "--port=5000", "--call", "forest:create_app"]
CMD ["python","app.py"]

View file

@ -5,7 +5,7 @@ from flask_sqlalchemy import get_debug_queries
from . import admin
from .. import db
from ..email import send_email
from ..mailsender import send_email
from ..models import User, Item
from ..decorators import admin_required, permission_required

View file

@ -13,6 +13,7 @@ from flask import (
redirect,
url_for
)
from waitress import serve
from flask_sqlalchemy import SQLAlchemy
from flask_bootstrap import Bootstrap
from flask_mail import Mail
@ -104,5 +105,5 @@ def service_unavailable(e):
def handle_csrf_error(e):
return render_template('errors/csrf_error.html', reason=e.description), 400
def create_app():
return app
if __name__ == "__main__":
serve(app, listen='*:5000')

View file

@ -4,7 +4,7 @@ from flask_login import login_required, login_user, logout_user, current_user
from . import auth
from .. import db
from ..models import User
from ..email import send_email
from ..mailsender import send_email
from .forms import LoginForm, TwoFAForm, RegistrationForm, ChangePasswordForm, PasswordResetRequestForm, PasswordResetForm
from ..decorators import admin_required, permission_required

View file

@ -5,7 +5,7 @@ from flask_sqlalchemy import get_debug_queries
from . import main
from .forms import LoginForm, RegistrationForm
from .. import db
from ..email import send_email
from ..mailsender import send_email
from ..models import User, Permission, Item
import base64

View file

@ -4,7 +4,7 @@ from flask_sqlalchemy import get_debug_queries
from . import panel
from .. import db
from ..email import send_email
from ..mailsender import send_email
from ..models import User, Permission, Item
import base64

View file

@ -5,7 +5,7 @@ from sqlalchemy import desc
from . import settings
from .forms import EditProfileForm, EditProfileAdminForm
from ..email import send_email
from ..mailsender import send_email
from .. import db
from ..models import User
import sys