Minor improvements (#1301)

* Minor improvements

* Update filelist.php
This commit is contained in:
Roman Kelesidis 2023-12-31 15:28:45 +07:00 committed by GitHub
commit 23456902e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 12 deletions

View file

@ -55,14 +55,13 @@ For installation, you need to follow a few simple steps:
3. After run `composer install` on the project directory
4. Create database and import dump located at **install/sql/mysql.sql**
5. Edit database configuration settings in the configuration file or a local copy (see below)
6. Edit domain name in the configuration file or a local copy (see below)
7. Edit domain ssl setting in the configuration file or a local copy (see below)
8. Edit this files:
6. Edit domain name in the configuration file or a local copy (`$reserved_name` and `$reserved_port`)
7. Edit this files:
1. **favicon.png** (change on your own)
2. **robots.txt** (change the addresses in lines **Host** and **Sitemap** on your own)
3. **opensearch_desc.xml** (change the description and address on your own)
4. **opensearch_desc_bt.xml** (change the description and address on your own)
9. Log in to the forum with admin/admin login/password and finish setting up via admin panel
8. Log in to the forum with admin/admin login/password and finish setting up via admin panel
## 🔑 Access rights on folders and files

View file

@ -14,7 +14,7 @@ $user->session_start();
if ($bb_cfg['bt_disable_dht'] && IS_GUEST) {
http_response_code(403);
die($lang['BT_PRIVATE_TRACKER']);
bb_simple_die($lang['BT_PRIVATE_TRACKER']);
}
$topic_id = !empty($_GET['topic']) ? (int)$_GET['topic'] : (http_response_code(404) && die($lang['INVALID_TOPIC_ID']));
@ -30,19 +30,19 @@ $row = DB()->fetch_row($sql);
if (empty($row) || empty($row['physical_filename'])) {
http_response_code(404);
die($lang['TOPIC_POST_NOT_EXIST']);
bb_simple_die($lang['TOPIC_POST_NOT_EXIST']);
}
if (empty($row['info_hash_v2'])) {
http_response_code(410);
die($lang['BT_V2_FLIST_ONLY']);
bb_simple_die($lang['BT_V2_FLIST_ONLY']);
}
$file_path = get_attachments_dir() . '/' . $row['physical_filename'];
if (!is_file($file_path)) {
http_response_code(410);
die($lang['TOR_NOT_FOUND']);
bb_simple_die($lang['TOR_NOT_FOUND']);
}
$file_contents = file_get_contents($file_path);
@ -54,7 +54,7 @@ if ($bb_cfg['flist_max_files']) {
if ($file_count > $bb_cfg['flist_max_files']) {
http_response_code(410);
die(sprintf($lang['BT_V2_FLIST_LIMIT'], $bb_cfg['flist_max_files'], $file_count));
bb_simple_die(sprintf($lang['BT_V2_FLIST_LIMIT'], $bb_cfg['flist_max_files'], $file_count));
}
}
@ -62,12 +62,12 @@ try {
$torrent = \Arokettu\Bencode\Bencode::decode($file_contents, dictType: \Arokettu\Bencode\Bencode\Collection::ARRAY);
} catch (\Exception $e) {
http_response_code(410);
die(htmlCHR("{$lang['TORFILE_INVALID']}: {$e->getMessage()}"));
bb_simple_die(htmlCHR("{$lang['TORFILE_INVALID']}: {$e->getMessage()}"));
}
if (isset($torrent['info']['private']) && IS_GUEST) {
http_response_code(403);
die($lang['BT_PRIVATE_TORRENT']);
bb_simple_die($lang['BT_PRIVATE_TORRENT']);
}
$files = (new TorrentPier\Legacy\TorrentFileList($torrent))->fileTreeTable($torrent['info']['file tree']);

View file

@ -1,4 +1,5 @@
User-agent: *
Disallow: /bt/*
Disallow: /dl.php
Disallow: /group.php
@ -10,4 +11,4 @@ Disallow: /privmsg.php
Disallow: /profile.php
Host: torrentpier.com
Sitemap: http://torrentpier.com/sitemap.xml
Sitemap: http://torrentpier.com/sitemap/sitemap.xml