Безопасность и публикация: убраны корпоративные следы, исправлены зависимости, SECRET_KEY обязателен

This commit is contained in:
InviteMe Developer
2026-08-31 17:51:37 +03:00
parent 35ab220b68
commit f5f4a33e8d
10 changed files with 42 additions and 19 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
# Обязательно: сильный случайный секретный ключ
# Пример генерации: openssl rand -hex 32
SECRET_KEY=change-me-in-production
SECRET_KEY=
# Базовый URL приложения (без слэша в конце), используется в QR-кодах
BASE_URL=https://your-domain.example.com
+20
View File
@@ -0,0 +1,20 @@
Proprietary License
Copyright (c) 2026 InviteMe
All rights reserved.
This software and associated documentation files (the "Software") are the
proprietary and confidential information of InviteMe. The Software is protected
by copyright law and international treaties.
Unauthorized access, use, copying, modification, merger, publication,
distribution, sublicensing, sale, transfer, reverse engineering, decompilation,
or disassembly of the Software, in whole or in part, is strictly prohibited
without prior written permission from the copyright holder.
The Software is provided "AS IS", without warranty of any kind, express or
implied, including but not limited to the warranties of merchantability,
fitness for a particular purpose and noninfringement.
For licensing inquiries, please contact the copyright holder.
+3 -3
View File
@@ -21,7 +21,7 @@
Требования: установленный Docker и Docker Compose.
```bash
git clone https://git.mycloud24.ru/insight/InviteMe.git
git clone <URL-репозитория>
cd InviteMe
# Собрать и запустить
@@ -37,7 +37,7 @@ docker compose up -d --build
Требования: Python 3.12.
```bash
git clone https://git.mycloud24.ru/insight/InviteMe.git
git clone <URL-репозитория>
cd InviteMe
python -m venv venv
@@ -101,4 +101,4 @@ InviteMe/
## Лицензия
Проект распространяется как есть для внутреннего использования.
См. файл [LICENSE](LICENSE).
+7
View File
@@ -20,6 +20,13 @@ def create_app(config_class=Config):
app = Flask(__name__)
app.config.from_object(config_class)
secret_key = app.config.get("SECRET_KEY", "")
if not secret_key or secret_key == "change-me-in-production":
raise RuntimeError(
"SECRET_KEY не задан или равен значению по умолчанию. "
"Задайте уникальный секретный ключ через переменную окружения SECRET_KEY или файл .env."
)
# Ensure upload directories exist
os.makedirs(app.config["PHOTO_FOLDER"], exist_ok=True)
os.makedirs(app.config["QR_FOLDER"], exist_ok=True)
+2 -2
View File
@@ -68,7 +68,7 @@
<div class="mb-4">
<label for="ews_url" class="form-label">EWS URL</label>
<input type="text" class="form-control" id="ews_url" name="ews_url" value="{{ settings.ews_url or '' }}" placeholder="https://mail.company.com/EWS/Exchange.asmx">
<div class="form-text text-muted">URL вида <code>https://mail.integrita.ru/EWS/Exchange.asmx</code></div>
<div class="form-text text-muted">URL вида <code>https://mail.company.com/EWS/Exchange.asmx</code></div>
</div>
</div>
@@ -88,7 +88,7 @@
<div class="row">
<div class="col-md-8 mb-3">
<label for="imap_server" class="form-label">IMAP-сервер</label>
<input type="text" class="form-control" id="imap_server" name="imap_server" value="{{ settings.imap_server or '' }}" placeholder="mail.integrita.ru">
<input type="text" class="form-control" id="imap_server" name="imap_server" value="{{ settings.imap_server or '' }}" placeholder="imap.example.com">
</div>
<div class="col-md-4 mb-3">
<label for="imap_port" class="form-label">Порт</label>
-5
View File
@@ -7,7 +7,6 @@
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
<link rel="icon" type="image/png" href="{{ url_for('static', filename='images/inviteme_logo.png') }}">
<!-- InviteMe — crafted for mycloud24.ru -->
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark">
@@ -81,9 +80,5 @@
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
{% block scripts %}{% endblock %}
<div class="easter-egg-star" title="о создателе">
★
<span class="ee-tooltip">crafted for mycloud24.ru</span>
</div>
</body>
</html>
+1 -1
View File
@@ -7,7 +7,7 @@ BASE_DIR = Path(__file__).resolve().parent
load_dotenv(BASE_DIR / ".env")
class Config:
SECRET_KEY = os.environ.get("SECRET_KEY") or "dev-secret-key-change-in-production"
SECRET_KEY = os.environ.get("SECRET_KEY") or ""
BASE_URL = os.environ.get("BASE_URL") or None
# Database
+2 -2
View File
@@ -8,9 +8,9 @@ services:
ports:
- "8888:8888"
environment:
# Замени на сильный случайный ключ перед запуском в продакшене
# Задай сильный случайный секретный ключ перед запуском.
# Пример генерации: openssl rand -hex 32
- SECRET_KEY=change-me-in-production
- SECRET_KEY=
- TIMEZONE=Europe/Moscow
volumes:
# База SQLite и загруженные файлы хранятся вне контейнера
+4 -4
View File
@@ -3,13 +3,13 @@ Flask-SQLAlchemy==3.1.1
Flask-Limiter==4.1.1
Flask-WTF==1.3.0
WTForms==3.2.2
waitress==3.2.2
Werkzeug==3.0.1
waitress==3.0.2
Werkzeug==3.0.3
openpyxl==3.1.2
qrcode==7.4.2
Pillow==10.1.0
Pillow==10.2.0
python-dotenv==1.0.0
Jinja2==3.1.2
Jinja2==3.1.6
svglib==2.2.0
reportlab==5.0.1
rlPyCairo==0.4.0
+2 -1
View File
@@ -3,4 +3,5 @@ from app import create_app
app = create_app()
if __name__ == "__main__":
app.run(host="0.0.0.0", port=5000, debug=True)
# debug=False для production; для разработки можно временно включить
app.run(host="127.0.0.1", port=5000, debug=False)