File tree Expand file tree Collapse file tree 3 files changed +20
-5
lines changed Expand file tree Collapse file tree 3 files changed +20
-5
lines changed Original file line number Diff line number Diff line change 1- TG_ENV = ' development"
1+ # Environment
2+ TG_ENV = ' development'
3+
4+ # Directories
5+ TG_BASE_DIR = ' /var/www/tg-support-bot'
6+ TG_CACHE_DIR = ' ${TG_BASE_DIR}/cache'
7+ TG_COMMANDS_DIR = ' ${TG_BASE_DIR}/commands'
8+ TG_LOGS_DIR = ' ${TG_BASE_DIR}/logs'
9+ TG_PUBLIC_DIR = ' ${TG_BASE_DIR}/public'
10+ TG_DOWNLOADS_DIR = ' ${TG_BASE_DIR}/downloads'
11+ TG_UPLOADS_DIR = ' ${TG_BASE_DIR}/uploads'
212
313# Bot vitals
414TG_API_KEY = ' 12345:api_key'
@@ -8,6 +18,7 @@ TG_SECRET='super-secret'
818# Bot extras
919TG_WEBHOOK = ' {"url": "https://bot.com/manager.php"}'
1020TG_ADMINS = ' [123,456]'
21+ TG_LOGGING = ' {"error": "${TG_LOGS_DIR}/error.log", "update": "${TG_LOGS_DIR}/update.log"}'
1122
1223# Database
1324TG_DB_HOST = ' localhost'
@@ -16,4 +27,8 @@ TG_DB_PASSWORD='root'
1627TG_DB_DATABASE = ' tgbot'
1728
1829# Paths
19- TG_PATHS = ' {"download": "/var/www/tgbot/downloads","upload": "/var/www/tgbot/uploads"}'
30+ TG_COMMANDS = ' {"paths": ["${TG_COMMANDS_DIR}"]}'
31+ TG_PATHS = ' {"download": "${TG_DOWNLOADS_DIR}", "upload": "${TG_UPLOADS_DIR}"}'
32+
33+ # Webhook secrets
34+ TG_WEBHOOK_SECRET_GITHUB = ' github-secret'
Original file line number Diff line number Diff line change 1616require_once __DIR__ . '/../../vendor/autoload.php ' ;
1717Dotenv \Dotenv::create (__DIR__ . '/../.. ' )->load ();
1818
19- $ webhook = new GitHubHandler (getenv ('SB_WEBHOOK_SECRET_GITHUB ' ));
19+ $ webhook = new GitHubHandler (getenv ('TG_WEBHOOK_SECRET_GITHUB ' ));
2020if (!$ webhook ->validate ()) {
2121 http_response_code (404 );
2222 die;
2323}
2424
2525// Save all incoming data to a log file for future reference.
26- Utils::logWebhookData (__DIR__ . '/../../logs/ ' . getenv ('SB_BOT_USERNAME ' ) . '_webhook_github.log ' );
26+ Utils::logWebhookData (getenv ( ' TG_LOGS_DIR ' ) . '/ ' . getenv ('TG_BOT_USERNAME ' ) . '_webhook_github.log ' );
Original file line number Diff line number Diff line change 2323}
2424
2525// Save all incoming data to a log file for future reference.
26- Utils::logWebhookData (__DIR__ . '/../../logs/ ' . getenv ('SB_BOT_USERNAME ' ) . '_webhook_travis-ci.log ' );
26+ Utils::logWebhookData (getenv ( ' TG_LOGS_DIR ' ) . '/ ' . getenv ('TG_BOT_USERNAME ' ) . '_webhook_travis-ci.log ' );
You can’t perform that action at this time.
0 commit comments