├── .env.example ├── .eslintrc.js ├── .gitattributes ├── .gitignore ├── .travis.yml ├── Homestead.yaml.example ├── LICENSE ├── README.md ├── UPGRADE.md ├── Vagrantfile ├── app ├── Api │ └── v1 │ │ ├── Controllers │ │ ├── AuthController.php │ │ ├── Controller.php │ │ ├── GreylistController.php │ │ ├── OptController.php │ │ ├── OptInController.php │ │ ├── OptOutController.php │ │ ├── StatsController.php │ │ ├── UserController.php │ │ └── WhitelistController.php │ │ ├── Exceptions │ │ └── ValidationException.php │ │ └── Transformers │ │ ├── GreylistTransformer.php │ │ ├── OptDomainTransformer.php │ │ ├── OptEmailTransformer.php │ │ ├── OptInDomainTransformer.php │ │ ├── OptInEmailTransformer.php │ │ ├── OptOutDomainTransformer.php │ │ ├── OptOutEmailTransformer.php │ │ ├── Transformer.php │ │ ├── UserTransformer.php │ │ ├── WhitelistDomainTransformer.php │ │ ├── WhitelistEmailTransformer.php │ │ └── WhitelistTransformer.php ├── Console │ ├── Commands │ │ ├── CreateUser.php │ │ └── DeleteUndefRecords.php │ └── Kernel.php ├── Exceptions │ └── Handler.php ├── Http │ ├── Controllers │ │ ├── Auth │ │ │ ├── ForgotPasswordController.php │ │ │ ├── LoginController.php │ │ │ ├── RegisterController.php │ │ │ └── ResetPasswordController.php │ │ ├── Controller.php │ │ └── HomeController.php │ ├── Kernel.php │ └── Middleware │ │ ├── EncryptCookies.php │ │ ├── RedirectIfAuthenticated.php │ │ ├── TrimStrings.php │ │ └── VerifyCsrfToken.php ├── Models │ ├── AwlDomain.php │ ├── AwlEmail.php │ ├── Greylist.php │ ├── OptDomain.php │ ├── OptEmail.php │ ├── OptInDomain.php │ ├── OptInEmail.php │ ├── OptOutDomain.php │ ├── OptOutEmail.php │ ├── SQLgreyConnection.php │ └── User.php ├── Providers │ ├── AppServiceProvider.php │ ├── AuthServiceProvider.php │ ├── BroadcastServiceProvider.php │ ├── EventServiceProvider.php │ ├── RepositoryServiceProvider.php │ └── RouteServiceProvider.php └── Repositories │ ├── AwlDomainRepositoryEloquent.php │ ├── AwlDomainRepositoryInterface.php │ ├── AwlEmailRepositoryEloquent.php │ ├── AwlEmailRepositoryInterface.php │ ├── BaseRepositoryEloquent.php │ ├── BaseRepositoryInterface.php │ ├── GreylistRepositoryEloquent.php │ ├── GreylistRepositoryInterface.php │ ├── OptDomainRepositoryInterface.php │ ├── OptDomainTrait.php │ ├── OptEmailRepositoryInterface.php │ ├── OptEmailTrait.php │ ├── OptInDomainRepositoryEloquent.php │ ├── OptInDomainRepositoryInterface.php │ ├── OptInEmailRepositoryEloquent.php │ ├── OptInEmailRepositoryInterface.php │ ├── OptOutDomainRepositoryEloquent.php │ ├── OptOutDomainRepositoryInterface.php │ ├── OptOutEmailRepositoryEloquent.php │ ├── OptOutEmailRepositoryInterface.php │ ├── UserProviderEloquent.php │ ├── UserProviderInterface.php │ ├── UserRepositoryEloquent.php │ └── UserRepositoryInterface.php ├── artisan ├── bootstrap ├── app.php ├── autoload.php └── cache │ └── .gitignore ├── circle.yml ├── composer.json ├── composer.lock ├── config ├── app.php ├── auth.php ├── broadcasting.php ├── cache.php ├── database.php ├── debugbar.php ├── filesystems.php ├── ide-helper.php ├── mail.php ├── queue.php ├── services.php ├── session.php ├── sqlgreygui.php ├── tail.php ├── twigbridge.php └── view.php ├── database ├── .gitignore ├── factories │ └── ModelFactory.php ├── migrations │ ├── 2014_07_22_213441_create_users_table.php │ ├── 2016_03_24_205059_make_users_username_column_unique.php │ └── 2017_03_20_100000_create_password_resets_table.php └── seeds │ ├── AwlDomainTableSeeder.php │ ├── AwlEmailTableSeeder.php │ ├── DatabaseSeeder.php │ ├── GreylistTableSeeder.php │ ├── OptInDomainTableSeeder.php │ ├── OptInEmailTableSeeder.php │ ├── OptOutDomainTableSeeder.php │ ├── OptOutEmailTableSeeder.php │ ├── SQLgreySeeder.php │ └── UsersTableSeeder.php ├── docs ├── _config.yml ├── demo.gif └── index.md ├── package.json ├── phpunit.dusk.xml ├── phpunit.xml ├── public ├── .htaccess ├── assets │ └── .gitignore ├── favicon.ico ├── images │ └── logo.png ├── index.php ├── robots.txt └── web.config ├── resources ├── assets │ ├── images │ │ └── logo.xcf │ ├── js │ │ ├── App.vue │ │ ├── app.js │ │ ├── components │ │ │ ├── Aside.vue │ │ │ ├── Breadcrumb.vue │ │ │ ├── DataTable.vue │ │ │ ├── DomainControls.vue │ │ │ ├── EmailControls.vue │ │ │ ├── Footer.vue │ │ │ ├── Header.vue │ │ │ ├── Navbar.vue │ │ │ ├── Sidebar.vue │ │ │ └── passport │ │ │ │ ├── AuthorizedClients.vue │ │ │ │ ├── Clients.vue │ │ │ │ └── PersonalAccessTokens.vue │ │ ├── containers │ │ │ └── Full.vue │ │ ├── public.js │ │ ├── router │ │ │ └── index.js │ │ ├── utils │ │ │ ├── Alert.js │ │ │ └── ValidationErrors.js │ │ ├── views │ │ │ ├── Dashboard.vue │ │ │ ├── Greylist.vue │ │ │ ├── OptInDomains.vue │ │ │ ├── OptInEmails.vue │ │ │ ├── OptOutDomains.vue │ │ │ ├── OptOutEmails.vue │ │ │ ├── SettingsAccount.vue │ │ │ ├── SettingsApi.vue │ │ │ ├── Users.vue │ │ │ ├── WhitelistDomains.vue │ │ │ └── WhitelistEmails.vue │ │ └── vue-strap │ │ │ └── utils.js │ └── sass │ │ ├── _bootstrap-variables.scss │ │ ├── _custom-variables.scss │ │ ├── _custom.scss │ │ ├── _variables.scss │ │ ├── bootstrap_custom │ │ ├── _badge.scss │ │ ├── _breadcrumb.scss │ │ ├── _buttons.scss │ │ ├── _card.scss │ │ ├── _dropdown.scss │ │ ├── _input-group.scss │ │ ├── _modal.scss │ │ ├── _nav.scss │ │ ├── _navbar.scss │ │ ├── _progress.scss │ │ └── _tables.scss │ │ ├── core │ │ ├── _animate.scss │ │ ├── _aside.scss │ │ ├── _avatars.scss │ │ ├── _breadcrumb-menu.scss │ │ ├── _buttons.scss │ │ ├── _callout.scss │ │ ├── _charts.scss │ │ ├── _footer.scss │ │ ├── _grid.scss │ │ ├── _layout.scss │ │ ├── _loading.scss │ │ ├── _mixins.scss │ │ ├── _mobile.scss │ │ ├── _navigation.scss │ │ ├── _others.scss │ │ ├── _rtl.scss │ │ ├── _switches.scss │ │ ├── _temp.scss │ │ ├── _typography.scss │ │ ├── _utilities-border.scss │ │ ├── _widgets.scss │ │ └── navigation │ │ │ ├── _disabled.scss │ │ │ ├── _sidebar.scss │ │ │ └── _top.scss │ │ ├── style.scss │ │ └── vendors │ │ ├── _vendors.scss │ │ └── chart.js │ │ └── chart.scss ├── lang │ └── en │ │ ├── auth.php │ │ ├── pagination.php │ │ ├── passwords.php │ │ └── validation.php └── views │ ├── Layouts │ ├── base.twig │ └── public.twig │ ├── auth │ ├── login.twig │ └── passwords │ │ ├── email.twig │ │ └── reset.twig │ ├── greylist │ └── index.twig │ ├── home.twig │ └── user │ ├── form.twig │ ├── index.twig │ └── table.twig ├── routes ├── api.php ├── channels.php ├── console.php └── web.php ├── server.php ├── storage ├── .gitignore ├── app │ ├── .gitignore │ └── public │ │ └── .gitignore ├── debugbar │ └── .gitignore ├── framework │ ├── .gitignore │ ├── cache │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ └── views │ │ └── .gitignore └── logs │ └── .gitignore ├── tests ├── Browser │ ├── DashboardTest.php │ ├── ExampleTest.php │ ├── GreylistTest.php │ ├── OptInTest.php.bak │ ├── OptOutTest.php.bak │ ├── Pages │ │ ├── HomePage.php │ │ └── Page.php │ ├── UserTest.php │ ├── WhitelistTest.php.bak │ ├── console │ │ └── .gitignore │ └── screenshots │ │ └── .gitignore ├── CreatesApplication.php ├── DuskTestCase.php ├── Feature │ └── ExampleTest.php ├── TestCase.php ├── Unit │ └── ExampleTest.php ├── dusk.sh ├── fixtures │ ├── .env.testing │ └── sqlgrey.sql ├── run.sh └── util.sh ├── webpack.mix.js └── yarn.lock /.env.example: -------------------------------------------------------------------------------- 1 | APP_NAME=SQLgreyGUI 2 | APP_ENV=production 3 | APP_KEY= 4 | APP_DEBUG=false 5 | APP_LOG_LEVEL=debug 6 | APP_URL=http://localhost 7 | APP_TIMEZONE=Europe/Berlin 8 | 9 | # Database for SQLgreyGUI 10 | # If you want to use a single database for both SQLgreyGUI and SQLgrey use only this config block 11 | DB_CONNECTION=sqlgreygui 12 | DB_DRIVER=mysql 13 | DB_HOST=127.0.0.1 14 | DB_PORT=3306 15 | DB_DATABASE=sqlgrey 16 | DB_USERNAME=sqlgrey 17 | DB_PASSWORD=sqlgrey 18 | 19 | # Uncomment the following lines if SQLgrey resides in a different database 20 | #SQLGREY_DB_CONNECTION=sqlgrey 21 | SQLGREY_DB_DRIVER=mysql 22 | #SQLGREY_DB_HOST=null 23 | #SQLGREY_DB_PORT=3306 24 | #SQLGREY_DB_DATABASE=null 25 | #SQLGREY_DB_USERNAME=null 26 | #SQLGREY_DB_PASSWORD=null 27 | 28 | BROADCAST_DRIVER=log 29 | CACHE_DRIVER=file 30 | SESSION_DRIVER=file 31 | QUEUE_DRIVER=sync 32 | 33 | REDIS_HOST=127.0.0.1 34 | REDIS_PASSWORD=null 35 | REDIS_PORT=6379 36 | 37 | MAIL_DRIVER=log 38 | MAIL_HOST=smtp.mailtrap.io 39 | MAIL_PORT=2525 40 | MAIL_USERNAME=null 41 | MAIL_PASSWORD=null 42 | MAIL_ENCRYPTION=null 43 | 44 | PUSHER_APP_ID= 45 | PUSHER_APP_KEY= 46 | PUSHER_APP_SECRET= 47 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "extends": "standard", 3 | "globals": { 4 | "_": true, 5 | "axios": true, 6 | "document": true, 7 | "window": true 8 | }, 9 | "plugins": [ 10 | "html", 11 | "standard", 12 | "promise" 13 | ] 14 | }; 15 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.css linguist-vendored 3 | *.scss linguist-vendored 4 | *.js linguist-vendored 5 | CHANGELOG.md export-ignore 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /public/hot 3 | /public/storage 4 | /storage/*.key 5 | /vendor 6 | /.idea 7 | /.vagrant 8 | Homestead.json 9 | Homestead.yaml 10 | npm-debug.log 11 | .env 12 | 13 | ## Development 14 | _ide_helper.php 15 | _ide_helper_models.php 16 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | language: php 3 | dist: trusty 4 | 5 | services: mysql 6 | 7 | php: 8 | - '5.6' 9 | - '7.0' 10 | - '7.1' 11 | 12 | env: 13 | - APP_URL="http://localhost:8000" 14 | 15 | cache: 16 | directories: 17 | - $HOME/.composer/cache/files 18 | - $HOME/.cache/yarn 19 | 20 | before_install: 21 | - mysql -e "CREATE DATABASE IF NOT EXISTS testing;" 22 | - mysql -e "GRANT ALL ON testing.* to 'homestead'@'%' IDENTIFIED BY 'secret';" 23 | - mysql --database testing < tests/fixtures/sqlgrey.sql 24 | - . $HOME/.nvm/nvm.sh 25 | - nvm install --lts 26 | - nvm use --lts 27 | - npm install -g yarn 28 | 29 | install: 30 | - cp -nv tests/fixtures/.env.testing .env 31 | - composer install --no-interaction 32 | - php artisan key:generate 33 | - php artisan migrate --force 34 | - php artisan passport:install 35 | - yarn install --check-files 36 | 37 | before_script: 38 | - export DISPLAY=:99.0 39 | - sh -e /etc/init.d/xvfb start 40 | - ./vendor/laravel/dusk/bin/chromedriver-linux & 41 | - php artisan serve & 42 | 43 | script: 44 | - php artisan dusk 45 | - ./vendor/bin/phpunit 46 | -------------------------------------------------------------------------------- /Homestead.yaml.example: -------------------------------------------------------------------------------- 1 | ip: 192.168.10.10 2 | memory: 2048 3 | cpus: 2 4 | hostname: sqlgreygui 5 | name: sqlgreygui 6 | provider: virtualbox 7 | authorize: ~/.ssh/id_rsa.pub 8 | keys: 9 | - ~/.ssh/id_rsa 10 | folders: 11 | - { map: /path/to/src, to: /home/vagrant/Code } 12 | sites: 13 | - { map: sqlgreygui.local, to: /home/vagrant/Code/public } 14 | databases: 15 | - homestead 16 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 - 2017 Lorenz Bausch 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | SQLgreyGUI 2 | ========== 3 | 4 | [![Build Status](https://travis-ci.org/lbausch/SQLgreyGUI.svg?branch=master)](https://travis-ci.org/lbausch/SQLgreyGUI) 5 | [![CircleCI](https://circleci.com/gh/lbausch/SQLgreyGUI/tree/master.svg?style=shield&circle-token=a1aa5f540878177c22252802a2725e2ed93e6d43)](https://circleci.com/gh/lbausch/SQLgreyGUI/tree/master) 6 | [![Codacy Badge](https://api.codacy.com/project/badge/Grade/88a59ccb64a24a8480a13313cb37599a)](https://www.codacy.com/app/lbausch/SQLgreyGUI?utm_source=github.com&utm_medium=referral&utm_content=lbausch/SQLgreyGUI&utm_campaign=Badge_Grade) 7 | [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT) 8 | 9 | Web interface for [SQLgrey](http://sqlgrey.sourceforge.net/) using the [Laravel 5](https://laravel.com/) Framework. 10 | 11 | 12 | ![Demo](docs/demo.gif?raw=true "Demo") 13 | 14 | 15 | ## Documentation 16 | Visit the [official homepage](https://lbausch.github.io/SQLgreyGUI/) for requirements, installation instructions and further information. 17 | -------------------------------------------------------------------------------- /UPGRADE.md: -------------------------------------------------------------------------------- 1 | # Upgrading 2 | 3 | ## Upgrading from v2.x to v3.x 4 | + Backup everything 5 | + Get the latest code from GitHub (`git fetch` and `git checkout master`) 6 | + Update your `.env` file based on `.env.example` 7 | + Install PHP packages: `composer install --no-dev` 8 | + Install npm packages: `yarn install` (if you don't use yarn `npm install` should work as well) 9 | + Generate frontend assets: `yarn run prod` (or `npm run prod`) 10 | + Upgrade database: `php artisan migrate` 11 | + Install Laravel Passport: `php artisan passport:install` 12 | + Add cron entry as mentioned in installation instructions (`README.md`) 13 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | require 'json' 5 | require 'yaml' 6 | 7 | VAGRANTFILE_API_VERSION ||= "2" 8 | confDir = $confDir ||= File.expand_path("vendor/laravel/homestead", File.dirname(__FILE__)) 9 | 10 | homesteadYamlPath = "Homestead.yaml" 11 | homesteadJsonPath = "Homestead.json" 12 | afterScriptPath = "after.sh" 13 | aliasesPath = "aliases" 14 | 15 | require File.expand_path(confDir + '/scripts/homestead.rb') 16 | 17 | Vagrant.require_version '>= 1.9.0' 18 | 19 | Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| 20 | if File.exist? aliasesPath then 21 | config.vm.provision "file", source: aliasesPath, destination: "/tmp/bash_aliases" 22 | config.vm.provision "shell" do |s| 23 | s.inline = "awk '{ sub(\"\r$\", \"\"); print }' /tmp/bash_aliases > /home/vagrant/.bash_aliases" 24 | end 25 | end 26 | 27 | if File.exist? homesteadYamlPath then 28 | settings = YAML::load(File.read(homesteadYamlPath)) 29 | elsif File.exist? homesteadJsonPath then 30 | settings = JSON.parse(File.read(homesteadJsonPath)) 31 | else 32 | abort "Homestead settings file not found in #{confDir}" 33 | end 34 | 35 | Homestead.configure(config, settings) 36 | 37 | if File.exist? afterScriptPath then 38 | config.vm.provision "shell", path: afterScriptPath, privileged: false 39 | end 40 | 41 | if defined? VagrantPlugins::HostsUpdater 42 | config.hostsupdater.aliases = settings['sites'].map { |site| site['map'] } 43 | end 44 | end 45 | -------------------------------------------------------------------------------- /app/Api/v1/Controllers/AuthController.php: -------------------------------------------------------------------------------- 1 | validate($request, [ 23 | 'email' => 'required', 24 | 'password' => 'required', 25 | ]); 26 | 27 | $email = $request->input('email'); 28 | $password = $request->input('password'); 29 | 30 | $login = $auth->guard()->attempt([ 31 | 'email' => $email, 32 | 'password' => $password, 33 | ]); 34 | 35 | if (!$login) { 36 | return; 37 | } 38 | 39 | $http = new Client(); 40 | 41 | // @TODO: use config() and env() 42 | $response = $http->post(url('/').'/oauth/token', [ 43 | 'form_params' => [ 44 | 'grant_type' => 'password', 45 | 'client_id' => '2', 46 | 'client_secret' => 'WNZpOsPcdFjHWHFViMTGKXLaTFP1x7P0QRDGYxC4', 47 | 'username' => $email, 48 | 'password' => $password, 49 | 'scope' => '*', 50 | ], 51 | ]); 52 | 53 | $token_data = json_decode($response->getBody()->getContents(), $assoc = true); 54 | 55 | return $this->respond($token_data); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /app/Api/v1/Controllers/OptInController.php: -------------------------------------------------------------------------------- 1 | emails = $emails; 23 | $this->domains = $domains; 24 | 25 | $this->emailTransformer = EmailTransformer::class; 26 | $this->domainTransformer = DomainTransformer::class; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/Api/v1/Controllers/OptOutController.php: -------------------------------------------------------------------------------- 1 | emails = $emails; 23 | $this->domains = $domains; 24 | 25 | $this->emailTransformer = EmailTransformer::class; 26 | $this->domainTransformer = DomainTransformer::class; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/Api/v1/Controllers/StatsController.php: -------------------------------------------------------------------------------- 1 | greylist = $greylist; 87 | $this->awl_email = $awl_email; 88 | $this->awl_domain = $awl_domain; 89 | $this->optout_email = $optput_email; 90 | $this->optout_domain = $optout_domain; 91 | $this->optin_email = $optin_email; 92 | $this->optin_domain = $optin_domain; 93 | } 94 | 95 | /** 96 | * Stats. 97 | * 98 | * @return \Illuminate\Http\Response 99 | */ 100 | public function index() 101 | { 102 | $dashboard_data = [ 103 | 'greylist' => $this->greylist->findAll()->count(), 104 | 'awl_emails' => $this->awl_email->findAll()->count(), 105 | 'awl_domains' => $this->awl_domain->findAll()->count(), 106 | 'optout_emails' => $this->optout_email->findAll()->count(), 107 | 'optout_domains' => $this->optout_domain->findAll()->count(), 108 | 'optin_emails' => $this->optin_email->findAll()->count(), 109 | 'optin_domains' => $this->optin_domain->findAll()->count(), 110 | ]; 111 | 112 | return $this->respond($dashboard_data); 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /app/Api/v1/Exceptions/ValidationException.php: -------------------------------------------------------------------------------- 1 | $errors]; 27 | } 28 | 29 | $this->errors = new MessageBag(); 30 | 31 | foreach ($errors as $field => $message) { 32 | $this->errors->add($field, $message); 33 | } 34 | } 35 | 36 | /** 37 | * Get response. 38 | * 39 | * @return JsonResponse 40 | */ 41 | public function getResponse() 42 | { 43 | return new JsonResponse($this->errors->toArray(), 422); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/Api/v1/Transformers/GreylistTransformer.php: -------------------------------------------------------------------------------- 1 | transformModel($greylist); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/Api/v1/Transformers/OptDomainTransformer.php: -------------------------------------------------------------------------------- 1 | toArray(); 19 | $data['id'] = $domain->domain; 20 | 21 | return $data; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/Api/v1/Transformers/OptEmailTransformer.php: -------------------------------------------------------------------------------- 1 | toArray(); 19 | $data['id'] = $email->email; 20 | 21 | return $data; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/Api/v1/Transformers/OptInDomainTransformer.php: -------------------------------------------------------------------------------- 1 | transformDomain($domain); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/Api/v1/Transformers/OptInEmailTransformer.php: -------------------------------------------------------------------------------- 1 | transformEmail($email); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/Api/v1/Transformers/OptOutDomainTransformer.php: -------------------------------------------------------------------------------- 1 | transformDomain($domain); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/Api/v1/Transformers/OptOutEmailTransformer.php: -------------------------------------------------------------------------------- 1 | transformEmail($email); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/Api/v1/Transformers/Transformer.php: -------------------------------------------------------------------------------- 1 | toArray(); 31 | $data['id'] = $this->generateId($model->toJson()); 32 | 33 | return $data; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/Api/v1/Transformers/UserTransformer.php: -------------------------------------------------------------------------------- 1 | toArray(); 19 | 20 | return $data; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/Api/v1/Transformers/WhitelistDomainTransformer.php: -------------------------------------------------------------------------------- 1 | transformModel($domain); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/Api/v1/Transformers/WhitelistEmailTransformer.php: -------------------------------------------------------------------------------- 1 | transformModel($email); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/Api/v1/Transformers/WhitelistTransformer.php: -------------------------------------------------------------------------------- 1 | users = $users; 39 | } 40 | 41 | /** 42 | * Execute the console command. 43 | * 44 | * @return mixed 45 | */ 46 | public function handle() 47 | { 48 | $username = $this->ask('Please enter the username'); 49 | $email = $this->ask('Please enter the email address'); 50 | 51 | $password = $this->secret('Please enter the password'); 52 | $password_confirmation = $this->secret('Please confirm the password'); 53 | 54 | if ($password !== $password_confirmation) { 55 | $this->error('Passwords do not match'); 56 | 57 | return; 58 | } 59 | 60 | $user = $this->users->instance([ 61 | 'username' => $username, 62 | 'email' => $email, 63 | ]); 64 | 65 | $user->setPassword($password); 66 | $user->setEnabled(true); 67 | 68 | $this->users->store($user); 69 | 70 | $this->info('User was created'); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /app/Console/Commands/DeleteUndefRecords.php: -------------------------------------------------------------------------------- 1 | whitelistedEmails = $whitelistedEmails; 46 | $this->greylisted = $greylisted; 47 | } 48 | 49 | /** 50 | * Execute the console command. 51 | */ 52 | public function handle() 53 | { 54 | foreach ($this->whitelistedEmails->findUndef() as $record) { 55 | $this->whitelistedEmails->destroy($record); 56 | } 57 | 58 | foreach ($this->greylisted->findUndef() as $record) { 59 | $this->greylisted->destroy($record); 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command(DeleteUndefRecords::class) 30 | ->hourly(); 31 | } 32 | 33 | /** 34 | * Register the Closure based commands for the application. 35 | */ 36 | protected function commands() 37 | { 38 | require base_path('routes/console.php'); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | wantsJson() && $exception instanceof ValidationException) { 49 | return $exception->getResponse(); 50 | } 51 | 52 | return parent::render($request, $exception); 53 | } 54 | 55 | /** 56 | * Convert an authentication exception into an unauthenticated response. 57 | * 58 | * @param \Illuminate\Http\Request $request 59 | * @param \Illuminate\Auth\AuthenticationException $exception 60 | * 61 | * @return \Illuminate\Http\Response 62 | */ 63 | protected function unauthenticated($request, AuthenticationException $exception) 64 | { 65 | if ($request->expectsJson()) { 66 | return response()->json(['error' => 'Unauthenticated.'], 401); 67 | } 68 | 69 | return redirect()->guest(route('login')); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ForgotPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/LoginController.php: -------------------------------------------------------------------------------- 1 | middleware('guest')->except('logout'); 37 | } 38 | 39 | /** 40 | * Get the needed authorization credentials from the request. 41 | * 42 | * @param \Illuminate\Http\Request $request 43 | * 44 | * @return array 45 | */ 46 | protected function credentials(Request $request) 47 | { 48 | $credentials = $request->only($this->username(), 'password'); 49 | $credentials['enabled'] = true; 50 | 51 | return $credentials; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/RegisterController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 38 | } 39 | 40 | /** 41 | * Get a validator for an incoming registration request. 42 | * 43 | * @param array $data 44 | * 45 | * @return \Illuminate\Contracts\Validation\Validator 46 | */ 47 | protected function validator(array $data) 48 | { 49 | return Validator::make($data, [ 50 | 'name' => 'required|string|max:255', 51 | 'email' => 'required|string|email|max:255|unique:users', 52 | 'password' => 'required|string|min:6|confirmed', 53 | ]); 54 | } 55 | 56 | /** 57 | * Create a new user instance after a valid registration. 58 | * 59 | * @param array $data 60 | * 61 | * @return 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/Http/Controllers/Auth/ResetPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | [ 30 | \SQLgreyGUI\Http\Middleware\EncryptCookies::class, 31 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, 32 | \Illuminate\Session\Middleware\StartSession::class, 33 | // \Illuminate\Session\Middleware\AuthenticateSession::class, 34 | \Illuminate\View\Middleware\ShareErrorsFromSession::class, 35 | \SQLgreyGUI\Http\Middleware\VerifyCsrfToken::class, 36 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 37 | \Laravel\Passport\Http\Middleware\CreateFreshApiToken::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' => \SQLgreyGUI\Http\Middleware\RedirectIfAuthenticated::class, 59 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 60 | ]; 61 | } 62 | -------------------------------------------------------------------------------- /app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | check()) { 22 | return redirect('/'); 23 | } 24 | 25 | return $next($request); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrimStrings.php: -------------------------------------------------------------------------------- 1 | sender_domain; 67 | } 68 | 69 | /** 70 | * Set sender_domain. 71 | * 72 | * @param $sender_domain 73 | */ 74 | public function setSenderDomain($sender_domain) 75 | { 76 | $this->sender_domain = $sender_domain; 77 | } 78 | 79 | /** 80 | * Get source. 81 | * 82 | * @return string 83 | */ 84 | public function getSource() 85 | { 86 | return $this->src; 87 | } 88 | 89 | /** 90 | * Set source. 91 | * 92 | * @param $source 93 | */ 94 | public function setSource($source) 95 | { 96 | $this->source = $source; 97 | } 98 | 99 | /** 100 | * Get first seen. 101 | * 102 | * @return Carbon|null 103 | */ 104 | public function getFirstSeen() 105 | { 106 | return $this->first_seen; 107 | } 108 | 109 | /** 110 | * Set first_seen. 111 | * 112 | * @param $first_seen 113 | */ 114 | public function setFirstSeen($first_seen) 115 | { 116 | $this->first_seen = $first_seen; 117 | } 118 | 119 | /** 120 | * Get last seen. 121 | * 122 | * @return Carbon|null 123 | */ 124 | public function getLastSeen() 125 | { 126 | return $this->last_seen; 127 | } 128 | 129 | /** 130 | * Set last_seen. 131 | * 132 | * @param $last_seen 133 | */ 134 | public function setLastSeen($last_seen) 135 | { 136 | $this->last_seen = $last_seen; 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /app/Models/AwlEmail.php: -------------------------------------------------------------------------------- 1 | sender_name; 68 | } 69 | 70 | /** 71 | * Set sender_name. 72 | * 73 | * @param $sender_name 74 | */ 75 | public function setSenderName($sender_name) 76 | { 77 | $this->sender_name = $sender_name; 78 | } 79 | 80 | /** 81 | * Get sender domain. 82 | * 83 | * @return string 84 | */ 85 | public function getSenderDomain() 86 | { 87 | return $this->sender_domain; 88 | } 89 | 90 | /** 91 | * Set sender_domain. 92 | * 93 | * @param $sender_domain 94 | */ 95 | public function setSenderDomain($sender_domain) 96 | { 97 | $this->sender_domain = $sender_domain; 98 | } 99 | 100 | /** 101 | * Get source. 102 | * 103 | * @return string 104 | */ 105 | public function getSource() 106 | { 107 | return $this->src; 108 | } 109 | 110 | /** 111 | * Set source. 112 | * 113 | * @param $source 114 | */ 115 | public function setSource($source) 116 | { 117 | $this->src = $source; 118 | } 119 | 120 | /** 121 | * Get first seen. 122 | * 123 | * @return Carbon|null 124 | */ 125 | public function getFirstSeen() 126 | { 127 | return $this->first_seen; 128 | } 129 | 130 | /** 131 | * Set first_seen. 132 | * 133 | * @param Carbon $first_seen 134 | */ 135 | public function setFirstSeen($first_seen) 136 | { 137 | $this->first_seen = $first_seen; 138 | } 139 | 140 | /** 141 | * Get last_seen. 142 | * 143 | * @return Carbon|null 144 | */ 145 | public function getLastSeen() 146 | { 147 | return $this->last_seen; 148 | } 149 | 150 | /** 151 | * Set last_seen. 152 | * 153 | * @param Carbon $last_seen 154 | */ 155 | public function setLastSeen($last_seen) 156 | { 157 | $this->last_seen = $last_seen; 158 | } 159 | } 160 | -------------------------------------------------------------------------------- /app/Models/Greylist.php: -------------------------------------------------------------------------------- 1 | sender_name; 67 | } 68 | 69 | /** 70 | * Get sender domain. 71 | * 72 | * @return string 73 | */ 74 | public function getSenderDomain() 75 | { 76 | return $this->sender_domain; 77 | } 78 | 79 | /** 80 | * Get source. 81 | * 82 | * @return string 83 | */ 84 | public function getSource() 85 | { 86 | return $this->src; 87 | } 88 | 89 | /** 90 | * Get recipient. 91 | * 92 | * @return string 93 | */ 94 | public function getRecipient() 95 | { 96 | return $this->rcpt; 97 | } 98 | 99 | /** 100 | * Get first seen. 101 | * 102 | * @return Carbon|null 103 | */ 104 | public function getFirstSeen() 105 | { 106 | return $this->first_seen; 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /app/Models/OptDomain.php: -------------------------------------------------------------------------------- 1 | domain; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /app/Models/OptEmail.php: -------------------------------------------------------------------------------- 1 | email; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /app/Models/OptInDomain.php: -------------------------------------------------------------------------------- 1 | connection = config('sqlgreygui.connection'); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/Models/User.php: -------------------------------------------------------------------------------- 1 | id); 44 | } 45 | 46 | /** 47 | * get username. 48 | * 49 | * @return string 50 | */ 51 | public function getUsername() 52 | { 53 | return $this->username; 54 | } 55 | 56 | /** 57 | * get password. 58 | * 59 | * @return string 60 | */ 61 | public function getPassword() 62 | { 63 | return $this->password; 64 | } 65 | 66 | /** 67 | * get email. 68 | * 69 | * @return string 70 | */ 71 | public function getEmail() 72 | { 73 | return $this->email; 74 | } 75 | 76 | /** 77 | * get updated at. 78 | * 79 | * @return \Carbon\Carbon 80 | */ 81 | public function getUpdatedAt() 82 | { 83 | return new Carbon($this->updated_at); 84 | } 85 | 86 | /** 87 | * get created at. 88 | * 89 | * @return \Carbon\Carbon 90 | */ 91 | public function getCreatedAt() 92 | { 93 | return new Carbon($this->created_at); 94 | } 95 | 96 | /** 97 | * is enabled. 98 | * 99 | * @return bool 100 | */ 101 | public function isEnabled() 102 | { 103 | return ($this->enabled == true) ? true : false; 104 | } 105 | 106 | /** 107 | * set username. 108 | * 109 | * @param string $username 110 | */ 111 | public function setUsername($username) 112 | { 113 | $this->username = $username; 114 | } 115 | 116 | /** 117 | * set password. 118 | * 119 | * @param string $password 120 | */ 121 | public function setPassword($password) 122 | { 123 | $this->password = Hash::make($password); 124 | } 125 | 126 | /** 127 | * set email. 128 | * 129 | * @param string $email 130 | */ 131 | public function setEmail($email) 132 | { 133 | $this->email = $email; 134 | } 135 | 136 | /** 137 | * set enabled. 138 | * 139 | * @param bool $enabled 140 | */ 141 | public function setEnabled($enabled) 142 | { 143 | if ($enabled === true) { 144 | $this->enabled = true; 145 | } else { 146 | $this->enabled = false; 147 | } 148 | } 149 | } 150 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | app->environment('local')) { 26 | $this->app->register(\Barryvdh\Debugbar\ServiceProvider::class); 27 | $this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class); 28 | } 29 | 30 | if ($this->app->environment('local', 'testing')) { 31 | $this->app->register(\Laravel\Dusk\DuskServiceProvider::class); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/Providers/AuthServiceProvider.php: -------------------------------------------------------------------------------- 1 | registerPolicies(); 27 | 28 | Passport::routes(); 29 | 30 | Passport::enableImplicitGrant(); 31 | 32 | Passport::tokensExpireIn(Carbon::now()->addDays(15)); 33 | 34 | Passport::refreshTokensExpireIn(Carbon::now()->addDays(30)); 35 | 36 | // Custom User Provider 37 | Auth::provider('sqlgreygui', function ($app, array $config) { 38 | // Return an instance of Illuminate\Contracts\Auth\UserProvider... 39 | 40 | return $app->make(UserProviderInterface::class); 41 | }); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/Providers/BroadcastServiceProvider.php: -------------------------------------------------------------------------------- 1 | Implementation. 11 | * 12 | * @var array 13 | */ 14 | private static $bindings = [ 15 | \SQLgreyGUI\Repositories\GreylistRepositoryInterface::class => \SQLgreyGUI\Repositories\GreylistRepositoryEloquent::class, 16 | \SQLgreyGUI\Repositories\AwlEmailRepositoryInterface::class => \SQLgreyGUI\Repositories\AwlEmailRepositoryEloquent::class, 17 | \SQLgreyGUI\Repositories\AwlDomainRepositoryInterface::class => \SQLgreyGUI\Repositories\AwlDomainRepositoryEloquent::class, 18 | \SQLgreyGUI\Repositories\OptOutEmailRepositoryInterface::class => \SQLgreyGUI\Repositories\OptOutEmailRepositoryEloquent::class, 19 | \SQLgreyGUI\Repositories\OptOutDomainRepositoryInterface::class => \SQLgreyGUI\Repositories\OptOutDomainRepositoryEloquent::class, 20 | \SQLgreyGUI\Repositories\OptInEmailRepositoryInterface::class => \SQLgreyGUI\Repositories\OptInEmailRepositoryEloquent::class, 21 | \SQLgreyGUI\Repositories\OptInDomainRepositoryInterface::class => \SQLgreyGUI\Repositories\OptInDomainRepositoryEloquent::class, 22 | \SQLgreyGUI\Repositories\UserRepositoryInterface::class => \SQLgreyGUI\Repositories\UserRepositoryEloquent::class, 23 | \SQLgreyGUI\Repositories\UserProviderInterface::class => \SQLgreyGUI\Repositories\UserProviderEloquent::class, 24 | ]; 25 | 26 | /** 27 | * Bootstrap the application services. 28 | */ 29 | public function boot() 30 | { 31 | } 32 | 33 | /** 34 | * Register the application services. 35 | */ 36 | public function register() 37 | { 38 | foreach (self::$bindings as $abstract => $concrete) { 39 | $this->app->singleton($abstract, $concrete); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | mapApiRoutes(); 40 | 41 | $this->mapWebRoutes(); 42 | } 43 | 44 | /** 45 | * Define the "web" routes for the application. 46 | * 47 | * These routes all receive session state, CSRF protection, etc. 48 | */ 49 | protected function mapWebRoutes() 50 | { 51 | Route::middleware('web') 52 | ->namespace($this->namespace) 53 | ->group(base_path('routes/web.php')); 54 | } 55 | 56 | /** 57 | * Define the "api" routes for the application. 58 | * 59 | * These routes are typically stateless. 60 | */ 61 | protected function mapApiRoutes() 62 | { 63 | Route::prefix('api') 64 | ->middleware('api') 65 | ->namespace($this->namespace_api) 66 | ->group(base_path('routes/api.php')); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /app/Repositories/AwlDomainRepositoryEloquent.php: -------------------------------------------------------------------------------- 1 | model = $domain; 12 | } 13 | 14 | public function findAll() 15 | { 16 | $data = $this->model->orderBy('sender_domain', 'asc')->get(); 17 | 18 | return $data; 19 | } 20 | 21 | public function findByDomainSource($domain, $source) 22 | { 23 | $domain = $this->model->where('sender_domain', $domain) 24 | ->where('src', $source) 25 | ->get() 26 | ->first(); 27 | 28 | return $domain; 29 | } 30 | 31 | public function store($domain) 32 | { 33 | return $this->model->insert(array( 34 | 'sender_domain' => $domain->getSenderDomain(), 35 | 'src' => $domain->getSource(), 36 | 'first_seen' => $domain->getFirstSeen(), 37 | 'last_seen' => $domain->getLastSeen(), 38 | )); 39 | } 40 | 41 | public function destroy($domain) 42 | { 43 | return $this->model->where('sender_domain', $domain->getSenderDomain()) 44 | ->where('src', $domain->getSource()) 45 | ->delete(); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /app/Repositories/AwlDomainRepositoryInterface.php: -------------------------------------------------------------------------------- 1 | model = $email; 12 | } 13 | 14 | public function findAll() 15 | { 16 | $data = $this->model->orderBy('sender_name', 'asc')->get(); 17 | 18 | return $data; 19 | } 20 | 21 | public function findByNameDomainSource($name, $domain, $source) 22 | { 23 | $email = $this->model->where('sender_name', $name) 24 | ->where('sender_domain', $domain) 25 | ->where('src', $source) 26 | ->get() 27 | ->first(); 28 | 29 | return $email; 30 | } 31 | 32 | public function findUndef() 33 | { 34 | return $this->model->where([ 35 | 'sender_name' => '-undef-', 36 | 'sender_domain' => '-undef-', 37 | ])->get(); 38 | } 39 | 40 | public function store($email) 41 | { 42 | return $this->model->insert(array( 43 | 'sender_name' => $email->getSenderName(), 44 | 'sender_domain' => $email->getSenderDomain(), 45 | 'src' => $email->getSource(), 46 | 'first_seen' => $email->getFirstSeen(), 47 | 'last_seen' => $email->getLastSeen(), 48 | )); 49 | } 50 | 51 | public function destroy($email) 52 | { 53 | return $this->model->where('sender_name', $email->getSenderName()) 54 | ->where('sender_domain', $email->getSenderDomain()) 55 | ->where('src', $email->getSource()) 56 | ->delete(); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /app/Repositories/AwlEmailRepositoryInterface.php: -------------------------------------------------------------------------------- 1 | model->all(); 10 | 11 | return $data; 12 | } 13 | 14 | /** 15 | * Find by. 16 | * 17 | * @param array $criteria 18 | * 19 | * @return \SQLgreyGUI\Models\Greylist 20 | */ 21 | public function findBy(array $criteria) 22 | { 23 | return $this->model->where($criteria)->get(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/Repositories/BaseRepositoryInterface.php: -------------------------------------------------------------------------------- 1 | model = $greylist; 13 | } 14 | 15 | public function findAll() 16 | { 17 | $data = $this->model->orderBy('first_seen', 'desc')->get(); 18 | 19 | return $data; 20 | } 21 | 22 | public function findBetween(Carbon $start, Carbon $end = null) 23 | { 24 | if (is_null($end)) { 25 | $end = Carbon::now(); 26 | } 27 | 28 | $data = $this->model->where('first_seen', '>=', $start->toDateTimeString()) 29 | ->where('first_seen', '<=', $end->toDateTimeString()) 30 | ->get(); 31 | 32 | return $data; 33 | } 34 | 35 | public function findUndef() 36 | { 37 | return $this->model->where([ 38 | 'sender_name' => '-undef-', 39 | 'sender_domain' => '-undef-', 40 | ])->get(); 41 | } 42 | 43 | public function destroy($greylist) 44 | { 45 | return $this->model->where('sender_name', $greylist->getSenderName()) 46 | ->where('sender_domain', $greylist->getSenderDomain()) 47 | ->where('src', $greylist->getSource()) 48 | ->where('rcpt', $greylist->getRecipient()) 49 | ->delete(); 50 | } 51 | 52 | public function destroyOlderThan(Carbon $date) 53 | { 54 | return $this->model->where('first_seen', '<=', $date->toDateTimeString()) 55 | ->delete(); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /app/Repositories/GreylistRepositoryInterface.php: -------------------------------------------------------------------------------- 1 | model = app('SQLgreyGUI\Models\\'.$this->model_class); 10 | } 11 | 12 | public function findAll() 13 | { 14 | $data = $this->model->orderBy('domain', 'asc')->get(); 15 | 16 | return $data; 17 | } 18 | 19 | public function findByDomain($domain) 20 | { 21 | return $this->model->where('domain', $domain) 22 | ->get() 23 | ->first(); 24 | } 25 | 26 | public function destroy($domain) 27 | { 28 | return $this->model->where('domain', $domain->getDomain())->delete(); 29 | } 30 | 31 | public function store($domain) 32 | { 33 | return $this->model->insert([ 34 | 'domain' => $domain->getDomain(), 35 | ]); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/Repositories/OptEmailRepositoryInterface.php: -------------------------------------------------------------------------------- 1 | model = app('SQLgreyGUI\Models\\'.$this->model_class); 10 | } 11 | 12 | public function findAll() 13 | { 14 | $data = $this->model->orderBy('email', 'asc')->get(); 15 | 16 | return $data; 17 | } 18 | 19 | public function findByEmail($email) 20 | { 21 | return $this->model->where('email', $email) 22 | ->get() 23 | ->first(); 24 | } 25 | 26 | public function destroy($email) 27 | { 28 | return $this->model->where('email', $email->getEmail())->delete(); 29 | } 30 | 31 | public function store($email) 32 | { 33 | return $this->model->insert([ 34 | 'email' => $email->getEmail(), 35 | ]); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/Repositories/OptInDomainRepositoryEloquent.php: -------------------------------------------------------------------------------- 1 | make('hash'); 14 | 15 | parent::__construct($hasher, $model); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app/Repositories/UserProviderInterface.php: -------------------------------------------------------------------------------- 1 | model = $user; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /app/Repositories/UserRepositoryInterface.php: -------------------------------------------------------------------------------- 1 | make(Illuminate\Contracts\Console\Kernel::class); 32 | 33 | $status = $kernel->handle( 34 | $input = new Symfony\Component\Console\Input\ArgvInput, 35 | new Symfony\Component\Console\Output\ConsoleOutput 36 | ); 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Shutdown The Application 41 | |-------------------------------------------------------------------------- 42 | | 43 | | Once Artisan has finished running, we will fire off the shutdown events 44 | | so that any final work may be done by the application before we shut 45 | | down the process. This is the last thing to happen to the request. 46 | | 47 | */ 48 | 49 | $kernel->terminate($input, $status); 50 | 51 | exit($status); 52 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | singleton( 30 | Illuminate\Contracts\Http\Kernel::class, 31 | SQLgreyGUI\Http\Kernel::class 32 | ); 33 | 34 | $app->singleton( 35 | Illuminate\Contracts\Console\Kernel::class, 36 | SQLgreyGUI\Console\Kernel::class 37 | ); 38 | 39 | $app->singleton( 40 | Illuminate\Contracts\Debug\ExceptionHandler::class, 41 | SQLgreyGUI\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 | -------------------------------------------------------------------------------- /bootstrap/autoload.php: -------------------------------------------------------------------------------- 1 | =5.6.4", 9 | "doctrine/dbal": "^2.5", 10 | "laravel/framework": "5.4.*", 11 | "laravel/passport": "^2.0", 12 | "laravel/tinker": "~1.0", 13 | "lbausch/laravel-cornerstone": "^5.1", 14 | "league/fractal": "^0.16.0", 15 | "rcrowe/twigbridge": "^0.9.4", 16 | "roave/security-advisories": "dev-master", 17 | "spatie/laravel-tail": "^1.1.1" 18 | }, 19 | "require-dev": { 20 | "barryvdh/laravel-debugbar": "~2.0", 21 | "barryvdh/laravel-ide-helper": "^2.1", 22 | "fzaninotto/faker": "~1.4", 23 | "laravel/dusk": "^1.0", 24 | "laravel/homestead": "^5.0", 25 | "mockery/mockery": "0.9.*", 26 | "phpunit/phpunit": "~5.7" 27 | }, 28 | "autoload": { 29 | "classmap": [ 30 | "database" 31 | ], 32 | "psr-4": { 33 | "SQLgreyGUI\\": "app/" 34 | } 35 | }, 36 | "autoload-dev": { 37 | "psr-4": { 38 | "Tests\\": "tests/" 39 | } 40 | }, 41 | "scripts": { 42 | "post-root-package-install": [ 43 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" 44 | ], 45 | "post-create-project-cmd": [ 46 | "@php artisan key:generate" 47 | ], 48 | "post-install-cmd": [ 49 | "Illuminate\\Foundation\\ComposerScripts::postInstall", 50 | "@php artisan optimize" 51 | ], 52 | "post-update-cmd": [ 53 | "Illuminate\\Foundation\\ComposerScripts::postUpdate", 54 | "@php artisan optimize" 55 | ] 56 | }, 57 | "config": { 58 | "preferred-install": "dist", 59 | "sort-packages": true, 60 | "optimize-autoloader": true 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /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 | // 40 | ], 41 | ], 42 | 43 | 'redis' => [ 44 | 'driver' => 'redis', 45 | 'connection' => 'default', 46 | ], 47 | 48 | 'log' => [ 49 | 'driver' => 'log', 50 | ], 51 | 52 | 'null' => [ 53 | 'driver' => 'null', 54 | ], 55 | 56 | ], 57 | 58 | ]; 59 | -------------------------------------------------------------------------------- /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' => 'laravel', 90 | 91 | ]; 92 | -------------------------------------------------------------------------------- /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_KEY'), 61 | 'secret' => env('AWS_SECRET'), 62 | 'region' => env('AWS_REGION'), 63 | 'bucket' => env('AWS_BUCKET'), 64 | ], 65 | 66 | ], 67 | 68 | ]; 69 | -------------------------------------------------------------------------------- /config/queue.php: -------------------------------------------------------------------------------- 1 | env('QUEUE_DRIVER', 'sync'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Queue Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may configure the connection information for each server that 26 | | is used by your application. A default configuration has been added 27 | | for each back-end shipped with Laravel. You are free to add more. 28 | | 29 | */ 30 | 31 | 'connections' => [ 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' => 'your-public-key', 54 | 'secret' => 'your-secret-key', 55 | 'prefix' => 'https://sqs.us-east-1.amazonaws.com/your-account-id', 56 | 'queue' => 'your-queue-name', 57 | '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 | -------------------------------------------------------------------------------- /config/services.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' => SQLgreyGUI\Models\User::class, 34 | 'key' => env('STRIPE_KEY'), 35 | 'secret' => env('STRIPE_SECRET'), 36 | ], 37 | 38 | ]; 39 | -------------------------------------------------------------------------------- /config/sqlgreygui.php: -------------------------------------------------------------------------------- 1 | env('SQLGREY_DB_CONNECTION', 'sqlgrey'), 5 | ]; 6 | -------------------------------------------------------------------------------- /config/tail.php: -------------------------------------------------------------------------------- 1 | [ 6 | 7 | /* 8 | * The environment name. You can use this value in the tail command. 9 | */ 10 | 'production' => [ 11 | 12 | /* 13 | * The hostname of the server where the logs are located 14 | */ 15 | 'host' => '', 16 | 17 | /* 18 | * The username to be used when connecting to the server where the logs are located 19 | */ 20 | 'username' => '', 21 | 22 | /* 23 | * The full path to the directory where the logs are located 24 | */ 25 | 'logDirectory' => '', 26 | ], 27 | ], 28 | ]; 29 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | -------------------------------------------------------------------------------- /database/factories/ModelFactory.php: -------------------------------------------------------------------------------- 1 | define(SQLgreyGUI\Models\User::class, function (Faker\Generator $faker) { 16 | static $password; 17 | 18 | return [ 19 | 'username' => $faker->userName, 20 | 'email' => $faker->unique()->safeEmail, 21 | 'password' => $password ?: $password = bcrypt('joh316'), 22 | 'enabled' => true, 23 | 'remember_token' => str_random(10), 24 | ]; 25 | }); 26 | 27 | $factory->define(SQLgreyGUI\Models\Greylist::class, function (Faker\Generator $faker) { 28 | return [ 29 | 'sender_name' => $faker->userName, 30 | 'sender_domain' => $faker->safeEmailDomain, 31 | 'src' => $faker->localIpv4, 32 | 'rcpt' => $faker->safeEmail, 33 | 'first_seen' => $faker->dateTime, 34 | ]; 35 | }); 36 | 37 | $factory->define(SQLgreyGUI\Models\AwlEmail::class, function (Faker\Generator $faker) { 38 | return [ 39 | 'sender_name' => $faker->unique()->userName, 40 | 'sender_domain' => $faker->safeEmailDomain, 41 | 'src' => $faker->ipv4, 42 | 'first_seen' => $faker->dateTime, 43 | 'last_seen' => $faker->dateTime, 44 | ]; 45 | }); 46 | 47 | $factory->define(SQLgreyGUI\Models\AwlDomain::class, function (Faker\Generator $faker) { 48 | return [ 49 | 'sender_domain' => $faker->safeEmailDomain, 50 | 'src' => $faker->ipv4, 51 | 'first_seen' => $faker->dateTime, 52 | 'last_seen' => $faker->dateTime, 53 | ]; 54 | }); 55 | 56 | $factory->define(SQLgreyGUI\Models\OptOutEmail::class, function (Faker\Generator $faker) { 57 | return [ 58 | 'email' => $faker->unique()->userName.'@'.$faker->safeEmailDomain, 59 | ]; 60 | }); 61 | 62 | $factory->define(SQLgreyGUI\Models\OptOutDomain::class, function (Faker\Generator $faker) { 63 | return [ 64 | 'domain' => $faker->domainWord.$faker->unique()->randomNumber.$faker->safeEmailDomain, 65 | ]; 66 | }); 67 | 68 | $factory->define(SQLgreyGUI\Models\OptInEmail::class, function (Faker\Generator $faker) { 69 | return [ 70 | 'email' => $faker->unique()->userName.'@'.$faker->safeEmailDomain, 71 | ]; 72 | }); 73 | 74 | $factory->define(SQLgreyGUI\Models\OptInDomain::class, function (Faker\Generator $faker) { 75 | return [ 76 | 'domain' => $faker->domainWord.$faker->unique()->randomNumber.$faker->safeEmailDomain, 77 | ]; 78 | }); 79 | -------------------------------------------------------------------------------- /database/migrations/2014_07_22_213441_create_users_table.php: -------------------------------------------------------------------------------- 1 | increments('id')->unsigned(); 15 | 16 | $table->string('username'); 17 | $table->string('password'); 18 | $table->string('email'); 19 | 20 | $table->boolean('enabled')->default(false); 21 | 22 | $table->rememberToken(); 23 | $table->timestamps(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | */ 30 | public function down() 31 | { 32 | Schema::drop('users'); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /database/migrations/2016_03_24_205059_make_users_username_column_unique.php: -------------------------------------------------------------------------------- 1 | unique('username'); 15 | }); 16 | } 17 | 18 | /** 19 | * Reverse the migrations. 20 | */ 21 | public function down() 22 | { 23 | Schema::table('users', function (Blueprint $table) { 24 | $table->dropUnique('users_username_unique'); 25 | }); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /database/migrations/2017_03_20_100000_create_password_resets_table.php: -------------------------------------------------------------------------------- 1 | string('email')->index(); 16 | $table->string('token'); 17 | $table->timestamp('created_at')->nullable(); 18 | }); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | */ 24 | public function down() 25 | { 26 | Schema::dropIfExists('password_resets'); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /database/seeds/AwlDomainTableSeeder.php: -------------------------------------------------------------------------------- 1 | create(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /database/seeds/AwlEmailTableSeeder.php: -------------------------------------------------------------------------------- 1 | create(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call(UsersTableSeeder::class); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /database/seeds/GreylistTableSeeder.php: -------------------------------------------------------------------------------- 1 | create(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /database/seeds/OptInDomainTableSeeder.php: -------------------------------------------------------------------------------- 1 | create(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /database/seeds/OptInEmailTableSeeder.php: -------------------------------------------------------------------------------- 1 | create(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /database/seeds/OptOutDomainTableSeeder.php: -------------------------------------------------------------------------------- 1 | create(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /database/seeds/OptOutEmailTableSeeder.php: -------------------------------------------------------------------------------- 1 | create(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /database/seeds/SQLgreySeeder.php: -------------------------------------------------------------------------------- 1 | call(GreylistTableSeeder::class); 21 | $this->call(AwlEmailTableSeeder::class); 22 | $this->call(AwlDomainTableSeeder::class); 23 | $this->call(OptOutEmailTableSeeder::class); 24 | $this->call(OptOutDomainTableSeeder::class); 25 | $this->call(OptInEmailTableSeeder::class); 26 | $this->call(OptInDomainTableSeeder::class); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /database/seeds/UsersTableSeeder.php: -------------------------------------------------------------------------------- 1 | users = $users; 23 | } 24 | 25 | public function run() 26 | { 27 | $user = $this->users->instance(); 28 | 29 | $user->setUsername('admin'); 30 | $user->setPassword('joh316'); 31 | $user->setEmail('root@localhost.local'); 32 | $user->setEnabled(true); 33 | 34 | // Save the new user 35 | $this->users->store($user); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /docs/_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman 2 | title: SQLgreyGUI 3 | description: Web interface for SQLgrey built on Laravel 5 4 | show_downloads: "true" 5 | -------------------------------------------------------------------------------- /docs/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lbausch/SQLgreyGUI/e870588475349b79fa4aa97373a968d209661053/docs/demo.gif -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | ## Features 2 | * Dashboard: Quick overview of emails / domains in greylist, whitelist, opt-out and opt-in 3 | * Greylist: Delete entries or move them to the whitelist 4 | * Whitelist: Add sender emails or sender domains to prevent them from being greylisted and delivered directly 5 | * Opt-Out: Define emails or domains you don't want greylisting to be enabled for 6 | * Opt-In: Define emails or domains for which you want to enforce greylisting permanently 7 | * Option of using separate databases for SQLgrey and the application itself. This way you can maintain a user database in a single place and use it with all installations of SQLgreyGUI. In addition you don't need to alter the SQLgrey database at all. 8 | 9 | 10 | ## Requirements 11 | * Working SQLgrey setup 12 | * Webserver (e.g. Apache) and Database (e.g. MySQL) 13 | * PHP >= 5.6.4 14 | 15 | 16 | ## Installation 17 | * Download and extract [master.zip](https://github.com/lbausch/SQLgreyGUI/archive/master.zip) or clone the repository (`git clone https://github.com/lbausch/SQLgreyGUI.git`) 18 | * Make your webserver use the `public` directory as document root 19 | * Copy `.env.example` to `.env` and adjust it to your needs (`APP_URL`, `APP_TIMEZONE`, `APP_KEY` and database settings) 20 | * Run `composer install --no-dev` to install all necessary PHP dependencies 21 | * Set application key with `php artisan key:generate` 22 | * Run `php artisan migrate --force` to create the database tables 23 | * Install Laravel Passport: `php artisan passport:install` 24 | * Install and generate frontend assets: `yarn install && yarn run prod` (or `npm install && npm run prod`) 25 | * Create user: `php artisan sqlgreygui:user` 26 | * Add cron entry `* * * * * php /path/to/sqlgreygui/artisan schedule:run >> /dev/null 2>&1` which will delete _undef_ records from the database 27 | 28 | 29 | ## Using separate databases for SQLgrey and SQLgreyGUI 30 | Adjust the values starting with `SQLGREY_DB_` in the `.env` file. 31 | Refer to the `.env.example` file for possible entries. 32 | The default configuration in `config/database.php` is designed to work with MySQL out of the box. 33 | If you need different settings, e.g. for PostgreSQL, take a look at the existing config blocks in `config/database.php`. 34 | Additional documentation for available configuration possibilities may be found in the [Laravel documentation](https://laravel.com/docs/5.4/database#configuration). 35 | 36 | Follow [@SQLgreyGUI](https://twitter.com/sqlgreygui) on Twitter 37 | -------------------------------------------------------------------------------- /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": "cp resources/assets/js/vue-strap/utils.js node_modules/vue-strap/src/utils/utils.js && cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", 11 | "convert": "babel --presets es2015 node_modules/vue-strap/src/utils/utils.js > resources/assets/js/vue-strap/utils.js", 12 | "postinstall": "yarn run prod" 13 | }, 14 | "devDependencies": { 15 | "axios": "^0.16.0", 16 | "babel-cli": "^6.24.0", 17 | "babel-preset-es2015": "^6.24.0", 18 | "bootstrap": "4.0.0-alpha.6", 19 | "browser-sync": "^2.18.12", 20 | "browser-sync-webpack-plugin": "^1.1.4", 21 | "cross-env": "^5.0.0", 22 | "eslint": "^4.1.1", 23 | "eslint-config-standard": "^10.0.0", 24 | "eslint-plugin-html": "^3.0.0", 25 | "eslint-plugin-import": "^2.2.0", 26 | "eslint-plugin-node": "^5.1.0", 27 | "eslint-plugin-promise": "^3.5.0", 28 | "eslint-plugin-standard": "^3.0.1", 29 | "font-awesome": "^4.7.0", 30 | "laravel-mix": "^1.0.7", 31 | "lodash": "^4.17.4", 32 | "simple-line-icons": "^2.4.1", 33 | "uglify-js": "git+https://github.com/mishoo/UglifyJS2.git#harmony", 34 | "vue": "^2.2.4", 35 | "vue-events": "^3.0.1", 36 | "vue-focus": "^2.1.0", 37 | "vue-router": "^2.3.0", 38 | "vue-strap": "github:wffranco/vue-strap", 39 | "vue-sweetalert": "^0.1.17", 40 | "vuex": "^2.2.1" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /phpunit.dusk.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | ./tests/Browser 14 | 15 | 16 | 17 | 18 | ./app 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Redirect Trailing Slashes If Not A Folder... 9 | RewriteCond %{REQUEST_FILENAME} !-d 10 | RewriteRule ^(.*)/$ /$1 [L,R=301] 11 | 12 | # Handle Front Controller... 13 | RewriteCond %{REQUEST_FILENAME} !-d 14 | RewriteCond %{REQUEST_FILENAME} !-f 15 | RewriteRule ^ index.php [L] 16 | 17 | # Handle Authorization Header 18 | RewriteCond %{HTTP:Authorization} . 19 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 20 | 21 | -------------------------------------------------------------------------------- /public/assets/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lbausch/SQLgreyGUI/e870588475349b79fa4aa97373a968d209661053/public/favicon.ico -------------------------------------------------------------------------------- /public/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lbausch/SQLgreyGUI/e870588475349b79fa4aa97373a968d209661053/public/images/logo.png -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | /* 11 | |-------------------------------------------------------------------------- 12 | | Register The Auto Loader 13 | |-------------------------------------------------------------------------- 14 | | 15 | | Composer provides a convenient, automatically generated class loader for 16 | | our application. We just need to utilize it! We'll simply require it 17 | | into the script here so that we don't have to worry about manual 18 | | loading any of our classes later on. It feels great to relax. 19 | | 20 | */ 21 | 22 | require __DIR__.'/../bootstrap/autoload.php'; 23 | 24 | /* 25 | |-------------------------------------------------------------------------- 26 | | Turn On The Lights 27 | |-------------------------------------------------------------------------- 28 | | 29 | | We need to illuminate PHP development, so let us turn on the lights. 30 | | This bootstraps the framework and gets it ready for use, then it 31 | | will load up this application so that we can run it and send 32 | | the responses back to the browser and delight our users. 33 | | 34 | */ 35 | 36 | $app = require_once __DIR__.'/../bootstrap/app.php'; 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Run The Application 41 | |-------------------------------------------------------------------------- 42 | | 43 | | Once we have the application, we can handle the incoming request 44 | | through the kernel, and send the associated response back to 45 | | the client's browser allowing them to enjoy the creative 46 | | and wonderful application we have prepared for them. 47 | | 48 | */ 49 | 50 | $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); 51 | 52 | $response = $kernel->handle( 53 | $request = Illuminate\Http\Request::capture() 54 | ); 55 | 56 | $response->send(); 57 | 58 | $kernel->terminate($request, $response); 59 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /public/web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /resources/assets/images/logo.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lbausch/SQLgreyGUI/e870588475349b79fa4aa97373a968d209661053/resources/assets/images/logo.xcf -------------------------------------------------------------------------------- /resources/assets/js/App.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 10 | -------------------------------------------------------------------------------- /resources/assets/js/app.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App' 3 | import VueEvents from 'vue-events' 4 | import VueRouter from './router' 5 | import Vuex from 'vuex' 6 | import VueSweetAlert from 'vue-sweetalert' 7 | import Alert from './utils/Alert' 8 | import { focus } from 'vue-focus' 9 | 10 | window._ = require('lodash') 11 | window.axios = require('axios') 12 | 13 | window.axios.defaults.headers.common = { 14 | 'Accept': 'application/json', 15 | 'X-CSRF-TOKEN': window.Laravel.csrfToken, 16 | 'X-Requested-With': 'XMLHttpRequest' 17 | } 18 | 19 | Vue.directive('focus', focus) 20 | Vue.use(VueEvents) 21 | Vue.use(Vuex) 22 | Vue.use(VueSweetAlert) 23 | Vue.use(Alert) 24 | 25 | const store = new Vuex.Store({ 26 | state: { 27 | user: {} 28 | }, 29 | getters: { 30 | // user: state => { 31 | // return state.user 32 | // } 33 | }, 34 | mutations: { 35 | user (state, user) { 36 | state.user = user 37 | } 38 | } 39 | }) 40 | 41 | /* eslint-disable no-new, no-unused-vars */ 42 | let vue = new Vue({ 43 | el: '#app', 44 | router: VueRouter, 45 | store, 46 | directives: {focus: focus}, 47 | template: '', 48 | components: {App} 49 | }) 50 | -------------------------------------------------------------------------------- /resources/assets/js/components/Breadcrumb.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 30 | -------------------------------------------------------------------------------- /resources/assets/js/components/Footer.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | -------------------------------------------------------------------------------- /resources/assets/js/components/Navbar.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 15 | -------------------------------------------------------------------------------- /resources/assets/js/components/passport/AuthorizedClients.vue: -------------------------------------------------------------------------------- 1 | 41 | 42 | 90 | -------------------------------------------------------------------------------- /resources/assets/js/containers/Full.vue: -------------------------------------------------------------------------------- 1 | 34 | 35 | 101 | -------------------------------------------------------------------------------- /resources/assets/js/public.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lbausch/SQLgreyGUI/e870588475349b79fa4aa97373a968d209661053/resources/assets/js/public.js -------------------------------------------------------------------------------- /resources/assets/js/utils/Alert.js: -------------------------------------------------------------------------------- 1 | const Alert = {} 2 | 3 | Alert.install = function (Vue) { 4 | Vue.prototype.$alertSuccess = function (text, options) { 5 | let defaultOptions = { 6 | type: 'success', 7 | title: 'Success!', 8 | text: text, 9 | timer: 3000 10 | } 11 | 12 | this.$swal(_.merge({}, defaultOptions, options)) 13 | .then(() => { 14 | // resolve() 15 | }) 16 | .catch(() => { 17 | // reject() 18 | }) 19 | } 20 | } 21 | 22 | export default Alert 23 | -------------------------------------------------------------------------------- /resources/assets/js/utils/ValidationErrors.js: -------------------------------------------------------------------------------- 1 | export default class ValidationErrors { 2 | constructor (errors) { 3 | this.ValidationErrors = {} 4 | 5 | if (errors) { 6 | this.set(errors) 7 | } 8 | } 9 | 10 | has (field) { 11 | return this.ValidationErrors.hasOwnProperty(field) 12 | } 13 | 14 | hasGeneral () { 15 | for (let field in this.ValidationErrors) { 16 | if (this.ValidationErrors.hasOwnProperty(field) && field === '*') { 17 | return true 18 | } 19 | } 20 | 21 | return false 22 | } 23 | 24 | first (field) { 25 | if (!this.has(field)) { 26 | return null 27 | } 28 | 29 | return this.ValidationErrors[field][0] 30 | } 31 | 32 | firstGeneral () { 33 | if (!this.hasGeneral()) { 34 | return null 35 | } 36 | 37 | return this.first('*') 38 | } 39 | 40 | add (field, messages) { 41 | if (!(field in this.ValidationErrors)) { 42 | this.ValidationErrors[field] = [] 43 | } 44 | 45 | this.ValidationErrors[field] = _.concat(this.ValidationErrors[field], messages) 46 | } 47 | 48 | set (errors) { 49 | this.clear() 50 | 51 | for (let field in errors) { 52 | if (errors.hasOwnProperty(field)) { 53 | this.add(field, errors[field]) 54 | } 55 | } 56 | 57 | // Trigger reactivity 58 | this.ValidationErrors = _.clone(this.ValidationErrors) 59 | } 60 | 61 | clear () { 62 | this.ValidationErrors = {} 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /resources/assets/js/views/OptInDomains.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 79 | -------------------------------------------------------------------------------- /resources/assets/js/views/OptInEmails.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 79 | -------------------------------------------------------------------------------- /resources/assets/js/views/OptOutDomains.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 79 | -------------------------------------------------------------------------------- /resources/assets/js/views/OptOutEmails.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 79 | -------------------------------------------------------------------------------- /resources/assets/js/views/SettingsApi.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | 40 | -------------------------------------------------------------------------------- /resources/assets/sass/_bootstrap-variables.scss: -------------------------------------------------------------------------------- 1 | // Bootstrap overrides 2 | 3 | // Colors 4 | // 5 | // Grayscale and brand colors for use across Bootstrap. 6 | 7 | $gray-dark: #263238; 8 | $gray: #607d8b; 9 | $gray-light: #b0bec5; 10 | $gray-lighter: #cfd8dc; 11 | $gray-lightest: #eceff1; 12 | 13 | $brand-primary: #20a8d8; 14 | $brand-success: #4dbd74; 15 | $brand-info: #63c2de; 16 | $brand-warning: #f8cb00; 17 | $brand-danger: #f86c6b; 18 | 19 | // Options 20 | // 21 | // Quickly modify global styling by enabling or disabling optional features. 22 | 23 | $enable-transitions: true; 24 | $enable-rounded: false; 25 | 26 | // Spacing 27 | // 28 | // Control the default styling of most Bootstrap elements by modifying these 29 | // variables. Mostly focused on spacing. 30 | 31 | $spacer: 1rem !default; 32 | $spacer-x: $spacer !default; 33 | $spacer-y: $spacer !default; 34 | $spacers: ( 35 | q: ( 36 | x: ($spacer-x * 0.25), 37 | y: ($spacer-y * 0.25) 38 | ), 39 | h: ( 40 | x: ($spacer-x * 0.5), 41 | y: ($spacer-y * 0.5) 42 | ), 43 | 0: ( 44 | x: 0, 45 | y: 0 46 | ), 47 | 1: ( 48 | x: $spacer-x, 49 | y: $spacer-y 50 | ), 51 | 2: ( 52 | x: ($spacer-x * 1.5), 53 | y: ($spacer-y * 1.5) 54 | ), 55 | 3: ( 56 | x: ($spacer-x * 3), 57 | y: ($spacer-y * 3) 58 | ) 59 | ); 60 | 61 | // Body 62 | // 63 | // Settings for the `` element. 64 | 65 | $body-bg: #e4e5e6; 66 | 67 | // Typography 68 | // 69 | // Font, line-height, and color for body text, headings, and more. 70 | 71 | $font-size-base: 0.875rem; 72 | 73 | // Breadcrumbs 74 | 75 | $breadcrumb-bg: #fff; 76 | 77 | // Cards 78 | 79 | $card-border-color: $gray-lighter; 80 | $card-cap-bg: $gray-lightest; 81 | 82 | // Dropdowns 83 | 84 | $dropdown-padding-y: 0; 85 | $dropdown-border-color: $gray-lighter; 86 | $dropdown-divider-bg: $gray-lightest; 87 | 88 | // Buttons 89 | 90 | $btn-secondary-border: $gray-light; 91 | 92 | // Progress bars 93 | 94 | $progress-bg: $gray-lightest; 95 | 96 | // Tables 97 | 98 | $table-bg-accent: $gray-lightest; 99 | $table-bg-hover: $gray-lightest; 100 | -------------------------------------------------------------------------------- /resources/assets/sass/_custom.scss: -------------------------------------------------------------------------------- 1 | // Here you can add other styles 2 | 3 | $lbit_blue: rgb(46, 109, 209); 4 | $lbit_grey: #787878; 5 | 6 | .component-fade-enter-active, .component-fade-leave-active { 7 | transition: opacity .1s ease; 8 | } 9 | 10 | .component-fade-enter, .component-fade-leave-to { 11 | opacity: 0; 12 | } 13 | 14 | .scroll-to-top { 15 | border-radius: 4px; 16 | background: $lbit_blue; 17 | position: fixed; 18 | bottom: 70px; 19 | right: 15px; 20 | padding: .7em; 21 | color: #ffffff; 22 | } 23 | 24 | .th-checkbox { 25 | width: 40px; 26 | } 27 | 28 | #loader-modal { 29 | position: fixed; 30 | z-index: 1111; 31 | left: 0; 32 | top: 0; 33 | width: 100%; 34 | height: 100%; 35 | overflow: hidden; 36 | background-color: rgb(0, 0, 0); 37 | background-color: rgba(0, 0, 0, 0.3); 38 | } 39 | 40 | .loader-modal-content { 41 | margin: 15% auto; 42 | padding: 20px; 43 | //border: 1px solid #888; 44 | width: 77%; 45 | } 46 | 47 | .loader, .loader:after { 48 | border-radius: 50%; 49 | width: 10em; 50 | height: 10em; 51 | } 52 | 53 | .loader { 54 | margin: 60px auto; 55 | font-size: 10px; 56 | position: relative; 57 | text-indent: -9999em; 58 | border-top: 1.1em solid rgba(255, 255, 255, 0.2); 59 | border-right: 1.1em solid rgba(255, 255, 255, 0.2); 60 | border-bottom: 1.1em solid rgba(255, 255, 255, 0.2); 61 | border-left: 1.1em solid $lbit_blue; 62 | -webkit-transform: translateZ(0); 63 | -ms-transform: translateZ(0); 64 | transform: translateZ(0); 65 | -webkit-animation: load8 1.1s infinite linear; 66 | animation: load8 1.1s infinite linear; 67 | } 68 | 69 | @-webkit-keyframes load8 { 70 | 0% { 71 | -webkit-transform: rotate(0deg); 72 | transform: rotate(0deg); 73 | } 74 | 100% { 75 | -webkit-transform: rotate(360deg); 76 | transform: rotate(360deg); 77 | } 78 | } 79 | 80 | @keyframes load8 { 81 | 0% { 82 | -webkit-transform: rotate(0deg); 83 | transform: rotate(0deg); 84 | } 85 | 100% { 86 | -webkit-transform: rotate(360deg); 87 | transform: rotate(360deg); 88 | } 89 | } 90 | 91 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /resources/assets/sass/bootstrap_custom/_badge.scss: -------------------------------------------------------------------------------- 1 | .badge-pill { 2 | border-radius: $badge-pill-border-radius; 3 | } 4 | -------------------------------------------------------------------------------- /resources/assets/sass/bootstrap_custom/_breadcrumb.scss: -------------------------------------------------------------------------------- 1 | .breadcrumb { 2 | position: relative; 3 | margin-bottom: 1.5 * $spacer-y; 4 | 5 | @include borders($breadcrumb-borders); 6 | } 7 | -------------------------------------------------------------------------------- /resources/assets/sass/bootstrap_custom/_buttons.scss: -------------------------------------------------------------------------------- 1 | .btn { 2 | .badge { 3 | position: absolute; 4 | top: 2px; 5 | right: 6px; 6 | font-size: 9px; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /resources/assets/sass/bootstrap_custom/_dropdown.scss: -------------------------------------------------------------------------------- 1 | // Links, buttons, and more within the dropdown menu 2 | .dropdown-item { 3 | position: relative; 4 | padding: 10px 20px; 5 | border-bottom: 1px solid $dropdown-border-color; 6 | 7 | &:last-child { 8 | border-bottom: 0; 9 | } 10 | 11 | i { 12 | display: inline-block; 13 | width: 20px; 14 | margin-right: 10px; 15 | margin-left: -10px; 16 | color: $dropdown-border-color; 17 | text-align: center; 18 | } 19 | 20 | .badge { 21 | position: absolute; 22 | right: 10px; 23 | margin-top: 2px; 24 | } 25 | } 26 | 27 | // Dropdown section headers 28 | .dropdown-header { 29 | padding: 8px 20px; 30 | background: $dropdown-divider-bg; 31 | border-bottom: 1px solid $dropdown-border-color; 32 | 33 | .btn { 34 | margin-top: -7px; 35 | color: $dropdown-header-color; 36 | 37 | &:hover { 38 | color: $body-color; 39 | } 40 | 41 | &.pull-right { 42 | margin-right: -20px; 43 | } 44 | } 45 | } 46 | 47 | .dropdown-menu-lg { 48 | width: 250px; 49 | } 50 | -------------------------------------------------------------------------------- /resources/assets/sass/bootstrap_custom/_input-group.scss: -------------------------------------------------------------------------------- 1 | .input-group-addon, 2 | .input-group-btn { 3 | min-width: 40px; 4 | white-space: nowrap; 5 | vertical-align: middle; // Match the inputs 6 | } 7 | -------------------------------------------------------------------------------- /resources/assets/sass/bootstrap_custom/_modal.scss: -------------------------------------------------------------------------------- 1 | @each $variant, $color in (primary: $brand-primary, secondary: $gray-lighter, success: $brand-success, info: $brand-info, warning: $brand-warning, danger: $brand-danger) { 2 | .modal-#{$variant} { 3 | 4 | .modal-content { 5 | border-color: $color; 6 | } 7 | 8 | .modal-header { 9 | color: #fff; 10 | background-color: $color; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /resources/assets/sass/bootstrap_custom/_nav.scss: -------------------------------------------------------------------------------- 1 | .nav-tabs { 2 | .nav-link { 3 | color: $gray; 4 | &.active { 5 | color: $gray-dark; 6 | background: #fff; 7 | border-color: $border-color; 8 | border-bottom-color: #fff; 9 | &:focus { 10 | background: #fff; 11 | border-color: $border-color; 12 | border-bottom-color: #fff; 13 | } 14 | } 15 | } 16 | } 17 | 18 | .tab-content { 19 | margin-top: -1px; 20 | background: #fff; 21 | border: 1px solid $border-color; 22 | .tab-pane { 23 | padding: $spacer-y $spacer-x; 24 | } 25 | } 26 | 27 | .card-block { 28 | .tab-content { 29 | margin-top: 0; 30 | border: 0; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /resources/assets/sass/bootstrap_custom/_navbar.scss: -------------------------------------------------------------------------------- 1 | header.navbar { 2 | position: relative; 3 | flex-direction: row; 4 | height: $navbar-height; 5 | padding: 0; 6 | background-color: $navbar-bg; 7 | @include borders($navbar-border); 8 | 9 | 10 | .navbar-brand { 11 | display: inline-block; 12 | width: $navbar-brand-width; 13 | height: $navbar-height; 14 | padding: $navbar-padding-y $navbar-padding-x; 15 | margin-right: 0; 16 | background-color: $navbar-brand-bg; 17 | background-image: $navbar-brand-logo; 18 | background-repeat: no-repeat; 19 | background-position: center center; 20 | background-size: $navbar-brand-logo-size; 21 | @include borders($navbar-brand-border); 22 | } 23 | 24 | .navbar-nav { 25 | flex-direction: row; 26 | align-items: center; 27 | } 28 | 29 | .nav-item { 30 | position: relative; 31 | min-width: 50px; 32 | margin: 0 !important; 33 | text-align: center; 34 | 35 | .nav-link { 36 | padding-top: 0; 37 | padding-bottom: 0; 38 | 39 | .badge { 40 | position: absolute; 41 | top: 50%; 42 | left: 50%; 43 | margin-top: -16px; 44 | margin-left: 0; 45 | } 46 | 47 | > .img-avatar { 48 | height: $navbar-height - 20px; 49 | margin: 0 10px; 50 | } 51 | } 52 | } 53 | 54 | .dropdown-menu { 55 | padding-bottom: 0; 56 | line-height: $line-height-base; 57 | } 58 | 59 | .dropdown-item { 60 | min-width: 180px; 61 | } 62 | } 63 | 64 | .navbar-brand { 65 | color: $navbar-active-color; 66 | 67 | @include hover-focus { 68 | color: $navbar-active-color; 69 | } 70 | } 71 | 72 | .navbar-nav { 73 | .nav-link { 74 | color: $navbar-color; 75 | 76 | @include hover-focus { 77 | color: $navbar-hover-color; 78 | } 79 | } 80 | 81 | .open > .nav-link, 82 | .active > .nav-link, 83 | .nav-link.open, 84 | .nav-link.active { 85 | @include plain-hover-focus { 86 | color: $navbar-active-color; 87 | } 88 | } 89 | } 90 | 91 | .navbar-divider { 92 | background-color: rgba(0,0,0,.075); 93 | } 94 | -------------------------------------------------------------------------------- /resources/assets/sass/bootstrap_custom/_progress.scss: -------------------------------------------------------------------------------- 1 | .progress-xs { 2 | height: 4px; 3 | } 4 | 5 | .progress-sm { 6 | height: 8px; 7 | } 8 | 9 | // White progress bar 10 | .progress-white { 11 | background-color: rgba(255,255,255,.2) !important; 12 | .progress-bar { 13 | background-color: #fff; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /resources/assets/sass/bootstrap_custom/_tables.scss: -------------------------------------------------------------------------------- 1 | .table-outline { 2 | border: 1px solid $table-border-color; 3 | 4 | td { 5 | vertical-align: middle; 6 | } 7 | } 8 | 9 | .table-align-middle { 10 | 11 | td { 12 | vertical-align: middle; 13 | } 14 | } 15 | 16 | .table-clear { 17 | td { 18 | border: 0; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /resources/assets/sass/core/_animate.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | .animated { 4 | -webkit-animation-duration: 1s; 5 | animation-duration: 1s; 6 | -webkit-animation-fill-mode: both; 7 | animation-fill-mode: both; 8 | } 9 | 10 | .animated.infinite { 11 | -webkit-animation-iteration-count: infinite; 12 | animation-iteration-count: infinite; 13 | } 14 | 15 | .animated.hinge { 16 | -webkit-animation-duration: 2s; 17 | animation-duration: 2s; 18 | } 19 | 20 | @-webkit-keyframes fadeIn { 21 | from { 22 | opacity: 0; 23 | } 24 | 25 | to { 26 | opacity: 1; 27 | } 28 | } 29 | 30 | @keyframes fadeIn { 31 | from { 32 | opacity: 0; 33 | } 34 | 35 | to { 36 | opacity: 1; 37 | } 38 | } 39 | 40 | .fadeIn { 41 | -webkit-animation-name: fadeIn; 42 | animation-name: fadeIn; 43 | } 44 | -------------------------------------------------------------------------------- /resources/assets/sass/core/_aside.scss: -------------------------------------------------------------------------------- 1 | .aside-menu { 2 | z-index: $zindex-navbar - 1; 3 | width: $aside-menu-width; 4 | color: $aside-menu-color; 5 | background: $aside-menu-bg; 6 | @include borders($aside-menu-borders); 7 | 8 | .nav-tabs { 9 | border-color: $border-color; 10 | .nav-link { 11 | padding: $aside-menu-nav-padding-y $aside-menu-nav-padding-x; 12 | color: $body-color; 13 | border-top: 0; 14 | &.active { 15 | color: $brand-primary; 16 | border-right-color: $border-color; 17 | border-left-color: $border-color; 18 | } 19 | } 20 | .nav-item:first-child { 21 | .nav-link { 22 | border-left: 0; 23 | } 24 | } 25 | } 26 | 27 | .tab-content { 28 | position: relative; 29 | overflow-x: hidden; 30 | overflow-y: auto; 31 | border: 0; 32 | border-top: 1px solid $border-color; 33 | -ms-overflow-style: -ms-autohiding-scrollbar; 34 | 35 | &::-webkit-scrollbar { 36 | width: 10px; 37 | margin-left: -10px; 38 | -webkit-appearance: none; 39 | } 40 | 41 | // &::-webkit-scrollbar-button { } 42 | 43 | &::-webkit-scrollbar-track { 44 | background-color: lighten($aside-menu-bg, 5%); 45 | border-right: 1px solid darken($aside-menu-bg, 5%); 46 | border-left: 1px solid darken($aside-menu-bg, 5%); 47 | } 48 | 49 | // &::-webkit-scrollbar-track-piece { } 50 | 51 | &::-webkit-scrollbar-thumb { 52 | height: 50px; 53 | background-color: darken($aside-menu-bg, 10%); 54 | background-clip: content-box; 55 | border-color: transparent; 56 | border-style: solid; 57 | border-width: 1px 2px; 58 | } 59 | 60 | .tab-pane { 61 | padding: 0; 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /resources/assets/sass/core/_avatars.scss: -------------------------------------------------------------------------------- 1 | .img-avatar { 2 | border-radius: 50em; 3 | } 4 | 5 | .avatar { 6 | $width: 36px; 7 | $status-width: 10px; 8 | @include avatar($width,$status-width); 9 | } 10 | 11 | .avatar.avatar-xs { 12 | $width: 20px; 13 | $status-width: 8px; 14 | @include avatar($width,$status-width); 15 | } 16 | 17 | .avatar.avatar-sm { 18 | $width: 24px; 19 | $status-width: 8px; 20 | @include avatar($width,$status-width); 21 | } 22 | 23 | .avatar.avatar-lg { 24 | $width: 72px; 25 | $status-width: 12px; 26 | @include avatar($width,$status-width); 27 | } 28 | 29 | .avatars-stack { 30 | .avatar.avatar-xs { 31 | margin-right: -10px; 32 | } 33 | 34 | // .avatar.avatar-sm { 35 | // 36 | // } 37 | 38 | .avatar { 39 | margin-right: -15px; 40 | transition-duration: $layout-transition-speed, $layout-transition-speed; 41 | transition-property: margin-left, margin-right; 42 | 43 | &:hover { 44 | margin-right: 0 !important; 45 | } 46 | } 47 | 48 | // .avatar.avatar-lg { 49 | // 50 | // } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /resources/assets/sass/core/_breadcrumb-menu.scss: -------------------------------------------------------------------------------- 1 | .breadcrumb-menu { 2 | position: absolute; 3 | top: 0; 4 | right: $breadcrumb-padding-x; 5 | 6 | &::before { 7 | display: none; 8 | } 9 | 10 | .btn { 11 | padding-top: $breadcrumb-padding-y; 12 | padding-bottom: $breadcrumb-padding-y; 13 | } 14 | 15 | .btn.btn-secondary { 16 | color: $text-muted; 17 | border: 0; 18 | 19 | &:hover, &.active { 20 | color: $body-color; 21 | background: transparent; 22 | } 23 | } 24 | 25 | .open { 26 | .btn.btn-secondary { 27 | color: $body-color; 28 | background: transparent; 29 | } 30 | } 31 | 32 | .dropdown-menu { 33 | min-width: 180px; 34 | line-height: $line-height-base; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /resources/assets/sass/core/_callout.scss: -------------------------------------------------------------------------------- 1 | .callout { 2 | position: relative; 3 | padding: 0 $spacer-y; 4 | margin: $spacer-x 0; 5 | border: 0 solid $border-color; 6 | border-left-width: .25rem; 7 | 8 | @if $enable-rounded { 9 | border-radius: .25rem; 10 | } 11 | 12 | .chart-wrapper { 13 | position: absolute; 14 | top: 18px; 15 | left: 45%; 16 | float: right; 17 | width: 100px; 18 | } 19 | } 20 | 21 | .callout-bordered { 22 | border: 1px solid $border-color; 23 | border-left-width: .25rem; 24 | } 25 | .callout code { 26 | border-radius: .25rem; 27 | } 28 | .callout h4 { 29 | margin-top: 0; 30 | margin-bottom: .25rem; 31 | } 32 | .callout p:last-child { 33 | margin-bottom: 0; 34 | } 35 | .callout + .callout { 36 | margin-top: - .25rem; 37 | } 38 | 39 | .callout-default { 40 | border-left-color: $text-muted; 41 | 42 | h4 { 43 | color: $text-muted; 44 | } 45 | } 46 | 47 | .callout-primary { 48 | border-left-color: $brand-primary; 49 | 50 | h4 { 51 | color: $brand-primary; 52 | } 53 | } 54 | 55 | .callout-info { 56 | border-left-color: $brand-info; 57 | 58 | h4 { 59 | color: $brand-info; 60 | } 61 | } 62 | 63 | .callout-warning { 64 | border-left-color: $brand-warning; 65 | 66 | h4 { 67 | color: $brand-warning; 68 | } 69 | } 70 | 71 | .callout-danger { 72 | border-left-color: $brand-danger; 73 | 74 | h4 { 75 | color: $brand-danger; 76 | } 77 | } 78 | 79 | .callout-success { 80 | border-left-color: $brand-success; 81 | 82 | h4 { 83 | color: $brand-success; 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /resources/assets/sass/core/_charts.scss: -------------------------------------------------------------------------------- 1 | .chart-wrapper { 2 | canvas { 3 | width: 100% !important; 4 | } 5 | } 6 | base-chart.chart { 7 | display: block !important; 8 | } 9 | -------------------------------------------------------------------------------- /resources/assets/sass/core/_footer.scss: -------------------------------------------------------------------------------- 1 | .app-footer { 2 | min-height: $footer-height; 3 | padding: 0 $spacer-x; 4 | line-height: $footer-height; 5 | color: $footer-color; 6 | background: $footer-bg; 7 | @include borders($footer-borders); 8 | } 9 | -------------------------------------------------------------------------------- /resources/assets/sass/core/_grid.scss: -------------------------------------------------------------------------------- 1 | .row.row-equal { 2 | padding-right: ($grid-gutter-width-base / 4); 3 | padding-left: ($grid-gutter-width-base / 4); 4 | margin-right: ($grid-gutter-width-base / -2); 5 | margin-left: ($grid-gutter-width-base / -2); 6 | 7 | [class*="col-"] { 8 | padding-right: ($grid-gutter-width-base / 4); 9 | padding-left: ($grid-gutter-width-base / 4); 10 | } 11 | } 12 | 13 | .main .container-fluid { 14 | padding: 0 30px; 15 | } 16 | -------------------------------------------------------------------------------- /resources/assets/sass/core/_mobile.scss: -------------------------------------------------------------------------------- 1 | // @include media-breakpoint-down(md) { 2 | // 3 | // body { 4 | // padding: 0 !important; 5 | // margin: 0 !important; 6 | // } 7 | // 8 | // header.navbar { 9 | // position: fixed !important; 10 | // top: 0 !important; 11 | // right: 0 !important; 12 | // left: 0 !important; 13 | // 14 | // .navbar-toggler { 15 | // position: absolute; 16 | // top: 0; 17 | // left: 0; 18 | // width: 70px; 19 | // height: inherit; 20 | // } 21 | // 22 | // .navbar-toggler { 23 | // @if (lightness( $navbar-brand-bg ) > 40) { 24 | // color: $navbar-color; 25 | // } @else { 26 | // color: #fff; 27 | // } 28 | // } 29 | // 30 | // .navbar-brand { 31 | // width: 100% !important; 32 | // margin: 0 auto !important; 33 | // } 34 | // 35 | // .navbar-nav { 36 | // position: absolute; 37 | // top: 0; 38 | // right: 15px; 39 | // height: inherit; 40 | // } 41 | // } 42 | // 43 | // .sidebar { 44 | // left: -$mobile-sidebar-width !important; 45 | // width: $mobile-sidebar-width !important; 46 | // 47 | // ul.nav { 48 | // width: $mobile-sidebar-width !important; 49 | // } 50 | // 51 | // .sidebar-footer { 52 | // margin-left: -$mobile-sidebar-width; 53 | // } 54 | // } 55 | // 56 | // .breadcrumb-menu { 57 | // display: none; 58 | // } 59 | // 60 | // .main { 61 | // width: 100% !important; 62 | // padding: 0 !important; 63 | // padding-top: $navbar-height !important; 64 | // margin: 0 !important; 65 | // overflow: hidden; 66 | // } 67 | // 68 | // .aside-menu { 69 | // right: -$aside-menu-width !important; 70 | // } 71 | // 72 | // .footer { 73 | // display: none; 74 | // } 75 | // 76 | // html { 77 | // max-width: 100%; 78 | // overflow-x: hidden; 79 | // } 80 | // 81 | // body.mobile-open { 82 | // max-width: 100%; 83 | // overflow-x: hidden; 84 | // .sidebar { 85 | // left: 0 !important; 86 | // } 87 | // 88 | // .main { 89 | // margin-left: $mobile-sidebar-width !important; 90 | // } 91 | // } 92 | // } 93 | -------------------------------------------------------------------------------- /resources/assets/sass/core/_navigation.scss: -------------------------------------------------------------------------------- 1 | // Disabled Navigation 2 | @import "navigation/disabled"; 3 | 4 | // Sidebar Navigation 5 | @import "navigation/sidebar"; 6 | 7 | // Top Navigation 8 | @import "navigation/top"; 9 | -------------------------------------------------------------------------------- /resources/assets/sass/core/_others.scss: -------------------------------------------------------------------------------- 1 | hr.transparent { 2 | border-top: 1px solid transparent; 3 | } 4 | -------------------------------------------------------------------------------- /resources/assets/sass/core/_temp.scss: -------------------------------------------------------------------------------- 1 | .pagination-datatables, .pagination { 2 | li { 3 | @extend .page-item; 4 | 5 | a { 6 | @extend .page-link; 7 | } 8 | } 9 | } 10 | 11 | .label-pill { 12 | border-radius: 1rem !important; 13 | } 14 | 15 | // temp fix for Vue-Strap 16 | 17 | // Open state for the dropdown 18 | .open { 19 | // Show the menu 20 | > .dropdown-menu { 21 | display: block; 22 | } 23 | 24 | // Remove the outline when :focus is triggered 25 | > a { 26 | outline: 0; 27 | } 28 | } 29 | 30 | // navbar dropdown fix 31 | .navbar .dropdown-toggle { 32 | @extend .nav-link; 33 | 34 | .img-avatar { 35 | height: $navbar-height - 20px; 36 | margin: 0 10px; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /resources/assets/sass/core/_typography.scss: -------------------------------------------------------------------------------- 1 | body { 2 | -moz-osx-font-smoothing: grayscale; 3 | -webkit-font-smoothing: antialiased; 4 | } 5 | 6 | .font-xs { 7 | font-size: .75rem !important; 8 | } 9 | 10 | .font-sm { 11 | font-size: .85rem !important; 12 | } 13 | 14 | .font-lg { 15 | font-size: 1rem !important; 16 | } 17 | 18 | .font-xl { 19 | font-size: 1.25rem !important; 20 | } 21 | 22 | .font-2xl { 23 | font-size: 1.5rem !important; 24 | } 25 | 26 | .font-3xl { 27 | font-size: 1.75rem !important; 28 | } 29 | 30 | .font-4xl { 31 | font-size: 2rem !important; 32 | } 33 | 34 | .font-5xl { 35 | font-size: 2.5rem !important; 36 | } 37 | -------------------------------------------------------------------------------- /resources/assets/sass/core/_utilities-border.scss: -------------------------------------------------------------------------------- 1 | //border 2 | @each $prop, $abbrev in (border: b) { 3 | @each $size in (0,1,2) { 4 | @if $size == 0 { 5 | .#{$abbrev}-a-#{$size} { #{$prop}: 0 !important; } // a = All sides 6 | .#{$abbrev}-t-#{$size} { #{$prop}-top: 0 !important; } 7 | .#{$abbrev}-r-#{$size} { #{$prop}-right: 0 !important; } 8 | .#{$abbrev}-b-#{$size} { #{$prop}-bottom: 0 !important; } 9 | .#{$abbrev}-l-#{$size} { #{$prop}-left: 0 !important; } 10 | } @else { 11 | .#{$abbrev}-a-#{$size} { #{$prop}: $size * $border-width solid $border-color !important; } // a = All sides 12 | .#{$abbrev}-t-#{$size} { #{$prop}-top: $size * $border-width solid $border-color !important; } 13 | .#{$abbrev}-r-#{$size} { #{$prop}-right: $size * $border-width solid $border-color !important; } 14 | .#{$abbrev}-b-#{$size} { #{$prop}-bottom: $size * $border-width solid $border-color !important; } 15 | .#{$abbrev}-l-#{$size} { #{$prop}-left: $size * $border-width solid $border-color !important; } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /resources/assets/sass/core/navigation/_disabled.scss: -------------------------------------------------------------------------------- 1 | // body { 2 | // #navigation { 3 | // left: - 4 | // display: none !important; 5 | // } 6 | // } 7 | -------------------------------------------------------------------------------- /resources/assets/sass/core/navigation/_top.scss: -------------------------------------------------------------------------------- 1 | nav.top-nav { 2 | position: absolute; 3 | top: $navbar-height; 4 | left: 0; 5 | z-index: $zindex-navbar - 1; 6 | display: inline !important; 7 | width: 100%; 8 | height: $top-nav-height; 9 | background: $top-nav-bg; 10 | @include borders($top-nav-borders); 11 | 12 | ul.nav { 13 | white-space: nowrap; 14 | 15 | li.nav-item { 16 | position: relative; 17 | display: inline-block; 18 | margin: 0; 19 | 20 | ul { 21 | display: none; 22 | padding: 0; 23 | margin: 0; 24 | white-space: normal; 25 | background: $top-nav-bg; 26 | @include borders($top-nav-ul-borders); 27 | 28 | 29 | li { 30 | padding: 0; 31 | list-style: none; 32 | } 33 | } 34 | 35 | a.nav-link { 36 | display: block; 37 | padding: 0 15px; 38 | font-size: 12px; 39 | font-weight: 400; 40 | line-height: $top-nav-height; 41 | color: $top-nav-color; 42 | text-decoration: none; 43 | text-transform: uppercase; 44 | 45 | i { 46 | display: block; 47 | float: left; 48 | width: 20px; 49 | margin: 0 10px 0 0; 50 | font-size: 14px; 51 | line-height: $top-nav-height - 1px; 52 | text-align: center; 53 | } 54 | 55 | .tag { 56 | float: right; 57 | margin-top: 13px; 58 | margin-left: 10px; 59 | } 60 | 61 | &:hover { 62 | color: $top-nav-hover-color; 63 | background: $top-nav-hover-bg; 64 | 65 | } 66 | 67 | &.active { 68 | color: $top-nav-active-color; 69 | background: $top-nav-active-bg; 70 | } 71 | } 72 | 73 | ul { 74 | position: absolute; 75 | top: $top-nav-height - 1px; 76 | left: 0; 77 | 78 | li { 79 | position: relative; 80 | padding: 0; 81 | 82 | a.nav-link { 83 | min-width: 200px; 84 | } 85 | 86 | ul { 87 | position: absolute; 88 | top: 0; 89 | left: 100%; 90 | } 91 | } 92 | } 93 | 94 | &.nav-more { 95 | ul { 96 | right: 0; 97 | left: auto; 98 | 99 | li { 100 | 101 | ul { 102 | right: 100%; 103 | left: auto; 104 | } 105 | } 106 | } 107 | } 108 | 109 | &:hover { 110 | > ul { 111 | display: inline; 112 | } 113 | } 114 | } 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /resources/assets/sass/style.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * CoreUI - Open Source Bootstrap Admin Template 3 | * @version v1.0.0-alpha.4 4 | * @link http://coreui.io 5 | * Copyright (c) 2017 creativeLabs Łukasz Holeczek 6 | * @license MIT 7 | */ 8 | 9 | @import "~font-awesome/scss/font-awesome.scss"; 10 | @import "~simple-line-icons/scss/simple-line-icons.scss"; 11 | 12 | // Core variables and mixins 13 | @import "bootstrap-variables"; 14 | @import "~bootstrap/scss/variables"; 15 | @import "custom-variables"; 16 | @import "~bootstrap/scss/mixins"; 17 | @import "core/mixins"; 18 | 19 | // Reset and dependencies 20 | @import "~bootstrap/scss/normalize"; 21 | @import "~bootstrap/scss/print"; 22 | 23 | // Core CSS 24 | @import "~bootstrap/scss/reboot"; 25 | @import "~bootstrap/scss/type"; 26 | @import "~bootstrap/scss/images"; 27 | @import "~bootstrap/scss/code"; 28 | @import "~bootstrap/scss/grid"; 29 | 30 | @import "~bootstrap/scss/tables"; 31 | @import "bootstrap_custom/tables"; 32 | 33 | @import "~bootstrap/scss/forms"; 34 | 35 | @import "~bootstrap/scss/buttons"; 36 | @import "bootstrap_custom/buttons"; 37 | 38 | // Components 39 | @import "~bootstrap/scss/transitions"; 40 | 41 | @import "~bootstrap/scss/dropdown"; 42 | @import "bootstrap_custom/dropdown"; 43 | 44 | @import "~bootstrap/scss/button-group"; 45 | 46 | @import "~bootstrap/scss/input-group"; 47 | @import "bootstrap_custom/input-group"; 48 | 49 | //@import "custom-forms"; 50 | 51 | @import "~bootstrap/scss/nav"; 52 | @import "bootstrap_custom/nav"; 53 | 54 | @import "~bootstrap/scss/navbar"; 55 | @import "bootstrap_custom/navbar"; 56 | 57 | @import "~bootstrap/scss/card"; 58 | @import "bootstrap_custom/card"; 59 | 60 | @import "~bootstrap/scss/breadcrumb"; 61 | @import "bootstrap_custom/breadcrumb"; 62 | 63 | @import "~bootstrap/scss/pagination"; 64 | 65 | @import "~bootstrap/scss/badge"; 66 | @import "bootstrap_custom/badge"; 67 | 68 | //@import "jumbotron"; 69 | @import "~bootstrap/scss/alert"; 70 | 71 | @import "~bootstrap/scss/progress"; 72 | @import "bootstrap_custom/progress"; 73 | 74 | @import "~bootstrap/scss/media"; 75 | @import "~bootstrap/scss/list-group"; 76 | @import "~bootstrap/scss/responsive-embed"; 77 | @import "~bootstrap/scss/close"; 78 | 79 | // Components w/ JavaScript 80 | @import "~bootstrap/scss/modal"; 81 | @import "bootstrap_custom/modal"; 82 | 83 | @import "~bootstrap/scss/tooltip"; 84 | @import "~bootstrap/scss/popover"; 85 | @import "~bootstrap/scss/carousel"; 86 | 87 | // Utility classes 88 | @import "~bootstrap/scss/utilities"; 89 | 90 | // Vendors Styles 91 | @import "vendors/vendors"; 92 | 93 | // CoreUI Styles 94 | // Additional typography 95 | @import "core/typography"; 96 | 97 | // Animations 98 | @import "core/animate"; 99 | 100 | // Core files 101 | @import "core/grid"; 102 | @import "core/layout"; 103 | @import "core/navigation"; 104 | @import "core/aside"; 105 | @import "core/loading"; 106 | @import "core/widgets"; 107 | @import "core/footer"; 108 | @import "core/buttons"; 109 | @import "core/others"; 110 | @import "core/breadcrumb-menu"; 111 | @import "core/avatars"; 112 | @import "core/callout"; 113 | @import "core/switches"; 114 | @import "core/charts"; 115 | @import "core/utilities-border"; 116 | 117 | // Temporary fixes 118 | @import "core/temp"; 119 | 120 | // Mobile View 121 | @import "core/mobile"; 122 | 123 | // Right-to-left 124 | @import "core/rtl"; 125 | 126 | // Custom styles 127 | @import "custom"; 128 | -------------------------------------------------------------------------------- /resources/assets/sass/vendors/_vendors.scss: -------------------------------------------------------------------------------- 1 | @import "chart.js/chart"; 2 | -------------------------------------------------------------------------------- /resources/assets/sass/vendors/chart.js/chart.scss: -------------------------------------------------------------------------------- 1 | .chart-legend, 2 | .bar-legend, 3 | .line-legend, 4 | .pie-legend, 5 | .radar-legend, 6 | .polararea-legend, 7 | .doughnut-legend { 8 | list-style-type: none; 9 | margin-top: 5px; 10 | text-align: center; 11 | -webkit-padding-start: 0; 12 | -moz-padding-start: 0; 13 | padding-left: 0; 14 | } 15 | .chart-legend li, 16 | .bar-legend li, 17 | .line-legend li, 18 | .pie-legend li, 19 | .radar-legend li, 20 | .polararea-legend li, 21 | .doughnut-legend li { 22 | display: inline-block; 23 | white-space: nowrap; 24 | position: relative; 25 | margin-bottom: 4px; 26 | @include border-radius($border-radius); 27 | padding: 2px 8px 2px 28px; 28 | font-size: smaller; 29 | cursor: default; 30 | } 31 | .chart-legend li span, 32 | .bar-legend li span, 33 | .line-legend li span, 34 | .pie-legend li span, 35 | .radar-legend li span, 36 | .polararea-legend li span, 37 | .doughnut-legend li span { 38 | display: block; 39 | position: absolute; 40 | left: 0; 41 | top: 0; 42 | width: 20px; 43 | height: 20px; 44 | @include border-radius($border-radius); 45 | } 46 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /resources/lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 'next' => 'Next »', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /resources/views/Layouts/base.twig: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | {{ config("app.name") }} 9 | 10 | 11 | 12 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /resources/views/Layouts/public.twig: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | {{ config("app.name") }} 9 | 10 | 11 | 12 | 16 | 17 | 18 | 19 | 20 |
21 | {% block content %}{% endblock %} 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /resources/views/auth/passwords/email.twig: -------------------------------------------------------------------------------- 1 | {% extends "Layouts.public" %} 2 | 3 | {% block content %} 4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | {{ csrf_field() }} 13 | 14 |

