├── .gitignore ├── app ├── commands │ ├── .gitkeep │ ├── CleanTableCommand.php │ └── WebsocketServerCommand.php ├── config │ ├── app.php │ ├── auth.php │ ├── cache.php │ ├── compile.php │ ├── database.php │ ├── lowendping.php │ ├── mail.php │ ├── packages │ │ └── .gitkeep │ ├── queue.php │ ├── remote.php │ ├── session.php │ ├── testing │ │ ├── cache.php │ │ └── session.php │ ├── view.php │ └── workbench.php ├── controllers │ ├── .gitkeep │ ├── ApiController.php │ ├── BaseController.php │ └── HomeController.php ├── database │ ├── migrations │ │ ├── .gitkeep │ │ ├── 2014_03_09_112337_create_queries_table.php │ │ ├── 2014_03_09_113619_create_responses_table.php │ │ └── 2014_03_17_031627_crate_ratelimit_table.php │ ├── production.sqlite │ └── seeds │ │ ├── .gitkeep │ │ └── DatabaseSeeder.php ├── filters.php ├── helpers.php ├── jobs │ └── QueryJob.php ├── lang │ └── en │ │ ├── pagination.php │ │ ├── reminders.php │ │ └── validation.php ├── lib │ └── LowEndPing │ │ └── Pusher.php ├── models │ ├── Query.php │ ├── QueryResponse.php │ ├── RateLimit.php │ └── User.php ├── routes.php ├── start │ ├── artisan.php │ ├── global.php │ └── local.php ├── storage │ ├── .gitignore │ ├── cache │ │ └── .gitignore │ ├── logs │ │ └── .gitignore │ ├── meta │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ └── views │ │ └── .gitignore ├── tests │ ├── ExampleTest.php │ └── TestCase.php ├── validators.php └── views │ ├── emails │ └── auth │ │ └── reminder.blade.php │ ├── home.blade.php │ ├── layouts │ ├── main.blade.php │ └── navbar.blade.php │ └── result.blade.php ├── artisan ├── bootstrap ├── autoload.php ├── paths.php └── start.php ├── composer.json ├── composer.lock ├── daemon ├── lep.py └── lepconf.py ├── index.php ├── phpunit.xml ├── public ├── .htaccess ├── css │ ├── application.css │ └── bootstrap │ │ ├── bootstrap-theme.css │ │ ├── bootstrap-theme.css.map │ │ ├── bootstrap-theme.min.css │ │ ├── bootstrap.css │ │ ├── bootstrap.css.map │ │ └── bootstrap.min.css ├── favicon.ico ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ └── glyphicons-halflings-regular.woff ├── index.php ├── js │ ├── application.js │ ├── autobahn.min.js │ └── bootstrap │ │ ├── bootstrap.js │ │ └── bootstrap.min.js ├── packages │ └── .gitkeep └── robots.txt ├── readme.md └── server.php /.gitignore: -------------------------------------------------------------------------------- 1 | /bootstrap/compiled.php 2 | /vendor 3 | composer.phar 4 | .env.local.php 5 | .env.php 6 | .DS_Store 7 | Thumbs.db -------------------------------------------------------------------------------- /app/commands/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nikkiii/lowendping/15321d82459048afa9d7aa85f70ab58baacc02ac/app/commands/.gitkeep -------------------------------------------------------------------------------- /app/commands/CleanTableCommand.php: -------------------------------------------------------------------------------- 1 | subMinutes(30); 42 | 43 | QueryResponse::unsent()->where('created_at', '<', $unsent_min)->delete(); 44 | 45 | // Check the archive 46 | if (Config::get('lowendping.archive.enabled', false)) { 47 | $mintime = \Carbon\Carbon::now()->subDays(Config::get('lowendping.archive.days')); 48 | 49 | $queries = Query::where('created_at', '<', $mintime)->get(); 50 | foreach ($queries as $query) { 51 | $this->info('Deleting query ' . $query->id); 52 | QueryResponse::where('query_id', $query->id)->delete(); 53 | $query->delete(); 54 | } 55 | } 56 | } 57 | 58 | /** 59 | * Get the console command arguments. 60 | * 61 | * @return array 62 | */ 63 | protected function getArguments() 64 | { 65 | return array( 66 | ); 67 | } 68 | 69 | /** 70 | * Get the console command options. 71 | * 72 | * @return array 73 | */ 74 | protected function getOptions() 75 | { 76 | return array( 77 | ); 78 | } 79 | 80 | } 81 | -------------------------------------------------------------------------------- /app/commands/WebsocketServerCommand.php: -------------------------------------------------------------------------------- 1 | getSocket(ZMQ::SOCKET_PULL); 46 | 47 | $this->info('Binding ZMQ to ' . $zmq_host); 48 | $pull->bind('tcp://' . $zmq_host); // Binding to 127.0.0.1 means the only client that can connect is itself 49 | $pull->on('message', array($pusher, 'onServerResponse')); 50 | 51 | $this->info('Binding Ratchet Websocket to 0.0.0.0:' . Config::get('lowendping.websocket.port', 8080)); 52 | // Set up our WebSocket server for clients wanting real-time updates 53 | $webSock = new React\Socket\Server($loop); 54 | $webSock->listen(Config::get('lowendping.websocket.port', 8080), '0.0.0.0'); // Binding to 0.0.0.0 means remotes can connect 55 | $webServer = new Ratchet\Server\IoServer( 56 | new Ratchet\Http\HttpServer( 57 | new Ratchet\WebSocket\WsServer( 58 | new Ratchet\Wamp\WampServer( 59 | $pusher 60 | ) 61 | ) 62 | ), 63 | $webSock 64 | ); 65 | 66 | $loop->run(); 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /app/config/app.php: -------------------------------------------------------------------------------- 1 | 'LowEndPing', 15 | 16 | /* 17 | |-------------------------------------------------------------------------- 18 | | Application Credits 19 | |-------------------------------------------------------------------------- 20 | | 21 | | If the above name is changed, then this will add a " - Powered by LowEndPing" to the footer. 22 | | You may disable it, but it doesn't hurt anything and helps the developer. 23 | | 24 | */ 25 | 'credits' => true, 26 | 27 | /* 28 | |-------------------------------------------------------------------------- 29 | | Application Debug Mode 30 | |-------------------------------------------------------------------------- 31 | | 32 | | When your application is in debug mode, detailed error messages with 33 | | stack traces will be shown on every error that occurs within your 34 | | application. If disabled, a simple generic error page is shown. 35 | | 36 | */ 37 | 38 | 'debug' => true, 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Application URL 43 | |-------------------------------------------------------------------------- 44 | | 45 | | This URL is used by the console to properly generate URLs when using 46 | | the Artisan command line tool. You should set this to the root of 47 | | your application so that it is used when running Artisan tasks. 48 | | 49 | */ 50 | 51 | 'url' => 'http://localhost', 52 | 53 | /* 54 | |-------------------------------------------------------------------------- 55 | | Application Timezone 56 | |-------------------------------------------------------------------------- 57 | | 58 | | Here you may specify the default timezone for your application, which 59 | | will be used by the PHP date and date-time functions. We have gone 60 | | ahead and set this to a sensible default for you out of the box. 61 | | 62 | */ 63 | 64 | 'timezone' => 'UTC', 65 | 66 | /* 67 | |-------------------------------------------------------------------------- 68 | | Application Locale Configuration 69 | |-------------------------------------------------------------------------- 70 | | 71 | | The application locale determines the default locale that will be used 72 | | by the translation service provider. You are free to set this value 73 | | to any of the locales which will be supported by the application. 74 | | 75 | */ 76 | 77 | 'locale' => 'en', 78 | 79 | /* 80 | |-------------------------------------------------------------------------- 81 | | Encryption Key 82 | |-------------------------------------------------------------------------- 83 | | 84 | | This key is used by the Illuminate encrypter service and should be set 85 | | to a random, 32 character string, otherwise these encrypted strings 86 | | will not be safe. Please do this before deploying an application! 87 | | 88 | */ 89 | 90 | 'key' => 'rRHA92ZjhFzEqfaqJt0qTmudDgm0Y3nL', 91 | 92 | /* 93 | |-------------------------------------------------------------------------- 94 | | Autoloaded Service Providers 95 | |-------------------------------------------------------------------------- 96 | | 97 | | The service providers listed here will be automatically loaded on the 98 | | request to your application. Feel free to add your own services to 99 | | this array to grant expanded functionality to your applications. 100 | | 101 | */ 102 | 103 | 'providers' => array( 104 | 105 | 'Illuminate\Foundation\Providers\ArtisanServiceProvider', 106 | 'Illuminate\Auth\AuthServiceProvider', 107 | 'Illuminate\Cache\CacheServiceProvider', 108 | 'Illuminate\Session\CommandsServiceProvider', 109 | 'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider', 110 | 'Illuminate\Routing\ControllerServiceProvider', 111 | 'Illuminate\Cookie\CookieServiceProvider', 112 | 'Illuminate\Database\DatabaseServiceProvider', 113 | 'Illuminate\Encryption\EncryptionServiceProvider', 114 | 'Illuminate\Filesystem\FilesystemServiceProvider', 115 | 'Illuminate\Hashing\HashServiceProvider', 116 | 'Illuminate\Html\HtmlServiceProvider', 117 | 'Illuminate\Log\LogServiceProvider', 118 | 'Illuminate\Mail\MailServiceProvider', 119 | 'Illuminate\Database\MigrationServiceProvider', 120 | 'Illuminate\Pagination\PaginationServiceProvider', 121 | 'Illuminate\Queue\QueueServiceProvider', 122 | 'Illuminate\Redis\RedisServiceProvider', 123 | 'Illuminate\Remote\RemoteServiceProvider', 124 | 'Illuminate\Auth\Reminders\ReminderServiceProvider', 125 | 'Illuminate\Database\SeedServiceProvider', 126 | 'Illuminate\Session\SessionServiceProvider', 127 | 'Illuminate\Translation\TranslationServiceProvider', 128 | 'Illuminate\Validation\ValidationServiceProvider', 129 | 'Illuminate\View\ViewServiceProvider', 130 | 'Illuminate\Workbench\WorkbenchServiceProvider', 131 | 132 | ), 133 | 134 | /* 135 | |-------------------------------------------------------------------------- 136 | | Service Provider Manifest 137 | |-------------------------------------------------------------------------- 138 | | 139 | | The service provider manifest is used by Laravel to lazy load service 140 | | providers which are not needed for each request, as well to keep a 141 | | list of all of the services. Here, you may set its storage spot. 142 | | 143 | */ 144 | 145 | 'manifest' => storage_path().'/meta', 146 | 147 | /* 148 | |-------------------------------------------------------------------------- 149 | | Class Aliases 150 | |-------------------------------------------------------------------------- 151 | | 152 | | This array of class aliases will be registered when this application 153 | | is started. However, feel free to register as many as you wish as 154 | | the aliases are "lazy" loaded so they don't hinder performance. 155 | | 156 | */ 157 | 158 | 'aliases' => array( 159 | 160 | 'App' => 'Illuminate\Support\Facades\App', 161 | 'Artisan' => 'Illuminate\Support\Facades\Artisan', 162 | 'Auth' => 'Illuminate\Support\Facades\Auth', 163 | 'Blade' => 'Illuminate\Support\Facades\Blade', 164 | 'Cache' => 'Illuminate\Support\Facades\Cache', 165 | 'ClassLoader' => 'Illuminate\Support\ClassLoader', 166 | 'Config' => 'Illuminate\Support\Facades\Config', 167 | 'Controller' => 'Illuminate\Routing\Controller', 168 | 'Cookie' => 'Illuminate\Support\Facades\Cookie', 169 | 'Crypt' => 'Illuminate\Support\Facades\Crypt', 170 | 'DB' => 'Illuminate\Support\Facades\DB', 171 | 'Eloquent' => 'Illuminate\Database\Eloquent\Model', 172 | 'Event' => 'Illuminate\Support\Facades\Event', 173 | 'File' => 'Illuminate\Support\Facades\File', 174 | 'Form' => 'Illuminate\Support\Facades\Form', 175 | 'Hash' => 'Illuminate\Support\Facades\Hash', 176 | 'HTML' => 'Illuminate\Support\Facades\HTML', 177 | 'Input' => 'Illuminate\Support\Facades\Input', 178 | 'Lang' => 'Illuminate\Support\Facades\Lang', 179 | 'Log' => 'Illuminate\Support\Facades\Log', 180 | 'Mail' => 'Illuminate\Support\Facades\Mail', 181 | 'Paginator' => 'Illuminate\Support\Facades\Paginator', 182 | 'Password' => 'Illuminate\Support\Facades\Password', 183 | 'Queue' => 'Illuminate\Support\Facades\Queue', 184 | 'Redirect' => 'Illuminate\Support\Facades\Redirect', 185 | 'Redis' => 'Illuminate\Support\Facades\Redis', 186 | 'Request' => 'Illuminate\Support\Facades\Request', 187 | 'Response' => 'Illuminate\Support\Facades\Response', 188 | 'Route' => 'Illuminate\Support\Facades\Route', 189 | 'Schema' => 'Illuminate\Support\Facades\Schema', 190 | 'Seeder' => 'Illuminate\Database\Seeder', 191 | 'Session' => 'Illuminate\Support\Facades\Session', 192 | 'SSH' => 'Illuminate\Support\Facades\SSH', 193 | 'Str' => 'Illuminate\Support\Str', 194 | 'URL' => 'Illuminate\Support\Facades\URL', 195 | 'Validator' => 'Illuminate\Support\Facades\Validator', 196 | 'View' => 'Illuminate\Support\Facades\View', 197 | 198 | ), 199 | 200 | ); 201 | -------------------------------------------------------------------------------- /app/config/auth.php: -------------------------------------------------------------------------------- 1 | 'eloquent', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Authentication Model 23 | |-------------------------------------------------------------------------- 24 | | 25 | | When using the "Eloquent" authentication driver, we need to know which 26 | | Eloquent model should be used to retrieve your users. Of course, it 27 | | is often just the "User" model but you may use whatever you like. 28 | | 29 | */ 30 | 31 | 'model' => 'User', 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Authentication Table 36 | |-------------------------------------------------------------------------- 37 | | 38 | | When using the "Database" authentication driver, we need to know which 39 | | table should be used to retrieve your users. We have chosen a basic 40 | | default value but you may easily change it to any table you like. 41 | | 42 | */ 43 | 44 | 'table' => 'users', 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Password Reminder Settings 49 | |-------------------------------------------------------------------------- 50 | | 51 | | Here you may set the settings for password reminders, including a view 52 | | that should be used as your password reminder e-mail. You will also 53 | | be able to set the name of the table that holds the reset tokens. 54 | | 55 | | The "expire" time is the number of minutes that the reminder should be 56 | | considered valid. This security feature keeps tokens short-lived so 57 | | they have less time to be guessed. You may change this as needed. 58 | | 59 | */ 60 | 61 | 'reminder' => array( 62 | 63 | 'email' => 'emails.auth.reminder', 64 | 65 | 'table' => 'password_reminders', 66 | 67 | 'expire' => 60, 68 | 69 | ), 70 | 71 | ); 72 | -------------------------------------------------------------------------------- /app/config/cache.php: -------------------------------------------------------------------------------- 1 | 'file', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | File Cache Location 23 | |-------------------------------------------------------------------------- 24 | | 25 | | When using the "file" cache driver, we need a location where the cache 26 | | files may be stored. A sensible default has been specified, but you 27 | | are free to change it to any other place on disk that you desire. 28 | | 29 | */ 30 | 31 | 'path' => storage_path().'/cache', 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Database Cache Connection 36 | |-------------------------------------------------------------------------- 37 | | 38 | | When using the "database" cache driver you may specify the connection 39 | | that should be used to store the cached items. When this option is 40 | | null the default database connection will be utilized for cache. 41 | | 42 | */ 43 | 44 | 'connection' => null, 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Database Cache Table 49 | |-------------------------------------------------------------------------- 50 | | 51 | | When using the "database" cache driver we need to know the table that 52 | | should be used to store the cached items. A default table name has 53 | | been provided but you're free to change it however you deem fit. 54 | | 55 | */ 56 | 57 | 'table' => 'cache', 58 | 59 | /* 60 | |-------------------------------------------------------------------------- 61 | | Memcached Servers 62 | |-------------------------------------------------------------------------- 63 | | 64 | | Now you may specify an array of your Memcached servers that should be 65 | | used when utilizing the Memcached cache driver. All of the servers 66 | | should contain a value for "host", "port", and "weight" options. 67 | | 68 | */ 69 | 70 | 'memcached' => array( 71 | 72 | array('host' => '127.0.0.1', 'port' => 11211, 'weight' => 100), 73 | 74 | ), 75 | 76 | /* 77 | |-------------------------------------------------------------------------- 78 | | Cache Key Prefix 79 | |-------------------------------------------------------------------------- 80 | | 81 | | When utilizing a RAM based store such as APC or Memcached, there might 82 | | be other applications utilizing the same cache. So, we'll specify a 83 | | value to get prefixed to all our keys so we can avoid collisions. 84 | | 85 | */ 86 | 87 | 'prefix' => 'laravel', 88 | 89 | ); 90 | -------------------------------------------------------------------------------- /app/config/compile.php: -------------------------------------------------------------------------------- 1 | PDO::FETCH_CLASS, 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Default Database Connection Name 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may specify which of the database connections below you wish 24 | | to use as your default connection for all database work. Of course 25 | | you may use many connections at once using the Database library. 26 | | 27 | */ 28 | 29 | 'default' => 'sqlite', 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Database Connections 34 | |-------------------------------------------------------------------------- 35 | | 36 | | Here are each of the database connections setup for your application. 37 | | Of course, examples of configuring each database platform that is 38 | | supported by Laravel is shown below to make development simple. 39 | | 40 | | 41 | | All database work in Laravel is done through the PHP PDO facilities 42 | | so make sure you have the driver for your particular database of 43 | | choice installed on your machine before you begin development. 44 | | 45 | */ 46 | 47 | 'connections' => array( 48 | 49 | 'sqlite' => array( 50 | 'driver' => 'sqlite', 51 | 'database' => __DIR__.'/../database/production.sqlite', 52 | 'prefix' => '', 53 | ), 54 | 55 | 'mysql' => array( 56 | 'driver' => 'mysql', 57 | 'host' => 'localhost', 58 | 'database' => 'database', 59 | 'username' => 'root', 60 | 'password' => '', 61 | 'charset' => 'utf8', 62 | 'collation' => 'utf8_unicode_ci', 63 | 'prefix' => '', 64 | ), 65 | 66 | 'pgsql' => array( 67 | 'driver' => 'pgsql', 68 | 'host' => 'localhost', 69 | 'database' => 'database', 70 | 'username' => 'root', 71 | 'password' => '', 72 | 'charset' => 'utf8', 73 | 'prefix' => '', 74 | 'schema' => 'public', 75 | ), 76 | 77 | 'sqlsrv' => array( 78 | 'driver' => 'sqlsrv', 79 | 'host' => 'localhost', 80 | 'database' => 'database', 81 | 'username' => 'root', 82 | 'password' => '', 83 | 'prefix' => '', 84 | ), 85 | 86 | ), 87 | 88 | /* 89 | |-------------------------------------------------------------------------- 90 | | Migration Repository Table 91 | |-------------------------------------------------------------------------- 92 | | 93 | | This table keeps track of all the migrations that have already run for 94 | | your application. Using this information, we can determine which of 95 | | the migrations on disk haven't actually been run in the database. 96 | | 97 | */ 98 | 99 | 'migrations' => 'migrations', 100 | 101 | /* 102 | |-------------------------------------------------------------------------- 103 | | Redis Databases 104 | |-------------------------------------------------------------------------- 105 | | 106 | | Redis is an open source, fast, and advanced key-value store that also 107 | | provides a richer set of commands than a typical key-value systems 108 | | such as APC or Memcached. Laravel makes it easy to dig right in. 109 | | 110 | */ 111 | 112 | 'redis' => array( 113 | 114 | 'cluster' => false, 115 | 116 | 'default' => array( 117 | 'host' => '127.0.0.1', 118 | 'port' => 6379, 119 | 'database' => 0, 120 | ), 121 | 122 | ), 123 | 124 | ); 125 | -------------------------------------------------------------------------------- /app/config/lowendping.php: -------------------------------------------------------------------------------- 1 | array( 14 | 1 => array('name' => 'Example', 'host' => 'localhost', 'port' => 12337, 'auth' => 'SOME_SECURE_STRING') 15 | ), 16 | 17 | /* 18 | |-------------------------------------------------------------------------- 19 | | API 20 | |-------------------------------------------------------------------------- 21 | | 22 | | There is an 'api' which allows a list of servers to be served using json. 23 | | It is mainly used for programs which wish to interact with LowEndPing instances, 24 | | and does not provide any extra information. 25 | | 26 | */ 27 | 'api' => array( 28 | 'enabled' => false 29 | ), 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Result Archive 34 | |-------------------------------------------------------------------------- 35 | | 36 | | You can archive LowEndPing results (keep them in the query response table) for a set amount of time. 37 | | This allows results to be shared and viewed by others. 38 | | Set 'enabled' to false to disable this and delete responses as soon as they are seen by the client. 39 | | 40 | */ 41 | 'archive' => array( 42 | 'enabled' => true, 43 | 'days' => 7 44 | ), 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Query settings 49 | |-------------------------------------------------------------------------- 50 | | 51 | | This is the timeout used when connecting to the LowEndPing servers, 5 is usually a good value to use. 52 | | 53 | */ 54 | 'query' => array( 55 | 'timeout' => 5 56 | ), 57 | 58 | /* 59 | |-------------------------------------------------------------------------- 60 | | Rate limiting 61 | |-------------------------------------------------------------------------- 62 | | 63 | | Rate limit IP addresses so they cannot spam queries. 64 | | Set 'queries' to 0 or false to disable 65 | | 66 | */ 67 | 'ratelimit' => array( 68 | 'queries' => 60, 69 | 'timespan' => 1440 70 | ), 71 | 72 | 73 | /* 74 | |-------------------------------------------------------------------------- 75 | | Enabled query types 76 | |-------------------------------------------------------------------------- 77 | | 78 | | Disable available query types by commenting out lines. By default, everything is enabled. 79 | | 80 | */ 81 | 'querytypes' => array( 82 | 'ping' => 'ping', 83 | 'ping6' => 'ping6', 84 | 'trace' => 'traceroute', 85 | 'trace6' => 'traceroute6', 86 | 'mtr' => 'mtr', 87 | 'mtr6' => 'mtr6' 88 | ), 89 | 90 | 91 | /* 92 | |-------------------------------------------------------------------------- 93 | | Websocket support 94 | |-------------------------------------------------------------------------- 95 | | 96 | | Websocket support via Ratchet and ZMQ 97 | | 98 | */ 99 | 'websocket' => array( 100 | 'enabled' => true, 101 | 'port' => 8080, 102 | 103 | // Websocket is proxied through webserver 104 | 'proxied' => false, 105 | 106 | // ZeroMQ Configuration 107 | 'zeromq' => array( 108 | 'host' => '127.0.0.1', 109 | 'port' => 5555 110 | ) 111 | ), 112 | ); 113 | -------------------------------------------------------------------------------- /app/config/mail.php: -------------------------------------------------------------------------------- 1 | 'smtp', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | SMTP Host Address 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may provide the host address of the SMTP server used by your 26 | | applications. A default option is provided that is compatible with 27 | | the Postmark mail service, which will provide reliable delivery. 28 | | 29 | */ 30 | 31 | 'host' => 'smtp.mailgun.org', 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | SMTP Host Port 36 | |-------------------------------------------------------------------------- 37 | | 38 | | This is the SMTP port used by your application to delivery e-mails to 39 | | users of your application. Like the host we have set this value to 40 | | stay compatible with the Postmark e-mail application by default. 41 | | 42 | */ 43 | 44 | 'port' => 587, 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Global "From" Address 49 | |-------------------------------------------------------------------------- 50 | | 51 | | You may wish for all e-mails sent by your application to be sent from 52 | | the same address. Here, you may specify a name and address that is 53 | | used globally for all e-mails that are sent by your application. 54 | | 55 | */ 56 | 57 | 'from' => array('address' => null, 'name' => null), 58 | 59 | /* 60 | |-------------------------------------------------------------------------- 61 | | E-Mail Encryption Protocol 62 | |-------------------------------------------------------------------------- 63 | | 64 | | Here you may specify the encryption protocol that should be used when 65 | | the application send e-mail messages. A sensible default using the 66 | | transport layer security protocol should provide great security. 67 | | 68 | */ 69 | 70 | 'encryption' => 'tls', 71 | 72 | /* 73 | |-------------------------------------------------------------------------- 74 | | SMTP Server Username 75 | |-------------------------------------------------------------------------- 76 | | 77 | | If your SMTP server requires a username for authentication, you should 78 | | set it here. This will get used to authenticate with your server on 79 | | connection. You may also set the "password" value below this one. 80 | | 81 | */ 82 | 83 | 'username' => null, 84 | 85 | /* 86 | |-------------------------------------------------------------------------- 87 | | SMTP Server Password 88 | |-------------------------------------------------------------------------- 89 | | 90 | | Here you may set the password required by your SMTP server to send out 91 | | messages from your application. This will be given to the server on 92 | | connection so that the application will be able to send messages. 93 | | 94 | */ 95 | 96 | 'password' => null, 97 | 98 | /* 99 | |-------------------------------------------------------------------------- 100 | | Sendmail System Path 101 | |-------------------------------------------------------------------------- 102 | | 103 | | When using the "sendmail" driver to send e-mails, we will need to know 104 | | the path to where Sendmail lives on this server. A default path has 105 | | been provided here, which will work well on most of your systems. 106 | | 107 | */ 108 | 109 | 'sendmail' => '/usr/sbin/sendmail -bs', 110 | 111 | /* 112 | |-------------------------------------------------------------------------- 113 | | Mail "Pretend" 114 | |-------------------------------------------------------------------------- 115 | | 116 | | When this option is enabled, e-mail will not actually be sent over the 117 | | web and will instead be written to your application's logs files so 118 | | you may inspect the message. This is great for local development. 119 | | 120 | */ 121 | 122 | 'pretend' => false, 123 | 124 | ); -------------------------------------------------------------------------------- /app/config/packages/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nikkiii/lowendping/15321d82459048afa9d7aa85f70ab58baacc02ac/app/config/packages/.gitkeep -------------------------------------------------------------------------------- /app/config/queue.php: -------------------------------------------------------------------------------- 1 | 'sync', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Queue Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may configure the connection information for each server that 26 | | is used by your application. A default configuration has been added 27 | | for each back-end shipped with Laravel. You are free to add more. 28 | | 29 | */ 30 | 31 | 'connections' => array( 32 | 33 | 'sync' => array( 34 | 'driver' => 'sync', 35 | ), 36 | 37 | 'beanstalkd' => array( 38 | 'driver' => 'beanstalkd', 39 | 'host' => 'localhost', 40 | 'queue' => 'default', 41 | ), 42 | 43 | 'sqs' => array( 44 | 'driver' => 'sqs', 45 | 'key' => 'your-public-key', 46 | 'secret' => 'your-secret-key', 47 | 'queue' => 'your-queue-url', 48 | 'region' => 'us-east-1', 49 | ), 50 | 51 | 'iron' => array( 52 | 'driver' => 'iron', 53 | 'project' => 'your-project-id', 54 | 'token' => 'your-token', 55 | 'queue' => 'your-queue-name', 56 | ), 57 | 58 | 'redis' => array( 59 | 'driver' => 'redis', 60 | 'queue' => 'default', 61 | ), 62 | 63 | ), 64 | 65 | /* 66 | |-------------------------------------------------------------------------- 67 | | Failed Queue Jobs 68 | |-------------------------------------------------------------------------- 69 | | 70 | | These options configure the behavior of failed queue job logging so you 71 | | can control which database and table are used to store the jobs that 72 | | have failed. You may change them to any database / table you wish. 73 | | 74 | */ 75 | 76 | 'failed' => array( 77 | 78 | 'database' => 'mysql', 'table' => 'failed_jobs', 79 | 80 | ), 81 | 82 | ); 83 | -------------------------------------------------------------------------------- /app/config/remote.php: -------------------------------------------------------------------------------- 1 | 'production', 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Remote Server Connections 21 | |-------------------------------------------------------------------------- 22 | | 23 | | These are the servers that will be accessible via the SSH task runner 24 | | facilities of Laravel. This feature radically simplifies executing 25 | | tasks on your servers, such as deploying out these applications. 26 | | 27 | */ 28 | 29 | 'connections' => array( 30 | 31 | 'production' => array( 32 | 'host' => '', 33 | 'username' => '', 34 | 'password' => '', 35 | 'key' => '', 36 | 'keyphrase' => '', 37 | 'root' => '/var/www', 38 | ), 39 | 40 | ), 41 | 42 | /* 43 | |-------------------------------------------------------------------------- 44 | | Remote Server Groups 45 | |-------------------------------------------------------------------------- 46 | | 47 | | Here you may list connections under a single group name, which allows 48 | | you to easily access all of the servers at once using a short name 49 | | that is extremely easy to remember, such as "web" or "database". 50 | | 51 | */ 52 | 53 | 'groups' => array( 54 | 55 | 'web' => array('production') 56 | 57 | ), 58 | 59 | ); -------------------------------------------------------------------------------- /app/config/session.php: -------------------------------------------------------------------------------- 1 | 'file', 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Session Lifetime 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Here you may specify the number of minutes that you wish the session 27 | | to be allowed to remain idle before it expires. If you want them 28 | | to immediately expire on the browser closing, set that option. 29 | | 30 | */ 31 | 32 | 'lifetime' => 120, 33 | 34 | 'expire_on_close' => false, 35 | 36 | /* 37 | |-------------------------------------------------------------------------- 38 | | Session File Location 39 | |-------------------------------------------------------------------------- 40 | | 41 | | When using the native session driver, we need a location where session 42 | | files may be stored. A default has been set for you but a different 43 | | location may be specified. This is only needed for file sessions. 44 | | 45 | */ 46 | 47 | 'files' => storage_path().'/sessions', 48 | 49 | /* 50 | |-------------------------------------------------------------------------- 51 | | Session Database Connection 52 | |-------------------------------------------------------------------------- 53 | | 54 | | When using the "database" or "redis" session drivers, you may specify a 55 | | connection that should be used to manage these sessions. This should 56 | | correspond to a connection in your database configuration options. 57 | | 58 | */ 59 | 60 | 'connection' => null, 61 | 62 | /* 63 | |-------------------------------------------------------------------------- 64 | | Session Database Table 65 | |-------------------------------------------------------------------------- 66 | | 67 | | When using the "database" session driver, you may specify the table we 68 | | should use to manage the sessions. Of course, a sensible default is 69 | | provided for you; however, you are free to change this as needed. 70 | | 71 | */ 72 | 73 | 'table' => 'sessions', 74 | 75 | /* 76 | |-------------------------------------------------------------------------- 77 | | Session Sweeping Lottery 78 | |-------------------------------------------------------------------------- 79 | | 80 | | Some session drivers must manually sweep their storage location to get 81 | | rid of old sessions from storage. Here are the chances that it will 82 | | happen on a given request. By default, the odds are 2 out of 100. 83 | | 84 | */ 85 | 86 | 'lottery' => array(2, 100), 87 | 88 | /* 89 | |-------------------------------------------------------------------------- 90 | | Session Cookie Name 91 | |-------------------------------------------------------------------------- 92 | | 93 | | Here you may change the name of the cookie used to identify a session 94 | | instance by ID. The name specified here will get used every time a 95 | | new session cookie is created by the framework for every driver. 96 | | 97 | */ 98 | 99 | 'cookie' => 'laravel_session', 100 | 101 | /* 102 | |-------------------------------------------------------------------------- 103 | | Session Cookie Path 104 | |-------------------------------------------------------------------------- 105 | | 106 | | The session cookie path determines the path for which the cookie will 107 | | be regarded as available. Typically, this will be the root path of 108 | | your application but you are free to change this when necessary. 109 | | 110 | */ 111 | 112 | 'path' => '/', 113 | 114 | /* 115 | |-------------------------------------------------------------------------- 116 | | Session Cookie Domain 117 | |-------------------------------------------------------------------------- 118 | | 119 | | Here you may change the domain of the cookie used to identify a session 120 | | in your application. This will determine which domains the cookie is 121 | | available to in your application. A sensible default has been set. 122 | | 123 | */ 124 | 125 | 'domain' => null, 126 | 127 | /* 128 | |-------------------------------------------------------------------------- 129 | | HTTPS Only Cookies 130 | |-------------------------------------------------------------------------- 131 | | 132 | | By setting this option to true, session cookies will only be sent back 133 | | to the server if the browser has a HTTPS connection. This will keep 134 | | the cookie from being sent to you if it can not be done securely. 135 | | 136 | */ 137 | 138 | 'secure' => false, 139 | 140 | ); 141 | -------------------------------------------------------------------------------- /app/config/testing/cache.php: -------------------------------------------------------------------------------- 1 | 'array', 19 | 20 | ); -------------------------------------------------------------------------------- /app/config/testing/session.php: -------------------------------------------------------------------------------- 1 | 'array', 20 | 21 | ); -------------------------------------------------------------------------------- /app/config/view.php: -------------------------------------------------------------------------------- 1 | array(__DIR__.'/../views'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Pagination View 21 | |-------------------------------------------------------------------------- 22 | | 23 | | This view will be used to render the pagination link output, and can 24 | | be easily customized here to show any view you like. A clean view 25 | | compatible with Twitter's Bootstrap is given to you by default. 26 | | 27 | */ 28 | 29 | 'pagination' => 'pagination::slider-3', 30 | 31 | ); 32 | -------------------------------------------------------------------------------- /app/config/workbench.php: -------------------------------------------------------------------------------- 1 | '', 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Workbench Author E-Mail Address 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Like the option above, your e-mail address is used when generating new 24 | | workbench packages. The e-mail is placed in your composer.json file 25 | | automatically after the package is created by the workbench tool. 26 | | 27 | */ 28 | 29 | 'email' => '', 30 | 31 | ); -------------------------------------------------------------------------------- /app/controllers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nikkiii/lowendping/15321d82459048afa9d7aa85f70ab58baacc02ac/app/controllers/.gitkeep -------------------------------------------------------------------------------- /app/controllers/ApiController.php: -------------------------------------------------------------------------------- 1 | beforeFilter(function() { 7 | if (!Config::get('lowendping.api.enabled', false)) { 8 | return Response::make('API Disabled', 403); 9 | } 10 | }); 11 | } 12 | 13 | public function serverList() { 14 | $list = array(); 15 | 16 | foreach (Config::get('lowendping.servers') as $server => $info) { 17 | $list[$server] = $info['name']; 18 | } 19 | 20 | return Response::json($list); 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /app/controllers/BaseController.php: -------------------------------------------------------------------------------- 1 | layout)) 13 | { 14 | $this->layout = View::make($this->layout); 15 | } 16 | } 17 | 18 | } -------------------------------------------------------------------------------- /app/controllers/HomeController.php: -------------------------------------------------------------------------------- 1 | with('servers', Config::get('lowendping.servers')); 20 | } 21 | 22 | public function showResult(Query $query) { 23 | $servers = Config::get('lowendping.servers'); 24 | $responses = array(); 25 | 26 | foreach ($query->responses()->orderBy('server_id', 'asc')->get() as $response) { 27 | $response->server = $servers[$response->server_id]; 28 | $responses[] = $response; 29 | } 30 | 31 | $query->expire_at = $query->created_at->addDays(Config::get('lowendping.archive.days', 7)); 32 | 33 | return View::make('result')->with('query', $query)->with('responses', $responses); 34 | } 35 | 36 | public function submitQuery() { 37 | $validator = Validator::make(Input::all(), 38 | array( 39 | 'query' => array('required', 'query'), 40 | 'servers' => array('required', 'array'), 41 | 'type' => array('required', 'type') 42 | ) 43 | ); 44 | 45 | if ($validator->fails()) { 46 | return Response::json(array('success' => false, 'error' => $validator->messages()->first())); 47 | } 48 | 49 | // Validate rate limit 50 | $ip = Request::getClientIp(); 51 | 52 | $querylimit = Config::get('lowendping.ratelimit.queries'); 53 | 54 | if (!empty($querylimit)) { 55 | $limit = RateLimit::find($ip); 56 | 57 | if ($limit) { 58 | $time = time(); 59 | 60 | $expiration = (int) ($limit->time + Config::get('lowendping.ratelimit.timespan')); 61 | 62 | if ($expiration > $time) { 63 | if ($limit->hits >= $querylimit) { 64 | $reset = ($expiration - $time) / 60; 65 | if ($reset <= 1) { 66 | return Response::json(array('success' => false, 'error' => 'Rate limit exceeded, please try again in 1 minute.')); 67 | } 68 | return Response::json(array('success' => false, 'error' => 'Rate limit exceeded, please try again in ' . $reset . ' minutes.')); 69 | } 70 | 71 | $limit->hits++; 72 | $limit->save(); 73 | } else { 74 | $limit->time = time(); 75 | $limit->hits = 1; 76 | $limit->save(); 77 | } 78 | } else { 79 | $limit = new RateLimit; 80 | $limit->ip = $ip; 81 | $limit->hits = 1; 82 | $limit->time = time(); 83 | $limit->save(); 84 | } 85 | } 86 | 87 | $servers = Config::get('lowendping.servers'); 88 | 89 | $serverIds = array(); 90 | 91 | // Validate servers 92 | foreach (Input::get('servers') as $id => $val) { 93 | if (!isset($servers[$id])) { 94 | return Response::json(array('success' => false, 'error' => 'Invalid server ' . $id)); 95 | } 96 | $serverIds[] = $id; 97 | } 98 | 99 | // Process the query 100 | $query = Input::get('query'); 101 | 102 | $q = new Query; 103 | $q->query = $query; 104 | $q->servers = serialize($serverIds); 105 | $q->save(); 106 | 107 | Queue::push('QueryJob', array('id' => $q->id, 'query' => $query, 'type' => Input::get('type'), 'servers' => $serverIds)); 108 | 109 | $response = array( 110 | 'success' => true, 111 | 'queryid' => $q->id, 112 | 'serverCount' => count($serverIds) 113 | ); 114 | 115 | if (Config::get('lowendping.websocket.enabled', false)) { 116 | $response['websocket'] = websocket_url(Config::get('lowendping.websocket.path', ''), Config::get('lowendping.websocket.proxied', false) ? false : Config::get('lowendping.websocket.port', 8080)); 117 | } 118 | 119 | if (Config::get('lowendping.archive.enabled', false)) { 120 | $response['resultLink'] = action('HomeController@showResult', array('query' => $q->id)); 121 | } 122 | 123 | return Response::json($response); 124 | } 125 | 126 | private function checkQueryType($query, $type = 4) { 127 | if ($type == 4 && filter_var($query, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE)) { 128 | return true; 129 | } else if ($type == 6 && filter_var($query, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) { 130 | return true; 131 | } 132 | return false; 133 | } 134 | 135 | public function checkResponses(Query $query) { 136 | $out = array(); 137 | 138 | $archive = Config::get('lowendping.archive.enabled', false); 139 | 140 | foreach ($query->responses()->unsent()->get() as $response) { 141 | if ($archive) { 142 | $response->sent = 1; 143 | $response->save(); 144 | } else { 145 | $response->delete(); 146 | } 147 | 148 | $out[] = array('id' => $response->server_id, 'data' => $response->response); 149 | } 150 | 151 | return Response::json($out); 152 | } 153 | 154 | public function serverResponse() { 155 | $validator = Validator::make(Input::all(), 156 | array( 157 | 'id' => array('required', 'exists:queries,id'), 158 | 'serverid' => array('required', 'server'), 159 | 'response' => array('required'), 160 | 'auth' => array('required') 161 | ) 162 | ); 163 | 164 | if ($validator->fails()) { 165 | return Response::json(array('success' => false, 'error' => $validator->messages()->first())); 166 | } 167 | 168 | $query = Query::find(Input::get('id')); 169 | 170 | $serverid = Input::get('serverid'); 171 | 172 | $servers = Config::get('lowendping.servers'); 173 | 174 | if (QueryResponse::where('server_id', $serverid)->where('query_id', $query->id)->count() > 0) { 175 | return Response::json(array('success' => false, 'error' => 'Response already logged!')); 176 | } 177 | 178 | if (!Input::has('auth') || Input::get('auth') != $servers[$serverid]['auth']) { 179 | // Should we be doing this? It makes sense since it could be a valid error. 180 | $this->submitResponse($query, $serverid, 'Invalid response authentication.'); 181 | return Response::json(array('success' => false, 'error' => 'Invalid authentication!')); 182 | } 183 | 184 | $this->submitResponse($query, $serverid, Input::get('response')); 185 | } 186 | 187 | private function submitResponse($query, $server_id, $res) { 188 | $response = new QueryResponse; 189 | $response->server_id = $server_id; 190 | $response->response = $res; 191 | $query->responses()->save($response); 192 | 193 | if (Config::get('lowendping.websocket.enabled')) { 194 | // Use ZeroMQ to send the data 195 | $context = new ZMQContext(); 196 | $socket = $context->getSocket(ZMQ::SOCKET_PUSH, 'Response Pusher'); 197 | $socket->connect("tcp://localhost:5555"); 198 | 199 | $entryData = array('query_id' => $query->id, 'server_id' => $server_id, 'data' => $res); 200 | 201 | $socket->send(json_encode($entryData)); 202 | } 203 | } 204 | 205 | } -------------------------------------------------------------------------------- /app/database/migrations/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nikkiii/lowendping/15321d82459048afa9d7aa85f70ab58baacc02ac/app/database/migrations/.gitkeep -------------------------------------------------------------------------------- /app/database/migrations/2014_03_09_112337_create_queries_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->string('query', 512); 18 | $table->string('servers', 512); // This is actually a comma separated list 19 | $table->timestamps(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::drop('queries'); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /app/database/migrations/2014_03_09_113619_create_responses_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->integer('query_id'); 18 | $table->integer('server_id'); 19 | $table->boolean('sent')->default(0); 20 | $table->text('response')->nullable(); 21 | $table->timestamps(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | * 28 | * @return void 29 | */ 30 | public function down() 31 | { 32 | Schema::drop('responses'); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /app/database/migrations/2014_03_17_031627_crate_ratelimit_table.php: -------------------------------------------------------------------------------- 1 | string('ip', 64); 17 | $table->integer('hits')->default(0); 18 | $table->integer('time'); 19 | 20 | $table->unique('ip'); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | Schema::drop('ratelimit'); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /app/database/production.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nikkiii/lowendping/15321d82459048afa9d7aa85f70ab58baacc02ac/app/database/production.sqlite -------------------------------------------------------------------------------- /app/database/seeds/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nikkiii/lowendping/15321d82459048afa9d7aa85f70ab58baacc02ac/app/database/seeds/.gitkeep -------------------------------------------------------------------------------- /app/database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call('UserTableSeeder'); 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /app/filters.php: -------------------------------------------------------------------------------- 1 | queryServer($id, $servers[$id], $data); 10 | } 11 | 12 | $job->delete(); 13 | } 14 | 15 | private function queryServer($id, $server, $data) { 16 | // Add required fields 17 | $data['serverid'] = $id; 18 | $data['auth'] = $server['auth']; 19 | // Connect and send the data 20 | $fs = @fsockopen($server['host'], $server['port'], $errno, $errstr, Config::get('lowendping.query.timeout', 5)); 21 | if (!$fs) { 22 | // mark as unable to connect so we aren't waiting forever 23 | $resp = new QueryResponse; 24 | $resp->query_id = $data['id']; 25 | $resp->server_id = $id; 26 | $resp->response = 'Failed to connect.'; 27 | $resp->save(); 28 | return; 29 | } 30 | fwrite($fs, json_encode($data)); 31 | fclose($fs); 32 | } 33 | 34 | } -------------------------------------------------------------------------------- /app/lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 18 | 'next' => 'Next »', 19 | 20 | ); -------------------------------------------------------------------------------- /app/lang/en/reminders.php: -------------------------------------------------------------------------------- 1 | "Passwords must be at least six characters and match the confirmation.", 17 | 18 | "user" => "We can't find a user with that e-mail address.", 19 | 20 | "token" => "This password reset token is invalid.", 21 | 22 | "sent" => "Password reminder sent!", 23 | 24 | ); 25 | -------------------------------------------------------------------------------- /app/lang/en/validation.php: -------------------------------------------------------------------------------- 1 | "The :attribute must be accepted.", 17 | "active_url" => "The :attribute is not a valid URL.", 18 | "after" => "The :attribute must be a date after :date.", 19 | "alpha" => "The :attribute may only contain letters.", 20 | "alpha_dash" => "The :attribute may only contain letters, numbers, and dashes.", 21 | "alpha_num" => "The :attribute may only contain letters and numbers.", 22 | "array" => "The :attribute must be an array.", 23 | "before" => "The :attribute must be a date before :date.", 24 | "between" => array( 25 | "numeric" => "The :attribute must be between :min and :max.", 26 | "file" => "The :attribute must be between :min and :max kilobytes.", 27 | "string" => "The :attribute must be between :min and :max characters.", 28 | "array" => "The :attribute must have between :min and :max items.", 29 | ), 30 | "confirmed" => "The :attribute confirmation does not match.", 31 | "date" => "The :attribute is not a valid date.", 32 | "date_format" => "The :attribute does not match the format :format.", 33 | "different" => "The :attribute and :other must be different.", 34 | "digits" => "The :attribute must be :digits digits.", 35 | "digits_between" => "The :attribute must be between :min and :max digits.", 36 | "email" => "The :attribute format is invalid.", 37 | "exists" => "The selected :attribute is invalid.", 38 | "image" => "The :attribute must be an image.", 39 | "in" => "The selected :attribute is invalid.", 40 | "integer" => "The :attribute must be an integer.", 41 | "ip" => "The :attribute must be a valid IP address.", 42 | "max" => array( 43 | "numeric" => "The :attribute may not be greater than :max.", 44 | "file" => "The :attribute may not be greater than :max kilobytes.", 45 | "string" => "The :attribute may not be greater than :max characters.", 46 | "array" => "The :attribute may not have more than :max items.", 47 | ), 48 | "mimes" => "The :attribute must be a file of type: :values.", 49 | "min" => array( 50 | "numeric" => "The :attribute must be at least :min.", 51 | "file" => "The :attribute must be at least :min kilobytes.", 52 | "string" => "The :attribute must be at least :min characters.", 53 | "array" => "The :attribute must have at least :min items.", 54 | ), 55 | "not_in" => "The selected :attribute is invalid.", 56 | "numeric" => "The :attribute must be a number.", 57 | "regex" => "The :attribute format is invalid.", 58 | "required" => "The :attribute field is required.", 59 | "required_if" => "The :attribute field is required when :other is :value.", 60 | "required_with" => "The :attribute field is required when :values is present.", 61 | "required_without" => "The :attribute field is required when :values is not present.", 62 | "same" => "The :attribute and :other must match.", 63 | "size" => array( 64 | "numeric" => "The :attribute must be :size.", 65 | "file" => "The :attribute must be :size kilobytes.", 66 | "string" => "The :attribute must be :size characters.", 67 | "array" => "The :attribute must contain :size items.", 68 | ), 69 | "unique" => "The :attribute has already been taken.", 70 | "url" => "The :attribute format is invalid.", 71 | 72 | 73 | "query" => "The :attribute is invalid.", 74 | "server" => "The :attribute is invalid.", 75 | "type" => "The :attribute is invalid.", 76 | 77 | /* 78 | |-------------------------------------------------------------------------- 79 | | Custom Validation Language Lines 80 | |-------------------------------------------------------------------------- 81 | | 82 | | Here you may specify custom validation messages for attributes using the 83 | | convention "attribute.rule" to name the lines. This makes it quick to 84 | | specify a specific custom language line for a given attribute rule. 85 | | 86 | */ 87 | 88 | 'custom' => array(), 89 | 90 | /* 91 | |-------------------------------------------------------------------------- 92 | | Custom Validation Attributes 93 | |-------------------------------------------------------------------------- 94 | | 95 | | The following language lines are used to swap attribute place-holders 96 | | with something more reader friendly such as E-Mail Address instead 97 | | of "email". This simply helps us make messages a little cleaner. 98 | | 99 | */ 100 | 101 | 'attributes' => array(), 102 | 103 | ); 104 | -------------------------------------------------------------------------------- /app/lib/LowEndPing/Pusher.php: -------------------------------------------------------------------------------- 1 | getId(), $this->subscribedTopics)) { 14 | $this->subscribedTopics[$topic->getId()] = $topic; 15 | } 16 | } 17 | 18 | public function onUnSubscribe(ConnectionInterface $conn, $topic) { 19 | if (array_key_exists($topic->getId(), $this->subscribedTopics)) { 20 | unset($this->subscribedTopics[$topic->getId()]); 21 | } 22 | } 23 | 24 | public function onOpen(ConnectionInterface $conn) { 25 | } 26 | 27 | public function onClose(ConnectionInterface $conn) { 28 | } 29 | 30 | public function onCall(ConnectionInterface $conn, $id, $topic, array $params) { 31 | // In this application if clients send data it's because the user hacked around in console 32 | $conn->callError($id, $topic, 'You are not allowed to make calls')->close(); 33 | } 34 | 35 | public function onPublish(ConnectionInterface $conn, $topic, $event, array $exclude, array $eligible) { 36 | // In this application if clients send data it's because the user hacked around in console 37 | $conn->close(); 38 | } 39 | 40 | public function onError(ConnectionInterface $conn, \Exception $e) { 41 | } 42 | 43 | /** 44 | * @param string JSON'ified string we'll receive from ZeroMQ 45 | */ 46 | public function onServerResponse($entry) { 47 | $entryData = json_decode($entry, true); 48 | 49 | // If the lookup topic object isn't set there is no one to publish to 50 | if (!array_key_exists($entryData['query_id'], $this->subscribedTopics)) { 51 | return; 52 | } 53 | 54 | $response = \QueryResponse::where('query_id', $entryData['query_id'])->where('server_id', $entryData['server_id']); 55 | 56 | if ($response) { 57 | if (\Config::get('lowendping.archive.enabled', false)) { 58 | $response->update(array('sent' => 1)); 59 | } else { 60 | $response->delete(); 61 | } 62 | } 63 | 64 | $topic = $this->subscribedTopics[$entryData['query_id']]; 65 | 66 | // re-send the data to all the clients subscribed to that category 67 | $topic->broadcast($entryData); 68 | } 69 | } -------------------------------------------------------------------------------- /app/models/Query.php: -------------------------------------------------------------------------------- 1 | hasMany('QueryResponse'); 14 | } 15 | } -------------------------------------------------------------------------------- /app/models/QueryResponse.php: -------------------------------------------------------------------------------- 1 | where('sent', '=', '0'); 14 | } 15 | 16 | public function serverQuery() { 17 | return $this->belongsTo('Query'); 18 | } 19 | } -------------------------------------------------------------------------------- /app/models/RateLimit.php: -------------------------------------------------------------------------------- 1 | getKey(); 30 | } 31 | 32 | /** 33 | * Get the password for the user. 34 | * 35 | * @return string 36 | */ 37 | public function getAuthPassword() 38 | { 39 | return $this->password; 40 | } 41 | 42 | /** 43 | * Get the e-mail address where password reminders are sent. 44 | * 45 | * @return string 46 | */ 47 | public function getReminderEmail() 48 | { 49 | return $this->email; 50 | } 51 | 52 | } -------------------------------------------------------------------------------- /app/routes.php: -------------------------------------------------------------------------------- 1 | client->request('GET', '/'); 13 | 14 | $this->assertTrue($this->client->getResponse()->isOk()); 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /app/tests/TestCase.php: -------------------------------------------------------------------------------- 1 | getData(); 5 | 6 | if (empty($data['type'])) { 7 | return false; 8 | } 9 | 10 | $iptype = endsWith($data['type'], '6') ? 6 : 4; 11 | 12 | // Check for IP address first 13 | if (!$this->checkAddressType($value, $iptype)) { 14 | $check = @dns_get_record($value, $iptype == 4 ? DNS_A : DNS_AAAA); 15 | 16 | $field = $iptype == 4 ? 'ip' : 'ipv6'; 17 | 18 | if (empty($check) || empty($check[0]) || empty($check[0][$field])) { 19 | return false; // Failed to resolve 20 | } 21 | 22 | $check = $check[0][$field]; 23 | 24 | if (!$check || !$this->checkAddressType($check, $iptype)) { 25 | return false; 26 | } 27 | } 28 | 29 | return true; 30 | } 31 | 32 | public function validateServer($attribute, $value, $parameters) { 33 | return array_key_exists($value, Config::get('lowendping.servers')); 34 | } 35 | 36 | public function validateType($attribute, $value, $parameters) { 37 | return array_key_exists($value, Config::get('lowendping.querytypes')); 38 | } 39 | 40 | private function checkAddressType($query, $type = 4) { 41 | if ($type == 4 && filter_var($query, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) && $query != '255.255.255.255') { 42 | return true; 43 | } else if ($type == 6 && filter_var($query, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) { 44 | return true; 45 | } 46 | return false; 47 | } 48 | } 49 | 50 | Validator::resolver(function($translator, $data, $rules, $messages) { 51 | return new QueryValidator($translator, $data, $rules, $messages); 52 | }); 53 | 54 | function endsWith($haystack, $needle) { 55 | $length = strlen($needle); 56 | if ($length == 0) { 57 | return true; 58 | } 59 | 60 | return (substr($haystack, -$length) === $needle); 61 | } -------------------------------------------------------------------------------- /app/views/emails/auth/reminder.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Password Reset

