Browse Source

Work out the Ocelot DB kinks

pjc 5 years ago
parent
commit
e6b76fd18a
5 changed files with 180 additions and 209 deletions
  1. 2
    2
      gazelle.sql
  2. 113
    0
      privacy.php
  3. 64
    44
      sections/donate/donate.php
  4. 1
    1
      sections/login/login.php
  5. 0
    162
      sections/login/stats.php

+ 2
- 2
gazelle.sql View File

1481
 
1481
 
1482
 CREATE TABLE `users_main` (
1482
 CREATE TABLE `users_main` (
1483
   `ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
1483
   `ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
1484
-  `Username` varchar(25) NOT NULL,
1485
-  `Email` varchar(255) NOT NULL,
1484
+  `Username` varchar(25) NOT NULL DEFAULT '',
1485
+  `Email` varchar(255) NOT NULL DEFAULT '',
1486
   `PassHash` varchar(60) NOT NULL,
1486
   `PassHash` varchar(60) NOT NULL,
1487
   `TwoFactor` varchar(255) DEFAULT NULL,
1487
   `TwoFactor` varchar(255) DEFAULT NULL,
1488
   `PublicKey` text,
1488
   `PublicKey` text,

+ 113
- 0
privacy.php View File

1
+<h1>Privacy Policy for BioTorrents.de</h1>
2
+
3
+<p>
4
+  At BioTorrents.de, accessible from https://biotorrents.de, one of our main priorities is the privacy of our visitors.
5
+  This Privacy Policy document contains types of information that is collected and recorded by BioTorrents.de and how we use it.
6
+</p>
7
+
8
+<p>
9
+  If you have additional questions or require more information about our Privacy Policy, do not hesitate to contact us.
10
+</p>
11
+
12
+
13
+<h2>General Data Protection Regulation (GDPR)</h2>
14
+
15
+<p>
16
+  We are a Data Controller of your information.
17
+</p>
18
+
19
+<p>
20
+  BioTorrents.de legal basis for collecting and using the personal information described in this Privacy Policy depends on the Personal Information we collect and the specific context in which we collect the information:
21
+</p>
22
+
23
+<ul>
24
+  <li>BioTorrents.de needs to perform a contract with you</li>
25
+  <li>You have given BioTorrents.de permission to do so</li>
26
+  <li>Processing your personal information is in BioTorrents.de legitimate interests</li>
27
+  <li>BioTorrents.de needs to comply with the law</li>
28
+</ul>
29
+  
30
+<p>
31
+  BioTorrents.de will retain your personal information only for as long as is necessary for the purposes set out in this Privacy Policy.
32
+  We will retain and use your information to the extent necessary to comply with our legal obligations, resolve disputes, and enforce our policies.
33
+  Our Privacy Policy was generated with the help of <a href="https://www.gdprprivacynotice.com/">GDPR Privacy Policy Generator</a>.
34
+</p> 
35
+
36
+<p>
37
+  If you are a resident of the European Economic Area (EEA), you have certain data protection rights.
38
+  If you wish to be informed what Personal Information we hold about you and if you want it to be removed from our systems, please contact us.
39
+</p>
40
+
41
+<p>
42
+  In certain circumstances, you have the following data protection rights:
43
+</p>
44
+
45
+<ul>
46
+  <li>The right to access, update or to delete the information we have on you</li>
47
+  <li>The right of rectification</li> 
48
+  <li>The right to object</li>
49
+  <li>The right of restriction</li>
50
+  <li>The right to data portability</li>
51
+  <li>The right to withdraw consent</li>
52
+</ul>
53
+
54
+
55
+<h2>Log Files</h2>
56
+
57
+<p>
58
+  BioTorrents.de only logs server errors.
59
+  The information collected by log files include internet protocol (IP) addresses, browser type, date and time stamp, and referring/exit pages.
60
+  These are not linked to any information that is personally identifiable.
61
+  The purpose of the information is for administering the site.
62
+</p>
63
+
64
+
65
+<h2>Cookies and Web Beacons</h2>
66
+
67
+<p>
68
+  Like any other website, BioTorrents.de uses "cookies."
69
+  These cookies are used to store information including visitors' preferences, and the pages on the website that the visitor accessed or visited.
70
+  The information is used to optimize the users' experience by customizing our web page content based on visitors' browser type and/or other information.
71
+</p>
72
+
73
+
74
+<h2>Third Party Privacy Policies</h2>
75
+
76
+<p>
77
+  BioTorrents.de's Privacy Policy does not apply to other advertisers or websites.
78
+  Thus, we are advising you to consult the respective Privacy Policies of these third-party ad servers for more detailed information.
79
+  It may include their practices and instructions about how to opt-out of certain options.
80
+</p>
81
+
82
+<p>
83
+  You can choose to disable cookies through your individual browser options.
84
+  To know more detailed information about cookie management with specific web browsers, it can be found at the browsers' respective websites.
85
+</p>
86
+
87
+
88
+<h2>Children's Information</h2>
89
+
90
+<p>
91
+  Another part of our priority is adding protection for children while using the internet.
92
+  We encourage parents and guardians to observe, participate in, and/or monitor and guide their online activity.
93
+</p>
94
+
95
+<p>
96
+  BioTorrents.de does not knowingly collect any Personal Identifiable Information from children under the age of 13.
97
+  If you think that your child provided this kind of information on our website, we strongly encourage you to contact us immediately and we will do our best efforts to promptly remove such information from our records.
98
+</p>
99
+
100
+
101
+<h2>Online Privacy Policy Only</h2>
102
+
103
+<p>
104
+  Our Privacy Policy applies only to our online activities and is valid for visitors to our website with regards to the information that they shared and/or collect in BioTorrents.de.
105
+  This policy is not applicable to any information collected offline or via channels other than this website.
106
+</p>
107
+
108
+
109
+<h2>Consent</h2>
110
+
111
+<p>
112
+  By using our website, you hereby consent to our Privacy Policy and agree to its terms.
113
+</p>

+ 64
- 44
sections/donate/donate.php View File

17
 ?>
17
 ?>
18
 
18
 
19
 <div class="thin">
19
 <div class="thin">
20
-  <span class="donation_info_title">Why donate?</span>
20
+  <span class="donation_info_title"><?= SITE_NAME ?> budget breakdown</span>
21
   <div class="box pad donation_info">
21
   <div class="box pad donation_info">
22
-    <p>
23
-      <?= SITE_NAME ?> has no advertisements, is not sponsored, and
24
-      provides its services free of charge.
25
-      For these reasons, its financial obligations can
26
-      only be met with the help of voluntary user donations.
27
-      Supporting <?= SITE_NAME ?> is and will always remain
28
-      voluntary.
29
-      If you are financially able, please help pay its
30
-      bills by donating.
31
-    </p>
32
-
33
-    <p>
34
-      <?= SITE_NAME ?> uses all voluntary donations to cover the
35
-      costs of running the site, tracker, and IRC network.
36
-      These costs represent the hardware the site runs on (e.g., servers, upgrades, fixes),
37
-      and recurring operating expenses (e.g., hosting, bandwidth, power).
22
+  <p>
23
+      <?= SITE_NAME ?> has no advertisements, is not sponsored, and provides its services free of charge.
24
+      For these reasons, its main income source is voluntary user donations.
25
+      Supporting <?= SITE_NAME ?> is and will always remain voluntary.
26
+      If you're financially able, please help pay its bills by donating.
27
+      We use the donations to cover the costs of running the site, tracker, and IRC network.
38
     </p>
28
     </p>
39
 
29
 
40
     <p>
30
     <p>
41
       No staff member or other individual responsible for the site's operation personally profits from user donations.
31
       No staff member or other individual responsible for the site's operation personally profits from user donations.
42
       As a donor, your financial support is exclusively applied to operating costs.
32
       As a donor, your financial support is exclusively applied to operating costs.
43
-      When you donate you are paying <?= SITE_NAME ?>'s bills.
33
+      By donating to <?= SITE_NAME ?>, you're helping to defray the recurring costs of necessary information services.
44
     </p>
34
     </p>
45
 
35
 
46
     <p>
36
     <p>
47
-    If you prefer to make a tax-deductible donation to an organization beyond my financial grasp, donations to the
48
-    <a href="https://www.boslab.org/donate" target="_blank">Boston Open Science Laboratory (BosLab)</a>
49
-    are honored the same as direct donations.
50
-    Please note in the comment field that your donation is on <?= SITE_NAME ?>'s behalf and to credit your username.
37
+      <?= SITE_NAME ?> currently operates on a shoestring budget.
38
+      The costs of running the site, and all its technical and legal infrastructure, are minimal by design.
39
+      Keeping costs in a range that I can pay out of pocket helps ensure the site doesn't depend on donations to exist.
40
+      Please find a detailed site budget below.
51
     </p>
41
     </p>
42
+
43
+    <ul>
44
+        <li><strong>Tracker Server.</strong> We currently use one budget VPS at 2.50€ per month, and can add more at the same price as needed.</li>
45
+        <li><strong>Seedbox Server.</strong> A dedicated seedbox in Europe to supplement my home servers in North America is forthcoming. It's not expected to exceed $20 per month.</li>
46
+        <li><strong>Domain Name.</strong> The site domain name costs $15 per year. The SSL certificate is gratis.</li>
47
+        <li><strong>Parent Company.</strong> Because I'm handling personal information such as email and IP addresses, and soliciting donations from the public, legal protection is prudent. An LLC is forthcoming and not expected to exceed $75 per year.</li>
48
+      </ul>
52
   </div>
49
   </div>
53
 
50
 
54
-  <span class="donation_info_title">What you will receive for donating</span>
51
+  <span class="donation_info_title">How to donate to <?= SITE_NAME ?></span>
55
   <div class="box pad donation_info">
52
   <div class="box pad donation_info">
56
     <p>
53
     <p>
57
-      Please see <a href="https://www.patreon.com/biotorrents" target="_blank"><?= SITE_NAME ?>'s Patreon</a> for a detailed overview of funding
58
-      goals.
59
-      There are some benefits to donating that culmulate at each tier pledged.
60
-      Each tier's awards include those already listed, and the tier system only applies to recurring donations.
61
-      Bitcoin donations are privately negotiable.
54
+      <?= SITE_NAME ?> accepts donations on a tactful array of platforms.
55
+      We also accept tax-deductible donations on behalf of the
56
+      <a href="https://www.boslab.org/donate" target="_blank">Boston Open Science Laboratory (BosLab)</a>,
57
+      a registered 501c3.
58
+      Please use the memo field on BosLab's PayPal form to credit your <?= SITE_NAME ?> account.
59
+      <strong>From: your username on <?= SITE_NAME ?>'s behalf, CC: ohm at biotorrents dot de.</strong>
60
+    </p>
61
+
62
+    <p>
63
+      Unlike affiliate donations to BosLab, where the funds are beyond my control, direct donations are used exclusively for <?= SITE_NAME ?>'s operating costs.
64
+      Please see <a href="https://www.patreon.com/biotorrents" target="_blank"><?= SITE_NAME ?>'s Patreon</a> for a detailed overview of funding goals.
65
+      There are some benefits to donating that culmulate with each tier pledged.
66
+      Each tier's awards include those already listed.
67
+    </p>
68
+
69
+    <p style="margin: 2em 0;">
70
+    <a href="https://www.patreon.com/bePatron?u=27142321" data-patreon-widget-type="become-patron-button">Become a Patron!</a><script async src="https://c6.patreon.com/becomePatronButton.bundle.js"></script>
71
+    </p>
62
 
72
 
63
       <ul>
73
       <ul>
64
         <li><strong>Bronze.</strong> A donor badge and forum access for your user account on the BioTorrents.de website
74
         <li><strong>Bronze.</strong> A donor badge and forum access for your user account on the BioTorrents.de website
72
           separately</li>
82
           separately</li>
73
       </ul>
83
       </ul>
74
 
84
 
75
-      <!-- Any donation or contribution option listed above gives you the opportunity to receive Donor Points.
76
-      After acquiring your first Donor Point, your account will unlock Donor Rank #1.
77
-      This rank will last forever, and you'll receive the following perks upon unlocking it:</p>
85
+    <p>
86
+      I also accept private donations of cash and cash equivalents, including Bitcoin and other cryptocurrencies.
87
+      Besides gift transactions sent to my personal PayPal account, I'll also accept USPS money orders in the mail.
88
+      I can generate unique cryptocurrency addresses for donations in Bitcoin, Litecoin, Curecoin, and Namecoin.
89
+      Please use <a href="https://pgp.mit.edu/pks/lookup?op=get&search=0x760EBED7CFE266D7" target="_blank">GPG key 760EBED7CFE266D7</a> if you desire.
90
+    </p>
91
+  </div>
92
+
93
+  <span class="donation_info_title">What donating means for your account</span>
94
+  <div class="box pad donation_info">
95
+  <p>
96
+    Please remember that when you make a donation, you aren't "purchasing" Donor Ranks, invites, or any <?= SITE_NAME ?>-specific benefit.
97
+    When donating, you're helping <?= SITE_NAME ?> pay its bills, and your donation should be made in this spirit.
98
+    The <?= SITE_NAME ?> staff does its best to recognize our financial supporters in a fair and fun way,
99
+    but all donor perks are subject to change or cancellation at any time, without notice.
100
+  </p>
101
+
102
+  <p>
103
+    Any donation or contribution option listed above gives you the opportunity to receive Donor Points.
104
+    Donor Points are awarded at a rate of one point per transaction, regardless of the amount.
105
+    After acquiring your first Donor Point, your account will unlock Donor Rank #1.
106
+    This rank will last forever, and you'll receive the below perks when you unlock it.
107
+  </p>
78
 
108
 
79
     <ul>
109
     <ul>
80
       <li>Our eternal love, as represented by the heart you get next to your name</li>
110
       <li>Our eternal love, as represented by the heart you get next to your name</li>
85
       <li>Personal collage creation privileges</li>
115
       <li>Personal collage creation privileges</li>
86
       <li>One additional personal collage</li>
116
       <li>One additional personal collage</li>
87
       <li>A warm, fuzzy feeling</li>
117
       <li>A warm, fuzzy feeling</li>
88
-      <li>Absolutely nothing else</li>
89
-    </ul> -->
90
-
91
-      <p>
92
-        Be reminded that when you make a donation, you aren't "purchasing" Donor Ranks, invites, or any <?= SITE_NAME ?>-specific benefit.
93
-        When donating, you are helping <?= SITE_NAME ?> pay its
94
-        bills, and your donation should be made in this spirit.
95
-        The <?= SITE_NAME ?> staff does its best to recognize <?= SITE_NAME ?>'s financial supporters in a fair and fun way,
96
-        but all Donor Perks are subject to change or cancellation at any time, without notice.
97
-      </p>
98
-  </div>
118
+    </ul>
119
+
120
+<p>What you won't receive for donating:</P.
99
 
121
 
100
-  <span class="donation_info_title">What you won't receive for donating</span>
101
-  <div class="box pad donation_info">
102
     <ul>
122
     <ul>
103
       <li>Immunity from the rules</li>
123
       <li>Immunity from the rules</li>
104
       <li>Additional upload credit</li>
124
       <li>Additional upload credit</li>

+ 1
- 1
sections/login/login.php View File

2
 View::show_header('Login');
2
 View::show_header('Login');
3
 ?>
3
 ?>
4
 
4
 
5
-<p style="text-align: center;">A platform to share <em>biological sequence</em><br />and <em>medical imaging</em> data</p>
5
+<p style="text-align: center;">A platform to share <strong>biological sequence</strong><br />and <strong>medical imaging</strong> data</p>
6
 
6
 
7
 <p id="no-cookies" class="hidden warning">You appear to have cookies disabled.</p>
7
 <p id="no-cookies" class="hidden warning">You appear to have cookies disabled.</p>
8
 
8
 

+ 0
- 162
sections/login/stats.php View File

1
-<!-- Stats -->
2
-<div class="box">
3
-      <div class="head colhead_dark"><strong>Stats</strong></div>
4
-      <ul class="stats nobullet">
5
-<?php if (USER_LIMIT > 0) { ?>
6
-        <li>Maximum users: <?=number_format(USER_LIMIT) ?></li>
7
-<?php
8
-}
9
-
10
-if (($UserCount = $Cache->get_value('stats_user_count')) === false) {
11
-    $DB->query("
12
-    SELECT COUNT(ID)
13
-    FROM users_main
14
-    WHERE Enabled = '1'");
15
-    list($UserCount) = $DB->next_record();
16
-    $Cache->cache_value('stats_user_count', $UserCount, 86400);
17
-}
18
-$UserCount = (int)$UserCount;
19
-?>
20
-        <li>Enabled users: <?=number_format($UserCount)?> <a href="stats.php?action=users" class="brackets">Details</a></li>
21
-<?php
22
-
23
-if (($UserStats = $Cache->get_value('stats_users')) === false) {
24
-    $DB->query("
25
-    SELECT COUNT(ID)
26
-    FROM users_main
27
-    WHERE Enabled = '1'
28
-      AND LastAccess > '".time_minus(3600 * 24)."'");
29
-    list($UserStats['Day']) = $DB->next_record();
30
-
31
-    $DB->query("
32
-    SELECT COUNT(ID)
33
-    FROM users_main
34
-    WHERE Enabled = '1'
35
-      AND LastAccess > '".time_minus(3600 * 24 * 7)."'");
36
-    list($UserStats['Week']) = $DB->next_record();
37
-
38
-    $DB->query("
39
-    SELECT COUNT(ID)
40
-    FROM users_main
41
-    WHERE Enabled = '1'
42
-      AND LastAccess > '".time_minus(3600 * 24 * 30)."'");
43
-    list($UserStats['Month']) = $DB->next_record();
44
-
45
-    $Cache->cache_value('stats_users', $UserStats, 0);
46
-}
47
-?>
48
-        <li>Users active today: <?=number_format($UserStats['Day'])?> (<?=number_format($UserStats['Day'] / $UserCount * 100, 2)?>%)</li>
49
-        <li>Users active this week: <?=number_format($UserStats['Week'])?> (<?=number_format($UserStats['Week'] / $UserCount * 100, 2)?>%)</li>
50
-        <li>Users active this month: <?=number_format($UserStats['Month'])?> (<?=number_format($UserStats['Month'] / $UserCount * 100, 2)?>%)</li>
51
-<?php
52
-
53
-if (($TorrentCount = $Cache->get_value('stats_torrent_count')) === false) {
54
-    $DB->query("
55
-    SELECT COUNT(ID)
56
-    FROM torrents");
57
-    list($TorrentCount) = $DB->next_record();
58
-    $Cache->cache_value('stats_torrent_count', $TorrentCount, 86400); // 1 day cache
59
-}
60
-
61
-if (($GroupCount = $Cache->get_value('stats_group_count')) === false) {
62
-    $DB->query("
63
-    SELECT COUNT(ID)
64
-    FROM torrents_group");
65
-    list($GroupCount) = $DB->next_record();
66
-    $Cache->cache_value('stats_group_count', $GroupCount, 86400); // 1 day cache
67
-}
68
-
69
-if (($TorrentSizeTotal = $Cache->get_value('stats_torrent_size_total')) === false) {
70
-    $DB->query("
71
-    SELECT SUM(Size)
72
-    FROM torrents");
73
-    list($TorrentSizeTotal) = $DB->next_record();
74
-    $Cache->cache_value('stats_torrent_size_total', $TorrentSizeTotal, 86400); // 1 day cache
75
-}
76
-?>
77
-        <li>Total Size of Torrents: <?=Format::get_size($TorrentSizeTotal)?> </li>
78
-<?php
79
-
80
-if (($ArtistCount = $Cache->get_value('stats_artist_count')) === false) {
81
-    $DB->query("
82
-    SELECT COUNT(ArtistID)
83
-    FROM artists_group");
84
-    list($ArtistCount) = $DB->next_record();
85
-    $Cache->cache_value('stats_artist_count', $ArtistCount, 86400); // 1 day cache
86
-}
87
-
88
-?>
89
-        <li>Torrents: <?=number_format($TorrentCount)?></li>
90
-        <li>Torrent Groups: <?=number_format($GroupCount)?></li>
91
-        <li>Artists: <?=number_format($ArtistCount)?></li>
92
-<?php
93
-// End Torrent Stats
94
-
95
-if (($RequestStats = $Cache->get_value('stats_requests')) === false) {
96
-    $DB->query("
97
-    SELECT COUNT(ID)
98
-    FROM requests");
99
-    list($RequestCount) = $DB->next_record();
100
-    $DB->query("
101
-    SELECT COUNT(ID)
102
-    FROM requests
103
-    WHERE FillerID > 0");
104
-    list($FilledCount) = $DB->next_record();
105
-    $Cache->cache_value('stats_requests', array($RequestCount, $FilledCount), 11280);
106
-} else {
107
-    list($RequestCount, $FilledCount) = $RequestStats;
108
-}
109
-
110
-// Do not divide by zero
111
-if ($RequestCount > 0) {
112
-    $RequestsFilledPercent = $FilledCount / $RequestCount * 100;
113
-} else {
114
-    $RequestsFilledPercent = 0;
115
-}
116
-
117
-?>
118
-        <li>Requests: <?=number_format($RequestCount)?> (<?=number_format($RequestsFilledPercent, 2)?>% filled)</li>
119
-<?php
120
-
121
-if ($SnatchStats = $Cache->get_value('stats_snatches')) {
122
-    ?>
123
-        <li>Snatches: <?=number_format($SnatchStats)?></li>
124
-<?php
125
-}
126
-
127
-if (($PeerStats = $Cache->get_value('stats_peers')) === false) {
128
-    // Cache lock!
129
-    $PeerStatsLocked = $Cache->get_value('stats_peers_lock');
130
-    if (!$PeerStatsLocked) {
131
-        $Cache->cache_value('stats_peers_lock', 1, 30);
132
-        $DB->query("
133
-      SELECT IF(remaining=0,'Seeding','Leeching') AS Type, COUNT(uid)
134
-      FROM xbt_files_users
135
-      WHERE active = 1
136
-      GROUP BY Type");
137
-        $PeerCount = $DB->to_array(0, MYSQLI_NUM, false);
138
-        $SeederCount = $PeerCount['Seeding'][1] ?: 0;
139
-        $LeecherCount = $PeerCount['Leeching'][1] ?: 0;
140
-        $Cache->cache_value('stats_peers', array($LeecherCount, $SeederCount), 604800); // 1 week cache
141
-        $Cache->delete_value('stats_peers_lock');
142
-    }
143
-} else {
144
-    $PeerStatsLocked = false;
145
-    list($LeecherCount, $SeederCount) = $PeerStats;
146
-}
147
-
148
-if (!$PeerStatsLocked) {
149
-    $Ratio = Format::get_ratio_html($SeederCount, $LeecherCount);
150
-    $PeerCount = number_format($SeederCount + $LeecherCount);
151
-    $SeederCount = number_format($SeederCount);
152
-    $LeecherCount = number_format($LeecherCount);
153
-} else {
154
-    $PeerCount = $SeederCount = $LeecherCount = $Ratio = 'Server busy';
155
-}
156
-?>
157
-        <li>Peers: <?=$PeerCount?></li>
158
-        <li>Seeders: <?=$SeederCount?></li>
159
-        <li>Leechers: <?=$LeecherCount?></li>
160
-        <li>Seeder/leecher ratio: <?=$Ratio?></li>
161
-      </ul>
162
-    </div>

Loading…
Cancel
Save