Reset Password

15 | 16 | {% if session('status') %} 17 |
18 | {{ session('status') }} 19 |
20 | {% endif %} 21 | 22 |
23 | 24 | 25 | 27 | 28 | {% if errors.has('email') %} 29 | 30 | {{ errors.first('email') }} 31 | 32 | {% endif %} 33 |
34 | 35 |
36 | 39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 | {% endblock %} 49 | -------------------------------------------------------------------------------- /resources/views/home.twig: -------------------------------------------------------------------------------- 1 | {% extends "Layouts.base" %} 2 | -------------------------------------------------------------------------------- /resources/views/user/form.twig: -------------------------------------------------------------------------------- 1 |
2 |
add User
3 |
4 | {{ form_open({ action: form.action, method: form.method, role: 'form', class: 'form-inline', id: 'user-form', onsubmit: 'submitUserForm($(this));return false;' }) }} 5 |
6 |
7 | {{ form_text('username', input_old('username', userdata.getUsername()), { class: 'form-control', placeholder: 'Username', autofocus: 'autofocus' } ) }} 8 |
9 |
10 | {{ form_text('email', input_old('email', userdata.getEmail()), { class: 'form-control', placeholder: 'eMail' } ) }} 11 |
12 | 13 |
14 | {{ form_password('password', { class: 'form-control', placeholder: 'Password' } ) }} 15 |
16 |
17 | {{ form_password('password_confirmation', { class: 'form-control', placeholder: 'confirm Password' } ) }} 18 |
19 | {{ form_submit('save', { class: 'btn btn-primary' } ) }} 20 |
21 | {{ form_close() }} 22 | 23 | {%if errors.has('username') %} 24 |

