├── .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 | [](https://travis-ci.org/lbausch/SQLgreyGUI)
5 | [](https://circleci.com/gh/lbausch/SQLgreyGUI/tree/master)
6 | [](https://www.codacy.com/app/lbausch/SQLgreyGUI?utm_source=github.com&utm_medium=referral&utm_content=lbausch/SQLgreyGUI&utm_campaign=Badge_Grade)
7 | [](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 | 
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 | No authorized applications.
6 |
7 |
37 |
8 |
12 |
13 |
14 |
15 | Name
9 | Scopes
10 |
11 |
16 |
17 |
35 |
36 |
18 | {{ token.client.name }}
19 |
20 |
21 |
22 |
23 |
24 | {{ token.scopes.join(', ') }}
25 |
26 |
27 |
28 |
29 |
30 |
31 | Revoke
32 |
33 |
34 |
{{ 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 |{{ form_checkbox('select_all', '', false, { id: 'user-select_all' }) }} | 5 |ID | 6 |Username | 7 |enabled | 9 |updated at | 10 |created at | 11 ||
---|---|---|---|---|---|---|
{{ form_checkbox('userids[]', u.getId()) }} | 17 |{{ u.getId() }} | 18 |{{ u.getUsername() }} | 20 |{{ u.getEmail() }} | 21 |{{ u.isEnabled() ? 'yes' : 'no' }} | 22 |{{ u.getUpdatedAt() }} | 23 |{{ u.getCreatedAt() }} | 24 |