Skip to content
Permalink
Browse files

Merge branch 'master' of /var/www/jump.wtf

  • Loading branch information...
millinon committed Apr 9, 2017
2 parents dba7440 + 91ddc54 commit 538b44b25dd80954f3753b238bf93c8e0cae977f
@@ -166,5 +166,3 @@ HTML output is generated by Facebook's [xhp-lib](https://github.com/facebook/xhp
`result.hh` uses [clipboard.js](https://github.com/zenorocha/clipboard.js) to provide "Click to copy" functionality.

As an easter egg, clippy.js is included on the page from [here](https://www.smore.com/clippy-js).

I've included these resources (except aws.phar) with the rest of the project files; if there are issues with this inclusion, please just let me know and I'll work with you to correct the problem.
@@ -3,7 +3,10 @@
set_include_path(dirname(__FILE__).'/../www/include');
require_once ('vendor/autoload.php');
require ('api/api.hh');
require ('helpers.hh');
if (!isset($argv)) {
echo 'Run this from the command line';
@@ -3,6 +3,8 @@
set_include_path(dirname(__FILE__).'/../www/include');
require ('vendor/autoload.php');
require ('api/api.hh');
if (!isset($argv)) {
@@ -3,8 +3,13 @@
set_include_path(dirname(__FILE__).'/../www/include');
require_once ('vendor/autoload.php');
require ('api/api.hh');
require ('helpers.hh');
require ('aws.hh');
$_SERVER['REMOTE_ADDR'] = 'localhost';
if (!isset($argv)) {
echo 'Run this from the command line';
@@ -3,8 +3,13 @@
set_include_path(dirname(__FILE__).'/../www/include');
require ('vendor/autoload.php');
require ('api/api.hh');
require ('helpers.hh');
require ('aws.hh');
$_SERVER['REMOTE_ADDR'] = 'localhost';
if (!isset($argv)) {
echo 'Run this from the command line';
@@ -3,10 +3,14 @@
set_include_path(dirname(__FILE__).'/../www/include');
require_once ('vendor/autoload.php');
require ('api/api.hh');
require_once ('helpers.hh');
$_SERVER['REMOTE_ADDR'] = 'localhost';
if (!isset($argv)) {
echo 'Run this from the command line';
exit(1);
@@ -72,7 +72,7 @@ server {
add_header 'Access-Control-Allow-Methods' "GET, POST, OPTIONS";
add_header 'Access-Control-Allow-Headers' "DNT,Keep-Alive,User-Agent,X-Requested-With,Cache-Control,Content-Type";

client_max_body_size 64m;
client_max_body_size 1024m;

location / {
limit_req zone=hhvm burst=5 nodelay;
@@ -447,13 +447,23 @@ class jump_api {
return self::error((string) $ve, 400);
}

if( $url_parts = parse_url($input['input-url']) ){
if( ! isset($url_parts['scheme']) ){
if( isset(jump_config::DEFAULT_PROTOCOL) ){
$input['input-url'] = jump_config::DEFAULT_PROTOCOL . $input['input-url'];
} else {
return self::error('Protocol missing from input URL. Did you mean http://' . $input['input-url'] . '?');
}
} else if( ! isset($url_parts['host']) ){
return self::error('Host missing from input URL.');
}
}

if (!filter_var($input['input-url'], FILTER_VALIDATE_URL)) {
return self::error("Invalid URL detected.", 400);
}

// $s3client = awsHelper::s3_client();
$dyclient = awsHelper::dydb_client();
// $glclient = awsHelper::gl_client();

$balance = ['success' => false, 'custom-urls' => 0];

@@ -36,6 +36,10 @@ class jump_config {
/* maximum input URL length */
const MAX_URL_LEN = 128;

/* default protocol */
/* comment out to show an error instead */
const DEFAULT_PROTOCOL = "http://";

/* max password length */
const MAX_PASS_LEN = 20;

0 comments on commit 538b44b

Please sign in to comment.
You can’t perform that action at this time.