File tree 3 files changed +20
-5
lines changed
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'
2
12
3
13
# Bot vitals
4
14
TG_API_KEY = ' 12345:api_key'
@@ -8,6 +18,7 @@ TG_SECRET='super-secret'
8
18
# Bot extras
9
19
TG_WEBHOOK = ' {"url": "https://bot.com/manager.php"}'
10
20
TG_ADMINS = ' [123,456]'
21
+ TG_LOGGING = ' {"error": "${TG_LOGS_DIR}/error.log", "update": "${TG_LOGS_DIR}/update.log"}'
11
22
12
23
# Database
13
24
TG_DB_HOST = ' localhost'
@@ -16,4 +27,8 @@ TG_DB_PASSWORD='root'
16
27
TG_DB_DATABASE = ' tgbot'
17
28
18
29
# 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 16
16
require_once __DIR__ . '/../../vendor/autoload.php ' ;
17
17
Dotenv \Dotenv::create (__DIR__ . '/../.. ' )->load ();
18
18
19
- $ webhook = new GitHubHandler (getenv ('SB_WEBHOOK_SECRET_GITHUB ' ));
19
+ $ webhook = new GitHubHandler (getenv ('TG_WEBHOOK_SECRET_GITHUB ' ));
20
20
if (!$ webhook ->validate ()) {
21
21
http_response_code (404 );
22
22
die;
23
23
}
24
24
25
25
// 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 23
23
}
24
24
25
25
// 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