├── TODO ├── public ├── favicon.ico ├── robots.txt ├── images │ ├── avatar.png │ ├── brand.png │ ├── favicon.ico │ ├── nebula.jpg │ └── small_black_login.png ├── js │ └── functions.js ├── .htaccess ├── css │ └── main.css └── index.php ├── database ├── .gitignore ├── seeds │ ├── DatabaseSeeder.php │ ├── DemoCharactersTableSeeder.php │ ├── DemoStructureStatesTableSeeder.php │ └── DemoStructureServicesTableSeeder.php ├── migrations │ ├── 2018_02_14_013132_add_structures_state.php │ ├── 2018_02_19_034724_drop_user_id_fuel_notice.php │ ├── 2018_02_18_220648_add_role_to_characters.php │ ├── 2018_02_18_220546_rmv_char_id_structure_vuls.php │ ├── 2018_02_18_220438_rmv_char_id_structure_states.php │ ├── 2018_02_18_220303_rmv_char_id_structure_services.php │ ├── 2018_06_10_220810_add_token_failures_characters.php │ ├── 2014_10_12_100000_create_password_resets_table.php │ ├── 2014_10_12_000000_create_users_table.php │ ├── 2018_02_04_033850_add_webhook_to_characters.php │ ├── 2018_02_13_235238_add_state.php │ ├── 2018_02_11_015831_add_fuel_days.php │ ├── 2018_02_18_220046_remove_chr_userid_from_structures.php │ ├── 2018_03_17_011005_create_fracture_notices_table.php │ ├── 2018_02_03_224903_create_failed_jobs_table.php │ ├── 2018_01_26_025628_create_structure_vuls_table.php │ ├── 2018_01_26_025637_create_structure_services_table.php │ ├── 2018_01_26_030057_create_structure_states_table.php │ ├── 2018_01_29_063509_create_demo_structure_services_table.php │ ├── 2018_01_29_063459_create_demo_structure_states_table.php │ ├── 2018_03_16_004918_create_slugs_table.php │ ├── 2018_03_09_224530_create_unanchor_notices_table.php │ ├── 2018_02_04_032555_create_fuel_notices_table.php │ ├── 2018_03_16_050248_create_extraction_datas_table.php │ ├── 2018_02_03_191343_create_jobs_table.php │ ├── 2018_03_10_022844_notification_info.php │ ├── 2018_03_01_212216_create_extractions_table.php │ ├── 2018_01_29_063432_create_demo_characters_table.php │ ├── 2018_01_26_022332_create_characters_table.php │ ├── 2019_02_09_171820_add_ping_here_to_notifications.php │ ├── 2018_01_29_063445_create_demo_structures_table.php │ ├── 2018_02_14_000709_add_vul_updates.php │ └── 2018_01_26_022307_create_structures_table.php └── factories │ └── UserFactory.php ├── bootstrap ├── cache │ └── .gitignore └── app.php ├── storage ├── logs │ └── .gitignore ├── app │ ├── public │ │ └── .gitignore │ └── .gitignore └── framework │ ├── cache │ └── .gitignore │ ├── testing │ └── .gitignore │ ├── views │ └── .gitignore │ ├── sessions │ └── .gitignore │ └── .gitignore ├── resources ├── views │ ├── google │ │ └── .gitignore │ ├── public_extractions.blade.php │ ├── layouts │ │ └── errors.blade.php │ ├── auth │ │ ├── passwords │ │ │ ├── email.blade.php │ │ │ └── reset.blade.php │ │ ├── login.blade.php │ │ └── register.blade.php │ ├── slug_manager.blade.php │ └── demo │ │ └── structure.blade.php ├── assets │ ├── sass │ │ ├── app.scss │ │ └── _variables.scss │ └── js │ │ ├── components │ │ └── ExampleComponent.vue │ │ ├── app.js │ │ └── bootstrap.js └── lang │ └── en │ ├── pagination.php │ ├── auth.php │ └── passwords.php ├── .gitattributes ├── app ├── DemoCharacter.php ├── DemoStructure.php ├── DemoStructureState.php ├── Slug.php ├── DemoStructureService.php ├── ExtractionData.php ├── FractureNotice.php ├── UnanchorNotice.php ├── FuelNotice.php ├── StructureVul.php ├── StructureService.php ├── StructureState.php ├── Channels │ └── DiscordChannel.php ├── Http │ ├── Middleware │ │ ├── EncryptCookies.php │ │ ├── VerifyCsrfToken.php │ │ ├── TrimStrings.php │ │ ├── RedirectIfAuthenticated.php │ │ └── TrustProxies.php │ ├── Controllers │ │ ├── Controller.php │ │ ├── WelcomeController.php │ │ ├── DemoController.php │ │ ├── Auth │ │ │ ├── ForgotPasswordController.php │ │ │ ├── LoginController.php │ │ │ ├── ResetPasswordController.php │ │ │ └── RegisterController.php │ │ ├── SlugController.php │ │ ├── NotificationManagerController.php │ │ ├── HomeController.php │ │ └── PublicExtraction.php │ └── Kernel.php ├── Extractions.php ├── Providers │ ├── BroadcastServiceProvider.php │ ├── AppServiceProvider.php │ ├── AuthServiceProvider.php │ ├── EventServiceProvider.php │ └── RouteServiceProvider.php ├── Character.php ├── NotificationManager.php ├── User.php ├── Structure.php ├── Console │ ├── Commands │ │ ├── CheckOrphans.php │ │ ├── UpdateStructures.php │ │ ├── Headers.php │ │ ├── UpdateCharacter.php │ │ ├── Fracture.php │ │ ├── StructureStateChange.php │ │ └── DailyExtractions.php │ └── Kernel.php ├── Exceptions │ └── Handler.php ├── Jobs │ ├── OrphanStructure.php │ ├── FractureCheck.php │ ├── StructureUpdate.php │ └── CharacterUpdate.php ├── Notifications │ ├── Slack │ │ ├── testSlack.php │ │ ├── ExtractionsDailySlack.php │ │ ├── UnanchorSlack.php │ │ ├── LowFuelSlack.php │ │ ├── StrctStateChangeSlack.php │ │ └── FractureSlack.php │ └── Discord │ │ ├── ExtractionsDailyDiscord.php │ │ ├── testDiscord.php │ │ ├── LowFuelDiscord.php │ │ ├── UnanchorDiscord.php │ │ ├── FractureDiscord.php │ │ └── StrctStateChange.php └── Traits │ └── Tokens.php ├── .gitignore ├── tests ├── TestCase.php ├── Unit │ └── ExampleTest.php ├── Feature │ └── ExampleTest.php └── CreatesApplication.php ├── routes ├── channels.php ├── api.php ├── console.php └── web.php ├── webpack.mix.js ├── server.php ├── .env.example ├── LICENSE.md ├── config ├── view.php ├── services.php ├── broadcasting.php ├── filesystems.php ├── queue.php ├── cache.php ├── auth.php ├── database.php └── mail.php ├── phpunit.xml ├── composer.json ├── artisan └── package.json /TODO: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | -------------------------------------------------------------------------------- /bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /storage/app/public/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !public/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/testing/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /resources/views/google/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | 4 | -------------------------------------------------------------------------------- /storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /public/images/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skiedude/evestructures/HEAD/public/images/avatar.png -------------------------------------------------------------------------------- /public/images/brand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skiedude/evestructures/HEAD/public/images/brand.png -------------------------------------------------------------------------------- /public/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skiedude/evestructures/HEAD/public/images/favicon.ico -------------------------------------------------------------------------------- /public/images/nebula.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skiedude/evestructures/HEAD/public/images/nebula.jpg -------------------------------------------------------------------------------- /public/images/small_black_login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skiedude/evestructures/HEAD/public/images/small_black_login.png -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.css linguist-vendored 3 | *.scss linguist-vendored 4 | *.js linguist-vendored 5 | CHANGELOG.md export-ignore 6 | -------------------------------------------------------------------------------- /storage/framework/.gitignore: -------------------------------------------------------------------------------- 1 | config.php 2 | routes.php 3 | schedule-* 4 | compiled.php 5 | services.json 6 | events.scanned.php 7 | routes.scanned.php 8 | down 9 | -------------------------------------------------------------------------------- /app/DemoCharacter.php: -------------------------------------------------------------------------------- 1 | toDiscord($notifiable); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/Extractions.php: -------------------------------------------------------------------------------- 1 | get('/'); 18 | 19 | $response->assertStatus(200); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/Providers/BroadcastServiceProvider.php: -------------------------------------------------------------------------------- 1 | pull('alert'); 11 | $success = session()->pull('success'); 12 | $alert = isset($alert[0]) ? $alert[0] : null; 13 | $success = isset($success[0]) ? $success[0] : null; 14 | return view('welcome', compact(['alert', 'success'])); 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app/Character.php: -------------------------------------------------------------------------------- 1 | corporation_id; 18 | } 19 | 20 | public function structures() { 21 | return $this->hasMany('App\Structure', 'corporation_id', 'corporation_id'); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /tests/CreatesApplication.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class)->bootstrap(); 20 | 21 | Hash::setRounds(4); 22 | 23 | return $app; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call(UsersTableSeeder::class); 15 | $this->call(DemoCharactersTableSeeder::class); 16 | $this->call(DemoStructureServicesTableSeeder::class); 17 | $this->call(DemoStructureStatesTableSeeder::class); 18 | $this->call(DemoStructuresTableSeeder::class); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /routes/channels.php: -------------------------------------------------------------------------------- 1 | id === (int) $id; 16 | }); 17 | -------------------------------------------------------------------------------- /app/NotificationManager.php: -------------------------------------------------------------------------------- 1 | {$this->slack_webhook}; 19 | } 20 | 21 | public function slackChannel($channel) { 22 | $this->slack_webhook = $channel; 23 | return $this; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /routes/api.php: -------------------------------------------------------------------------------- 1 | get('/user', function (Request $request) { 17 | return $request->user(); 18 | }); 19 | -------------------------------------------------------------------------------- /webpack.mix.js: -------------------------------------------------------------------------------- 1 | let mix = require('laravel-mix'); 2 | 3 | /* 4 | |-------------------------------------------------------------------------- 5 | | Mix Asset Management 6 | |-------------------------------------------------------------------------- 7 | | 8 | | Mix provides a clean, fluent API for defining some Webpack build steps 9 | | for your Laravel application. By default, we are compiling the Sass 10 | | file for the application as well as bundling up all the JS files. 11 | | 12 | */ 13 | 14 | mix.js('resources/assets/js/app.js', 'public/js') 15 | .sass('resources/assets/sass/app.scss', 'public/css'); 16 | -------------------------------------------------------------------------------- /public/js/functions.js: -------------------------------------------------------------------------------- 1 | window.onscroll = function() {scrollFunction()}; 2 | 3 | function scrollFunction() { 4 | if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) { 5 | document.getElementById("scrollBtn").style.display = "block"; 6 | } else { 7 | document.getElementById("scrollBtn").style.display = "none"; 8 | } 9 | } 10 | 11 | // When the user clicks on the button, scroll to the top of the document 12 | function topFunction() { 13 | document.body.scrollTop = 0; // For Safari 14 | document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera 15 | } 16 | -------------------------------------------------------------------------------- /resources/lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 'next' => 'Next »', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 18 | })->describe('Display an inspiring quote'); 19 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | $uri = urldecode( 11 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) 12 | ); 13 | 14 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the 15 | // built-in PHP web server. This provides a convenient way to test a Laravel 16 | // application without having installed a "real" web server software here. 17 | if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { 18 | return false; 19 | } 20 | 21 | require_once __DIR__.'/public/index.php'; 22 | -------------------------------------------------------------------------------- /app/Http/Middleware/RedirectIfAuthenticated.php: -------------------------------------------------------------------------------- 1 | check()) { 21 | return redirect('/home'); 22 | } 23 | 24 | return $next($request); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews -Indexes 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Handle Authorization Header 9 | RewriteCond %{HTTP:Authorization} . 10 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 11 | 12 | # Redirect Trailing Slashes If Not A Folder... 13 | RewriteCond %{REQUEST_FILENAME} !-d 14 | RewriteCond %{REQUEST_URI} (.+)/$ 15 | RewriteRule ^ %1 [L,R=301] 16 | 17 | # Handle Front Controller... 18 | RewriteCond %{REQUEST_FILENAME} !-d 19 | RewriteCond %{REQUEST_FILENAME} !-f 20 | RewriteRule ^ index.php [L] 21 | 22 | -------------------------------------------------------------------------------- /resources/assets/js/components/ExampleComponent.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 24 | -------------------------------------------------------------------------------- /resources/lang/en/auth.php: -------------------------------------------------------------------------------- 1 | 'These credentials do not match our records.', 17 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /app/Providers/AuthServiceProvider.php: -------------------------------------------------------------------------------- 1 | 'App\Policies\ModelPolicy', 17 | ]; 18 | 19 | /** 20 | * Register any authentication / authorization services. 21 | * 22 | * @return void 23 | */ 24 | public function boot() 25 | { 26 | $this->registerPolicies(); 27 | 28 | // 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /resources/assets/js/app.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * First we will load all of this project's JavaScript dependencies which 4 | * includes Vue and other libraries. It is a great starting point when 5 | * building robust, powerful web applications using Vue and Laravel. 6 | */ 7 | 8 | require('./bootstrap'); 9 | 10 | window.Vue = require('vue'); 11 | 12 | /** 13 | * Next, we will create a fresh Vue application instance and attach it to 14 | * the page. Then, you may begin adding components to this application 15 | * or customize the JavaScript scaffolding to fit your unique needs. 16 | */ 17 | 18 | Vue.component('example-component', require('./components/ExampleComponent.vue')); 19 | 20 | const app = new Vue({ 21 | el: '#app' 22 | }); 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /public/css/main.css: -------------------------------------------------------------------------------- 1 | #scrollBtn { 2 | display: none; /* Hidden by default */ 3 | position: fixed; /* Fixed/sticky position */ 4 | bottom: 20px; /* Place the button at the bottom of the page */ 5 | right: 30px; /* Place the button 30px from the right */ 6 | z-index: 99; /* Make sure it does not overlap */ 7 | cursor: pointer; /* Add a mouse pointer on hover */ 8 | padding: 15px; /* Some padding */ 9 | } 10 | 11 | 12 | .one_day { 13 | color:red; 14 | font-weight:bold; 15 | 16 | } 17 | 18 | .thirty_less { 19 | color:orange; 20 | font-weight:bold; 21 | 22 | } 23 | 24 | .thirty_plus { 25 | color:green; 26 | font-weight:bold; 27 | } 28 | 29 | .link-unstyled, .link-unstyled:link, .link-unstyled:hover { 30 | color: inherit; 31 | text-decoration: inherit; 32 | } 33 | -------------------------------------------------------------------------------- /app/Providers/EventServiceProvider.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'App\Listeners\EventListener', 18 | ], 19 | ]; 20 | 21 | /** 22 | * Register any events for your application. 23 | * 24 | * @return void 25 | */ 26 | public function boot() 27 | { 28 | parent::boot(); 29 | 30 | // 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/migrations/2018_02_14_013132_add_structures_state.php: -------------------------------------------------------------------------------- 1 | string('state'); 18 | }); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | * 24 | * @return void 25 | */ 26 | public function down() 27 | { 28 | Schema::table('structures', function (Blueprint $table) { 29 | $table->dropColumn('state'); 30 | }); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | APP_NAME=Laravel 2 | APP_ENV=local 3 | APP_KEY= 4 | APP_DEBUG=false 5 | APP_LOG_LEVEL=debug 6 | APP_URL=http://localhost 7 | 8 | DB_CONNECTION=mysql 9 | DB_HOST=127.0.0.1 10 | DB_PORT=3306 11 | DB_DATABASE=homestead 12 | DB_USERNAME=homestead 13 | DB_PASSWORD=secret 14 | 15 | BROADCAST_DRIVER=log 16 | CACHE_DRIVER=file 17 | SESSION_DRIVER=file 18 | SESSION_LIFETIME=120 19 | QUEUE_DRIVER=sync 20 | 21 | REDIS_HOST=127.0.0.1 22 | REDIS_PASSWORD=null 23 | REDIS_PORT=6379 24 | 25 | MAIL_DRIVER=smtp 26 | MAIL_HOST=smtp.mailtrap.io 27 | MAIL_PORT=2525 28 | MAIL_USERNAME=null 29 | MAIL_PASSWORD=null 30 | MAIL_ENCRYPTION=null 31 | 32 | PUSHER_APP_ID= 33 | PUSHER_APP_KEY= 34 | PUSHER_APP_SECRET= 35 | PUSHER_APP_CLUSTER=mt1 36 | 37 | USERAGENT= 38 | CALLBACK_URL=https://URL_GOES_HERE.COME/sso/callback 39 | CLIENT_ID= 40 | SECRET_KEY= 41 | -------------------------------------------------------------------------------- /database/migrations/2018_02_19_034724_drop_user_id_fuel_notice.php: -------------------------------------------------------------------------------- 1 | dropColumn('user_id'); 18 | }); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | * 24 | * @return void 25 | */ 26 | public function down() 27 | { 28 | Schema::table('fuel_notices', function (Blueprint $table) { 29 | $table->integer('user_id'); 30 | }); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrustProxies.php: -------------------------------------------------------------------------------- 1 | 'FORWARDED', 24 | Request::HEADER_X_FORWARDED_FOR => 'X_FORWARDED_FOR', 25 | Request::HEADER_X_FORWARDED_HOST => 'X_FORWARDED_HOST', 26 | Request::HEADER_X_FORWARDED_PORT => 'X_FORWARDED_PORT', 27 | Request::HEADER_X_FORWARDED_PROTO => 'X_FORWARDED_PROTO', 28 | ]; 29 | } 30 | -------------------------------------------------------------------------------- /database/factories/UserFactory.php: -------------------------------------------------------------------------------- 1 | define(App\User::class, function (Faker $faker) { 17 | return [ 18 | 'name' => $faker->name, 19 | 'email' => $faker->unique()->safeEmail, 20 | 'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret 21 | 'remember_token' => str_random(10), 22 | ]; 23 | }); 24 | -------------------------------------------------------------------------------- /database/migrations/2018_02_18_220648_add_role_to_characters.php: -------------------------------------------------------------------------------- 1 | boolean('is_manager')->default(FALSE); 18 | }); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | * 24 | * @return void 25 | */ 26 | public function down() 27 | { 28 | Schema::table('characters', function (Blueprint $table) { 29 | $table->dropColumn('is_manager'); 30 | }); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/migrations/2018_02_18_220546_rmv_char_id_structure_vuls.php: -------------------------------------------------------------------------------- 1 | dropColumn('character_id'); 18 | }); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | * 24 | * @return void 25 | */ 26 | public function down() 27 | { 28 | Schema::table('structure_vuls', function (Blueprint $table) { 29 | $table->bigInteger('character_id'); 30 | }); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/migrations/2018_02_18_220438_rmv_char_id_structure_states.php: -------------------------------------------------------------------------------- 1 | dropColumn('character_id'); 18 | }); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | * 24 | * @return void 25 | */ 26 | public function down() 27 | { 28 | Schema::table('structure_states', function (Blueprint $table) { 29 | $table->bigInteger('character_id'); 30 | }); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/User.php: -------------------------------------------------------------------------------- 1 | hasMany(Character::class); 33 | } 34 | 35 | public function notifications() { 36 | return $this->hasMany(NotificationManager::class); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /database/migrations/2018_02_18_220303_rmv_char_id_structure_services.php: -------------------------------------------------------------------------------- 1 | dropColumn('character_id'); 18 | }); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | * 24 | * @return void 25 | */ 26 | public function down() 27 | { 28 | Schema::table('structure_services', function (Blueprint $table) { 29 | $table->bigInteger('character_id'); 30 | }); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/migrations/2018_06_10_220810_add_token_failures_characters.php: -------------------------------------------------------------------------------- 1 | integer('token_failures')->default(0); 18 | }); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | * 24 | * @return void 25 | */ 26 | public function down() 27 | { 28 | Schema::table('characters', function (Blueprint $table) { 29 | $table->dropColumn('token_failures'); 30 | }); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_100000_create_password_resets_table.php: -------------------------------------------------------------------------------- 1 | string('email')->index(); 18 | $table->string('token'); 19 | $table->timestamp('created_at')->nullable(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::dropIfExists('password_resets'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /resources/lang/en/passwords.php: -------------------------------------------------------------------------------- 1 | 'Passwords must be at least six characters and match the confirmation.', 17 | 'reset' => 'Your password has been reset!', 18 | 'sent' => 'We have e-mailed your password reset link!', 19 | 'token' => 'This password reset token is invalid.', 20 | 'user' => "We can't find a user with that e-mail address.", 21 | 22 | ]; 23 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->string('name'); 19 | $table->string('email')->unique(); 20 | $table->string('password'); 21 | $table->rememberToken(); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists('users'); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /database/migrations/2018_02_04_033850_add_webhook_to_characters.php: -------------------------------------------------------------------------------- 1 | string('discord_webhook')->nullable(); 18 | $table->string('slack_webhook')->nullable(); 19 | }); 20 | } 21 | 22 | /** 23 | * Reverse the migrations. 24 | * 25 | * @return void 26 | */ 27 | public function down() 28 | { 29 | Schema::table('characters', function (Blueprint $table) { 30 | $table->dropColumn('discord_webhook'); 31 | $table->dropColumn('slack_webhook'); 32 | }); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /database/migrations/2018_02_13_235238_add_state.php: -------------------------------------------------------------------------------- 1 | string('state_timer_start')->nullable()->change(); 18 | $table->string('state_timer_end')->nullable()->change(); 19 | $table->string('state'); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::table('structure_states', function (Blueprint $table) { 31 | $table->dropColumn('state'); 32 | }); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/Http/Controllers/DemoController.php: -------------------------------------------------------------------------------- 1 | first(); 22 | $services = DemoStructureService::where('character_id', $structure->character_id)->where('structure_id', $structure_id)->get(); 23 | $state = DemoStructureState::where('structure_id', $structure_id)->get(); 24 | 25 | return view('demo.structure', compact(['structure', 'services', 'state'])); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /database/migrations/2018_02_11_015831_add_fuel_days.php: -------------------------------------------------------------------------------- 1 | integer('fuel_days_left')->nullable(); 18 | $table->string('fuel_time_left')->nullable(); 19 | }); 20 | } 21 | 22 | /** 23 | * Reverse the migrations. 24 | * 25 | * @return void 26 | */ 27 | public function down() 28 | { 29 | Schema::table('demo_structures', function (Blueprint $table) { 30 | $table->dropColumn('fuel_days_left'); 31 | $table->dropColumn('fuel_time_left'); 32 | }); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/Structure.php: -------------------------------------------------------------------------------- 1 | hasMany('App\Character', 'corporation_id', 'corporation_id'); 15 | } 16 | 17 | public function services() { 18 | return $this->hasMany('App\StructureService', 'structure_id', 'structure_id'); 19 | } 20 | 21 | public function states() { 22 | return $this->hasMany('App\StructureState', 'structure_id', 'structure_id'); 23 | } 24 | 25 | public function vuls() { 26 | return $this->hasMany('App\StructureVul', 'structure_id', 'structure_id'); 27 | } 28 | 29 | public function extractions() { 30 | return $this->hasOne('App\Extractions', 'structure_id', 'structure_id'); 31 | } 32 | 33 | } 34 | 35 | -------------------------------------------------------------------------------- /database/migrations/2018_02_18_220046_remove_chr_userid_from_structures.php: -------------------------------------------------------------------------------- 1 | dropColumn('user_id'); 18 | $table->dropColumn('character_id'); 19 | }); 20 | } 21 | 22 | /** 23 | * Reverse the migrations. 24 | * 25 | * @return void 26 | */ 27 | public function down() 28 | { 29 | Schema::table('structures', function (Blueprint $table) { 30 | $table->bigInteger('character_id'); 31 | $table->integer('user_id'); 32 | // 33 | }); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /database/migrations/2018_03_17_011005_create_fracture_notices_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->bigInteger('character_id'); 19 | $table->bigInteger('structure_id'); 20 | $table->boolean('notice')->default(FALSE); 21 | $table->timestamps(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | * 28 | * @return void 29 | */ 30 | public function down() 31 | { 32 | Schema::dropIfExists('fracture_notices'); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/Console/Commands/CheckOrphans.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 18 | $table->text('connection'); 19 | $table->text('queue'); 20 | $table->longText('payload'); 21 | $table->longText('exception'); 22 | $table->timestamp('failed_at')->useCurrent(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists('failed_jobs'); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /database/migrations/2018_01_26_025628_create_structure_vuls_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 19 | $table->bigInteger('structure_id'); 20 | $table->string('vul_type'); //current or next 21 | $table->integer('day'); 22 | $table->integer('hour'); 23 | $table->timestamps(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('structure_vuls'); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /database/migrations/2018_01_26_025637_create_structure_services_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->bigInteger('structure_id'); 19 | $table->bigInteger('character_id'); 20 | $table->string('name'); 21 | $table->string('state'); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists('structure_services'); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ForgotPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/migrations/2018_01_26_030057_create_structure_states_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->bigInteger('structure_id'); 19 | $table->bigInteger('character_id'); 20 | $table->string('state_timer_start'); 21 | $table->string('state_timer_end'); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists('structure_states'); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /database/migrations/2018_01_29_063509_create_demo_structure_services_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->bigInteger('structure_id'); 19 | $table->bigInteger('character_id'); 20 | $table->string('name'); 21 | $table->string('state'); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists('demo_structure_services'); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /database/migrations/2018_01_29_063459_create_demo_structure_states_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->bigInteger('structure_id'); 19 | $table->bigInteger('character_id'); 20 | $table->string('state_timer_start'); 21 | $table->string('state_timer_end'); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists('demo_structure_states'); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /database/migrations/2018_03_16_004918_create_slugs_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->integer('user_id'); 19 | $table->string('slug_name')->nullable(); 20 | $table->bigInteger('corporation_id'); 21 | $table->bigInteger('character_id'); 22 | $table->boolean('enabled')->default(FALSE); 23 | $table->timestamps(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('slugs'); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright 2018 Skiedude 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /database/migrations/2018_03_09_224530_create_unanchor_notices_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->bigInteger('character_id'); 19 | $table->bigInteger('structure_id'); 20 | $table->boolean('start_notice')->default(FALSE); 21 | $table->boolean('finish_notice')->default(FALSE); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists('unanchor_notices'); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /database/migrations/2018_02_04_032555_create_fuel_notices_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 19 | $table->bigInteger('user_id'); 20 | $table->bigInteger('character_id'); 21 | $table->bigInteger('structure_id'); 22 | $table->boolean('seven_day')->default(FALSE); 23 | $table->boolean('twentyfour_hour')->default(FALSE); 24 | $table->timestamps(); 25 | }); 26 | } 27 | 28 | /** 29 | * Reverse the migrations. 30 | * 31 | * @return void 32 | */ 33 | public function down() 34 | { 35 | Schema::dropIfExists('fuel_notices'); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /database/migrations/2018_03_16_050248_create_extraction_datas_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->bigInteger('structure_id'); 19 | $table->bigInteger('value')->default(0); 20 | $table->string('ores')->default('Ore'); 21 | $table->string('fracture_pref')->default('auto_fracture'); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists('extraction_datas'); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /database/migrations/2018_02_03_191343_create_jobs_table.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 18 | $table->string('queue')->index(); 19 | $table->longText('payload'); 20 | $table->unsignedTinyInteger('attempts'); 21 | $table->unsignedInteger('reserved_at')->nullable(); 22 | $table->unsignedInteger('available_at'); 23 | $table->unsignedInteger('created_at'); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('jobs'); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /resources/assets/sass/_variables.scss: -------------------------------------------------------------------------------- 1 | 2 | // Body 3 | $body-bg: #f5f8fa; 4 | 5 | // Borders 6 | $laravel-border-color: darken($body-bg, 10%); 7 | $list-group-border: $laravel-border-color; 8 | $navbar-default-border: $laravel-border-color; 9 | $panel-default-border: $laravel-border-color; 10 | $panel-inner-border: $laravel-border-color; 11 | 12 | // Brands 13 | $brand-primary: #3097D1; 14 | $brand-info: #8eb4cb; 15 | $brand-success: #2ab27b; 16 | $brand-warning: #cbb956; 17 | $brand-danger: #bf5329; 18 | 19 | // Typography 20 | $icon-font-path: "~bootstrap-sass/assets/fonts/bootstrap/"; 21 | $font-family-sans-serif: "Raleway", sans-serif; 22 | $font-size-base: 14px; 23 | $line-height-base: 1.6; 24 | $text-color: #636b6f; 25 | 26 | // Navbar 27 | $navbar-default-bg: #fff; 28 | 29 | // Buttons 30 | $btn-default-color: $text-color; 31 | 32 | // Inputs 33 | $input-border: lighten($text-color, 40%); 34 | $input-border-focus: lighten($brand-primary, 25%); 35 | $input-color-placeholder: lighten($text-color, 30%); 36 | 37 | // Panels 38 | $panel-default-heading-bg: #fff; 39 | -------------------------------------------------------------------------------- /database/migrations/2018_03_10_022844_notification_info.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->integer('user_id'); 19 | $table->bigInteger('character_id'); 20 | $table->string('fuel_webhook')->nullable(); 21 | $table->string('state_webhook')->nullable(); 22 | $table->string('unanchor_webhook')->nullable(); 23 | $table->string('extraction_webhook')->nullable(); 24 | $table->timestamps(); 25 | }); 26 | } 27 | 28 | /** 29 | * Reverse the migrations. 30 | * 31 | * @return void 32 | */ 33 | public function down() 34 | { 35 | Schema::dropIfExists('notification_info'); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/LoginController.php: -------------------------------------------------------------------------------- 1 | middleware('guest')->except('logout'); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /config/view.php: -------------------------------------------------------------------------------- 1 | [ 17 | resource_path('views'), 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled View Path 23 | |-------------------------------------------------------------------------- 24 | | 25 | | This option determines where all the compiled Blade templates will be 26 | | stored for your application. Typically, this is within the storage 27 | | directory. However, as usual, you are free to change this value. 28 | | 29 | */ 30 | 31 | 'compiled' => realpath(storage_path('framework/views')), 32 | 33 | ]; 34 | -------------------------------------------------------------------------------- /app/Console/Commands/UpdateStructures.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => env('MAILGUN_DOMAIN'), 19 | 'secret' => env('MAILGUN_SECRET'), 20 | ], 21 | 22 | 'ses' => [ 23 | 'key' => env('SES_KEY'), 24 | 'secret' => env('SES_SECRET'), 25 | 'region' => 'us-east-1', 26 | ], 27 | 28 | 'sparkpost' => [ 29 | 'secret' => env('SPARKPOST_SECRET'), 30 | ], 31 | 32 | 'stripe' => [ 33 | 'model' => App\User::class, 34 | 'key' => env('STRIPE_KEY'), 35 | 'secret' => env('STRIPE_SECRET'), 36 | ], 37 | 38 | ]; 39 | -------------------------------------------------------------------------------- /database/migrations/2018_03_01_212216_create_extractions_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->bigInteger('structure_id'); 19 | $table->bigInteger('moon_id'); 20 | $table->string('moon_name'); 21 | $table->timestamp('extraction_start_time')->useCurrent(); 22 | $table->timestamp('chunk_arrival_time')->useCurrent(); 23 | $table->timestamp('natural_decay_time')->useCurrent(); 24 | $table->timestamps(); 25 | }); 26 | } 27 | 28 | /** 29 | * Reverse the migrations. 30 | * 31 | * @return void 32 | */ 33 | public function down() 34 | { 35 | Schema::dropIfExists('extractions'); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ResetPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /database/migrations/2018_01_29_063432_create_demo_characters_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->integer('character_id')->unique(); 19 | $table->integer('corporation_id'); 20 | $table->string('corporation_name'); 21 | $table->string('character_name'); 22 | $table->string('access_token'); 23 | $table->string('refresh_token'); 24 | $table->integer('expires'); 25 | $table->timestamps(); 26 | }); 27 | } 28 | 29 | /** 30 | * Reverse the migrations. 31 | * 32 | * @return void 33 | */ 34 | public function down() 35 | { 36 | Schema::dropIfExists('demo_characters'); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | ./tests/Feature 14 | 15 | 16 | 17 | ./tests/Unit 18 | 19 | 20 | 21 | 22 | ./app 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /database/migrations/2018_01_26_022332_create_characters_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->integer('user_id'); 19 | $table->integer('character_id')->unique(); 20 | $table->integer('corporation_id'); 21 | $table->string('corporation_name'); 22 | $table->string('character_name'); 23 | $table->string('access_token'); 24 | $table->string('refresh_token'); 25 | $table->integer('expires'); 26 | $table->dateTime('last_fetch')->nullable(); 27 | $table->timestamps(); 28 | }); 29 | } 30 | 31 | /** 32 | * Reverse the migrations. 33 | * 34 | * @return void 35 | */ 36 | public function down() 37 | { 38 | Schema::dropIfExists('characters'); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /database/migrations/2019_02_09_171820_add_ping_here_to_notifications.php: -------------------------------------------------------------------------------- 1 | boolean('fuel_ping_here')->default(FALSE); 18 | $table->boolean('state_ping_here')->default(FALSE); 19 | $table->boolean('anchor_ping_here')->default(FALSE); 20 | $table->boolean('extraction_ping_here')->default(FALSE); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | Schema::table('notification_info', function (Blueprint $table) { 32 | $table->dropColumn('fuel_ping_here'); 33 | $table->dropColumn('state_ping_here'); 34 | $table->dropColumn('anchor_ping_here'); 35 | $table->dropColumn('extraction_ping_here'); 36 | }); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /resources/views/public_extractions.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 | 5 |
6 | @include ('layouts.errors') 7 |
8 |
9 |