{{ errors.first('username') }}

25 | {% endif %} 26 | {%if errors.has('email') %} 27 |

{{ errors.first('email') }}

28 | {% endif %} 29 | {%if errors.has('password') %} 30 |

{{ errors.first('password') }}

31 | {% endif %} 32 | {%if errors.has('password_confirmation') %} 33 |

{{ errors.first('password_confirmation') }}

34 | {% endif %} 35 | 36 |

37 | 38 | {{ alert('info', 'Leave both password fields blank if you don\'t want to set / change the password.') }} 39 | 40 | cancel 42 |
43 |
44 | -------------------------------------------------------------------------------- /resources/views/user/index.twig: -------------------------------------------------------------------------------- 1 | {% extends "layouts.base" %} 2 | 3 | {% block title %} 4 | {{ parent() }}Users 5 | {% endblock %} 6 | 7 | {% macro buttons() %} 8 | 9 | add 11 | {% endmacro %} 12 | 13 | {% block content %} 14 | 15 | 16 |
17 | 19 |
20 | 21 | {{ form_open({ action: 'UserController@deleteUsers' }) }} 22 |
23 | 24 | {{ _self.buttons() }} 25 | 26 |

27 | 28 |
{{ users_table | raw }}
29 | 30 | {{ _self.buttons() }} 31 |
32 | 33 | 34 | {{ form_close() }} 35 | {% endblock %} 36 | 37 | {% block javascript %} 38 | 95 | {% endblock %} 96 | -------------------------------------------------------------------------------- /resources/views/user/table.twig: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | {% for u in users %} 15 | 16 | 17 | 18 | 20 | 21 | 22 | 23 | 24 | 25 | {% endfor %} 26 | 27 |
{{ form_checkbox('select_all', '', false, { id: 'user-select_all' }) }}IDUsernameeMailenabledupdated atcreated at
{{ form_checkbox('userids[]', u.getId()) }}{{ u.getId() }}{{ u.getUsername() }}{{ u.getEmail() }}{{ u.isEnabled() ? 'yes' : 'no' }}{{ u.getUpdatedAt() }}{{ u.getCreatedAt() }}
28 | -------------------------------------------------------------------------------- /routes/api.php: -------------------------------------------------------------------------------- 1 | group(['prefix' => 'v1'], function ($router) { 15 | //$router->post('auth', 'v1\Controllers\AuthController@auth'); 16 | 17 | $router->group(['middleware' => 'auth:api'], function ($router) { 18 | $router->get('me', 'v1\Controllers\UserController@me'); 19 | $router->patch('me', 'v1\Controllers\UserController@updateMe'); 20 | $router->post('me/password', 'v1\Controllers\UserController@password'); 21 | 22 | $router->get('users', 'v1\Controllers\UserController@users'); 23 | $router->post('user', 'v1\Controllers\UserController@add'); 24 | $router->post('users/delete', 'v1\Controllers\UserController@delete'); 25 | $router->put('user/{id}', 'v1\Controllers\UserController@update'); 26 | 27 | $router->get('stats', 'v1\Controllers\StatsController@index'); 28 | 29 | $router->get('greylist', 'v1\Controllers\GreylistController@index'); 30 | $router->post('greylist', 'v1\Controllers\GreylistController@delete'); 31 | $router->post('greylist/move', 'v1\Controllers\GreylistController@move'); 32 | 33 | $router->get('whitelist/emails', 'v1\Controllers\WhitelistController@emails'); 34 | $router->post('whitelist/emails/add', 'v1\Controllers\WhitelistController@addEmail'); 35 | $router->post('whitelist/emails', 'v1\Controllers\WhitelistController@deleteEmails'); 36 | 37 | $router->get('whitelist/domains', 'v1\Controllers\WhitelistController@domains'); 38 | $router->post('whitelist/domains/add', 'v1\Controllers\WhitelistController@addDomain'); 39 | $router->post('whitelist/domains', 'v1\Controllers\WhitelistController@deleteDomains'); 40 | 41 | $router->get('optin/emails', 'v1\Controllers\OptInController@emails'); 42 | $router->post('optin/emails/add', 'v1\Controllers\OptInController@addEmail'); 43 | $router->post('optin/emails', 'v1\Controllers\OptInController@deleteEmails'); 44 | $router->get('optin/domains', 'v1\Controllers\OptInController@domains'); 45 | $router->post('optin/domains/add', 'v1\Controllers\OptInController@addDomain'); 46 | $router->post('optin/domains', 'v1\Controllers\OptInController@deleteDomains'); 47 | 48 | $router->get('optout/emails', 'v1\Controllers\OptOutController@emails'); 49 | $router->post('optout/emails/add', 'v1\Controllers\OptOutController@addEmail'); 50 | $router->post('optout/emails', 'v1\Controllers\OptOutController@deleteEmails'); 51 | $router->get('optout/domains', 'v1\Controllers\OptOutController@domains'); 52 | $router->post('optout/domains/add', 'v1\Controllers\OptOutController@addDomain'); 53 | $router->post('optout/domains', 'v1\Controllers\OptOutController@deleteDomains'); 54 | }); 55 | }); 56 | -------------------------------------------------------------------------------- /routes/channels.php: -------------------------------------------------------------------------------- 1 | id === (int) $id; 16 | });*/ 17 | -------------------------------------------------------------------------------- /routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 18 | })->describe('Display an inspiring quote');*/ 19 | -------------------------------------------------------------------------------- /server.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 | -------------------------------------------------------------------------------- /storage/.gitignore: -------------------------------------------------------------------------------- 1 | laravel.log -------------------------------------------------------------------------------- /storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !public/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/app/public/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/debugbar/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /tests/Browser/DashboardTest.php: -------------------------------------------------------------------------------- 1 | browse(function (Browser $browser) { 16 | $greylist = factory(\SQLgreyGUI\Models\Greylist::class, 9)->create(); 17 | $whitelist_emails = factory(\SQLgreyGUI\Models\AwlEmail::class, 7)->create(); 18 | $whitelist_domains = factory(\SQLgreyGUI\Models\AwlDomain::class, 12)->create(); 19 | $optout_emails = factory(\SQLgreyGUI\Models\OptOutEmail::class, 3)->create(); 20 | $optout_domains = factory(\SQLgreyGUI\Models\OptOutDomain::class, 5)->create(); 21 | $optin_emails = factory(\SQLgreyGUI\Models\OptInEmail::class, 15)->create(); 22 | $optin_domains = factory(\SQLgreyGUI\Models\OptInDomain::class, 17)->create(); 23 | 24 | $browser->loginAs($this->getUser()) 25 | ->visit('/') 26 | ->waitForText($greylist->count()) 27 | ->screenshot('dashboard') 28 | ->assertSee('Dashboard') 29 | 30 | // Greylist 31 | ->assertsee('Greylist') 32 | ->assertSee($greylist->count()) 33 | ->assertSeeLink('View Details') 34 | ->assertSourceHas('#/greylist') 35 | 36 | // Whitelist 37 | ->assertSee('Auto-Whitelist') 38 | ->assertSee($whitelist_emails->count()) 39 | ->assertSee($whitelist_domains->count()) 40 | ->assertSeeLink('View Emails') 41 | ->assertSourceHas('#/whitelist/emails') 42 | ->assertSeeLink('View Domains') 43 | ->assertSourceHas('#/whitelist/domains') 44 | 45 | // Opt-Out Emails / Domains 46 | ->assertSee('Opt-Out') 47 | ->assertSee($optout_emails->count()) 48 | ->assertSee($optout_domains->count()) 49 | ->assertSeeLink('View Emails') 50 | ->assertSourceHas('#/optout/emails') 51 | ->assertSeeLink('View Domains') 52 | ->assertSourceHas('#/optout/domains') 53 | 54 | // Opt-Out Emails / Domains 55 | ->assertSee('Opt-In') 56 | ->assertSee($optin_emails->count()) 57 | ->assertSee($optin_domains->count()) 58 | ->assertSeeLink('View Emails') 59 | ->assertSourceHas('#/optin/emails') 60 | ->assertSeeLink('View Domains') 61 | ->assertSourceHas('#/optin/domains'); 62 | }); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /tests/Browser/ExampleTest.php: -------------------------------------------------------------------------------- 1 | browse(function (Browser $browser) { 19 | $browser->visit('/') 20 | ->assertSee('SQLgreyGUI'); 21 | }); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /tests/Browser/Pages/HomePage.php: -------------------------------------------------------------------------------- 1 | '#selector', 35 | ]; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /tests/Browser/Pages/Page.php: -------------------------------------------------------------------------------- 1 | '#selector', 18 | ]; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /tests/Browser/UserTest.php: -------------------------------------------------------------------------------- 1 | browse(function (Browser $browser) { 16 | $users = factory(\SQLgreyGUI\Models\User::class, 20)->create(); 17 | 18 | $browser->loginAs($this->getUser()) 19 | ->visit('#/admin/users') 20 | ->waitUntilMissing('#loader-modal') 21 | ->screenshot('users') 22 | ->assertSee($this->getUser()->getUsername()) 23 | ->assertSee($this->getUser()->getEmail()); 24 | 25 | foreach ($users as $record) { 26 | $browser->assertSee($record->getUsername()) 27 | ->assertSee($record->getEmail()); 28 | } 29 | }); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/Browser/console/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /tests/Browser/screenshots/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /tests/CreatesApplication.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class)->bootstrap(); 19 | 20 | return $app; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/DuskTestCase.php: -------------------------------------------------------------------------------- 1 | user) { 50 | $this->user = factory(\SQLgreyGUI\Models\User::class)->create([ 51 | 'username' => 'admin', 52 | 'email' => 'admin@localhost.local', 53 | ]); 54 | } 55 | 56 | return $this->user; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /tests/Feature/ExampleTest.php: -------------------------------------------------------------------------------- 1 | get('/'); 20 | 21 | $response->assertStatus(302); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /tests/dusk.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cd $(cd -P -- "$(dirname -- "$0")" && pwd -P) 4 | 5 | . util.sh 6 | 7 | cd .. 8 | 9 | create_database 10 | 11 | copy_configuration 12 | 13 | configure_application 14 | 15 | pids=$(pidof /usr/bin/Xvfb) 16 | 17 | if [ ! -n "$pids" ]; then 18 | Xvfb :0 -screen 0 1366x768x24 & 19 | fi 20 | 21 | php artisan dusk 22 | 23 | restore_configuration 24 | -------------------------------------------------------------------------------- /tests/fixtures/.env.testing: -------------------------------------------------------------------------------- 1 | APP_NAME=SQLgreyGUI 2 | APP_ENV=testing 3 | APP_KEY= 4 | APP_DEBUG=true 5 | APP_LOG_LEVEL=debug 6 | APP_URL=http://localhost 7 | APP_TIMEZONE=Europe/Berlin 8 | 9 | # Database for SQLgreyGUI 10 | # If you want to use a single database for both SQLgreyGUI and SQLgrey use only this config block 11 | DB_CONNECTION=sqlgreygui 12 | DB_DRIVER=mysql 13 | DB_HOST=127.0.0.1 14 | DB_PORT=3306 15 | DB_DATABASE=testing 16 | DB_USERNAME=homestead 17 | DB_PASSWORD=secret 18 | 19 | # Uncomment the following lines if SQLgrey resides in a different database 20 | #SQLGREY_DB_CONNECTION=sqlgrey 21 | #SQLGREY_DB_DRIVER=mysql 22 | #SQLGREY_DB_HOST= 23 | #SQLGREY_DB_PORT=3306 24 | #SQLGREY_DB_DATABASE= 25 | #SQLGREY_DB_USERNAME= 26 | #SQLGREY_DB_PASSWORD= 27 | 28 | BROADCAST_DRIVER=log 29 | CACHE_DRIVER=file 30 | SESSION_DRIVER=file 31 | QUEUE_DRIVER=sync 32 | 33 | REDIS_HOST=127.0.0.1 34 | REDIS_PASSWORD=null 35 | REDIS_PORT=6379 36 | 37 | MAIL_DRIVER=log 38 | MAIL_HOST=smtp.mailtrap.io 39 | MAIL_PORT=2525 40 | MAIL_USERNAME=null 41 | MAIL_PASSWORD=null 42 | MAIL_ENCRYPTION=null 43 | 44 | PUSHER_APP_ID= 45 | PUSHER_APP_KEY= 46 | PUSHER_APP_SECRET= 47 | -------------------------------------------------------------------------------- /tests/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cd $(cd -P -- "$(dirname -- "$0")" && pwd -P) 4 | 5 | . util.sh 6 | 7 | cd .. 8 | 9 | create_database 10 | 11 | copy_configuration 12 | 13 | configure_application 14 | 15 | ./vendor/bin/phpunit 16 | 17 | restore_configuration 18 | -------------------------------------------------------------------------------- /tests/util.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | create_database() { 4 | mysql -uroot -e "DROP DATABASE IF EXISTS testing" 5 | mysql -uroot -e "CREATE DATABASE testing" 6 | mysql -uroot -e "GRANT ALL ON testing.* to 'homestead'@'%';" 7 | mysql -uroot --database testing < tests/fixtures/sqlgrey.sql 8 | } 9 | 10 | copy_configuration() { 11 | cp -n .env .env.bak 12 | cp -v tests/fixtures/.env.testing .env 13 | } 14 | 15 | configure_application() { 16 | php artisan key:generate 17 | php artisan migrate 18 | php artisan passport:install 19 | } 20 | 21 | restore_configuration() { 22 | mv .env.bak .env 23 | } 24 | -------------------------------------------------------------------------------- /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.disableNotifications() 15 | 16 | mix.browserSync({ 17 | open: false, 18 | proxy: 'sqlgreygui.local', 19 | files: [ 20 | 'app/**/*.php', 21 | 'resources/views/**/*.php', 22 | 'resources/views/**/*.twig', 23 | 'public/assets/js/**/*.js', 24 | 'public/assets/css/**/*.css' 25 | ] 26 | }) 27 | 28 | mix.setPublicPath('public/assets') 29 | mix.setResourceRoot('/assets/') 30 | 31 | mix.sass('resources/assets/sass/style.scss', 'css') 32 | .js('resources/assets/js/app.js', 'js') 33 | .js('resources/assets/js/public.js', 'js') 34 | .extract([ 35 | 'axios', 36 | 'lodash', 37 | 'vue', 38 | 'vuex', 39 | 'vue-events', 40 | 'vue-focus', 41 | 'vue-sweetalert', 42 | 'vue-strap' 43 | ]) 44 | 45 | if (mix.inProduction()) { 46 | mix.version() 47 | } 48 | --------------------------------------------------------------------------------