8 | 9 |
10 | To reset your password, complete this form: {{ URL::to('password/reset', array($token)) }}. 11 |
12 | 13 | -------------------------------------------------------------------------------- /app/views/home.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.main') 2 | 3 | @section('scripts') 4 | @if (Config::get('lowendping.websocket.enabled', false)) 5 | {{ HTML::script('/js/autobahn.min.js') }} 6 | @endif 7 | @endsection 8 | 9 | @section('content') 10 |
11 |
12 |
13 |
14 |

Query (Host/IP)

15 | {{ Form::text('query', Request::getClientIp(), array('class' => 'form-control')) }} 16 |
17 |
18 |
19 |
20 |
21 | {{ Form::select('type', Config::get('lowendping.querytypes'), 'ping', array('class' => 'form-control')) }} 22 |
23 |
24 |
25 | Servers ({{ count($servers) }}) 26 |
27 | 37 |
38 |
39 | 40 |
41 |
42 | 45 | @foreach ($servers as $id => $server) 46 | 52 | @endforeach 53 |
54 |
55 | @endsection -------------------------------------------------------------------------------- /app/views/layouts/main.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | @yield('title', Config::get('app.name')) 6 | 7 | 8 | 9 | 10 | {{ HTML::style('/css/bootstrap/bootstrap.min.css') }} 11 | {{ HTML::style('/css/application.css') }} 12 | @yield('stylesheets') 13 | 14 | 18 | 19 | 20 | @include('layouts.navbar') 21 |
22 | @yield('content') 23 |
24 | 32 |
33 | 34 | 35 | 36 | 37 | @yield('scripts') 38 | 39 | -------------------------------------------------------------------------------- /app/views/layouts/navbar.blade.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/views/result.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.main') 2 | 3 | @section('title') 4 | {{ Config::get('app.name') }} - Result #{{ $query->id }} 5 | @endsection 6 | 7 | @section('content') 8 |
9 |