Moon Extractions for {{$character->corporation_name}}

10 |
11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | @foreach($extractions as $extraction) 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | @endforeach 31 |
LocationStructure NameOresEstimated ValueFracture Time
{{$extraction->moon_name}}{{$extraction->structure_name}}{{$extraction->ores}}${{number_format($extraction->value)}}@if($extraction->fracture_pref == 'auto_fracture') {{$extraction->natural_decay_time}} @else {{$extraction->chunk_arrival_time}} @endif
32 |
33 |
34 |
35 | @endsection 36 | 37 | -------------------------------------------------------------------------------- /app/Console/Commands/Headers.php: -------------------------------------------------------------------------------- 1 | [ 44 | 'User-Agent' => env('USERAGENT'), 45 | ], 46 | ]; 47 | 48 | $client = new Client(['base_uri' => 'https://esi.evetech.net']); 49 | $resp = $client->get('/headers/', $noauth_headers); 50 | $body = json_decode($resp->getBody()); 51 | dd($body); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /database/migrations/2018_01_29_063445_create_demo_structures_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->bigInteger('character_id'); 19 | $table->bigInteger('corporation_id'); 20 | $table->bigInteger('structure_id'); 21 | $table->string('structure_name'); 22 | $table->integer('type_id'); 23 | $table->string('type_name'); 24 | $table->bigInteger('system_id'); 25 | $table->string('system_name'); 26 | $table->integer('profile_id'); 27 | $table->string('fuel_expires')->nullable(); 28 | $table->string('unanchors_at')->nullable(); 29 | $table->timestamps(); 30 | }); 31 | } 32 | 33 | /** 34 | * Reverse the migrations. 35 | * 36 | * @return void 37 | */ 38 | public function down() 39 | { 40 | Schema::dropIfExists('demo_structures'); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /database/migrations/2018_02_14_000709_add_vul_updates.php: -------------------------------------------------------------------------------- 1 | dropColumn('vul_type'); 18 | $table->integer('character_id'); 19 | $table->string('day')->change(); 20 | $table->string('next_day')->nullable(); 21 | $table->integer('next_hour')->nullable(); 22 | $table->string('next_reinforce_apply')->nullable(); 23 | // 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::table('structure_vuls', function (Blueprint $table) { 35 | $table->string('vul_type'); 36 | $table->integer('day')->change(); 37 | $table->dropColumn('character_id'); 38 | $table->dropColumn('next_hour'); 39 | $table->dropColumn('next_day'); 40 | $table->dropColumn('next_reinforce_apply'); 41 | }); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | @endisset 9 | 10 | @isset($success) 11 |
12 | 16 |
17 | @endisset 18 | 19 | @isset($warning) 20 |
21 | 25 |
26 | @endisset 27 | 28 | @if($errors->any()) 29 |
30 | 36 |
37 | @endif 38 | 39 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('check:orphans')->weekly(); 28 | $schedule->command('update:structures')->hourly(); 29 | $schedule->command('check:unanchor')->hourlyAt(15); 30 | $schedule->command('check:fuel')->hourlyAt(30); 31 | $schedule->command('check:fracture')->hourlyAt(45); 32 | $schedule->command('extraction:daily')->dailyAt('13:00'); 33 | $schedule->command('update:character')->twiceDaily(1,14); 34 | } 35 | 36 | /** 37 | * Register the commands for the application. 38 | * 39 | * @return void 40 | */ 41 | protected function commands() 42 | { 43 | $this->load(__DIR__.'/Commands'); 44 | 45 | require base_path('routes/console.php'); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /app/Http/Controllers/SlugController.php: -------------------------------------------------------------------------------- 1 | middleware('auth'); 13 | } 14 | 15 | public function index() { 16 | $characters = Character::where('user_id', \Auth::id())->where('is_manager', TRUE)->get(); 17 | $slugs = Slug::where('user_id', \Auth::id())->get(); 18 | 19 | return view('slug_manager', compact(['slugs', 'characters'])); 20 | 21 | } 22 | 23 | public function create($character_id, Request $request) { 24 | 25 | $character = Character::where('user_id', \Auth::id())->where('character_id', $character_id)->first(); 26 | if(is_null($character)) { 27 | $alert = "Character not found on this account"; 28 | return redirect()->to('/home')->with('alert', [$alert]); 29 | } 30 | $this->validate($request, [ 31 | 'slug_name' => 'max:25|regex:/^[a-zA-Z0-9]+$/', 32 | 'status' => 'nullable|regex:/^on$/', 33 | ]); 34 | 35 | $status = isset($request->status) && $request->status == 'on' ? TRUE : FALSE; 36 | 37 | Slug::where('user_id', \Auth::id())->where('character_id', $character_id) 38 | ->update(['slug_name' => $request->slug_name, 'enabled' => $status] 39 | ); 40 | 41 | return redirect()->to('extraction'); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /app/Jobs/OrphanStructure.php: -------------------------------------------------------------------------------- 1 | structure_id)->characters; 37 | if(count($characters) < 1) { 38 | Log::debug("Deleting $structure->structure_name and attached services, states, vuls and extractions , no owners found"); 39 | Structure::find($structure->structure_id)->services()->delete(); 40 | Structure::find($structure->structure_id)->states()->delete(); 41 | Structure::find($structure->structure_id)->vuls()->delete(); 42 | Structure::find($structure->structure_id)->extractions()->delete(); 43 | $structure->delete(); 44 | } 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /database/migrations/2018_01_26_022307_create_structures_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->integer('user_id'); 19 | $table->bigInteger('character_id'); 20 | $table->bigInteger('corporation_id'); 21 | $table->bigInteger('structure_id'); 22 | $table->string('structure_name'); 23 | $table->integer('type_id'); 24 | $table->string('type_name'); 25 | $table->bigInteger('system_id'); 26 | $table->string('system_name'); 27 | $table->integer('profile_id'); 28 | $table->string('fuel_expires')->nullable(); 29 | $table->string('fuel_time_left')->nullable(); 30 | $table->integer('fuel_days_left')->nullable(); 31 | $table->string('unanchors_at')->nullable(); 32 | $table->timestamps(); 33 | }); 34 | } 35 | 36 | /** 37 | * Reverse the migrations. 38 | * 39 | * @return void 40 | */ 41 | public function down() 42 | { 43 | Schema::dropIfExists('structures'); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/Console/Commands/UpdateCharacter.php: -------------------------------------------------------------------------------- 1 | argument('character_name')) { 43 | $character = Character::where('character_name', $this->argument('character_name'))->first(); 44 | if(is_null($character)) { 45 | Log::error("No character found by name {$this->argument('character_name')}"); 46 | return; 47 | } 48 | 49 | CharacterUpdate::dispatch($character); 50 | 51 | } else { 52 | $characters = Character::all(); 53 | foreach ($characters as $character) { 54 | CharacterUpdate::dispatch($character); 55 | } 56 | } 57 | 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /app/Console/Commands/Fracture.php: -------------------------------------------------------------------------------- 1 | argument('character_name')) { 43 | $character = Character::where('character_name', $this->argument('character_name'))->first(); 44 | if(is_null($character)) { 45 | Log::error("No character found by name {$this->argument('character_name')}"); 46 | return; 47 | } 48 | 49 | FractureCheck::dispatch($character); 50 | 51 | } else { 52 | $characters = Character::all(); 53 | foreach ($characters as $character) { 54 | if($character->is_manager) { 55 | FractureCheck::dispatch($character); 56 | } 57 | } 58 | } 59 | 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /app/Jobs/FractureCheck.php: -------------------------------------------------------------------------------- 1 | character = $character; 28 | } 29 | 30 | /** 31 | * Execute the job. 32 | * 33 | * @return void 34 | */ 35 | public function handle() 36 | { 37 | $refresh = $this->refreshToken($this->character->character_name); 38 | switch ($refresh) { 39 | case "not_expired": 40 | //Good to go 41 | break; 42 | 43 | case "refreshed": 44 | //Pull down new info from DB 45 | $this->character = Character::where('user_id', $this->character->user_id)->where('character_id', $this->character->character_id)->first(); 46 | Log::debug("Refreshed token for {$this->character->character_name}"); 47 | break; 48 | 49 | default: 50 | Log::error("Refresh function returned '$refresh' for {$this->character->character_name}"); 51 | return; 52 | break; 53 | } 54 | 55 | $this->getExtractions($this->character); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /app/Notifications/Slack/testSlack.php: -------------------------------------------------------------------------------- 1 | character = $character; 23 | $this->webhook = $webhook; 24 | } 25 | 26 | /** 27 | * Get the notification's delivery channels. 28 | * 29 | * @param mixed $notifiable 30 | * @return array 31 | */ 32 | public function via($notifiable) 33 | { 34 | return ['slack']; 35 | } 36 | 37 | 38 | public function toSlack($notifiable) { 39 | try { 40 | Log::debug("Sent Test Slack notification for {$this->character->character_name} for webhook $this->webhook"); 41 | return (new SlackMessage) 42 | ->success() 43 | ->image(env('APP_URL') . "/images/avatar.png") 44 | ->content(':heavy_check_mark: *Webhook test* :heavy_check_mark:') 45 | ->from(env('APP_NAME') . 'Bot') 46 | ->attachment(function ($attachment) { 47 | $attachment->title("Webhook Test") 48 | ->content("Webhook test for {$this->character->character_name} for $this->webhook"); 49 | }); 50 | } catch (\Exception $e) { 51 | Log::error("Failed to send Slack notification for {$this->character->character_name} on account $notifiable->user_id , $e"); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel/laravel", 3 | "description": "The Laravel Framework.", 4 | "keywords": ["framework", "laravel"], 5 | "license": "MIT", 6 | "type": "project", 7 | "require": { 8 | "php": ">=7.0.0", 9 | "doctrine/dbal": "^2.5", 10 | "fideloper/proxy": "~3.3", 11 | "guzzlehttp/guzzle": "~6.0", 12 | "laravel/framework": "5.5.*", 13 | "laravel/tinker": "~1.0", 14 | "nopjmp/discord-webhooks": "^0.2.2", 15 | "orangehill/iseed": "^2.5" 16 | }, 17 | "require-dev": { 18 | "filp/whoops": "~2.0", 19 | "fzaninotto/faker": "~1.4", 20 | "mockery/mockery": "~1.0", 21 | "phpunit/phpunit": "~6.0", 22 | "symfony/thanks": "^1.0" 23 | }, 24 | "autoload": { 25 | "classmap": [ 26 | "database/seeds", 27 | "database/factories" 28 | ], 29 | "psr-4": { 30 | "App\\": "app/" 31 | } 32 | }, 33 | "autoload-dev": { 34 | "psr-4": { 35 | "Tests\\": "tests/" 36 | } 37 | }, 38 | "extra": { 39 | "laravel": { 40 | "dont-discover": [ 41 | ] 42 | } 43 | }, 44 | "scripts": { 45 | "post-root-package-install": [ 46 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" 47 | ], 48 | "post-create-project-cmd": [ 49 | "@php artisan key:generate" 50 | ], 51 | "post-autoload-dump": [ 52 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", 53 | "@php artisan package:discover" 54 | ] 55 | }, 56 | "config": { 57 | "preferred-install": "dist", 58 | "sort-packages": true, 59 | "optimize-autoloader": true 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | singleton( 30 | Illuminate\Contracts\Http\Kernel::class, 31 | App\Http\Kernel::class 32 | ); 33 | 34 | $app->singleton( 35 | Illuminate\Contracts\Console\Kernel::class, 36 | App\Console\Kernel::class 37 | ); 38 | 39 | $app->singleton( 40 | Illuminate\Contracts\Debug\ExceptionHandler::class, 41 | App\Exceptions\Handler::class 42 | ); 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Return The Application 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This script returns the application instance. The instance is given to 50 | | the calling script so we can separate the building of the instances 51 | | from the actual running of the application and sending responses. 52 | | 53 | */ 54 | 55 | return $app; 56 | -------------------------------------------------------------------------------- /config/broadcasting.php: -------------------------------------------------------------------------------- 1 | env('BROADCAST_DRIVER', 'null'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Broadcast Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the broadcast connections that will be used 26 | | to broadcast events to other systems or over websockets. Samples of 27 | | each available type of connection are provided inside this array. 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'pusher' => [ 34 | 'driver' => 'pusher', 35 | 'key' => env('PUSHER_APP_KEY'), 36 | 'secret' => env('PUSHER_APP_SECRET'), 37 | 'app_id' => env('PUSHER_APP_ID'), 38 | 'options' => [ 39 | 'cluster' => env('PUSHER_APP_CLUSTER'), 40 | 'encrypted' => true, 41 | ], 42 | ], 43 | 44 | 'redis' => [ 45 | 'driver' => 'redis', 46 | 'connection' => 'default', 47 | ], 48 | 49 | 'log' => [ 50 | 'driver' => 'log', 51 | ], 52 | 53 | 'null' => [ 54 | 'driver' => 'null', 55 | ], 56 | 57 | ], 58 | 59 | ]; 60 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | mapApiRoutes(); 39 | 40 | $this->mapWebRoutes(); 41 | 42 | // 43 | } 44 | 45 | /** 46 | * Define the "web" routes for the application. 47 | * 48 | * These routes all receive session state, CSRF protection, etc. 49 | * 50 | * @return void 51 | */ 52 | protected function mapWebRoutes() 53 | { 54 | Route::middleware('web') 55 | ->namespace($this->namespace) 56 | ->group(base_path('routes/web.php')); 57 | } 58 | 59 | /** 60 | * Define the "api" routes for the application. 61 | * 62 | * These routes are typically stateless. 63 | * 64 | * @return void 65 | */ 66 | protected function mapApiRoutes() 67 | { 68 | Route::prefix('api') 69 | ->middleware('api') 70 | ->namespace($this->namespace) 71 | ->group(base_path('routes/api.php')); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /app/Notifications/Slack/ExtractionsDailySlack.php: -------------------------------------------------------------------------------- 1 | character = $character; 23 | $this->extractions = $extractions; 24 | } 25 | 26 | /** 27 | * Get the notification's delivery channels. 28 | * 29 | * @param mixed $notifiable 30 | * @return array 31 | */ 32 | public function via($notifiable) 33 | { 34 | return ['slack']; 35 | } 36 | 37 | 38 | public function toSlack($notifiable) { 39 | try { 40 | $extractions = ""; 41 | foreach($this->extractions as $ext) { 42 | $extractions .= "*$ext->moon_name*\nChunk Arrives: $ext->chunk_arrival_time\nAuto Fracture: $ext->natural_decay_time\n"; 43 | } 44 | 45 | return (new SlackMessage) 46 | ->success() 47 | ->image(env('APP_URL') . "/images/avatar.png") 48 | ->content(":pick: *Upcoming 7 Day Extractions for {$this->character->corporation_name}* :pick:") 49 | ->from(env('APP_NAME') . 'Bot') 50 | ->attachment(function ($attachment) use ($extractions) { 51 | $attachment->fields(['' => $extractions]); 52 | }); 53 | 54 | } catch (\Exception $e) { 55 | Log::error("Failed to send ExtractionsDaily slack notification for {$this->character->character_name} on account $notifiable->user_id , $e"); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | make(Illuminate\Contracts\Console\Kernel::class); 34 | 35 | $status = $kernel->handle( 36 | $input = new Symfony\Component\Console\Input\ArgvInput, 37 | new Symfony\Component\Console\Output\ConsoleOutput 38 | ); 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Shutdown The Application 43 | |-------------------------------------------------------------------------- 44 | | 45 | | Once Artisan has finished running, we will fire off the shutdown events 46 | | so that any final work may be done by the application before we shut 47 | | down the process. This is the last thing to happen to the request. 48 | | 49 | */ 50 | 51 | $kernel->terminate($input, $status); 52 | 53 | exit($status); 54 | -------------------------------------------------------------------------------- /resources/assets/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | 2 | window._ = require('lodash'); 3 | 4 | /** 5 | * We'll load jQuery and the Bootstrap jQuery plugin which provides support 6 | * for JavaScript based Bootstrap features such as modals and tabs. This 7 | * code may be modified to fit the specific needs of your application. 8 | */ 9 | 10 | try { 11 | window.$ = window.jQuery = require('jquery'); 12 | 13 | require('bootstrap-sass'); 14 | } catch (e) {} 15 | 16 | /** 17 | * We'll load the axios HTTP library which allows us to easily issue requests 18 | * to our Laravel back-end. This library automatically handles sending the 19 | * CSRF token as a header based on the value of the "XSRF" token cookie. 20 | */ 21 | 22 | window.axios = require('axios'); 23 | 24 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 25 | 26 | /** 27 | * Next we will register the CSRF Token as a common header with Axios so that 28 | * all outgoing HTTP requests automatically have it attached. This is just 29 | * a simple convenience so we don't have to attach every token manually. 30 | */ 31 | 32 | let token = document.head.querySelector('meta[name="csrf-token"]'); 33 | 34 | if (token) { 35 | window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content; 36 | } else { 37 | console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token'); 38 | } 39 | 40 | /** 41 | * Echo exposes an expressive API for subscribing to channels and listening 42 | * for events that are broadcast by Laravel. Echo and event broadcasting 43 | * allows your team to easily build robust real-time web applications. 44 | */ 45 | 46 | // import Echo from 'laravel-echo' 47 | 48 | // window.Pusher = require('pusher-js'); 49 | 50 | // window.Echo = new Echo({ 51 | // broadcaster: 'pusher', 52 | // key: 'your-pusher-key', 53 | // cluster: 'mt1', 54 | // encrypted: true 55 | // }); 56 | -------------------------------------------------------------------------------- /app/Http/Controllers/NotificationManagerController.php: -------------------------------------------------------------------------------- 1 | middleware('auth'); 14 | } 15 | 16 | public function index() { 17 | $alert = session()->pull('alert'); 18 | $success = session()->pull('success'); 19 | $warning = session()->pull('warning'); 20 | $alert = isset($alert[0]) ? $alert[0] : null; 21 | $success = isset($success[0]) ? $success[0] : null; 22 | $warning = isset($warning[0]) ? $warning[0] : null; 23 | 24 | $characters = DB::table('characters')->where('user_id', auth()->id())->where('is_manager', TRUE)->select('character_id')->get(); 25 | foreach($characters as $char) { 26 | #Delete entries for a character that was on a previous account that has been moved 27 | $old = NotificationManager::where('user_id', '<>', auth()->id())->where('character_id', $char->character_id)->delete(); 28 | 29 | #If a character doesn't exit here, but should, create it 30 | $find = NotificationManager::where('user_id', auth()->id())->where('character_id', $char->character_id)->get(); 31 | if(count($find) < 1) { 32 | $new = new NotificationManager; 33 | $new->character_id = $char->character_id; 34 | $new->user_id = auth()->id(); 35 | $new->save(); 36 | }; 37 | } 38 | 39 | $notifications = DB::table('characters') 40 | ->join('notification_info', 'characters.character_id', '=', 'notification_info.character_id') 41 | ->where('characters.user_id', auth()->id()) 42 | ->where('characters.is_manager', TRUE) 43 | ->select('characters.character_name', 'characters.character_id as char_id', 'notification_info.*') 44 | ->get(); 45 | 46 | return view('notification_manager', compact(['notifications','alert','warning','success'])); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | define('LARAVEL_START', microtime(true)); 11 | 12 | /* 13 | |-------------------------------------------------------------------------- 14 | | Register The Auto Loader 15 | |-------------------------------------------------------------------------- 16 | | 17 | | Composer provides a convenient, automatically generated class loader for 18 | | our application. We just need to utilize it! We'll simply require it 19 | | into the script here so that we don't have to worry about manual 20 | | loading any of our classes later on. It feels great to relax. 21 | | 22 | */ 23 | 24 | require __DIR__.'/../vendor/autoload.php'; 25 | 26 | /* 27 | |-------------------------------------------------------------------------- 28 | | Turn On The Lights 29 | |-------------------------------------------------------------------------- 30 | | 31 | | We need to illuminate PHP development, so let us turn on the lights. 32 | | This bootstraps the framework and gets it ready for use, then it 33 | | will load up this application so that we can run it and send 34 | | the responses back to the browser and delight our users. 35 | | 36 | */ 37 | 38 | $app = require_once __DIR__.'/../bootstrap/app.php'; 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Run The Application 43 | |-------------------------------------------------------------------------- 44 | | 45 | | Once we have the application, we can handle the incoming request 46 | | through the kernel, and send the associated response back to 47 | | the client's browser allowing them to enjoy the creative 48 | | and wonderful application we have prepared for them. 49 | | 50 | */ 51 | 52 | $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); 53 | 54 | $response = $kernel->handle( 55 | $request = Illuminate\Http\Request::capture() 56 | ); 57 | 58 | $response->send(); 59 | 60 | $kernel->terminate($request, $response); 61 | -------------------------------------------------------------------------------- /app/Jobs/StructureUpdate.php: -------------------------------------------------------------------------------- 1 | character = $character; 32 | } 33 | 34 | /** 35 | * Execute the job. 36 | * 37 | * @return void 38 | */ 39 | public function handle() 40 | { 41 | $refresh = $this->refreshToken($this->character->character_name); 42 | switch ($refresh) { 43 | case "not_expired": 44 | //Good to go 45 | break; 46 | 47 | case "refreshed": 48 | //Pull down new info from DB 49 | $this->character = Character::where('user_id', $this->character->user_id)->where('character_id', $this->character->character_id)->first(); 50 | Log::debug("Refreshed token for {$this->character->character_name}"); 51 | break; 52 | 53 | default: 54 | Log::error("Refresh function returned '$refresh' for {$this->character->character_name}"); 55 | return; 56 | break; 57 | } 58 | 59 | $update = $this->getStructures($this->character); 60 | 61 | if(isset($update->exception)) { 62 | $alert = $update->exception; 63 | Log::error("Failed Structure pull for character {$this->character->character_name}: $alert"); 64 | return; 65 | } 66 | 67 | return; 68 | } 69 | } 70 | 71 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "npm run development", 5 | "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", 6 | "watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", 7 | "watch-poll": "npm run watch -- --watch-poll", 8 | "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", 9 | "prod": "npm run production", 10 | "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" 11 | }, 12 | "devDependencies": { 13 | "axios": "^0.21.1", 14 | "bootstrap-sass": "^3.4.1", 15 | "cross-env": "^5.1", 16 | "jquery": "^3.5.0", 17 | "laravel-mix": "^1.0", 18 | "lodash": "^4.17.21", 19 | "vue": "^2.5.7" 20 | }, 21 | "dependencies": { 22 | "atob": "^2.1.0", 23 | "braces": "^2.3.1", 24 | "clean-css": "^4.1.11", 25 | "cryptiles": "^4.1.2", 26 | "deep-extend": "^0.5.1", 27 | "extend": "^3.0.2", 28 | "fstream": "^1.0.12", 29 | "hoek": "^4.2.1", 30 | "is-my-json-valid": "^2.17.2", 31 | "js-yaml": "^3.13.1", 32 | "lodash.mergewith": "^4.6.2", 33 | "lodash.template": "^4.5.0", 34 | "macaddress": "^0.2.9", 35 | "mem": "^4.0.0", 36 | "mixin-deep": "^1.3.2", 37 | "querystringify": "^2.0.0", 38 | "randomatic": "^3.0.0", 39 | "set-value": "^2.0.1", 40 | "sshpk": "^1.13.2", 41 | "ssri": "^8.0.1", 42 | "stringstream": "^0.0.6", 43 | "tar": "^4.4.2", 44 | "url-parse": "^1.5.0", 45 | "webpack-dev-server": "^3.1.11" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /resources/views/auth/passwords/email.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
Reset Password
9 | 10 |
11 | @if (session('status')) 12 |
13 | {{ session('status') }} 14 |
15 | @endif 16 | 17 |
18 | {{ csrf_field() }} 19 | 20 |
21 | 22 | 23 |
24 | 25 | 26 | @if ($errors->has('email')) 27 | 28 | {{ $errors->first('email') }} 29 | 30 | @endif 31 |
32 |
33 | 34 |
35 |
36 | 39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | @endsection 48 | -------------------------------------------------------------------------------- /app/Notifications/Discord/ExtractionsDailyDiscord.php: -------------------------------------------------------------------------------- 1 | character = $character; 25 | $this->extractions = $extractions; 26 | } 27 | 28 | /** 29 | * Get the notification's delivery channels. 30 | * 31 | * @param mixed $notifiable 32 | * @return array 33 | */ 34 | public function via($notifiable) 35 | { 36 | return [DiscordChannel::class]; 37 | } 38 | 39 | 40 | public function toDiscord($notifiable) { 41 | try { 42 | $client = new Client($notifiable->extraction_webhook); 43 | $embed = new Embed(); 44 | 45 | foreach($this->extractions as $ext) { 46 | $embed->field($ext->moon_name, "Chunk Arrives: $ext->chunk_arrival_time\nAuto Fracture: $ext->natural_decay_time"); 47 | } 48 | 49 | $embed->color( 0x24d04a ); 50 | $embed->title(":pick: **Upcoming 7 Day Extractions for {$this->character->corporation_name}** :pick:"); 51 | $embed->author(env('APP_NAME'). 'Bot', null, "https://imageserver.eveonline.com/Character/{$notifiable->character_id}_64.jpg"); 52 | 53 | $client->username(env('APP_NAME')) 54 | ->avatar(env('APP_URL') . "/images/avatar.png") 55 | ->embed($embed); 56 | 57 | return $client->send(); 58 | 59 | } catch (\Exception $e) { 60 | Log::error("Failed to send ExtractionsDaily discord notification for {$this->character->character_name} on account $notifiable->user_id , $e"); 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /app/Notifications/Slack/UnanchorSlack.php: -------------------------------------------------------------------------------- 1 | structure = $structure; 23 | $this->character = $character; 24 | $this->unotice = $unotice; 25 | } 26 | 27 | /** 28 | * Get the notification's delivery channels. 29 | * 30 | * @param mixed $notifiable 31 | * @return array 32 | */ 33 | public function via($notifiable) 34 | { 35 | return ['slack']; 36 | } 37 | 38 | 39 | public function toSlack($notifiable) { 40 | 41 | $ping_here = $notifiable->anchor_ping_here == True ? ' ' : ''; 42 | 43 | try { 44 | return (new SlackMessage) 45 | ->warning() 46 | ->image(env('APP_URL') . "/images/avatar.png") 47 | ->content(":anchor: *$this->unotice Unanchor Alert* for {$this->character->corporation_name} :anchor: $ping_here") 48 | ->from(env('APP_NAME') . 'Bot') 49 | ->attachment(function ($attachment) { 50 | $attachment->title("{$this->structure->structure_name}", env('APP_URL') . "/home/structure/{$this->structure->structure_id}") 51 | ->thumb("https://imageserver.eveonline.com/Type/{$this->structure->type_id}_64.png") 52 | ->fields([ 53 | 'Unanchors At' => $this->structure->unanchors_at, 54 | 'System' => $this->structure->system_name, 55 | ]); 56 | }); 57 | } catch (\Exception $e) { 58 | Log::error("Failed to send unanchor slack notification for {$this->character->character_name} on account $notifiable->user_id , $e"); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /app/Notifications/Slack/LowFuelSlack.php: -------------------------------------------------------------------------------- 1 | structure = $structure; 23 | $this->character = $character; 24 | } 25 | 26 | /** 27 | * Get the notification's delivery channels. 28 | * 29 | * @param mixed $notifiable 30 | * @return array 31 | */ 32 | public function via($notifiable) 33 | { 34 | return ['slack']; 35 | } 36 | 37 | 38 | public function toSlack($notifiable) { 39 | 40 | $ping_here = $notifiable->fuel_ping_here == True ? ' ' : ''; 41 | 42 | try { 43 | return (new SlackMessage) 44 | ->warning() 45 | ->image(env('APP_URL') . "/images/avatar.png") 46 | ->content(":warning: *Fuel Alert* for {$this->character->corporation_name} :warning: $ping_here") 47 | ->from(env('APP_NAME') . 'Bot') 48 | ->attachment(function ($attachment) { 49 | $attachment->title("{$this->structure->structure_name}", env('APP_URL') . "/home/structure/{$this->structure->structure_id}") 50 | ->thumb("https://imageserver.eveonline.com/Type/{$this->structure->type_id}_64.png") 51 | ->fields([ 52 | 'Fuel Remaining' => $this->structure->fuel_time_left, 53 | 'Fuel Expiration' => $this->structure->fuel_expires, 54 | 'System' => $this->structure->system_name, 55 | ]); 56 | }); 57 | } catch (\Exception $e) { 58 | Log::error("Failed to send LowFuel slack notification for {$this->character->character_name} on account $notifiable->user_id , $e"); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/RegisterController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 40 | } 41 | 42 | /** 43 | * Get a validator for an incoming registration request. 44 | * 45 | * @param array $data 46 | * @return \Illuminate\Contracts\Validation\Validator 47 | */ 48 | protected function validator(array $data) 49 | { 50 | return Validator::make($data, [ 51 | 'name' => 'required|string|max:255', 52 | 'email' => 'required|string|email|max:255|unique:users', 53 | 'password' => 'required|string|min:6|confirmed', 54 | ]); 55 | } 56 | 57 | /** 58 | * Create a new user instance after a valid registration. 59 | * 60 | * @param array $data 61 | * @return \App\User 62 | */ 63 | protected function create(array $data) 64 | { 65 | return User::create([ 66 | 'name' => $data['name'], 67 | 'email' => $data['email'], 68 | 'password' => bcrypt($data['password']), 69 | ]); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /app/Notifications/Discord/testDiscord.php: -------------------------------------------------------------------------------- 1 | character = $character; 25 | $this->webhook = $webhook; 26 | } 27 | 28 | /** 29 | * Get the notification's delivery channels. 30 | * 31 | * @param mixed $notifiable 32 | * @return array 33 | */ 34 | public function via($notifiable) 35 | { 36 | return [DiscordChannel::class]; 37 | } 38 | 39 | 40 | public function toDiscord($notifiable) { 41 | try { 42 | $client = new Client($notifiable->{$this->webhook}); 43 | 44 | $embed = new Embed(); 45 | $embed->description(':white_check_mark: **Webhook Test** :white_check_mark:'); 46 | $embed->title("Test Notification for {$this->character->character_name}"); 47 | $embed->color( 0x0000a0 ); 48 | $embed->author(env('APP_NAME'). 'Bot', null, "https://imageserver.eveonline.com/Character/{$notifiable->character_id}_64.jpg"); 49 | $embed->field('Test Message', 'Ahoy Champion', TRUE); 50 | $embed->field('Webhook', "$this->webhook", TRUE); 51 | 52 | $client->username(env('APP_NAME')) 53 | ->avatar(env('APP_URL') . "/images/avatar.png") 54 | ->embed($embed); 55 | Log::debug("Sent Test Discord notification for {$this->character->character_name} for webhook $this->webhook"); 56 | return $client->send(); 57 | } catch (\Exception $e) { 58 | Log::error("Failed to send discord notification for {$this->character->character_name} on account $notifiable->user_id , $e"); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /app/Notifications/Slack/StrctStateChangeSlack.php: -------------------------------------------------------------------------------- 1 | structure = $structure; 23 | $this->character = $character; 24 | $this->old_state = $old_state; 25 | $this->new_state = $new_state; 26 | } 27 | 28 | /** 29 | * Get the notification's delivery channels. 30 | * 31 | * @param mixed $notifiable 32 | * @return array 33 | */ 34 | public function via($notifiable) 35 | { 36 | return ['slack']; 37 | } 38 | 39 | 40 | public function toSlack($notifiable) { 41 | 42 | $ping_here = $notifiable->state_ping_here == True ? ' ' : ''; 43 | try { 44 | return (new SlackMessage) 45 | ->image(env('APP_URL') . "/images/avatar.png") 46 | ->content(":large_orange_diamond: *Structure Changed State* for {$this->character->corporation_name} :large_orange_diamond: $ping_here") 47 | ->from(env('APP_NAME') . 'Bot') 48 | ->attachment(function ($attachment) { 49 | $attachment->title("{$this->structure->structure_name}", env('APP_URL') . "/home/structure/{$this->structure->structure_id}") 50 | ->thumb("https://imageserver.eveonline.com/Type/{$this->structure->type_id}_64.png") 51 | ->fields([ 52 | 'Old State' => $this->old_state, 53 | 'New State' => $this->new_state, 54 | 'System' => $this->structure->system_name, 55 | ]); 56 | }); 57 | 58 | } catch (\Exception $e) { 59 | Log::error("Failed to send structure state change slack notification for {$this->character->character_name} on account $notifiable->user_id , $e"); 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /app/Http/Kernel.php: -------------------------------------------------------------------------------- 1 | [ 31 | \App\Http\Middleware\EncryptCookies::class, 32 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, 33 | \Illuminate\Session\Middleware\StartSession::class, 34 | // \Illuminate\Session\Middleware\AuthenticateSession::class, 35 | \Illuminate\View\Middleware\ShareErrorsFromSession::class, 36 | \App\Http\Middleware\VerifyCsrfToken::class, 37 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 38 | ], 39 | 40 | 'api' => [ 41 | 'throttle:60,1', 42 | 'bindings', 43 | ], 44 | ]; 45 | 46 | /** 47 | * The application's route middleware. 48 | * 49 | * These middleware may be assigned to groups or used individually. 50 | * 51 | * @var array 52 | */ 53 | protected $routeMiddleware = [ 54 | 'auth' => \Illuminate\Auth\Middleware\Authenticate::class, 55 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 56 | 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, 57 | 'can' => \Illuminate\Auth\Middleware\Authorize::class, 58 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 59 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 60 | ]; 61 | } 62 | -------------------------------------------------------------------------------- /config/filesystems.php: -------------------------------------------------------------------------------- 1 | env('FILESYSTEM_DRIVER', 'local'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Default Cloud Filesystem Disk 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Many applications store files both locally and in the cloud. For this 24 | | reason, you may specify a default "cloud" driver here. This driver 25 | | will be bound as the Cloud disk implementation in the container. 26 | | 27 | */ 28 | 29 | 'cloud' => env('FILESYSTEM_CLOUD', 's3'), 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Filesystem Disks 34 | |-------------------------------------------------------------------------- 35 | | 36 | | Here you may configure as many filesystem "disks" as you wish, and you 37 | | may even configure multiple disks of the same driver. Defaults have 38 | | been setup for each driver as an example of the required options. 39 | | 40 | | Supported Drivers: "local", "ftp", "s3", "rackspace" 41 | | 42 | */ 43 | 44 | 'disks' => [ 45 | 46 | 'local' => [ 47 | 'driver' => 'local', 48 | 'root' => storage_path('app'), 49 | ], 50 | 51 | 'public' => [ 52 | 'driver' => 'local', 53 | 'root' => storage_path('app/public'), 54 | 'url' => env('APP_URL').'/storage', 55 | 'visibility' => 'public', 56 | ], 57 | 58 | 's3' => [ 59 | 'driver' => 's3', 60 | 'key' => env('AWS_ACCESS_KEY_ID'), 61 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 62 | 'region' => env('AWS_DEFAULT_REGION'), 63 | 'bucket' => env('AWS_BUCKET'), 64 | ], 65 | 66 | ], 67 | 68 | ]; 69 | -------------------------------------------------------------------------------- /app/Jobs/CharacterUpdate.php: -------------------------------------------------------------------------------- 1 | character = $character; 28 | } 29 | 30 | /** 31 | * Execute the job. 32 | * 33 | * @return void 34 | */ 35 | public function handle() 36 | { 37 | Log::debug("Updating Public info for {$this->character->character_name}"); 38 | try { 39 | $client = new Client(); 40 | $character_url = config('app.CCP_URL') . "/v4/characters/{$this->character->character_id}"; 41 | $noauth_headers = [ 42 | 'headers' => [ 43 | 'User-Agent' => env('USERAGENT'), 44 | ], 45 | ]; 46 | $resp = $client->get($character_url, $noauth_headers); 47 | $updated_character = json_decode($resp->getBody()); 48 | 49 | $corp_url = config('app.CCP_URL') . "/v4/corporations/$updated_character->corporation_id"; 50 | $resp = $client->get($corp_url, $noauth_headers); 51 | $corp = json_decode($resp->getBody()); 52 | 53 | Character::updateOrCreate( 54 | ['character_id' => $this->character->character_id], 55 | ['corporation_id' => $updated_character->corporation_id, 56 | 'corporation_name' => $corp->name,] 57 | ); 58 | 59 | Slug::updateOrCreate( 60 | ['character_id' => $this->character->character_id], 61 | ['corporation_id' => $updated_character->corporation_id] 62 | ); 63 | Log::debug("Finished Updating Public info for {$this->character->character_name}"); 64 | return; 65 | } catch (\Exception $e) { 66 | Log::error("Exception caught on public data for {$this->character->character_name}: " . $e->getMessage()); 67 | return; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /app/Traits/Tokens.php: -------------------------------------------------------------------------------- 1 | first(); 16 | if(($character->expires - 120) > time()) { 17 | Log::notice("Token for $characterName was not expired"); 18 | return "not_expired"; 19 | } 20 | 21 | if($character->token_failures >= 5) { 22 | return "failure limit reached"; 23 | } 24 | 25 | try { 26 | $client = new Client(); 27 | $authsite = 'https://login.eveonline.com/oauth/token/'; 28 | $token_headers = [ 29 | 'headers' => [ 30 | 'Authorization' => 'Basic ' . base64_encode(env('CLIENT_ID') . ':' . env('SECRET_KEY')), 31 | 'User-Agent' => env('USERAGENT'), 32 | 'Content-Type' => 'application/x-www-form-urlencoded', 33 | ], 34 | 'form_params' => [ 35 | 'grant_type' => 'refresh_token', 36 | 'refresh_token' => $character->refresh_token 37 | ] 38 | ]; 39 | 40 | $result = $client->post($authsite, $token_headers); 41 | $resp = json_decode($result->getBody()); 42 | $expires_new = time() + $resp->expires_in; 43 | Character::updateOrCreate( 44 | ['character_id' => $character->character_id], 45 | ['access_token' => $resp->access_token, 46 | 'expires' => $expires_new, 47 | 'token_failures' => 0] 48 | ); 49 | } catch (ClientException $e) { 50 | //4xx error, usually encountered when token has been revoked on CCP website 51 | $character->increment('token_failures'); 52 | Log::Error("Token refresh failed (4xx) for $characterName: \n" . $e->getMessage()); 53 | return "revoked"; 54 | } catch (ServerException $e ) { 55 | //5xx error, usually and issue with ESI 56 | Log::Error("Token refresh failed (5xx) for $characterName: \n" . $e->getMessage()); 57 | return "5xx"; 58 | } catch (\Exception $e) { 59 | //Everything else 60 | Log::Error("Token refresh failed (?xx) for $characterName: \n" . $e->getMessage()); 61 | return "failed"; 62 | } 63 | return "refreshed"; 64 | } 65 | } 66 | 67 | -------------------------------------------------------------------------------- /app/Http/Controllers/HomeController.php: -------------------------------------------------------------------------------- 1 | middleware('auth'); 22 | } 23 | 24 | /** 25 | * Show the application dashboard. 26 | * 27 | * @return \Illuminate\Http\Response 28 | */ 29 | public function index() 30 | { 31 | $alert = session()->pull('alert'); 32 | $success = session()->pull('success'); 33 | $warning = session()->pull('warning'); 34 | $alert = isset($alert[0]) ? $alert[0] : null; 35 | $success = isset($success[0]) ? $success[0] : null; 36 | $warning = isset($warning[0]) ? $warning[0] : null; 37 | 38 | 39 | $characters = User::find(auth()->id())->characters; 40 | $structures = DB::table('users') 41 | ->join('characters', 'users.id', '=', 'characters.user_id') 42 | ->join('structures', 'structures.corporation_id', '=', 'characters.corporation_id') 43 | ->where('users.id', auth()->id()) 44 | ->where('characters.is_manager', TRUE) 45 | ->select('structures.*') 46 | ->distinct() 47 | ->get(); 48 | return view('home', compact(['characters', 'structures', 'alert', 'success', 'warning'])); 49 | } 50 | 51 | public function deleteAccount() { 52 | $user = User::find(\Auth::id()); 53 | $characters = User::find(auth()->id())->characters; 54 | foreach ($characters as $character) { 55 | CharacterController::destroy($character->character_id, 1); 56 | } 57 | \Auth::logout(); 58 | 59 | if($user->delete()) { 60 | 61 | $success = "Successfully deleted your acccount, all your characters, structures and revoked all ESI privileges. Come back soon!"; 62 | return redirect()->to('/')->with('success', [$success]); 63 | } else { 64 | $alert = "Failed to delete account, contact Brock Khans in game for help."; 65 | return redirect()->to('/')->with('alert', [$alert]); 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /app/Notifications/Discord/LowFuelDiscord.php: -------------------------------------------------------------------------------- 1 | structure = $structure; 25 | $this->character = $character; 26 | } 27 | 28 | /** 29 | * Get the notification's delivery channels. 30 | * 31 | * @param mixed $notifiable 32 | * @return array 33 | */ 34 | public function via($notifiable) 35 | { 36 | return [DiscordChannel::class]; 37 | } 38 | 39 | 40 | public function toDiscord($notifiable) { 41 | try { 42 | $client = new Client($notifiable->fuel_webhook); 43 | 44 | $embed = new Embed(); 45 | $embed->title("{$this->structure->structure_name}", env('APP_URL') . "/home/structure/{$this->structure->structure_id}"); 46 | $embed->description(":warning: **Fuel Alert** for {$this->character->corporation_name} :warning:"); 47 | $embed->color( 15105570 ); 48 | $embed->thumbnail("https://imageserver.eveonline.com/Type/{$this->structure->type_id}_64.png"); 49 | $embed->author(env('APP_NAME'). 'Bot', null, "https://imageserver.eveonline.com/Character/{$notifiable->character_id}_64.jpg"); 50 | $embed->field('Fuel Remaining', $this->structure->fuel_time_left, TRUE); 51 | $embed->field('Fuel Expiration', $this->structure->fuel_expires, TRUE); 52 | $embed->field('System', $this->structure->system_name, TRUE); 53 | 54 | $ping_here = $notifiable->fuel_ping_here == True ? '@here' : ''; 55 | 56 | $client->username(env('APP_NAME')) 57 | ->avatar(env('APP_URL') . "/images/avatar.png") 58 | ->embed($embed) 59 | ->message($ping_here); 60 | 61 | return $client->send(); 62 | } catch (\Exception $e) { 63 | Log::error("Failed to send LowFuel discord notification for {$this->character->character_name} on account $notifiable->user_id , $e"); 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /app/Http/Controllers/PublicExtraction.php: -------------------------------------------------------------------------------- 1 | where('corporation_id', $corporation_id)->first(); 16 | if(is_null($slug) || $slug->enabled == FALSE) { 17 | $alert = "This Public Extraction page has been removed, disabled or doesn't exist"; 18 | return redirect()->to("/")->with('alert', [$alert]); 19 | } 20 | 21 | $character = Character::find($slug->character_id)->where('corporation_id', $corporation_id)->first(); 22 | if(is_null($character)) { 23 | $alert = "This Public Extraction page has been removed, disabled or doesn't exist"; 24 | return redirect()->to("/")->with('alert', [$alert]); 25 | } 26 | 27 | $extractions = array(); 28 | $structures = Character::find($slug->character_id)->structures; 29 | foreach($structures as $structure) { 30 | if($structure->corporation_id != $corporation_id) { 31 | continue; 32 | } 33 | $structure_name = Structure::find($structure->structure_id); 34 | $structure_name = $structure_name->structure_name; 35 | $extraction = Structure::find($structure->structure_id)->extractions; 36 | $data = ExtractionData::where('structure_id', $structure->structure_id)->first(); 37 | if(!is_null($extraction)) { 38 | if(!is_null($data)) { 39 | $extraction->value = $data->value; 40 | $extraction->ores = $data->ores; 41 | $extraction->fracture_pref = $data->fracture_pref; 42 | } else { 43 | $extraction->value = 0; 44 | $extraction->ores = "None"; 45 | $extraction->fracture_pref = "auto_fracture"; 46 | } 47 | $extraction->structure_name = $structure_name; 48 | array_push($extractions, $extraction); 49 | } 50 | } 51 | 52 | usort($extractions, function($a,$b) { 53 | $ad = new \DateTime($a->chunk_arrival_time); 54 | $bd = new \DateTime($b->chunk_arrival_time); 55 | 56 | if($ad == $bd) { 57 | return 0; 58 | } 59 | 60 | return $ad < $bd ? -1 : 1; 61 | }); 62 | 63 | return view('public_extractions', compact(['extractions', 'character'])); 64 | 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /resources/views/slug_manager.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 | 5 |
6 | @include ('layouts.errors') 7 |
8 |
9 |

Shareable Extraction URL -- Only Letters/Numbers allowed. No symbols or spaces

10 |
11 |
12 |
13 |
14 | @foreach($characters as $char) 15 | @foreach($slugs as $slug) 16 | @if($char->character_id == $slug->character_id) 17 |

{{str_replace('_', ' ', $char->character_name)}}

{{ $char->corporation_name }} 18 |
19 | {{ csrf_field() }} 20 |
21 | 22 | 23 |
24 |
25 | 28 |
29 |
30 | 31 |
32 |
33 | @isset($slug->slug_name) 34 | 35 | @endisset 36 | @endif 37 | @endforeach 38 | @endforeach 39 |
40 |
41 |
42 |
43 |
44 | 54 | @endsection 55 | 56 | -------------------------------------------------------------------------------- /routes/web.php: -------------------------------------------------------------------------------- 1 | name('demo'); 18 | Route::get('/demo/structure/{structure_id}', 'DemoController@show'); 19 | 20 | Route::get('/sso/login', function() { 21 | $authsite = 'https://login.eveonline.com/oauth/authorize'; 22 | $client_id = env('CLIENT_ID'); 23 | $redirect_uri = env('CALLBACK_URL'); 24 | $scopes = "esi-corporations.read_structures.v1 esi-characters.read_corporation_roles.v1 esi-universe.read_structures.v1 esi-industry.read_corporation_mining.v1"; 25 | $state = uniqid(); 26 | session(['auth_state' => $state]); 27 | 28 | return redirect($authsite . '?response_type=code&redirect_uri=' . $redirect_uri 29 | . '&client_id=' . $client_id . '&scope=' . $scopes . '&state=' . $state); 30 | 31 | }); 32 | 33 | //SSO RELATED// 34 | Route::get('/sso/callback', 'CharacterController@create'); 35 | Route::get('/fetch/{character_id}', 'StructureController@create'); 36 | 37 | //HOME ROUTES// 38 | Route::get('/home', 'HomeController@index')->name('home'); 39 | Route::get('/home/notifications', 'NotificationManagerController@index')->name('notifications'); 40 | Route::get('/home/structure/{structure_id}', 'StructureController@show'); 41 | Route::post('/home/structure/{structure_id}', 'StructureController@updateExtraction'); 42 | 43 | //DELETE ROUTES// 44 | Route::get('/delete/{character_id}', 'CharacterController@destroy'); 45 | Route::get('/account/delete', 'HomeController@deleteAccount'); 46 | 47 | //WEBHOOK ROUTES// 48 | Route::post('/webhook/{character_id}', 'WebhookController@store'); 49 | Route::delete('/webhook/delete/{character_id}', 'WebhookController@destroy'); 50 | Route::post('/webhook/test/{character_id}', 'WebhookController@testNotify'); 51 | 52 | //PUBLIC EXTRACTIONS// 53 | Route::get('/extraction/', 'SlugController@index')->name('extraction'); 54 | Route::get('/extraction/{corporation_id}/{slug}', 'PublicExtraction@index'); 55 | Route::post('/extraction/create/{character_id}', 'SlugController@create'); 56 | Route::delete('/extraction/delete/{character_id}', 'SlugController@destroy'); 57 | -------------------------------------------------------------------------------- /app/Notifications/Discord/UnanchorDiscord.php: -------------------------------------------------------------------------------- 1 | structure = $structure; 25 | $this->character = $character; 26 | $this->unotice = $unotice; 27 | } 28 | 29 | /** 30 | * Get the notification's delivery channels. 31 | * 32 | * @param mixed $notifiable 33 | * @return array 34 | */ 35 | public function via($notifiable) 36 | { 37 | return [DiscordChannel::class]; 38 | } 39 | 40 | 41 | public function toDiscord($notifiable) { 42 | try { 43 | $client = new Client($notifiable->unanchor_webhook); 44 | 45 | $embed = new Embed(); 46 | 47 | if($this->unotice == 'START') { 48 | $embed->color( 0xf0ba3c ); 49 | $embed->description(":anchor: **START Unanchor Alert** for {$this->character->corporation_name} :anchor:"); 50 | } else { 51 | $embed->color( 0xff2d32 ); 52 | $embed->description(":anchor: **FINAL Unanchor Alert** for {$this->character->corporation_name}:anchor:"); 53 | } 54 | 55 | $embed->title("{$this->structure->structure_name}", env('APP_URL') . "/home/structure/{$this->structure->structure_id}"); 56 | $embed->thumbnail("https://imageserver.eveonline.com/Type/{$this->structure->type_id}_64.png"); 57 | $embed->author(env('APP_NAME'). 'Bot', null, "https://imageserver.eveonline.com/Character/{$notifiable->character_id}_64.jpg"); 58 | $embed->field('Unanchors At', $this->structure->unanchors_at, TRUE); 59 | $embed->field('System', $this->structure->system_name, TRUE); 60 | 61 | $ping_here = $notifiable->anchor_ping_here == True ? '@here' : ''; 62 | 63 | $client->username(env('APP_NAME')) 64 | ->avatar(env('APP_URL') . "/images/avatar.png") 65 | ->embed($embed) 66 | ->message($ping_here); 67 | 68 | return $client->send(); 69 | } catch (\Exception $e) { 70 | Log::error("Failed to send unanchor discord notification for {$this->character->character_name} on account $notifiable->user_id , $e"); 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /database/seeds/DemoCharactersTableSeeder.php: -------------------------------------------------------------------------------- 1 | delete(); 18 | 19 | \DB::table('demo_characters')->insert(array ( 20 | 0 => 21 | array ( 22 | 'id' => 1, 23 | 'character_id' => 2112565794, 24 | 'corporation_id' => 98544069, 25 | 'corporation_name' => 'BKH', 26 | 'character_name' => 'Brock_Khans', 27 | 'access_token' => '00000', 28 | 'refresh_token' => '1111111', 29 | 'expires' => 2222222, 30 | 'created_at' => '2018-01-28 06:08:28', 31 | 'updated_at' => '2018-01-29 17:53:18', 32 | ), 33 | 1 => 34 | array ( 35 | 'id' => 5, 36 | 'character_id' => 1435599763, 37 | 'corporation_id' => 1234, 38 | 'corporation_name' => 'eveskillboard', 39 | 'character_name' => 'Brock_Khans', 40 | 'access_token' => '00000', 41 | 'refresh_token' => '1111111', 42 | 'expires' => 2222222, 43 | 'created_at' => '2018-01-28 06:08:28', 44 | 'updated_at' => '2018-01-29 17:53:18', 45 | ), 46 | 2 => 47 | array ( 48 | 'id' => 9, 49 | 'character_id' => 2113338704, 50 | 'corporation_id' => 12345, 51 | 'corporation_name' => 'structures', 52 | 'character_name' => 'Brock_Khans', 53 | 'access_token' => '00000', 54 | 'refresh_token' => '1111111', 55 | 'expires' => 2222222, 56 | 'created_at' => '2018-01-28 06:08:28', 57 | 'updated_at' => '2018-01-29 17:53:18', 58 | ), 59 | 3 => 60 | array ( 61 | 'id' => 10, 62 | 'character_id' => 2113690051, 63 | 'corporation_id' => 123456, 64 | 'corporation_name' => 'Pew Pew', 65 | 'character_name' => 'Brock_Khans', 66 | 'access_token' => '00000', 67 | 'refresh_token' => '1111111', 68 | 'expires' => 2222222, 69 | 'created_at' => '2018-01-28 06:08:28', 70 | 'updated_at' => '2018-01-29 17:53:18', 71 | ), 72 | )); 73 | 74 | 75 | } 76 | } -------------------------------------------------------------------------------- /app/Console/Commands/StructureStateChange.php: -------------------------------------------------------------------------------- 1 | argument('structure_id')); 46 | $characters = Structure::find($structure->structure_id)->characters; 47 | foreach ($characters as $character) { 48 | Log::debug("Starting Structure State Change Notification for {$structure->structure_name} owned by {$character->character_name}"); 49 | 50 | $notification = NotificationManager::where('character_id', $character->character_id)->first(); 51 | if(!isset($notification->state_webhook) || is_null($notification->state_webhook)) { 52 | Log::debug("Ending Structure State Change Notification for $structure->structure_name for $character->character_name, no state_webhook"); 53 | continue; 54 | } 55 | 56 | if(preg_match("/slack/", $notification->unanchor_webhook)) { 57 | #keep anything anchoring in the anchor channel 58 | if(stripos($this->argument('old_state'), 'anchor') !== false || stripos($this->argument('new_state'), 'anchor') !== false) { 59 | $webhook = 'unanchor_webhook'; 60 | } else { 61 | $webhook = 'state_webhook'; 62 | } 63 | 64 | $notification->slackChannel($webhook)->notify(new StrctStateChangeSlack($structure, $character, $this->argument('old_state'), $this->argument('new_state'))); 65 | } else { 66 | $notification->notify(new StrctStateChange($structure, $character, $this->argument('old_state'), $this->argument('new_state'))); 67 | } 68 | 69 | Log::debug("Ending Structure State Change Notification for $structure->structure_name for $character->character_name, notification successfully sent"); 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /app/Notifications/Discord/FractureDiscord.php: -------------------------------------------------------------------------------- 1 | type = $type; 25 | $this->extraction = $extraction; 26 | $this->moon = $moon; 27 | $this->extraction_data = $extraction_data; 28 | $this->character = $character; 29 | } 30 | 31 | /** 32 | * Get the notification's delivery channels. 33 | * 34 | * @param mixed $notifiable 35 | * @return array 36 | */ 37 | public function via($notifiable) 38 | { 39 | return [DiscordChannel::class]; 40 | } 41 | 42 | 43 | public function toDiscord($notifiable) { 44 | try { 45 | $client = new Client($notifiable->extraction_webhook); 46 | $embed = new Embed(); 47 | 48 | if($this->type == 'manual') { 49 | $embed->field("Expected Manual Fracture", $this->extraction->chunk_arrival_time); 50 | $embed->description(":boom: {$this->moon->name} is ready to Manual Fracture for {$this->character->corporation_name}! :boom:"); 51 | } else { 52 | $embed->field("Auto Fracture", $this->extraction->natural_decay_time); 53 | $embed->description(":boom: {$this->moon->name} is about to Auto Fracture for {$this->character->corporation_name}! :boom:"); 54 | } 55 | 56 | $embed->field("Moon", $this->moon->name); 57 | $embed->field("Ores Available", $this->extraction_data->ores); 58 | $embed->field("Estimated Value", number_format($this->extraction_data->value)); 59 | $embed->color( 0x24d04a ); 60 | $embed->author(env('APP_NAME'). 'Bot', null, "https://imageserver.eveonline.com/Character/{$notifiable->character_id}_64.jpg"); 61 | 62 | $ping_here = $notifiable->extraction_ping_here == True ? '@here' : ''; 63 | 64 | $client->username(env('APP_NAME')) 65 | ->avatar(env('APP_URL') . "/images/avatar.png") 66 | ->embed($embed) 67 | ->message($ping_here); 68 | 69 | Log::debug("Sending Fracture discord notification for {$this->moon->name} for character $notifiable->character_id"); 70 | return $client->send(); 71 | } catch (\Exception $e) { 72 | Log::error("Failed to send fracture discord notification for {$this->moon->name} on account $notifiable->user_id , $e"); 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /app/Notifications/Slack/FractureSlack.php: -------------------------------------------------------------------------------- 1 | type = $type; 23 | $this->extraction = $extraction; 24 | $this->moon = $moon; 25 | $this->extraction_data = $extraction_data; 26 | $this->character = $character; 27 | } 28 | 29 | /** 30 | * Get the notification's delivery channels. 31 | * 32 | * @param mixed $notifiable 33 | * @return array 34 | */ 35 | public function via($notifiable) 36 | { 37 | return ['slack']; 38 | } 39 | 40 | 41 | public function toSlack($notifiable) { 42 | try { 43 | Log::debug("Sending Fracture slack notification for {$this->moon->name} for character $notifiable->character_id"); 44 | $fracture_data = new \stdClass(); 45 | 46 | $ping_here = $notifiable->extraction_ping_here == True ? ' ' : ''; 47 | 48 | if($this->type == 'manual') { 49 | $fracture_data->{'message'} = "Expected Manual Fracture"; 50 | $fracture_data->{'time'} = $this->extraction->chunk_arrival_time; 51 | $fracture_data->{'content'} = ":boom: {$this->moon->name} is ready to Manual Fracture for {$this->character->corporation_name}! :boom: $ping_here"; 52 | } else { 53 | $fracture_data->{'message'} = "Auto Fracture"; 54 | $fracture_data->{'time'} = $this->extraction->natural_decay_time; 55 | $fracture_data->{'content'} = ":boom: {$this->moon->name} is about to Auto Fracture for {$this->character->corporation_name}! :boom: $ping_here"; 56 | } 57 | 58 | return (new SlackMessage) 59 | ->image(env('APP_URL') . "/images/avatar.png") 60 | ->content($fracture_data->content) 61 | ->from(env('APP_NAME') . 'Bot') 62 | ->attachment(function ($attachment) use ($fracture_data) { 63 | $attachment->fields([ 64 | $fracture_data->message => $fracture_data->time, 65 | 'Moon' => $this->moon->name, 66 | 'Ores Available' => $this->extraction_data->ores, 67 | 'Estimated Value' => number_format($this->extraction_data->value), 68 | ]); 69 | }); 70 | } catch (\Exception $e) { 71 | Log::error("Failed to send fracture slack notification for {$this->moon->name} on account $notifiable->user_id , $e"); 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /config/queue.php: -------------------------------------------------------------------------------- 1 | env('QUEUE_DRIVER', 'database'), 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' => [ 32 | 33 | 'sync' => [ 34 | 'driver' => 'sync', 35 | ], 36 | 37 | 'database' => [ 38 | 'driver' => 'database', 39 | 'table' => 'jobs', 40 | 'queue' => 'default', 41 | 'retry_after' => 90, 42 | ], 43 | 44 | 'beanstalkd' => [ 45 | 'driver' => 'beanstalkd', 46 | 'host' => 'localhost', 47 | 'queue' => 'default', 48 | 'retry_after' => 90, 49 | ], 50 | 51 | 'sqs' => [ 52 | 'driver' => 'sqs', 53 | 'key' => env('SQS_KEY', 'your-public-key'), 54 | 'secret' => env('SQS_SECRET', 'your-secret-key'), 55 | 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), 56 | 'queue' => env('SQS_QUEUE', 'your-queue-name'), 57 | 'region' => env('SQS_REGION', 'us-east-1'), 58 | ], 59 | 60 | 'redis' => [ 61 | 'driver' => 'redis', 62 | 'connection' => 'default', 63 | 'queue' => 'default', 64 | 'retry_after' => 90, 65 | ], 66 | 67 | ], 68 | 69 | /* 70 | |-------------------------------------------------------------------------- 71 | | Failed Queue Jobs 72 | |-------------------------------------------------------------------------- 73 | | 74 | | These options configure the behavior of failed queue job logging so you 75 | | can control which database and table are used to store the jobs that 76 | | have failed. You may change them to any database / table you wish. 77 | | 78 | */ 79 | 80 | 'failed' => [ 81 | 'database' => env('DB_CONNECTION', 'mysql'), 82 | 'table' => 'failed_jobs', 83 | ], 84 | 85 | ]; 86 | -------------------------------------------------------------------------------- /app/Notifications/Discord/StrctStateChange.php: -------------------------------------------------------------------------------- 1 | structure = $structure; 25 | $this->character = $character; 26 | $this->old_state = $old_state; 27 | $this->new_state = $new_state; 28 | } 29 | 30 | /** 31 | * Get the notification's delivery channels. 32 | * 33 | * @param mixed $notifiable 34 | * @return array 35 | */ 36 | public function via($notifiable) 37 | { 38 | return [DiscordChannel::class]; 39 | } 40 | 41 | 42 | public function toDiscord($notifiable) { 43 | try { 44 | 45 | if(stripos($this->old_state, 'anchor') !== false || stripos($this->new_state, 'anchor') !== false) { 46 | //Keep anchoring things together 47 | $webhook = $notifiable->unanchor_webhook; 48 | $ping_here = $notifiable->anchor_ping_here == True ? '@here' : ''; 49 | } else { 50 | $webhook = $notifiable->state_webhook; 51 | $ping_here = $notifiable->state_ping_here == True ? '@here' : ''; 52 | } 53 | 54 | $client = new Client($webhook); 55 | $embed = new Embed(); 56 | 57 | if($this->new_state == 'shield_vulnerable') { 58 | $embed->color( 0x24d04a ); 59 | } else { 60 | $embed->color( 0xff2d32 ); 61 | } 62 | $embed->description(":no_entry: **Structure Changed State** for {$this->character->corporation_name} :no_entry:"); 63 | $embed->title("{$this->structure->structure_name}", env('APP_URL') . "/home/structure/{$this->structure->structure_id}"); 64 | $embed->thumbnail("https://imageserver.eveonline.com/Type/{$this->structure->type_id}_64.png"); 65 | $embed->author(env('APP_NAME'). 'Bot', null, "https://imageserver.eveonline.com/Character/{$notifiable->character_id}_64.jpg"); 66 | $embed->field('Old State', $this->old_state, TRUE); 67 | $embed->field('New State', $this->new_state, TRUE); 68 | $embed->field('System', $this->structure->system_name, TRUE); 69 | 70 | $client->username(env('APP_NAME')) 71 | ->avatar(env('APP_URL') . "/images/avatar.png") 72 | ->embed($embed) 73 | ->message($ping_here); 74 | 75 | return $client->send(); 76 | } catch (\Exception $e) { 77 | Log::error("Failed to send structure state change discord notification for {$this->character->character_name} on account $notifiable->user_id , $e"); 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /config/cache.php: -------------------------------------------------------------------------------- 1 | env('CACHE_DRIVER', 'file'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Cache Stores 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the cache "stores" for your application as 26 | | well as their drivers. You may even define multiple stores for the 27 | | same cache driver to group types of items stored in your caches. 28 | | 29 | */ 30 | 31 | 'stores' => [ 32 | 33 | 'apc' => [ 34 | 'driver' => 'apc', 35 | ], 36 | 37 | 'array' => [ 38 | 'driver' => 'array', 39 | ], 40 | 41 | 'database' => [ 42 | 'driver' => 'database', 43 | 'table' => 'cache', 44 | 'connection' => null, 45 | ], 46 | 47 | 'file' => [ 48 | 'driver' => 'file', 49 | 'path' => storage_path('framework/cache/data'), 50 | ], 51 | 52 | 'memcached' => [ 53 | 'driver' => 'memcached', 54 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), 55 | 'sasl' => [ 56 | env('MEMCACHED_USERNAME'), 57 | env('MEMCACHED_PASSWORD'), 58 | ], 59 | 'options' => [ 60 | // Memcached::OPT_CONNECT_TIMEOUT => 2000, 61 | ], 62 | 'servers' => [ 63 | [ 64 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'), 65 | 'port' => env('MEMCACHED_PORT', 11211), 66 | 'weight' => 100, 67 | ], 68 | ], 69 | ], 70 | 71 | 'redis' => [ 72 | 'driver' => 'redis', 73 | 'connection' => 'default', 74 | ], 75 | 76 | ], 77 | 78 | /* 79 | |-------------------------------------------------------------------------- 80 | | Cache Key Prefix 81 | |-------------------------------------------------------------------------- 82 | | 83 | | When utilizing a RAM based store such as APC or Memcached, there might 84 | | be other applications utilizing the same cache. So, we'll specify a 85 | | value to get prefixed to all our keys so we can avoid collisions. 86 | | 87 | */ 88 | 89 | 'prefix' => env( 90 | 'CACHE_PREFIX', 91 | str_slug(env('APP_NAME', 'laravel'), '_').'_cache' 92 | ), 93 | 94 | ]; 95 | -------------------------------------------------------------------------------- /database/seeds/DemoStructureStatesTableSeeder.php: -------------------------------------------------------------------------------- 1 | delete(); 18 | 19 | \DB::table('demo_structure_states')->insert(array ( 20 | 0 => 21 | array ( 22 | 'id' => 1, 23 | 'structure_id' => 1, 24 | 'character_id' => 2112565794, 25 | 'state_timer_start' => '2018-01-24 07:00', 26 | 'state_timer_end' => '2018-01-31 04:00', 27 | 'created_at' => '2018-01-29 05:17:13', 28 | 'updated_at' => '2018-01-29 05:17:13', 29 | ), 30 | 1 => 31 | array ( 32 | 'id' => 2, 33 | 'structure_id' => 2, 34 | 'character_id' => 2112565794, 35 | 'state_timer_start' => '2018-01-01 07:00', 36 | 'state_timer_end' => '2018-01-31 04:00', 37 | 'created_at' => '2018-01-29 05:17:13', 38 | 'updated_at' => '2018-01-29 05:17:13', 39 | ), 40 | 2 => 41 | array ( 42 | 'id' => 3, 43 | 'structure_id' => 3, 44 | 'character_id' => 2112565794, 45 | 'state_timer_start' => '2018-05-18 07:00', 46 | 'state_timer_end' => '2018-06-24 04:00', 47 | 'created_at' => '2018-01-29 05:17:13', 48 | 'updated_at' => '2018-01-29 05:17:13', 49 | ), 50 | 3 => 51 | array ( 52 | 'id' => 4, 53 | 'structure_id' => 4, 54 | 'character_id' => 1435599763, 55 | 'state_timer_start' => '2018-05-18 07:00', 56 | 'state_timer_end' => '2018-06-24 04:00', 57 | 'created_at' => '2018-01-29 05:17:13', 58 | 'updated_at' => '2018-01-29 05:17:13', 59 | ), 60 | 4 => 61 | array ( 62 | 'id' => 5, 63 | 'structure_id' => 5, 64 | 'character_id' => 1435599763, 65 | 'state_timer_start' => '2018-05-18 07:00', 66 | 'state_timer_end' => '2018-06-24 04:00', 67 | 'created_at' => '2018-01-29 05:17:13', 68 | 'updated_at' => '2018-01-29 05:17:13', 69 | ), 70 | 5 => 71 | array ( 72 | 'id' => 6, 73 | 'structure_id' => 6, 74 | 'character_id' => 2113690051, 75 | 'state_timer_start' => '2018-05-18 07:00', 76 | 'state_timer_end' => '2018-06-24 04:00', 77 | 'created_at' => '2018-01-29 05:17:13', 78 | 'updated_at' => '2018-01-29 05:17:13', 79 | ), 80 | )); 81 | 82 | 83 | } 84 | } -------------------------------------------------------------------------------- /resources/views/demo/structure.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 | @include ('layouts.errors') 6 |
7 |
8 |
9 |
10 | Back 11 |
12 |
13 |
14 | 15 |
16 |
17 |

{{$structure->structure_name}}

18 | 19 |
20 |
21 |
22 | 23 | 24 | 25 | 26 | 27 | @if(count($services)) 28 | @foreach($services as $svc) 29 | 30 | 31 | 34 | 35 | @endforeach 36 | @endif 37 |
Service NameStatus
{{$svc->name}}state == "online") style="color:green;" @else style="color:red" @endif> 32 | {{$svc->state}} 33 |
38 |
39 |
40 |
41 |
42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 |
Info NameValue
Unanchors{{$structure->unanchors_at}}
System{{$structure->system_name}}
Fuel Expires{{$structure->fuel_expires}}
Current State Starts{{$state[0]->state_timer_start}}
Current State Ends{{$state[0]->state_timer_end}}
68 |
69 |
70 |
71 |
72 | 73 |
74 |
75 |
76 |
77 |
78 | @endsection 79 | -------------------------------------------------------------------------------- /resources/views/auth/login.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
Login
9 | 10 |
11 |
12 | {{ csrf_field() }} 13 | 14 |
15 | 16 | 17 |
18 | 19 | 20 | @if ($errors->has('email')) 21 | 22 | {{ $errors->first('email') }} 23 | 24 | @endif 25 |
26 |
27 | 28 |
29 | 30 | 31 |
32 | 33 | 34 | @if ($errors->has('password')) 35 | 36 | {{ $errors->first('password') }} 37 | 38 | @endif 39 |
40 |
41 | 42 |
43 |
44 |
45 | 48 |
49 |
50 |
51 | 52 |
53 |
54 | 57 | 58 | 59 | Forgot Your Password? 60 | 61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | @endsection 70 | -------------------------------------------------------------------------------- /app/Console/Commands/DailyExtractions.php: -------------------------------------------------------------------------------- 1 | character_name}"); 50 | $structures = Character::find($character->character_id)->structures; 51 | foreach($structures as $structure) { 52 | $extraction = Structure::find($structure->structure_id)->extractions; 53 | if(!is_null($extraction)) { 54 | $fracture_time = new \DateTime($extraction->chunk_arrival_time); 55 | $now = new \DateTime(); 56 | $diff = date_diff($now, $fracture_time); 57 | if ($diff->days <= 7 && $diff->invert == 0) { 58 | array_push($extractions, $extraction); 59 | } 60 | } 61 | } 62 | 63 | if(count($extractions) > 0) { 64 | 65 | usort($extractions, function($a,$b) { 66 | $ad = new \DateTime($a->chunk_arrival_time); 67 | $bd = new \DateTime($b->chunk_arrival_time); 68 | 69 | if($ad == $bd) { 70 | return 0; 71 | } 72 | 73 | return $ad < $bd ? -1 : 1; 74 | }); 75 | 76 | $notification = NotificationManager::where('character_id', $character->character_id)->first(); 77 | if(!isset($notification->extraction_webhook) || is_null($notification->extraction_webhook)) { 78 | //Nothing to send withot a webhook 79 | Log::debug("Ending Daily Extractions Notification for $structure->structure_name for $character->character_name, no extraction_webhook"); 80 | continue; 81 | } 82 | 83 | if(preg_match("/slack/", $notification->extraction_webhook)) { 84 | $notification->slackChannel('extraction_webhook')->notify(new ExtractionsDailySlack($character, $extractions)); 85 | } else { 86 | $notification->notify(new ExtractionsDailyDiscord($character, $extractions)); 87 | } 88 | 89 | Log::debug("Ending Daily Extractions Notification for $structure->structure_name for $character->character_name"); 90 | } 91 | } 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /resources/views/auth/passwords/reset.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
Reset Password
9 | 10 |
11 |
12 | {{ csrf_field() }} 13 | 14 | 15 | 16 |
17 | 18 | 19 |
20 | 21 | 22 | @if ($errors->has('email')) 23 | 24 | {{ $errors->first('email') }} 25 | 26 | @endif 27 |
28 |
29 | 30 |
31 | 32 | 33 |
34 | 35 | 36 | @if ($errors->has('password')) 37 | 38 | {{ $errors->first('password') }} 39 | 40 | @endif 41 |
42 |
43 | 44 |
45 | 46 |
47 | 48 | 49 | @if ($errors->has('password_confirmation')) 50 | 51 | {{ $errors->first('password_confirmation') }} 52 | 53 | @endif 54 |
55 |
56 | 57 |
58 |
59 | 62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 | @endsection 71 | -------------------------------------------------------------------------------- /database/seeds/DemoStructureServicesTableSeeder.php: -------------------------------------------------------------------------------- 1 | delete(); 18 | 19 | \DB::table('demo_structure_services')->insert(array ( 20 | 0 => 21 | array ( 22 | 'id' => 1, 23 | 'structure_id' => 1, 24 | 'character_id' => 2112565794, 25 | 'name' => 'Reprocessing', 26 | 'state' => 'online', 27 | 'created_at' => '2018-01-28 06:08:28', 28 | 'updated_at' => '2018-01-29 17:53:18', 29 | ), 30 | 1 => 31 | array ( 32 | 'id' => 2, 33 | 'structure_id' => 1, 34 | 'character_id' => 2112565794, 35 | 'name' => 'Clone Bay', 36 | 'state' => 'online', 37 | 'created_at' => '2018-01-28 06:08:28', 38 | 'updated_at' => '2018-01-29 17:53:18', 39 | ), 40 | 2 => 41 | array ( 42 | 'id' => 3, 43 | 'structure_id' => 1, 44 | 'character_id' => 2112565794, 45 | 'name' => 'Blueprint Copying', 46 | 'state' => 'offline', 47 | 'created_at' => '2018-01-28 06:08:28', 48 | 'updated_at' => '2018-01-29 17:53:18', 49 | ), 50 | 3 => 51 | array ( 52 | 'id' => 4, 53 | 'structure_id' => 2, 54 | 'character_id' => 2112565794, 55 | 'name' => 'Invention', 56 | 'state' => 'offline', 57 | 'created_at' => '2018-01-28 06:08:28', 58 | 'updated_at' => '2018-01-29 17:53:18', 59 | ), 60 | 4 => 61 | array ( 62 | 'id' => 5, 63 | 'structure_id' => 2, 64 | 'character_id' => 2112565794, 65 | 'name' => 'Market', 66 | 'state' => 'offline', 67 | 'created_at' => '2018-01-28 06:08:28', 68 | 'updated_at' => '2018-01-29 17:53:18', 69 | ), 70 | 5 => 71 | array ( 72 | 'id' => 6, 73 | 'structure_id' => 3, 74 | 'character_id' => 2112565794, 75 | 'name' => 'Time Efficiency Research', 76 | 'state' => 'online', 77 | 'created_at' => '2018-01-28 06:08:28', 78 | 'updated_at' => '2018-01-29 17:53:18', 79 | ), 80 | 6 => 81 | array ( 82 | 'id' => 7, 83 | 'structure_id' => 4, 84 | 'character_id' => 1435599763, 85 | 'name' => 'Invention', 86 | 'state' => 'online', 87 | 'created_at' => '2018-01-28 06:08:28', 88 | 'updated_at' => '2018-01-29 17:53:18', 89 | ), 90 | 7 => 91 | array ( 92 | 'id' => 8, 93 | 'structure_id' => 5, 94 | 'character_id' => 1435599763, 95 | 'name' => 'Blueprint Copying', 96 | 'state' => 'offline', 97 | 'created_at' => '2018-01-28 06:08:28', 98 | 'updated_at' => '2018-01-29 17:53:18', 99 | ), 100 | )); 101 | 102 | 103 | } 104 | } -------------------------------------------------------------------------------- /config/auth.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'guard' => 'web', 18 | 'passwords' => 'users', 19 | ], 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Authentication Guards 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Next, you may define every authentication guard for your application. 27 | | Of course, a great default configuration has been defined for you 28 | | here which uses session storage and the Eloquent user provider. 29 | | 30 | | All authentication drivers have a user provider. This defines how the 31 | | users are actually retrieved out of your database or other storage 32 | | mechanisms used by this application to persist your user's data. 33 | | 34 | | Supported: "session", "token" 35 | | 36 | */ 37 | 38 | 'guards' => [ 39 | 'web' => [ 40 | 'driver' => 'session', 41 | 'provider' => 'users', 42 | ], 43 | 44 | 'api' => [ 45 | 'driver' => 'token', 46 | 'provider' => 'users', 47 | ], 48 | ], 49 | 50 | /* 51 | |-------------------------------------------------------------------------- 52 | | User Providers 53 | |-------------------------------------------------------------------------- 54 | | 55 | | All authentication drivers have a user provider. This defines how the 56 | | users are actually retrieved out of your database or other storage 57 | | mechanisms used by this application to persist your user's data. 58 | | 59 | | If you have multiple user tables or models you may configure multiple 60 | | sources which represent each model / table. These sources may then 61 | | be assigned to any extra authentication guards you have defined. 62 | | 63 | | Supported: "database", "eloquent" 64 | | 65 | */ 66 | 67 | 'providers' => [ 68 | 'users' => [ 69 | 'driver' => 'eloquent', 70 | 'model' => App\User::class, 71 | ], 72 | 73 | // 'users' => [ 74 | // 'driver' => 'database', 75 | // 'table' => 'users', 76 | // ], 77 | ], 78 | 79 | /* 80 | |-------------------------------------------------------------------------- 81 | | Resetting Passwords 82 | |-------------------------------------------------------------------------- 83 | | 84 | | You may specify multiple password reset configurations if you have more 85 | | than one user table or model in the application and you want to have 86 | | separate password reset settings based on the specific user types. 87 | | 88 | | The expire time is the number of minutes that the reset token should be 89 | | considered valid. This security feature keeps tokens short-lived so 90 | | they have less time to be guessed. You may change this as needed. 91 | | 92 | */ 93 | 94 | 'passwords' => [ 95 | 'users' => [ 96 | 'provider' => 'users', 97 | 'table' => 'password_resets', 98 | 'expire' => 60, 99 | ], 100 | ], 101 | 102 | ]; 103 | -------------------------------------------------------------------------------- /resources/views/auth/register.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
Register
9 | 10 |
11 |
12 | {{ csrf_field() }} 13 | 14 |
15 | 16 | 17 |
18 | 19 | 20 | @if ($errors->has('name')) 21 | 22 | {{ $errors->first('name') }} 23 | 24 | @endif 25 |
26 |
27 | 28 |
29 | 30 | 31 |
32 | 33 | 34 | @if ($errors->has('email')) 35 | 36 | {{ $errors->first('email') }} 37 | 38 | @endif 39 |
40 |
41 | 42 |
43 | 44 | 45 |
46 | 47 | 48 | @if ($errors->has('password')) 49 | 50 | {{ $errors->first('password') }} 51 | 52 | @endif 53 |
54 |
55 | 56 |
57 | 58 | 59 |
60 | 61 |
62 |
63 | 64 |
65 |
66 | 69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 | @endsection 78 | -------------------------------------------------------------------------------- /config/database.php: -------------------------------------------------------------------------------- 1 | env('DB_CONNECTION', 'mysql'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Database Connections 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here are each of the database connections setup for your application. 24 | | Of course, examples of configuring each database platform that is 25 | | supported by Laravel is shown below to make development simple. 26 | | 27 | | 28 | | All database work in Laravel is done through the PHP PDO facilities 29 | | so make sure you have the driver for your particular database of 30 | | choice installed on your machine before you begin development. 31 | | 32 | */ 33 | 34 | 'connections' => [ 35 | 36 | 'sqlite' => [ 37 | 'driver' => 'sqlite', 38 | 'database' => env('DB_DATABASE', database_path('database.sqlite')), 39 | 'prefix' => '', 40 | ], 41 | 42 | 'mysql' => [ 43 | 'driver' => 'mysql', 44 | 'host' => env('DB_HOST', '127.0.0.1'), 45 | 'port' => env('DB_PORT', '3306'), 46 | 'database' => env('DB_DATABASE', 'forge'), 47 | 'username' => env('DB_USERNAME', 'forge'), 48 | 'password' => env('DB_PASSWORD', ''), 49 | 'unix_socket' => env('DB_SOCKET', ''), 50 | 'charset' => 'utf8mb4', 51 | 'collation' => 'utf8mb4_unicode_ci', 52 | 'prefix' => '', 53 | 'strict' => true, 54 | 'engine' => null, 55 | ], 56 | 57 | 'pgsql' => [ 58 | 'driver' => 'pgsql', 59 | 'host' => env('DB_HOST', '127.0.0.1'), 60 | 'port' => env('DB_PORT', '5432'), 61 | 'database' => env('DB_DATABASE', 'forge'), 62 | 'username' => env('DB_USERNAME', 'forge'), 63 | 'password' => env('DB_PASSWORD', ''), 64 | 'charset' => 'utf8', 65 | 'prefix' => '', 66 | 'schema' => 'public', 67 | 'sslmode' => 'prefer', 68 | ], 69 | 70 | 'sqlsrv' => [ 71 | 'driver' => 'sqlsrv', 72 | 'host' => env('DB_HOST', 'localhost'), 73 | 'port' => env('DB_PORT', '1433'), 74 | 'database' => env('DB_DATABASE', 'forge'), 75 | 'username' => env('DB_USERNAME', 'forge'), 76 | 'password' => env('DB_PASSWORD', ''), 77 | 'charset' => 'utf8', 78 | 'prefix' => '', 79 | ], 80 | 81 | ], 82 | 83 | /* 84 | |-------------------------------------------------------------------------- 85 | | Migration Repository Table 86 | |-------------------------------------------------------------------------- 87 | | 88 | | This table keeps track of all the migrations that have already run for 89 | | your application. Using this information, we can determine which of 90 | | the migrations on disk haven't actually been run in the database. 91 | | 92 | */ 93 | 94 | 'migrations' => 'migrations', 95 | 96 | /* 97 | |-------------------------------------------------------------------------- 98 | | Redis Databases 99 | |-------------------------------------------------------------------------- 100 | | 101 | | Redis is an open source, fast, and advanced key-value store that also 102 | | provides a richer set of commands than a typical key-value systems 103 | | such as APC or Memcached. Laravel makes it easy to dig right in. 104 | | 105 | */ 106 | 107 | 'redis' => [ 108 | 109 | 'client' => 'predis', 110 | 111 | 'default' => [ 112 | 'host' => env('REDIS_HOST', '127.0.0.1'), 113 | 'password' => env('REDIS_PASSWORD', null), 114 | 'port' => env('REDIS_PORT', 6379), 115 | 'database' => 0, 116 | ], 117 | 118 | ], 119 | 120 | ]; 121 | -------------------------------------------------------------------------------- /config/mail.php: -------------------------------------------------------------------------------- 1 | env('MAIL_DRIVER', 'smtp'), 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | SMTP Host Address 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Here you may provide the host address of the SMTP server used by your 27 | | applications. A default option is provided that is compatible with 28 | | the Mailgun mail service which will provide reliable deliveries. 29 | | 30 | */ 31 | 32 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), 33 | 34 | /* 35 | |-------------------------------------------------------------------------- 36 | | SMTP Host Port 37 | |-------------------------------------------------------------------------- 38 | | 39 | | This is the SMTP port used by your application to deliver e-mails to 40 | | users of the application. Like the host we have set this value to 41 | | stay compatible with the Mailgun e-mail application by default. 42 | | 43 | */ 44 | 45 | 'port' => env('MAIL_PORT', 587), 46 | 47 | /* 48 | |-------------------------------------------------------------------------- 49 | | Global "From" Address 50 | |-------------------------------------------------------------------------- 51 | | 52 | | You may wish for all e-mails sent by your application to be sent from 53 | | the same address. Here, you may specify a name and address that is 54 | | used globally for all e-mails that are sent by your application. 55 | | 56 | */ 57 | 58 | 'from' => [ 59 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), 60 | 'name' => env('MAIL_FROM_NAME', 'Example'), 61 | ], 62 | 63 | /* 64 | |-------------------------------------------------------------------------- 65 | | E-Mail Encryption Protocol 66 | |-------------------------------------------------------------------------- 67 | | 68 | | Here you may specify the encryption protocol that should be used when 69 | | the application send e-mail messages. A sensible default using the 70 | | transport layer security protocol should provide great security. 71 | | 72 | */ 73 | 74 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'), 75 | 76 | /* 77 | |-------------------------------------------------------------------------- 78 | | SMTP Server Username 79 | |-------------------------------------------------------------------------- 80 | | 81 | | If your SMTP server requires a username for authentication, you should 82 | | set it here. This will get used to authenticate with your server on 83 | | connection. You may also set the "password" value below this one. 84 | | 85 | */ 86 | 87 | 'username' => env('MAIL_USERNAME'), 88 | 89 | 'password' => env('MAIL_PASSWORD'), 90 | 91 | /* 92 | |-------------------------------------------------------------------------- 93 | | Sendmail System Path 94 | |-------------------------------------------------------------------------- 95 | | 96 | | When using the "sendmail" driver to send e-mails, we will need to know 97 | | the path to where Sendmail lives on this server. A default path has 98 | | been provided here, which will work well on most of your systems. 99 | | 100 | */ 101 | 102 | 'sendmail' => '/usr/sbin/sendmail -bs', 103 | 104 | /* 105 | |-------------------------------------------------------------------------- 106 | | Markdown Mail Settings 107 | |-------------------------------------------------------------------------- 108 | | 109 | | If you are using Markdown based email rendering, you may configure your 110 | | theme and component paths here, allowing you to customize the design 111 | | of the emails. Or, you may simply stick with the Laravel defaults! 112 | | 113 | */ 114 | 115 | 'markdown' => [ 116 | 'theme' => 'default', 117 | 118 | 'paths' => [ 119 | resource_path('views/vendor/mail'), 120 | ], 121 | ], 122 | 123 | ]; 124 | --------------------------------------------------------------------------------