Release 1.2: bulk upload, S3/SFTP/FTP, SMTP, password reset, user groups, git deploy
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+27
-2
@@ -33,6 +33,13 @@ def create_app():
|
||||
app.config["UPLOAD_FOLDER"] = os.getenv("UPLOAD_FOLDER", "uploads")
|
||||
app.config["MAX_CONTENT_LENGTH"] = int(os.getenv("MAX_UPLOAD_MB", "10")) * 1024 * 1024
|
||||
app.config["ALLOWED_EXTENSIONS"] = {"png", "jpg", "jpeg", "gif", "webp", "bmp"}
|
||||
app.config["GIT_REPO_PATH"] = os.getenv("GIT_REPO_PATH", "/repo")
|
||||
app.config["ALLOW_GIT_DEPLOY"] = os.getenv("ALLOW_GIT_DEPLOY", "false").lower() in (
|
||||
"1",
|
||||
"true",
|
||||
"yes",
|
||||
)
|
||||
app.config["DEFAULT_GROUP_QUOTA_MB"] = int(os.getenv("DEFAULT_GROUP_QUOTA_MB", "100"))
|
||||
|
||||
os.makedirs(app.config["UPLOAD_FOLDER"], exist_ok=True)
|
||||
|
||||
@@ -53,14 +60,32 @@ def create_app():
|
||||
register_cli(app)
|
||||
|
||||
with app.app_context():
|
||||
from app.models import Folder, FolderInvite, FolderMember, Photo, User # noqa: F401
|
||||
from app.models import ( # noqa: F401
|
||||
Folder,
|
||||
FolderInvite,
|
||||
FolderMember,
|
||||
PasswordResetToken,
|
||||
Photo,
|
||||
SiteSettings,
|
||||
User,
|
||||
UserGroup,
|
||||
)
|
||||
|
||||
db.create_all()
|
||||
from app.bootstrap import create_first_admin, ensure_schema
|
||||
from app.bootstrap import (
|
||||
create_first_admin,
|
||||
ensure_default_group,
|
||||
ensure_photo_storage_column,
|
||||
ensure_schema,
|
||||
ensure_site_settings,
|
||||
)
|
||||
from app.folders import ensure_folder_schema
|
||||
|
||||
ensure_schema()
|
||||
ensure_default_group(app)
|
||||
ensure_folder_schema()
|
||||
ensure_site_settings(app)
|
||||
ensure_photo_storage_column()
|
||||
create_first_admin(app)
|
||||
|
||||
return app
|
||||
|
||||
Reference in New Issue
Block a user