Browse Source

Use new experimental image host

spaghetti 8 years ago
parent
commit
6ad54e28f6
2 changed files with 4 additions and 2 deletions
  1. 2
    0
      classes/config.template
  2. 2
    2
      classes/imagetools.class.php

+ 2
- 0
classes/config.template View File

7
 // Main settings
7
 // Main settings
8
 define('SITE_NAME',     'Oppaitime'); //The name of your site
8
 define('SITE_NAME',     'Oppaitime'); //The name of your site
9
 define('SITE_DOMAIN',   'oppaiti.me'); //The FQDN of your site
9
 define('SITE_DOMAIN',   'oppaiti.me'); //The FQDN of your site
10
+define('IMAGE_DOMAIN',  'img.oppaiti.me'); //The FQDN of your image host
10
 define('SERVER_ROOT',   '/var/www/oppaiti.me'); //The root of the server, used for includes
11
 define('SERVER_ROOT',   '/var/www/oppaiti.me'); //The root of the server, used for includes
11
 define('TORRENT_STORE', '/var/torrents/'); //Where torrent files are stored
12
 define('TORRENT_STORE', '/var/torrents/'); //Where torrent files are stored
12
 
13
 
32
 
33
 
33
 // Keys
34
 // Keys
34
 define('ENCKEY',       'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'); //Random key. The key for encryption
35
 define('ENCKEY',       'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'); //Random key. The key for encryption
36
+define('IMAGE_PSK',    'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'); //Pre-shared key for generating hmacs for the image proxy
35
 define('SCHEDULE_KEY', 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'); // Random key. This key must be the argument to schedule.php for the schedule to work.
37
 define('SCHEDULE_KEY', 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'); // Random key. This key must be the argument to schedule.php for the schedule to work.
36
 define('RSS_HASH',     'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'); //Random key. Used for generating unique RSS auth key.
38
 define('RSS_HASH',     'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'); //Random key. Used for generating unique RSS auth key.
37
 
39
 

+ 2
- 2
classes/imagetools.class.php View File

183
       }
183
       }
184
     }
184
     }
185
 
185
 
186
-    if (preg_match('/^https:\/\/'.SITE_DOMAIN.'\//', $Url)) {
186
+    if (preg_match('/^https:\/\/('.SITE_DOMAIN.'|'.IMAGE_DOMAIN.')\//', $Url)) {
187
       return $Url;
187
       return $Url;
188
     } else {
188
     } else {
189
-      return 'https://' . SITE_DOMAIN . "/image.php?c=1&i=" . urlencode($Url);
189
+      return 'https://'.IMAGE_DOMAIN.'?h='.rawurlencode(base64_encode(hash_hmac('sha256', $Url, IMAGE_PSK, true))).'&i='.urlencode($Url);
190
     }
190
     }
191
   }
191
   }
192
 
192
 

Loading…
Cancel
Save