Skip to content

Commit 2bd7c10

Browse files
committed
Add environment example and ignore file
1 parent 62c20a2 commit 2bd7c10

File tree

6 files changed

+45
-28
lines changed

6 files changed

+45
-28
lines changed

.env.example

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
DB_HOST=localhost
2+
DB_USER=username
3+
DB_PASSWORD=password
4+
DB_NAME=database
5+
6+
BOT_TOKEN=your_telegram_bot_token
7+
XPAY_MERCHANT_ID=your_xpay_merchant_id
8+
XPAY_PRIVATE_KEY=your_xpay_private_key
9+
TON_API_KEY=your_ton_api_key
10+
MAIN_WALLET=your_main_wallet_address
11+
GEN_SEED=your_seed_phrase
12+
TEGROMONEY_SHOP_ID=your_tegromoney_shop_id
13+
TEGROMONEY_SECRET_KEY=your_tegromoney_secret_key

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.env
2+
.php_errors.log
3+

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ TON Multifunctional Bot is an indispensable assistant for working with TON. From
1313

1414
### **Setup and Launch**:
1515

16-
1. Fill in the variables in `botdata.php` as per the comments provided in the file.
16+
1. Copy `.env.example` to `.env`, set database credentials, API keys, and seed phrases as needed, and keep `.env` out of version control.
1717
2. Add the link to `_0xpay_postback.php` in the postback field of the 0xpay control panel.
1818
3. Insert the link to `tm_postback.php` in the postback field of the tegro.money control panel.
1919
4. Set up the cronjobs as follows:

botdata.php

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
1-
<?php
2-
$xPayMerchantId = '5a6200fe-0798-4b4a-b1c3-2779d42af64a';
3-
$xPayPrivateKey = '71ba018a2bb3ffb52fcceb9aa3b574bc';
4-
$tonapikey = 'e52c8854142eba7ba3c015c1b0b046d31e0333a6d25fce4e7872cec7cd9c39e4';
5-
$mainWallet = 'EQADeT9xqZ4wAam-bCXbTjNhUTN03K33EYQmnL5Q8udk5E2T';
6-
$genseed = 'tide viable airport master inch weather citizen hood slot wire fatal toy below bring same vocal amused tourist opera seed burger october collect master';
7-
$tgrbep20fee = 2; // USD
8-
$tgrtonfee = 0.1; // TON
9-
$tonfee = 0.1; // TON
10-
$tegromoney_shopid = "58897C1D797CA1F09A12269C8E40BA69";
11-
$tegromoney_secretkey = "p3fUjzEM";
12-
$chequefee = 0.02;
13-
$stakingfee[0][0] = 15;
14-
$stakingfee[0][1] = 18;
15-
$stakingfee[0][2] = 21;
16-
$stakingfee[0][3] = 24;
17-
$stakingfee[1][0] = 9;
18-
$stakingfee[1][1] = 10;
19-
$stakingfee[1][2] = 11;
20-
$stakingfee[1][3] = 12;
21-
$exchangefee = 0.005;
22-
?>
1+
<?php
2+
define('TOKEN', getenv('BOT_TOKEN'));
3+
$xPayMerchantId = getenv('XPAY_MERCHANT_ID');
4+
$xPayPrivateKey = getenv('XPAY_PRIVATE_KEY');
5+
$tonapikey = getenv('TON_API_KEY');
6+
$mainWallet = getenv('MAIN_WALLET');
7+
$genseed = getenv('GEN_SEED');
8+
$tgrbep20fee = 2; // USD
9+
$tgrtonfee = 0.1; // TON
10+
$tonfee = 0.1; // TON
11+
$tegromoney_shopid = getenv('TEGROMONEY_SHOP_ID');
12+
$tegromoney_secretkey = getenv('TEGROMONEY_SECRET_KEY');
13+
$chequefee = 0.02;
14+
$stakingfee[0][0] = 15;
15+
$stakingfee[0][1] = 18;
16+
$stakingfee[0][2] = 21;
17+
$stakingfee[0][3] = 24;
18+
$stakingfee[1][0] = 9;
19+
$stakingfee[1][1] = 10;
20+
$stakingfee[1][2] = 11;
21+
$stakingfee[1][3] = 12;
22+
$exchangefee = 0.005;
23+
?>

global.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
2-
$hostName = 'localhost';
3-
$userName = 'tegromoneybot_bot';
4-
$password = 'TV0Up5ARw036c';
5-
$databaseName = 'tegromoneybot_bot';
2+
$hostName = getenv('DB_HOST');
3+
$userName = getenv('DB_USER');
4+
$password = getenv('DB_PASSWORD');
5+
$databaseName = getenv('DB_NAME');
66
?>

tm_postback.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
fclose($file);
1616
} // end frite to file
1717

18-
define('TOKEN', 'УКАЖИТЕ_ЗДЕСЬ-СВОЙ_КЛЮЧ_TELEGRAM_БОТА');
18+
define('TOKEN', getenv('BOT_TOKEN'));
1919

2020
include "global.php";
2121
$link = mysqli_connect($hostName, $userName, $password, $databaseName) or die ("Error connect to database");

0 commit comments

Comments
 (0)