Query Results for {{{ $query->query }}}

10 | Queried on {{{ $query->created_at->format('F j, Y \a\t h:i:s a') }}}.
11 | These results will expire {{{ $query->expire_at->diffForHumans() }}}. 12 |
13 | @foreach ($responses as $response) 14 |
15 |

{{{ $response->server['name'] }}}

16 |
17 |
18 |
{{{ $response->response }}}
19 |
20 |
21 |
22 | @endforeach 23 |
24 |
25 | @endsection -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | setRequestForConsoleEnvironment(); 45 | 46 | $artisan = Illuminate\Console\Application::start($app); 47 | 48 | /* 49 | |-------------------------------------------------------------------------- 50 | | Run The Artisan Application 51 | |-------------------------------------------------------------------------- 52 | | 53 | | When we run the console application, the current CLI command will be 54 | | executed in this console and the response sent back to a terminal 55 | | or another output device for the developers. Here goes nothing! 56 | | 57 | */ 58 | 59 | $status = $artisan->run(); 60 | 61 | /* 62 | |-------------------------------------------------------------------------- 63 | | Shutdown The Application 64 | |-------------------------------------------------------------------------- 65 | | 66 | | Once Artisan has finished running. We will fire off the shutdown events 67 | | so that any final work may be done by the application before we shut 68 | | down the process. This is the last thing to happen to the request. 69 | | 70 | */ 71 | 72 | $app->shutdown(); 73 | 74 | exit($status); -------------------------------------------------------------------------------- /bootstrap/autoload.php: -------------------------------------------------------------------------------- 1 | __DIR__.'/../app', 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Public Path 21 | |-------------------------------------------------------------------------- 22 | | 23 | | The public path contains the assets for your web application, such as 24 | | your JavaScript and CSS files, and also contains the primary entry 25 | | point for web requests into these applications from the outside. 26 | | 27 | */ 28 | 29 | 'public' => __DIR__.'/../public', 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Base Path 34 | |-------------------------------------------------------------------------- 35 | | 36 | | The base path is the root of the Laravel installation. Most likely you 37 | | will not need to change this value. But, if for some wild reason it 38 | | is necessary you will do so here, just proceed with some caution. 39 | | 40 | */ 41 | 42 | 'base' => __DIR__.'/..', 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Storage Path 47 | |-------------------------------------------------------------------------- 48 | | 49 | | The storage path is used by Laravel to store cached Blade views, logs 50 | | and other pieces of information. You may modify the path here when 51 | | you want to change the location of this directory for your apps. 52 | | 53 | */ 54 | 55 | 'storage' => __DIR__.'/../app/storage', 56 | 57 | ); 58 | -------------------------------------------------------------------------------- /bootstrap/start.php: -------------------------------------------------------------------------------- 1 | detectEnvironment(array( 28 | 29 | 'local' => array('your-machine-name'), 30 | 31 | )); 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Bind Paths 36 | |-------------------------------------------------------------------------- 37 | | 38 | | Here we are binding the paths configured in paths.php to the app. You 39 | | should not be changing these here. If you need to change these you 40 | | may do so within the paths.php file and they will be bound here. 41 | | 42 | */ 43 | 44 | $app->bindInstallPaths(require __DIR__.'/paths.php'); 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Load The Application 49 | |-------------------------------------------------------------------------- 50 | | 51 | | Here we will load this Illuminate application. We will keep this in a 52 | | separate location so we can isolate the creation of an application 53 | | from the actual running of the application with a given request. 54 | | 55 | */ 56 | 57 | $framework = $app['path.base'].'/vendor/laravel/framework/src'; 58 | 59 | require $framework.'/Illuminate/Foundation/start.php'; 60 | 61 | /* 62 | |-------------------------------------------------------------------------- 63 | | Return The Application 64 | |-------------------------------------------------------------------------- 65 | | 66 | | This script returns the application instance. The instance is given to 67 | | the calling script so we can separate the building of the instances 68 | | from the actual running of the application and sending responses. 69 | | 70 | */ 71 | 72 | return $app; 73 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel/laravel", 3 | "description": "The Laravel Framework.", 4 | "keywords": ["framework", "laravel"], 5 | "license": "MIT", 6 | "require": { 7 | "laravel/framework": "4.1.*" 8 | }, 9 | "autoload": { 10 | "classmap": [ 11 | "app/commands", 12 | "app/jobs", 13 | "app/controllers", 14 | "app/models", 15 | "app/database/migrations", 16 | "app/database/seeds", 17 | "app/lib", 18 | "app/tests/TestCase.php" 19 | ] 20 | }, 21 | "scripts": { 22 | "post-install-cmd": [ 23 | "php artisan clear-compiled", 24 | "php artisan optimize" 25 | ], 26 | "post-update-cmd": [ 27 | "php artisan clear-compiled", 28 | "php artisan optimize" 29 | ], 30 | "post-create-project-cmd": [ 31 | "php artisan key:generate" 32 | ] 33 | }, 34 | "config": { 35 | "preferred-install": "dist" 36 | }, 37 | "minimum-stability": "stable" 38 | } 39 | -------------------------------------------------------------------------------- /daemon/lep.py: -------------------------------------------------------------------------------- 1 | import threading 2 | import Queue 3 | import json 4 | import SocketServer 5 | import socket 6 | import ipaddress 7 | from time import sleep 8 | 9 | from sh import ping, ping6, traceroute, mtr 10 | 11 | try: 12 | import lepconf 13 | except ImportError, err: 14 | print "Couldn't import the config." 15 | raise err 16 | 17 | ping = ping.bake(c=4, _ok_code=[0,1]) 18 | ping6 = ping6.bake(c=4, _ok_code=[0,1]) 19 | 20 | traceroute4 = traceroute.bake("-4") 21 | traceroute6 = traceroute.bake("-6") 22 | 23 | mtr4 = mtr.bake("-4", "--report", "--report-wide") 24 | mtr6 = mtr.bake("-6", "--report", "--report-wide") 25 | 26 | queue = Queue.Queue() 27 | 28 | class QueryThread(threading.Thread): 29 | def __init__(self, queue): 30 | threading.Thread.__init__(self) 31 | self.queue = queue 32 | 33 | def run(self): 34 | while True: 35 | query = self.queue.get() 36 | out = None 37 | if query.type == "ping": 38 | out = ping(query.query) 39 | elif query.type == "ping6": 40 | out = ping6(query.query) 41 | elif query.type == "trace": 42 | out = traceroute4(query.query) 43 | elif query.type == "trace6": 44 | out = traceroute6(query.query) 45 | elif query.type == "mtr": 46 | out = mtr4(query.query) 47 | elif query.type == "mtr6": 48 | out = mtr6(query.query) 49 | 50 | if out: 51 | print "Processed query",str(query.id) 52 | send_response(query, out) 53 | else: 54 | print "Unable to process query",str(query.id),"- invalid type",type 55 | 56 | class Query: 57 | def __init__(self, id, serverid, query, type): 58 | self.id = id 59 | self.serverid = serverid 60 | self.query = query 61 | self.type = type 62 | 63 | class ThreadedTCPRequestHandler(SocketServer.BaseRequestHandler): 64 | def handle(self): 65 | data = self.request.recv(2048) 66 | try: 67 | obj = json.loads(data) 68 | 69 | if not obj or not 'id' in obj or not 'serverid' in obj or not 'query' in obj or not 'type' in obj or not 'auth' in obj: 70 | close(self.request, 'invalid') 71 | elif not obj['auth'] == lepconf.auth: 72 | close(self.request, 'denied') 73 | elif not valid_query(obj['query']): 74 | close(self.request, 'invalid_query') 75 | else: 76 | queue.put(Query(obj['id'], obj['serverid'], obj['query'], obj['type'])) 77 | self.request.close() 78 | except ValueError: 79 | close(self.request, 'invalid') 80 | 81 | class ThreadedTCPServer(SocketServer.ThreadingMixIn, SocketServer.TCPServer): 82 | pass 83 | 84 | def valid_query(query): 85 | try: 86 | if ipaddress.ip_address(query): 87 | return 1 88 | except ValueError: 89 | pass 90 | try: 91 | socket.gethostbyname(query) 92 | return 1 93 | except socket.error: 94 | return 0 95 | 96 | def send_response(query, response): 97 | sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 98 | sock.connect(lepconf.remote) 99 | try: 100 | res = { 101 | "auth" : lepconf.auth, 102 | "id" : query.id, 103 | "serverid" : query.serverid, 104 | "response" : str(response) 105 | } 106 | dump = json.dumps(res) 107 | 108 | put(sock, "POST %s HTTP/1.1" % lepconf.page) 109 | put(sock, "Host: %s" % lepconf.remote[0]) 110 | put(sock, "Content-Type: application/json") 111 | put(sock, "Content-Length: %d" % len(dump)) 112 | put(sock, "User-Agent: LowEndPing") 113 | put(sock, "Connection: close") 114 | put(sock, "") 115 | put(sock, dump) 116 | put(sock, "") 117 | finally: 118 | sock.close() 119 | 120 | def put(sock, buf): 121 | if isinstance(buf, (list, tuple)): 122 | for scalar in buf: put(sock, scalar) 123 | else: 124 | sock.send(str(buf)+"\r\n") 125 | 126 | def close(sock, buf): 127 | try: 128 | put(sock, buf) 129 | finally: 130 | sock.close() 131 | 132 | if __name__ == "__main__": 133 | for i in range(lepconf.reqthreads): 134 | t = QueryThread(queue) 135 | t.setDaemon(True) 136 | t.start() 137 | 138 | HOST, PORT = "0.0.0.0", 12337 139 | 140 | server = ThreadedTCPServer((HOST, PORT), ThreadedTCPRequestHandler) 141 | 142 | # Start a thread with the server -- that thread will then start one 143 | # more thread for each request 144 | server_thread = threading.Thread(target=server.serve_forever) 145 | # Exit the server thread when the main thread terminates 146 | server_thread.daemon = True 147 | server_thread.start() 148 | 149 | print "Server loop running in thread:", server_thread.name 150 | 151 | while True: 152 | sleep(10); 153 | -------------------------------------------------------------------------------- /daemon/lepconf.py: -------------------------------------------------------------------------------- 1 | remote = ("example.com", 80) 2 | page = "/response" 3 | 4 | auth = "" 5 | 6 | reqthreads = 4 7 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | ./app/tests/ 16 | 17 | 18 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Redirect Trailing Slashes... 9 | RewriteRule ^(.*)/$ /$1 [L,R=301] 10 | 11 | # Handle Front Controller... 12 | RewriteCond %{REQUEST_FILENAME} !-d 13 | RewriteCond %{REQUEST_FILENAME} !-f 14 | RewriteRule ^ index.php [L] 15 | 16 | -------------------------------------------------------------------------------- /public/css/application.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 70px; 3 | } -------------------------------------------------------------------------------- /public/css/bootstrap/bootstrap-theme.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.1.1 (http://getbootstrap.com) 3 | * Copyright 2011-2014 Twitter, Inc. 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | 7 | .btn-default, 8 | .btn-primary, 9 | .btn-success, 10 | .btn-info, 11 | .btn-warning, 12 | .btn-danger { 13 | text-shadow: 0 -1px 0 rgba(0, 0, 0, .2); 14 | -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 1px rgba(0, 0, 0, .075); 15 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 1px rgba(0, 0, 0, .075); 16 | } 17 | .btn-default:active, 18 | .btn-primary:active, 19 | .btn-success:active, 20 | .btn-info:active, 21 | .btn-warning:active, 22 | .btn-danger:active, 23 | .btn-default.active, 24 | .btn-primary.active, 25 | .btn-success.active, 26 | .btn-info.active, 27 | .btn-warning.active, 28 | .btn-danger.active { 29 | -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); 30 | box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); 31 | } 32 | .btn:active, 33 | .btn.active { 34 | background-image: none; 35 | } 36 | .btn-default { 37 | text-shadow: 0 1px 0 #fff; 38 | background-image: -webkit-linear-gradient(top, #fff 0%, #e0e0e0 100%); 39 | background-image: linear-gradient(to bottom, #fff 0%, #e0e0e0 100%); 40 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0); 41 | filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); 42 | background-repeat: repeat-x; 43 | border-color: #dbdbdb; 44 | border-color: #ccc; 45 | } 46 | .btn-default:hover, 47 | .btn-default:focus { 48 | background-color: #e0e0e0; 49 | background-position: 0 -15px; 50 | } 51 | .btn-default:active, 52 | .btn-default.active { 53 | background-color: #e0e0e0; 54 | border-color: #dbdbdb; 55 | } 56 | .btn-primary { 57 | background-image: -webkit-linear-gradient(top, #428bca 0%, #2d6ca2 100%); 58 | background-image: linear-gradient(to bottom, #428bca 0%, #2d6ca2 100%); 59 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff2d6ca2', GradientType=0); 60 | filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); 61 | background-repeat: repeat-x; 62 | border-color: #2b669a; 63 | } 64 | .btn-primary:hover, 65 | .btn-primary:focus { 66 | background-color: #2d6ca2; 67 | background-position: 0 -15px; 68 | } 69 | .btn-primary:active, 70 | .btn-primary.active { 71 | background-color: #2d6ca2; 72 | border-color: #2b669a; 73 | } 74 | .btn-success { 75 | background-image: -webkit-linear-gradient(top, #5cb85c 0%, #419641 100%); 76 | background-image: linear-gradient(to bottom, #5cb85c 0%, #419641 100%); 77 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0); 78 | filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); 79 | background-repeat: repeat-x; 80 | border-color: #3e8f3e; 81 | } 82 | .btn-success:hover, 83 | .btn-success:focus { 84 | background-color: #419641; 85 | background-position: 0 -15px; 86 | } 87 | .btn-success:active, 88 | .btn-success.active { 89 | background-color: #419641; 90 | border-color: #3e8f3e; 91 | } 92 | .btn-info { 93 | background-image: -webkit-linear-gradient(top, #5bc0de 0%, #2aabd2 100%); 94 | background-image: linear-gradient(to bottom, #5bc0de 0%, #2aabd2 100%); 95 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0); 96 | filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); 97 | background-repeat: repeat-x; 98 | border-color: #28a4c9; 99 | } 100 | .btn-info:hover, 101 | .btn-info:focus { 102 | background-color: #2aabd2; 103 | background-position: 0 -15px; 104 | } 105 | .btn-info:active, 106 | .btn-info.active { 107 | background-color: #2aabd2; 108 | border-color: #28a4c9; 109 | } 110 | .btn-warning { 111 | background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #eb9316 100%); 112 | background-image: linear-gradient(to bottom, #f0ad4e 0%, #eb9316 100%); 113 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0); 114 | filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); 115 | background-repeat: repeat-x; 116 | border-color: #e38d13; 117 | } 118 | .btn-warning:hover, 119 | .btn-warning:focus { 120 | background-color: #eb9316; 121 | background-position: 0 -15px; 122 | } 123 | .btn-warning:active, 124 | .btn-warning.active { 125 | background-color: #eb9316; 126 | border-color: #e38d13; 127 | } 128 | .btn-danger { 129 | background-image: -webkit-linear-gradient(top, #d9534f 0%, #c12e2a 100%); 130 | background-image: linear-gradient(to bottom, #d9534f 0%, #c12e2a 100%); 131 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0); 132 | filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); 133 | background-repeat: repeat-x; 134 | border-color: #b92c28; 135 | } 136 | .btn-danger:hover, 137 | .btn-danger:focus { 138 | background-color: #c12e2a; 139 | background-position: 0 -15px; 140 | } 141 | .btn-danger:active, 142 | .btn-danger.active { 143 | background-color: #c12e2a; 144 | border-color: #b92c28; 145 | } 146 | .thumbnail, 147 | .img-thumbnail { 148 | -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .075); 149 | box-shadow: 0 1px 2px rgba(0, 0, 0, .075); 150 | } 151 | .dropdown-menu > li > a:hover, 152 | .dropdown-menu > li > a:focus { 153 | background-color: #e8e8e8; 154 | background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%); 155 | background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%); 156 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0); 157 | background-repeat: repeat-x; 158 | } 159 | .dropdown-menu > .active > a, 160 | .dropdown-menu > .active > a:hover, 161 | .dropdown-menu > .active > a:focus { 162 | background-color: #357ebd; 163 | background-image: -webkit-linear-gradient(top, #428bca 0%, #357ebd 100%); 164 | background-image: linear-gradient(to bottom, #428bca 0%, #357ebd 100%); 165 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0); 166 | background-repeat: repeat-x; 167 | } 168 | .navbar-default { 169 | background-image: -webkit-linear-gradient(top, #fff 0%, #f8f8f8 100%); 170 | background-image: linear-gradient(to bottom, #fff 0%, #f8f8f8 100%); 171 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0); 172 | filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); 173 | background-repeat: repeat-x; 174 | border-radius: 4px; 175 | -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 5px rgba(0, 0, 0, .075); 176 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 5px rgba(0, 0, 0, .075); 177 | } 178 | .navbar-default .navbar-nav > .active > a { 179 | background-image: -webkit-linear-gradient(top, #ebebeb 0%, #f3f3f3 100%); 180 | background-image: linear-gradient(to bottom, #ebebeb 0%, #f3f3f3 100%); 181 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff3f3f3', GradientType=0); 182 | background-repeat: repeat-x; 183 | -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, .075); 184 | box-shadow: inset 0 3px 9px rgba(0, 0, 0, .075); 185 | } 186 | .navbar-brand, 187 | .navbar-nav > li > a { 188 | text-shadow: 0 1px 0 rgba(255, 255, 255, .25); 189 | } 190 | .navbar-inverse { 191 | background-image: -webkit-linear-gradient(top, #3c3c3c 0%, #222 100%); 192 | background-image: linear-gradient(to bottom, #3c3c3c 0%, #222 100%); 193 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0); 194 | filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); 195 | background-repeat: repeat-x; 196 | } 197 | .navbar-inverse .navbar-nav > .active > a { 198 | background-image: -webkit-linear-gradient(top, #222 0%, #282828 100%); 199 | background-image: linear-gradient(to bottom, #222 0%, #282828 100%); 200 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222', endColorstr='#ff282828', GradientType=0); 201 | background-repeat: repeat-x; 202 | -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, .25); 203 | box-shadow: inset 0 3px 9px rgba(0, 0, 0, .25); 204 | } 205 | .navbar-inverse .navbar-brand, 206 | .navbar-inverse .navbar-nav > li > a { 207 | text-shadow: 0 -1px 0 rgba(0, 0, 0, .25); 208 | } 209 | .navbar-static-top, 210 | .navbar-fixed-top, 211 | .navbar-fixed-bottom { 212 | border-radius: 0; 213 | } 214 | .alert { 215 | text-shadow: 0 1px 0 rgba(255, 255, 255, .2); 216 | -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .05); 217 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .05); 218 | } 219 | .alert-success { 220 | background-image: -webkit-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%); 221 | background-image: linear-gradient(to bottom, #dff0d8 0%, #c8e5bc 100%); 222 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0); 223 | background-repeat: repeat-x; 224 | border-color: #b2dba1; 225 | } 226 | .alert-info { 227 | background-image: -webkit-linear-gradient(top, #d9edf7 0%, #b9def0 100%); 228 | background-image: linear-gradient(to bottom, #d9edf7 0%, #b9def0 100%); 229 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0); 230 | background-repeat: repeat-x; 231 | border-color: #9acfea; 232 | } 233 | .alert-warning { 234 | background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%); 235 | background-image: linear-gradient(to bottom, #fcf8e3 0%, #f8efc0 100%); 236 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0); 237 | background-repeat: repeat-x; 238 | border-color: #f5e79e; 239 | } 240 | .alert-danger { 241 | background-image: -webkit-linear-gradient(top, #f2dede 0%, #e7c3c3 100%); 242 | background-image: linear-gradient(to bottom, #f2dede 0%, #e7c3c3 100%); 243 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0); 244 | background-repeat: repeat-x; 245 | border-color: #dca7a7; 246 | } 247 | .progress { 248 | background-image: -webkit-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%); 249 | background-image: linear-gradient(to bottom, #ebebeb 0%, #f5f5f5 100%); 250 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0); 251 | background-repeat: repeat-x; 252 | } 253 | .progress-bar { 254 | background-image: -webkit-linear-gradient(top, #428bca 0%, #3071a9 100%); 255 | background-image: linear-gradient(to bottom, #428bca 0%, #3071a9 100%); 256 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3071a9', GradientType=0); 257 | background-repeat: repeat-x; 258 | } 259 | .progress-bar-success { 260 | background-image: -webkit-linear-gradient(top, #5cb85c 0%, #449d44 100%); 261 | background-image: linear-gradient(to bottom, #5cb85c 0%, #449d44 100%); 262 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0); 263 | background-repeat: repeat-x; 264 | } 265 | .progress-bar-info { 266 | background-image: -webkit-linear-gradient(top, #5bc0de 0%, #31b0d5 100%); 267 | background-image: linear-gradient(to bottom, #5bc0de 0%, #31b0d5 100%); 268 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0); 269 | background-repeat: repeat-x; 270 | } 271 | .progress-bar-warning { 272 | background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #ec971f 100%); 273 | background-image: linear-gradient(to bottom, #f0ad4e 0%, #ec971f 100%); 274 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0); 275 | background-repeat: repeat-x; 276 | } 277 | .progress-bar-danger { 278 | background-image: -webkit-linear-gradient(top, #d9534f 0%, #c9302c 100%); 279 | background-image: linear-gradient(to bottom, #d9534f 0%, #c9302c 100%); 280 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0); 281 | background-repeat: repeat-x; 282 | } 283 | .list-group { 284 | border-radius: 4px; 285 | -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .075); 286 | box-shadow: 0 1px 2px rgba(0, 0, 0, .075); 287 | } 288 | .list-group-item.active, 289 | .list-group-item.active:hover, 290 | .list-group-item.active:focus { 291 | text-shadow: 0 -1px 0 #3071a9; 292 | background-image: -webkit-linear-gradient(top, #428bca 0%, #3278b3 100%); 293 | background-image: linear-gradient(to bottom, #428bca 0%, #3278b3 100%); 294 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3278b3', GradientType=0); 295 | background-repeat: repeat-x; 296 | border-color: #3278b3; 297 | } 298 | .panel { 299 | -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .05); 300 | box-shadow: 0 1px 2px rgba(0, 0, 0, .05); 301 | } 302 | .panel-default > .panel-heading { 303 | background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%); 304 | background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%); 305 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0); 306 | background-repeat: repeat-x; 307 | } 308 | .panel-primary > .panel-heading { 309 | background-image: -webkit-linear-gradient(top, #428bca 0%, #357ebd 100%); 310 | background-image: linear-gradient(to bottom, #428bca 0%, #357ebd 100%); 311 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0); 312 | background-repeat: repeat-x; 313 | } 314 | .panel-success > .panel-heading { 315 | background-image: -webkit-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%); 316 | background-image: linear-gradient(to bottom, #dff0d8 0%, #d0e9c6 100%); 317 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0); 318 | background-repeat: repeat-x; 319 | } 320 | .panel-info > .panel-heading { 321 | background-image: -webkit-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%); 322 | background-image: linear-gradient(to bottom, #d9edf7 0%, #c4e3f3 100%); 323 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0); 324 | background-repeat: repeat-x; 325 | } 326 | .panel-warning > .panel-heading { 327 | background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%); 328 | background-image: linear-gradient(to bottom, #fcf8e3 0%, #faf2cc 100%); 329 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0); 330 | background-repeat: repeat-x; 331 | } 332 | .panel-danger > .panel-heading { 333 | background-image: -webkit-linear-gradient(top, #f2dede 0%, #ebcccc 100%); 334 | background-image: linear-gradient(to bottom, #f2dede 0%, #ebcccc 100%); 335 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0); 336 | background-repeat: repeat-x; 337 | } 338 | .well { 339 | background-image: -webkit-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%); 340 | background-image: linear-gradient(to bottom, #e8e8e8 0%, #f5f5f5 100%); 341 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0); 342 | background-repeat: repeat-x; 343 | border-color: #dcdcdc; 344 | -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05), 0 1px 0 rgba(255, 255, 255, .1); 345 | box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05), 0 1px 0 rgba(255, 255, 255, .1); 346 | } 347 | /*# sourceMappingURL=bootstrap-theme.css.map */ 348 | -------------------------------------------------------------------------------- /public/css/bootstrap/bootstrap-theme.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.1.1 (http://getbootstrap.com) 3 | * Copyright 2011-2014 Twitter, Inc. 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | 7 | .btn-default,.btn-primary,.btn-success,.btn-info,.btn-warning,.btn-danger{text-shadow:0 -1px 0 rgba(0,0,0,.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075)}.btn-default:active,.btn-primary:active,.btn-success:active,.btn-info:active,.btn-warning:active,.btn-danger:active,.btn-default.active,.btn-primary.active,.btn-success.active,.btn-info.active,.btn-warning.active,.btn-danger.active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn:active,.btn.active{background-image:none}.btn-default{background-image:-webkit-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image:linear-gradient(to bottom,#fff 0,#e0e0e0 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#dbdbdb;text-shadow:0 1px 0 #fff;border-color:#ccc}.btn-default:hover,.btn-default:focus{background-color:#e0e0e0;background-position:0 -15px}.btn-default:active,.btn-default.active{background-color:#e0e0e0;border-color:#dbdbdb}.btn-primary{background-image:-webkit-linear-gradient(top,#428bca 0,#2d6ca2 100%);background-image:linear-gradient(to bottom,#428bca 0,#2d6ca2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff2d6ca2', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#2b669a}.btn-primary:hover,.btn-primary:focus{background-color:#2d6ca2;background-position:0 -15px}.btn-primary:active,.btn-primary.active{background-color:#2d6ca2;border-color:#2b669a}.btn-success{background-image:-webkit-linear-gradient(top,#5cb85c 0,#419641 100%);background-image:linear-gradient(to bottom,#5cb85c 0,#419641 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#3e8f3e}.btn-success:hover,.btn-success:focus{background-color:#419641;background-position:0 -15px}.btn-success:active,.btn-success.active{background-color:#419641;border-color:#3e8f3e}.btn-info{background-image:-webkit-linear-gradient(top,#5bc0de 0,#2aabd2 100%);background-image:linear-gradient(to bottom,#5bc0de 0,#2aabd2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#28a4c9}.btn-info:hover,.btn-info:focus{background-color:#2aabd2;background-position:0 -15px}.btn-info:active,.btn-info.active{background-color:#2aabd2;border-color:#28a4c9}.btn-warning{background-image:-webkit-linear-gradient(top,#f0ad4e 0,#eb9316 100%);background-image:linear-gradient(to bottom,#f0ad4e 0,#eb9316 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#e38d13}.btn-warning:hover,.btn-warning:focus{background-color:#eb9316;background-position:0 -15px}.btn-warning:active,.btn-warning.active{background-color:#eb9316;border-color:#e38d13}.btn-danger{background-image:-webkit-linear-gradient(top,#d9534f 0,#c12e2a 100%);background-image:linear-gradient(to bottom,#d9534f 0,#c12e2a 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#b92c28}.btn-danger:hover,.btn-danger:focus{background-color:#c12e2a;background-position:0 -15px}.btn-danger:active,.btn-danger.active{background-color:#c12e2a;border-color:#b92c28}.thumbnail,.img-thumbnail{-webkit-box-shadow:0 1px 2px rgba(0,0,0,.075);box-shadow:0 1px 2px rgba(0,0,0,.075)}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{background-image:-webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);background-color:#e8e8e8}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{background-image:-webkit-linear-gradient(top,#428bca 0,#357ebd 100%);background-image:linear-gradient(to bottom,#428bca 0,#357ebd 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0);background-color:#357ebd}.navbar-default{background-image:-webkit-linear-gradient(top,#fff 0,#f8f8f8 100%);background-image:linear-gradient(to bottom,#fff 0,#f8f8f8 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);border-radius:4px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 5px rgba(0,0,0,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 5px rgba(0,0,0,.075)}.navbar-default .navbar-nav>.active>a{background-image:-webkit-linear-gradient(top,#ebebeb 0,#f3f3f3 100%);background-image:linear-gradient(to bottom,#ebebeb 0,#f3f3f3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff3f3f3', GradientType=0);-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,.075);box-shadow:inset 0 3px 9px rgba(0,0,0,.075)}.navbar-brand,.navbar-nav>li>a{text-shadow:0 1px 0 rgba(255,255,255,.25)}.navbar-inverse{background-image:-webkit-linear-gradient(top,#3c3c3c 0,#222 100%);background-image:linear-gradient(to bottom,#3c3c3c 0,#222 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.navbar-inverse .navbar-nav>.active>a{background-image:-webkit-linear-gradient(top,#222 0,#282828 100%);background-image:linear-gradient(to bottom,#222 0,#282828 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222', endColorstr='#ff282828', GradientType=0);-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,.25);box-shadow:inset 0 3px 9px rgba(0,0,0,.25)}.navbar-inverse .navbar-brand,.navbar-inverse .navbar-nav>li>a{text-shadow:0 -1px 0 rgba(0,0,0,.25)}.navbar-static-top,.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}.alert{text-shadow:0 1px 0 rgba(255,255,255,.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 2px rgba(0,0,0,.05)}.alert-success{background-image:-webkit-linear-gradient(top,#dff0d8 0,#c8e5bc 100%);background-image:linear-gradient(to bottom,#dff0d8 0,#c8e5bc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0);border-color:#b2dba1}.alert-info{background-image:-webkit-linear-gradient(top,#d9edf7 0,#b9def0 100%);background-image:linear-gradient(to bottom,#d9edf7 0,#b9def0 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0);border-color:#9acfea}.alert-warning{background-image:-webkit-linear-gradient(top,#fcf8e3 0,#f8efc0 100%);background-image:linear-gradient(to bottom,#fcf8e3 0,#f8efc0 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0);border-color:#f5e79e}.alert-danger{background-image:-webkit-linear-gradient(top,#f2dede 0,#e7c3c3 100%);background-image:linear-gradient(to bottom,#f2dede 0,#e7c3c3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0);border-color:#dca7a7}.progress{background-image:-webkit-linear-gradient(top,#ebebeb 0,#f5f5f5 100%);background-image:linear-gradient(to bottom,#ebebeb 0,#f5f5f5 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0)}.progress-bar{background-image:-webkit-linear-gradient(top,#428bca 0,#3071a9 100%);background-image:linear-gradient(to bottom,#428bca 0,#3071a9 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3071a9', GradientType=0)}.progress-bar-success{background-image:-webkit-linear-gradient(top,#5cb85c 0,#449d44 100%);background-image:linear-gradient(to bottom,#5cb85c 0,#449d44 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0)}.progress-bar-info{background-image:-webkit-linear-gradient(top,#5bc0de 0,#31b0d5 100%);background-image:linear-gradient(to bottom,#5bc0de 0,#31b0d5 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0)}.progress-bar-warning{background-image:-webkit-linear-gradient(top,#f0ad4e 0,#ec971f 100%);background-image:linear-gradient(to bottom,#f0ad4e 0,#ec971f 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0)}.progress-bar-danger{background-image:-webkit-linear-gradient(top,#d9534f 0,#c9302c 100%);background-image:linear-gradient(to bottom,#d9534f 0,#c9302c 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0)}.list-group{border-radius:4px;-webkit-box-shadow:0 1px 2px rgba(0,0,0,.075);box-shadow:0 1px 2px rgba(0,0,0,.075)}.list-group-item.active,.list-group-item.active:hover,.list-group-item.active:focus{text-shadow:0 -1px 0 #3071a9;background-image:-webkit-linear-gradient(top,#428bca 0,#3278b3 100%);background-image:linear-gradient(to bottom,#428bca 0,#3278b3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3278b3', GradientType=0);border-color:#3278b3}.panel{-webkit-box-shadow:0 1px 2px rgba(0,0,0,.05);box-shadow:0 1px 2px rgba(0,0,0,.05)}.panel-default>.panel-heading{background-image:-webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0)}.panel-primary>.panel-heading{background-image:-webkit-linear-gradient(top,#428bca 0,#357ebd 100%);background-image:linear-gradient(to bottom,#428bca 0,#357ebd 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0)}.panel-success>.panel-heading{background-image:-webkit-linear-gradient(top,#dff0d8 0,#d0e9c6 100%);background-image:linear-gradient(to bottom,#dff0d8 0,#d0e9c6 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0)}.panel-info>.panel-heading{background-image:-webkit-linear-gradient(top,#d9edf7 0,#c4e3f3 100%);background-image:linear-gradient(to bottom,#d9edf7 0,#c4e3f3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0)}.panel-warning>.panel-heading{background-image:-webkit-linear-gradient(top,#fcf8e3 0,#faf2cc 100%);background-image:linear-gradient(to bottom,#fcf8e3 0,#faf2cc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0)}.panel-danger>.panel-heading{background-image:-webkit-linear-gradient(top,#f2dede 0,#ebcccc 100%);background-image:linear-gradient(to bottom,#f2dede 0,#ebcccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0)}.well{background-image:-webkit-linear-gradient(top,#e8e8e8 0,#f5f5f5 100%);background-image:linear-gradient(to bottom,#e8e8e8 0,#f5f5f5 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0);border-color:#dcdcdc;-webkit-box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 rgba(255,255,255,.1)} -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nikkiii/lowendping/15321d82459048afa9d7aa85f70ab58baacc02ac/public/favicon.ico -------------------------------------------------------------------------------- /public/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nikkiii/lowendping/15321d82459048afa9d7aa85f70ab58baacc02ac/public/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /public/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nikkiii/lowendping/15321d82459048afa9d7aa85f70ab58baacc02ac/public/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /public/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nikkiii/lowendping/15321d82459048afa9d7aa85f70ab58baacc02ac/public/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | 9 | /* 10 | |-------------------------------------------------------------------------- 11 | | Register The Auto Loader 12 | |-------------------------------------------------------------------------- 13 | | 14 | | Composer provides a convenient, automatically generated class loader 15 | | for our application. We just need to utilize it! We'll require it 16 | | into the script here so that we do not have to worry about the 17 | | loading of any our classes "manually". Feels great to relax. 18 | | 19 | */ 20 | 21 | require __DIR__.'/../bootstrap/autoload.php'; 22 | 23 | /* 24 | |-------------------------------------------------------------------------- 25 | | Turn On The Lights 26 | |-------------------------------------------------------------------------- 27 | | 28 | | We need to illuminate PHP development, so let's turn on the lights. 29 | | This bootstraps the framework and gets it ready for use, then it 30 | | will load up this application so that we can run it and send 31 | | the responses back to the browser and delight these users. 32 | | 33 | */ 34 | 35 | $app = require_once __DIR__.'/../bootstrap/start.php'; 36 | 37 | /* 38 | |-------------------------------------------------------------------------- 39 | | Run The Application 40 | |-------------------------------------------------------------------------- 41 | | 42 | | Once we have the application, we can simply call the run method, 43 | | which will execute the request and send the response back to 44 | | the client's browser allowing them to enjoy the creative 45 | | and wonderful application we have whipped up for them. 46 | | 47 | */ 48 | 49 | $app->run(); 50 | -------------------------------------------------------------------------------- /public/js/application.js: -------------------------------------------------------------------------------- 1 | // LowEndPing 2 | // ++++++++++++++++++++++++++++++++++++++++++ 3 | 4 | var totalQueries = -1; 5 | 6 | var conn = false; 7 | 8 | var onData = function(topic, data) { 9 | var $respdiv = $('#server_' + data.server_id + '_response'); 10 | $respdiv.find('div.progress').remove(); 11 | $respdiv.html('
' + data.data + '
'); 12 | totalQueries--; 13 | 14 | if (totalQueries < 1) { 15 | $('#resultcontainer').data('queryid', false); 16 | $('input[type="submit"]').button('complete'); 17 | totalQueries = -1; 18 | 19 | conn.unsubscribe(data.query_id.toString()); 20 | } 21 | }; 22 | 23 | var loading = '\ 24 |
\ 25 |
\ 26 |
'; 27 | 28 | var validateRegex = new RegExp('^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$|^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$|^(?:(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){6})(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:::(?:(?:(?:[0-9a-fA-F]{1,4})):){5})(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})))?::(?:(?:(?:[0-9a-fA-F]{1,4})):){4})(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){0,1}(?:(?:[0-9a-fA-F]{1,4})))?::(?:(?:(?:[0-9a-fA-F]{1,4})):){3})(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){0,2}(?:(?:[0-9a-fA-F]{1,4})))?::(?:(?:(?:[0-9a-fA-F]{1,4})):){2})(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){0,3}(?:(?:[0-9a-fA-F]{1,4})))?::(?:(?:[0-9a-fA-F]{1,4})):)(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){0,4}(?:(?:[0-9a-fA-F]{1,4})))?::)(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){0,5}(?:(?:[0-9a-fA-F]{1,4})))?::)(?:(?:[0-9a-fA-F]{1,4})))|(?:(?:(?:(?:(?:(?:[0-9a-fA-F]{1,4})):){0,6}(?:(?:[0-9a-fA-F]{1,4})))?::))))$'); 29 | 30 | $(document).ready(function() { 31 | $("#serverlink").click(function(e) { 32 | e.preventDefault(); 33 | $("#servers").slideToggle(); 34 | }); 35 | 36 | $('#mastercheck').change(function(e) { 37 | $('input:checkbox').prop('checked', $(this).is(":checked")); 38 | }); 39 | 40 | $('input:checkbox').change(function(e) { 41 | var checkbox = $("#mastercheck"); 42 | if (checkbox.is(":checked") && !$(this).is(":checked")) { 43 | checkbox.attr('checked', false); 44 | } 45 | }); 46 | 47 | $('#queryform').submit(function(e) { 48 | e.preventDefault(); 49 | 50 | var query = $('input[name=query]').val(); 51 | 52 | if (!validateRegex.test(query)) { 53 | alert("Please enter a valid hostname/ip address"); 54 | return; 55 | } 56 | 57 | if ($('input:checkbox:checked').length < 1) { 58 | alert('Please select one or more servers.'); 59 | return; 60 | } 61 | 62 | $("#servers").slideUp(); 63 | 64 | $('input[type="submit"]').button('loading'); 65 | 66 | $.post('/submit', $(this).serialize(), function(res) { 67 | if (res.success) { 68 | $('#resultcontainer').resetResponses(); 69 | 70 | $('#resultcontainer').data('queryid', res.queryid); 71 | 72 | if (res.resultLink) { 73 | $('#resultLink').attr('href', res.resultLink).parent().parent().removeClass('hidden'); 74 | } 75 | 76 | totalQueries = res.serverCount; 77 | 78 | if (res.websocket && window.WebSocket) { 79 | if (!conn) { 80 | conn = new ab.Session( 81 | res.websocket, 82 | function() { 83 | console.log('WebSocket connected.'); 84 | conn.subscribe(res.queryid.toString(), onData); 85 | }, function() { 86 | conn = false; 87 | console.log('WebSocket closed.'); 88 | if (totalQueries > 0) { 89 | console.log('Falling back to HTTP requests.'); 90 | $('#resultcontainer').status(); 91 | } 92 | }, { 93 | 'skipSubprotocolCheck': true 94 | } 95 | ); 96 | } else { 97 | conn.subscribe(res.queryid.toString(), onData); 98 | } 99 | } else { 100 | $('#resultcontainer').status(); 101 | } 102 | } else { 103 | $('input[type="submit"]').button('complete'); 104 | alert('Error: ' + res.error); 105 | } 106 | }, 'json'); 107 | }); 108 | 109 | $.fn.extend({ 110 | // Resets the response containers before a new query, adding the loading 111 | // bar. 112 | resetResponses : function(options) { 113 | var obj = $(this); 114 | 115 | obj.children().each(function(index) { 116 | $(this).find('div.response').remove(); 117 | $(this).addClass('hidden'); 118 | }); 119 | 120 | $("input:checked").each(function(index) { 121 | var id = $(this).attr("name"); 122 | 123 | if (id == undefined) 124 | return; 125 | 126 | id = id.match(/servers\[(\d+)\]/)[1]; 127 | 128 | $('#server_' + id).removeClass('hidden'); 129 | $('#server_' + id + '_response').html(loading); 130 | }); 131 | 132 | obj.slideDown('slow'); 133 | }, 134 | 135 | status : function(options) { 136 | var currentQuery = $(this).data('queryid'); 137 | if (currentQuery == undefined || totalQueries == -1) { 138 | return; 139 | } 140 | var obj = $(this); 141 | $.get('/update/' + currentQuery, function(data) { 142 | for (idx in data) { 143 | var response = data[idx]; 144 | var $respdiv = $('#server_' + response.id + '_response'); 145 | $respdiv.find('div.progress').remove(); 146 | $respdiv.html('
' + response.data + '
'); 147 | totalQueries--; 148 | } 149 | if (totalQueries > 0) { 150 | setTimeout(function() { 151 | obj.status(); 152 | }, 2000); 153 | } else { 154 | obj.data('queryid', false); 155 | $('input[type="submit"]').button('complete'); 156 | totalQueries = -1; 157 | } 158 | }, 'json'); 159 | } 160 | }); 161 | 162 | }); -------------------------------------------------------------------------------- /public/js/autobahn.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | AutobahnJS - http://autobahn.ws 3 | 4 | Copyright (C) 2011-2014 Tavendo GmbH. 5 | Licensed under the MIT License. 6 | See license text at http://www.opensource.org/licenses/mit-license.php 7 | 8 | AutobahnJS includes code from: 9 | 10 | when - http://cujojs.com 11 | 12 | (c) copyright B Cavalier & J Hann 13 | Licensed under the MIT License at: 14 | http://www.opensource.org/licenses/mit-license.php 15 | 16 | Crypto-JS - http://code.google.com/p/crypto-js/ 17 | 18 | (c) 2009-2012 by Jeff Mott. All rights reserved. 19 | Licensed under the New BSD License at: 20 | http://code.google.com/p/crypto-js/wiki/License 21 | 22 | console-normalizer - https://github.com/Zenovations/console-normalizer 23 | 24 | (c) 2012 by Zenovations. 25 | Licensed under the MIT License at: 26 | http://www.opensource.org/licenses/mit-license.php 27 | 28 | */ 29 | window.define||(window.define=function(c){try{delete window.define}catch(g){window.define=void 0}window.when=c()},window.define.amd={});(function(c){c||(c=window.console={log:function(c,a,b,d,h){},info:function(c,a,b,d,h){},warn:function(c,a,b,d,h){},error:function(c,a,b,d,h){}});Function.prototype.bind||(Function.prototype.bind=function(c){var a=this,b=Array.prototype.slice.call(arguments,1);return function(){return a.apply(c,Array.prototype.concat.apply(b,arguments))}});"object"===typeof c.log&&(c.log=Function.prototype.call.bind(c.log,c),c.info=Function.prototype.call.bind(c.info,c),c.warn=Function.prototype.call.bind(c.warn,c), 30 | c.error=Function.prototype.call.bind(c.error,c));"group"in c||(c.group=function(g){c.info("\n--- "+g+" ---\n")});"groupEnd"in c||(c.groupEnd=function(){c.log("\n")});"time"in c||function(){var g={};c.time=function(a){g[a]=(new Date).getTime()};c.timeEnd=function(a){var b=(new Date).getTime();c.info(a+": "+(a in g?b-g[a]:0)+"ms")}}()})(window.console);/* 31 | MIT License (c) copyright 2011-2013 original author or authors */ 32 | (function(c){c(function(c){function a(a,b,e,c){return(a instanceof d?a:h(a)).then(b,e,c)}function b(a){return new d(a,B.PromiseStatus&&B.PromiseStatus())}function d(a,b){function d(a){if(m){var c=m;m=w;p(function(){q=e(l,a);b&&A(q,b);f(c,q)})}}function c(a){d(new k(a))}function h(a){if(m){var b=m;p(function(){f(b,new z(a))})}}var l,q,m=[];l=this;this._status=b;this.inspect=function(){return q?q.inspect():{state:"pending"}};this._when=function(a,b,e,d,c){function f(h){h._when(a,b,e,d,c)}m?m.push(f): 33 | p(function(){f(q)})};try{a(d,c,h)}catch(n){c(n)}}function h(a){return b(function(b){b(a)})}function f(a,b){for(var e=0;e>>0;l=Math.max(0,Math.min(d,t));D=[];q=t-l+1;m=[];if(l){n=function(a){m.push(a);--q||(k=n=s,c(m))};k=function(a){D.push(a);--l||(k=n=s,b(D))};for(g=0;g>>0;l=[];if(k)for(m=0;m>>0;e=arguments;if(1>=e.length)for(;;){if(f in b){d=b[f++];break}if(++f>=c)throw new TypeError;}else d=e[1];for(;f>>2]|=(e[c>>>2]>>>24-8*(c%4)&255)<<24-8*((d+c)%4);else if(65535>>2]=e[c>>>2];else b.push.apply(b,e);this.sigBytes+=a;return this},clamp:function(){var a= 43 | this.words,b=this.sigBytes;a[b>>>2]&=4294967295<<32-8*(b%4);a.length=c.ceil(b/4)},clone:function(){var a=d.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var b=[],e=0;e>>2]>>>24-8*(d%4)&255;e.push((c>>>4).toString(16));e.push((c&15).toString(16))}return e.join("")},parse:function(a){for(var b=a.length, 44 | e=[],d=0;d>>3]|=parseInt(a.substr(d,2),16)<<24-4*(d%8);return new h.init(e,b/2)}},l=f.Latin1={stringify:function(a){var b=a.words;a=a.sigBytes;for(var e=[],d=0;d>>2]>>>24-8*(d%4)&255));return e.join("")},parse:function(a){for(var b=a.length,e=[],d=0;d>>2]|=(a.charCodeAt(d)&255)<<24-8*(d%4);return new h.init(e,b)}},t=f.Utf8={stringify:function(a){try{return decodeURIComponent(escape(l.stringify(a)))}catch(b){throw Error("Malformed UTF-8 data"); 45 | }},parse:function(a){return l.parse(unescape(encodeURIComponent(a)))}},k=b.BufferedBlockAlgorithm=d.extend({reset:function(){this._data=new h.init;this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=t.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var b=this._data,e=b.words,d=b.sigBytes,f=this.blockSize,l=d/(4*f),l=a?c.ceil(l):c.max((l|0)-this._minBufferSize,0);a=l*f;d=c.min(4*a,d);if(a){for(var k=0;k>>2]>>>24-8*(f%4)&255)<<16|(b[f+1>>>2]>>>24-8*((f+1)%4)&255)<<8|b[f+2>>>2]>>>24-8*((f+2)%4)&255,l=0;4>l&&f+0.75*l>>6*(3-l)&63));if(b=c.charAt(64))for(;a.length%4;)a.push(b);return a.join("")},parse:function(a){var b=a.length,d=this._map,c=d.charAt(64);c&&(c=a.indexOf(c),-1!=c&&(b=c));for(var c=[],f=0,e=0;e< 48 | b;e++)if(e%4){var l=d.indexOf(a.charAt(e-1))<<2*(e%4),t=d.indexOf(a.charAt(e))>>>6-2*(e%4);c[f>>>2]|=(l|t)<<24-8*(f%4);f++}return g.create(c,f)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})();(function(){var c=CryptoJS,g=c.enc.Utf8;c.algo.HMAC=c.lib.Base.extend({init:function(a,b){a=this._hasher=new a.init;"string"==typeof b&&(b=g.parse(b));var d=a.blockSize,c=4*d;b.sigBytes>c&&(b=a.finalize(b));b.clamp();for(var f=this._oKey=b.clone(),e=this._iKey=b.clone(),l=f.words,t=e.words,k=0;kd;)a(e)&&(8>d&&(h[d]=b(c.pow(e,0.5))),f[d]=b(c.pow(e,1/3)),d++),e++})();var e=[],a=a.SHA256=d.extend({_doReset:function(){this._hash=new b.init(h.slice(0))},_doProcessBlock:function(a,b){for(var d=this._hash.words,c=d[0],h=d[1],g=d[2],m=d[3],n=d[4],u=d[5],y=d[6],x=d[7],p= 50 | 0;64>p;p++){if(16>p)e[p]=a[b+p]|0;else{var v=e[p-15],s=e[p-2];e[p]=((v<<25|v>>>7)^(v<<14|v>>>18)^v>>>3)+e[p-7]+((s<<15|s>>>17)^(s<<13|s>>>19)^s>>>10)+e[p-16]}v=x+((n<<26|n>>>6)^(n<<21|n>>>11)^(n<<7|n>>>25))+(n&u^~n&y)+f[p]+e[p];s=((c<<30|c>>>2)^(c<<19|c>>>13)^(c<<10|c>>>22))+(c&h^c&g^h&g);x=y;y=u;u=n;n=m+v|0;m=g;g=h;h=c;c=v+s|0}d[0]=d[0]+c|0;d[1]=d[1]+h|0;d[2]=d[2]+g|0;d[3]=d[3]+m|0;d[4]=d[4]+n|0;d[5]=d[5]+u|0;d[6]=d[6]+y|0;d[7]=d[7]+x|0},_doFinalize:function(){var a=this._data,b=a.words,d=8*this._nDataBytes, 51 | e=8*a.sigBytes;b[e>>>5]|=128<<24-e%32;b[(e+64>>>9<<4)+14]=c.floor(d/4294967296);b[(e+64>>>9<<4)+15]=d;a.sigBytes=4*b.length;this._process();return this._hash},clone:function(){var a=d.clone.call(this);a._hash=this._hash.clone();return a}});g.SHA256=d._createHelper(a);g.HmacSHA256=d._createHmacHelper(a)})(Math);(function(){var c=CryptoJS,g=c.lib,a=g.Base,b=g.WordArray,g=c.algo,d=g.HMAC,h=g.PBKDF2=a.extend({cfg:a.extend({keySize:4,hasher:g.SHA1,iterations:1}),init:function(a){this.cfg=this.cfg.extend(a)},compute:function(a,e){for(var c=this.cfg,h=d.create(c.hasher,a),g=b.create(),z=b.create([1]),A=g.words,q=z.words,m=c.keySize,c=c.iterations;A.length>>0;if(0===c)return-1;var f=0;0=c)return-1;for(f=0<=f?f:Math.max(c-Math.abs(f),0);f>>0;if("[object Function]"!=={}.toString.call(a))throw new TypeError(a+" is not a function");d&&(c=d);for(f=0;fd&&(d=e.length);c=e.slice(a,d).split(c);e=c[1].split(".");for(d=0;dthis.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},b.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},b.prototype.next=function(){return this.sliding?void 0:this.slide("next")},b.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},b.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}if(e.hasClass("active"))return this.sliding=!1;var j=a.Event("slide.bs.carousel",{relatedTarget:e[0],direction:g});return this.$element.trigger(j),j.isDefaultPrevented()?void 0:(this.sliding=!0,f&&this.pause(),this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid.bs.carousel",function(){var b=a(i.$indicators.children()[i.getActiveIndex()]);b&&b.addClass("active")})),a.support.transition&&this.$element.hasClass("slide")?(e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid.bs.carousel")},0)}).emulateTransitionEnd(1e3*d.css("transition-duration").slice(0,-1))):(d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid.bs.carousel")),f&&this.cycle(),this)};var c=a.fn.carousel;a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c),g="string"==typeof c?c:f.slide;e||d.data("bs.carousel",e=new b(this,f)),"number"==typeof c?e.to(c):g?e[g]():f.interval&&e.pause().cycle()})},a.fn.carousel.Constructor=b,a.fn.carousel.noConflict=function(){return a.fn.carousel=c,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(b){var c,d=a(this),e=a(d.attr("data-target")||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"")),f=a.extend({},e.data(),d.data()),g=d.attr("data-slide-to");g&&(f.interval=!1),e.carousel(f),(g=d.attr("data-slide-to"))&&e.data("bs.carousel").to(g),b.preventDefault()}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var b=a(this);b.carousel(b.data())})})}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.DEFAULTS={toggle:!0},b.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},b.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b=a.Event("show.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.$parent&&this.$parent.find("> .panel > .in");if(c&&c.length){var d=c.data("bs.collapse");if(d&&d.transitioning)return;c.collapse("hide"),d||c.data("bs.collapse",null)}var e=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[e](0),this.transitioning=1;var f=function(){this.$element.removeClass("collapsing").addClass("collapse in")[e]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return f.call(this);var g=a.camelCase(["scroll",e].join("-"));this.$element.one(a.support.transition.end,a.proxy(f,this)).emulateTransitionEnd(350)[e](this.$element[0][g])}}},b.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?void this.$element[c](0).one(a.support.transition.end,a.proxy(d,this)).emulateTransitionEnd(350):d.call(this)}}},b.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var c=a.fn.collapse;a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c);!e&&f.toggle&&"show"==c&&(c=!c),e||d.data("bs.collapse",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.collapse.Constructor=b,a.fn.collapse.noConflict=function(){return a.fn.collapse=c,this},a(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(b){var c,d=a(this),e=d.attr("data-target")||b.preventDefault()||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.collapse"),h=g?"toggle":d.data(),i=d.attr("data-parent"),j=i&&a(i);g&&g.transitioning||(j&&j.find('[data-toggle=collapse][data-parent="'+i+'"]').not(d).addClass("collapsed"),d[f.hasClass("in")?"addClass":"removeClass"]("collapsed")),f.collapse(h)})}(jQuery),+function(a){"use strict";function b(b){a(d).remove(),a(e).each(function(){var d=c(a(this)),e={relatedTarget:this};d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown",e)),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown",e))})}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}var d=".dropdown-backdrop",e="[data-toggle=dropdown]",f=function(b){a(b).on("click.bs.dropdown",this.toggle)};f.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(''}),b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),b.prototype.constructor=b,b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content")[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},b.prototype.hasContent=function(){return this.getTitle()||this.getContent()},b.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},b.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var c=a.fn.popover;a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof c&&c;(e||"destroy"!=c)&&(e||d.data("bs.popover",e=new b(this,f)),"string"==typeof c&&e[c]())})},a.fn.popover.Constructor=b,a.fn.popover.noConflict=function(){return a.fn.popover=c,this}}(jQuery),+function(a){"use strict";function b(c,d){var e,f=a.proxy(this.process,this);this.$element=a(a(c).is("body")?window:c),this.$body=a("body"),this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||(e=a(c).attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.offsets=a([]),this.targets=a([]),this.activeTarget=null,this.refresh(),this.process()}b.DEFAULTS={offset:10},b.prototype.refresh=function(){var b=this.$element[0]==window?"offset":"position";this.offsets=a([]),this.targets=a([]);{var c=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[b]().top+(!a.isWindow(c.$scrollElement.get(0))&&c.$scrollElement.scrollTop()),e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){c.offsets.push(this[0]),c.targets.push(this[1])})}},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,d=c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(b>=d)return g!=(a=f.last()[0])&&this.activate(a);if(g&&b<=e[0])return g!=(a=f[0])&&this.activate(a);for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parentsUntil(this.options.target,".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")};var c=a.fn.scrollspy;a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=c,this},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(jQuery),+function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});if(b.trigger(f),!f.isDefaultPrevented()){var g=a(d);this.activate(b.parent("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})}}},b.prototype.activate=function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one(a.support.transition.end,e).emulateTransitionEnd(150):e(),f.removeClass("in")};var c=a.fn.tab;a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new b(this)),"string"==typeof c&&e[c]()})},a.fn.tab.Constructor=b,a.fn.tab.noConflict=function(){return a.fn.tab=c,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(jQuery),+function(a){"use strict";var b=function(c,d){this.options=a.extend({},b.DEFAULTS,d),this.$window=a(window).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(c),this.affixed=this.unpin=this.pinnedOffset=null,this.checkPosition()};b.RESET="affix affix-top affix-bottom",b.DEFAULTS={offset:0},b.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(b.RESET).addClass("affix");var a=this.$window.scrollTop(),c=this.$element.offset();return this.pinnedOffset=c.top-a},b.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},b.prototype.checkPosition=function(){if(this.$element.is(":visible")){var c=a(document).height(),d=this.$window.scrollTop(),e=this.$element.offset(),f=this.options.offset,g=f.top,h=f.bottom;"top"==this.affixed&&(e.top+=d),"object"!=typeof f&&(h=g=f),"function"==typeof g&&(g=f.top(this.$element)),"function"==typeof h&&(h=f.bottom(this.$element));var i=null!=this.unpin&&d+this.unpin<=e.top?!1:null!=h&&e.top+this.$element.height()>=c-h?"bottom":null!=g&&g>=d?"top":!1;if(this.affixed!==i){this.unpin&&this.$element.css("top","");var j="affix"+(i?"-"+i:""),k=a.Event(j+".bs.affix");this.$element.trigger(k),k.isDefaultPrevented()||(this.affixed=i,this.unpin="bottom"==i?this.getPinnedOffset():null,this.$element.removeClass(b.RESET).addClass(j).trigger(a.Event(j.replace("affix","affixed"))),"bottom"==i&&this.$element.offset({top:c-h-this.$element.height()}))}}};var c=a.fn.affix;a.fn.affix=function(c){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof c&&c;e||d.data("bs.affix",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.affix.Constructor=b,a.fn.affix.noConflict=function(){return a.fn.affix=c,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var b=a(this),c=b.data();c.offset=c.offset||{},c.offsetBottom&&(c.offset.bottom=c.offsetBottom),c.offsetTop&&(c.offset.top=c.offsetTop),b.affix(c)})})}(jQuery); -------------------------------------------------------------------------------- /public/packages/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nikkiii/lowendping/15321d82459048afa9d7aa85f70ab58baacc02ac/public/packages/.gitkeep -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | ## LowEndPing Network Status 2 | 3 | LowEndPing is a simple network query script. 4 | 5 | Installation: 6 | 7 | - Install Composer 8 | - Download the contents and extract into a directory 9 | - Run "composer install" in that directory 10 | - Run "php artisan migrate" to initialize the database 11 | - Install the python script on the servers you want (see below) 12 | - Edit app/config/lowendping.php and add the servers (Numeric keys are required, and it is recommended to keep them in order), and optionally disable the archive 13 | - Add "cd /path/to/lowendping; php artisan lowendping:archive" to a cron job, every hour or daily would be fine. This is required even without the archive to clean up old queries. 14 | - Edit your webserver configuration and set the document root to (install dir)/public, then add a rewrite rule for laravel (Use google, there's plenty out there) 15 | - Try it out! 16 | 17 | Python script installation: 18 | 19 | - Install python, python-pip, and mtr-tiny 20 | - Run 'pip install sh' (the required shell wrapper) and 'pip install ipaddress' (required only if python 2.7 instead of python 3) 21 | - Update the information in lepconf.py to point to your server and define an auth token 22 | - Run 'python lep.py' (It is recommended to run it as a user other than root of course) 23 | 24 | ### Websockets 25 | 26 | Websockets will allow LowEndPing to give instant responses. It requires a bit more configuration, and is probably only really worth it when running a LowEndPing installation with more than 10 servers or a lot of traffic. 27 | 28 | To use Websockets, install the following packages (along with a c compiler, gcc will work just fine): 29 | 30 | Debian: 31 | 32 | apt-get install libzmq1 libzmq-dev 33 | 34 | Then, install php-zmq 35 | 36 | 37 | git clone git://github.com/mkoppanen/php-zmq.git 38 | cd php-zmq 39 | phpize && ./configure 40 | make && make install 41 | echo "extension=zmq.so" > /etc/php5/conf.d/zmq.ini 42 | 43 | 44 | To install the libraries needed in PHP you must add the following to composer.json's "require" section, and run "composer update" 45 | 46 | 47 | "cboden/Ratchet": "0.3.*", 48 | "react/zmq": "0.2.*" 49 | 50 | 51 | And then start "php artisan lowendping:websocket" and restart your webserver/php5. 52 | 53 | Then, set websocket.enabled to "true" in app/config/lowendping.php, and modify the port if you wish. Websockets should now work, verify it by opening your url and the Network console in Chrome/Firefox, and watch for "Switching Protocols" when submitting a query. 54 | 55 | It is also suggested to start the server using supervisord, just any standard config running the above command will work. 56 | 57 | ### License 58 | 59 | The Laravel framework is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT) 60 | 61 | LowEndPing is also open-source and licensed under the same license. -------------------------------------------------------------------------------- /server.php: -------------------------------------------------------------------------------- 1 |