Skip to content

Commit b5a7785

Browse files
authored
Merge pull request pterodactyl#163 from Pterodactyl/develop
Merge develop into master
2 parents 09b0a3d + e77b984 commit b5a7785

File tree

502 files changed

+6588
-2150
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

502 files changed

+6588
-2150
lines changed

.env.example

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ APP_DEBUG=false
33
APP_KEY=SomeRandomString3232RandomString
44
APP_THEME=default
55
APP_TIMEZONE=UTC
6+
APP_CLEAR_TASKLOG=720
7+
APP_DELETE_MINUTES=10
8+
CONSOLE_PUSH_FREQ=250
9+
CONSOLE_PUSH_COUNT=10
610

711
DB_HOST=localhost
812
DB_PORT=3306
@@ -12,7 +16,6 @@ DB_PASSWORD=secret
1216

1317
CACHE_DRIVER=file
1418
SESSION_DRIVER=database
15-
QUEUE_DRIVER=database
1619

1720
MAIL_DRIVER=smtp
1821
MAIL_HOST=mailtrap.io
@@ -25,3 +28,12 @@ MAIL_FROM=you@example.com
2528
API_PREFIX=api
2629
API_VERSION=v1
2730
API_DEBUG=false
31+
32+
QUEUE_DRIVER=database
33+
QUEUE_HIGH=high
34+
QUEUE_STANDARD=standard
35+
QUEUE_LOW=low
36+
37+
SQS_KEY=aws-public
38+
SQS_SECRET=aws-secret
39+
SQS_QUEUE_PREFIX=aws-queue-prefix

.github/ISSUE_TEMPLATE.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<!-- The checkboxes below can be clicked once you submit this report if you'd like -->
2+
<!-- You can also use "- [x]" to mark it as checked. -->
3+
## Product
4+
Please check the corresponding boxes below for which products this is about.
5+
6+
- [ ] Panel
7+
- [ ] Daemon
8+
- [ ] Dockerfile(s) [Please list if so: __ ]
9+
10+
## Type
11+
- [ ] Bug or Issue
12+
- [ ] Feature Request
13+
- [ ] Enhancement
14+
- [ ] Other
15+
16+
<!-- You only need to fill out the information below if this is a bug report. -->
17+
<!-- Please delete this line and everything below if this is NOT a bug report. -->
18+
19+
## What Happens
20+
<!-- Please include a description of what is happening when you encounter this bug. -->
21+
22+
## How to Reproduce
23+
<!-- Please provide us a list of step for how to reproduce this issue. -->
24+
25+
1. Step 1
26+
2. Step 2
27+
3. etc.
28+
29+
## Error Logs
30+
<!-- Please include a paste output of the errors if they are logged. They can be found in: -->
31+
<!-- Panel: /var/www/pterodactyl/html/storage/logs/ Daemon: /srv/daemon/logs -->
32+
<!-- You can also paste them on https://gist.github.com and include their links below. -->
33+
34+
```
35+
error logs
36+
```
37+
38+
## System Information
39+
#### Output of `uname -a`:
40+
41+
```
42+
paste here
43+
```
44+
45+
#### Output of `php -v` (if Panel):
46+
47+
```
48+
paste here
49+
```
50+
51+
#### Output of `node -v` (if Daemon):
52+
53+
```
54+
paste here
55+
```
56+
57+
#### Output of `docker info` and `docker -v` (if Daemon or Dockerfiles):
58+
59+
```
60+
paste here
61+
```

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ composer.lock
88
Homestead.yaml
99
Vagrantfile
1010
Vagrantfile
11+
12+
node_modules
13+
.babelrc

.phraseapp.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
phraseapp:
2+
project_id: 94f8b39450cd749ae9c3cc0ab8cdb61d
3+
file_format: laravel
4+
push:
5+
sources:
6+
- file: ./resources/lang/<locale_code>/<tag>.php
7+
pull:
8+
targets:
9+
- file: ./resources/lang/<locale_code>/auth.php
10+
params:
11+
tag: "auth"
12+
- file: ./resources/lang/<locale_code>/base.php
13+
params:
14+
tag: "base"
15+
- file: ./resources/lang/<locale_code>/pagination.php
16+
params:
17+
tag: "pagination"
18+
- file: ./resources/lang/<locale_code>/passwords.php
19+
params:
20+
tag: "passwords"
21+
- file: ./resources/lang/<locale_code>/server.php
22+
params:
23+
tag: "server"
24+
- file: ./resources/lang/<locale_code>/strings.php
25+
params:
26+
tag: "strings"
27+
- file: ./resources/lang/<locale_code>/validation.php
28+
params:
29+
tag: "validation"

CHANGELOG.md

Lines changed: 182 additions & 2 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## Pterodactyl Panel
2-
Pterodactyl is the free game server management panel designed by users, for users. Featuring support for Vanilla Minecraft, Spigot, Source Dedicated Servers, BungeeCord, and many more. Pterodactyl is built on the `Laravel PHP Framework (v5.2)`.
2+
Pterodactyl is the free game server management panel designed by users, for users. Featuring support for Vanilla Minecraft, Spigot, Source Dedicated Servers, BungeeCord, and many more. Pterodactyl is built on the `Laravel PHP Framework (v5.3)`.
33

44
## Support & Documentation
55
Support for using Pterodactyl can be found on our [wiki](https://github.com/Pterodactyl/Panel/wiki) or on our [Discord chat](https://discord.gg/0gYt8oU8QOkDhKLS).
@@ -28,6 +28,11 @@ SOFTWARE.
2828
```
2929

3030
### Credits
31+
![](http://static.s3.pterodactyl.io/PhraseApp-parrot.png)
32+
A huge thanks to [PhraseApp](https://phraseapp.com) who provide us the software to help translate this project.
33+
34+
Ace Editor - [license](https://github.com/ajaxorg/ace/blob/master/LICENSE) - [homepage](https://ace.c9.io)
35+
3136
Animate.css - [license](https://github.com/daneden/animate.css/blob/master/LICENSE) - [homepage](http://daneden.github.io/animate.css/)
3237

3338
Async.js - [license](https://github.com/caolan/async/blob/master/LICENSE) - [homepage](https://github.com/caolan/async/)
@@ -38,22 +43,26 @@ Bootstrap - [license](https://github.com/twbs/bootstrap/blob/master/LICENSE) - [
3843

3944
BootStrap Notify - [license](https://github.com/mouse0270/bootstrap-notify/blob/master/LICENSE) - [homepage](http://bootstrap-notify.remabledesigns.com)
4045

41-
D3.js - [license](https://github.com/mbostock/d3/blob/master/LICENSE) - [homepage](https://d3js.org/)
46+
Chart.js - [license](https://github.com/chartjs/Chart.js/blob/master/LICENSE.md) - [homepage](http://www.chartjs.org)
4247

4348
FontAwesome - [license](http://fontawesome.io/license/) - [homepage](http://fontawesome.io)
4449

50+
FontAwesome Animations - [license](https://github.com/l-lin/font-awesome-animation#license) - [homepage](https://github.com/l-lin/font-awesome-animation)
51+
4552
FuelUX - [license](https://github.com/ExactTarget/fuelux/blob/master/LICENSE) - [homepage](http://getfuelux.com)
4653

4754
jQuery - [license](https://github.com/jquery/jquery/blob/master/LICENSE.txt) - [homepage](http://jquery.com)
4855

4956
jQuery Terminal - [license](https://github.com/jcubic/jquery.terminal/blob/master/LICENSE) - [homepage](http://terminal.jcubic.pl)
5057

51-
MetricsGraphics.js - [license](https://github.com/mozilla/metrics-graphics/blob/master/LICENSE) - [homepage](http://metricsgraphicsjs.org/)
58+
Lodash - [license](https://github.com/lodash/lodash/blob/master/LICENSE) - [homepage](https://lodash.com/)
5259

5360
Socket.io - [license](https://github.com/socketio/socket.io/blob/master/LICENSE) - [homepage](http://socket.io)
5461

5562
SweetAlert - [license](https://github.com/t4t5/sweetalert/blob/master/LICENSE) - [homepage](http://t4t5.github.io/sweetalert/)
5663

64+
Typeahead — [license](https://github.com/bassjobsen/Bootstrap-3-Typeahead/blob/master/bootstrap3-typeahead.js)[homepage](https://github.com/bassjobsen/Bootstrap-3-Typeahead)
65+
5766
### Additional License Information
5867
Some Javascript and CSS used within the panel is licensed under a `MIT` or `Apache 2.0`. Please check their respective header files for more information.
5968

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
<?php
2+
/**
3+
* Pterodactyl - Panel
4+
* Copyright (c) 2015 - 2016 Dane Everitt <dane@daneeveritt.com>
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in all
14+
* copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
* SOFTWARE.
23+
*/
24+
namespace Pterodactyl\Console\Commands;
25+
26+
use DB;
27+
use Carbon;
28+
use Pterodactyl\Models;
29+
use Illuminate\Console\Command;
30+
use Illuminate\Foundation\Bus\DispatchesJobs;
31+
32+
use Pterodactyl\Jobs\SendScheduledTask;
33+
34+
class ClearTasks extends Command
35+
{
36+
37+
use DispatchesJobs;
38+
39+
/**
40+
* The name and signature of the console command.
41+
*
42+
* @var string
43+
*/
44+
protected $signature = 'pterodactyl:tasks:clearlog';
45+
46+
/**
47+
* The console command description.
48+
*
49+
* @var string
50+
*/
51+
protected $description = 'Clears old log entires (> 2 months) from the last log.';
52+
53+
/**
54+
* Create a new command instance.
55+
*
56+
* @return void
57+
*/
58+
public function __construct()
59+
{
60+
parent::__construct();
61+
}
62+
63+
/**
64+
* Execute the console command.
65+
*
66+
* @return mixed
67+
*/
68+
public function handle()
69+
{
70+
$entries = Models\TaskLog::where('run_time', '<=', Carbon::now()->subHours(env('APP_CLEAR_TASKLOG', 720))->toAtomString())->get();
71+
72+
$this->info(sprintf('Preparing to delete %d old task log entries.', count($entries)));
73+
$bar = $this->output->createProgressBar(count($entries));
74+
75+
foreach ($entries as &$entry) {
76+
$entry->delete();
77+
$bar->advance();
78+
}
79+
80+
$bar->finish();
81+
$this->info("\nFinished deleting old logs.");
82+
}
83+
}

app/Console/Commands/MakeUser.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ class MakeUser extends Command
3535
*
3636
* @var string
3737
*/
38-
protected $signature = 'pterodactyl:user';
38+
protected $signature = 'pterodactyl:user
39+
{--email= : Email address to use for this account.}
40+
{--password= : Password to assign to the user.}
41+
{--admin= : Boolean flag for if user should be an admin.}';
3942

4043
/**
4144
* The console command description.
@@ -61,15 +64,15 @@ public function __construct()
6164
*/
6265
public function handle()
6366
{
64-
$email = $this->ask('Email');
65-
$password = $this->secret('Password');
66-
$password_confirmation = $this->secret('Confirm Password');
67+
$email = is_null($this->option('email')) ? $this->ask('Email') : $this->option('email');
68+
$password = is_null($this->option('password')) ? $this->secret('Password') : $this->option('password');
69+
$password_confirmation = is_null($this->option('password')) ? $this->secret('Confirm Password') : $this->option('password');
6770

6871
if ($password !== $password_confirmation) {
6972
return $this->error('The passwords provided did not match!');
7073
}
7174

72-
$admin = $this->confirm('Is this user a root administrator?');
75+
$admin = is_null($this->option('admin')) ? $this->confirm('Is this user a root administrator?') : $this->option('admin');
7376

7477
try {
7578
$user = new UserRepository;

app/Console/Commands/RunTasks.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function handle()
7474

7575
foreach ($tasks as &$task) {
7676
$bar->advance();
77-
$this->dispatch(new SendScheduledTask(Models\Server::findOrFail($task->server), $task));
77+
$this->dispatch((new SendScheduledTask(Models\Server::findOrFail($task->server), $task))->onQueue(env('QUEUE_LOW', 'low')));
7878
}
7979

8080
$bar->finish();

app/Console/Commands/UpdateEmailSettings.php

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@ class UpdateEmailSettings extends Command
3232
*
3333
* @var string
3434
*/
35-
protected $signature = 'pterodactyl:mail';
35+
protected $signature = 'pterodactyl:mail
36+
{--driver=}
37+
{--email=}
38+
{--host=}
39+
{--port=}
40+
{--username=}
41+
{--password=}';
3642

3743
/**
3844
* The console command description.
@@ -92,35 +98,35 @@ public function handle()
9298
'Postmark Transactional Email Service'
9399
]
94100
]);
95-
$variables['MAIL_DRIVER'] = $this->choice('Which email driver would you like to use?', [
101+
$variables['MAIL_DRIVER'] = is_null($this->option('driver')) ? $this->choice('Which email driver would you like to use?', [
96102
'smtp',
97103
'mail',
98104
'mailgun',
99105
'mandrill',
100106
'postmark'
101-
]);
107+
]) : $this->option('driver');
102108

103109
switch ($variables['MAIL_DRIVER']) {
104110
case 'smtp':
105-
$variables['MAIL_HOST'] = $this->ask('SMTP Host (e.g smtp.google.com)');
106-
$variables['MAIL_PORT'] = $this->anticipate('SMTP Host Port (e.g 587)', ['587']);
107-
$variables['MAIL_USERNAME'] = $this->ask('SMTP Username');
108-
$variables['MAIL_PASSWORD'] = $this->secret('SMTP Password');
111+
$variables['MAIL_HOST'] = is_null($this->option('host')) ? $this->ask('SMTP Host (e.g smtp.google.com)') : $this->option('host');
112+
$variables['MAIL_PORT'] = is_null($this->option('port')) ? $this->anticipate('SMTP Host Port (e.g 587)', ['587']) : $this->option('port');
113+
$variables['MAIL_USERNAME'] = is_null($this->option('username')) ? $this->ask('SMTP Username') : $this->option('password');
114+
$variables['MAIL_PASSWORD'] = is_null($this->option('password')) ? $this->secret('SMTP Password') : $this->option('password');
109115
break;
110116
case 'mail':
111117
break;
112118
case 'mailgun':
113-
$variables['MAILGUN_DOMAIN'] = $this->ask('Mailgun Domain');
114-
$variables['MAILGUN_KEY'] = $this->ask('Mailgun Key');
119+
$variables['MAILGUN_DOMAIN'] = is_null($this->option('host')) ? $this->ask('Mailgun Domain') : $this->option('host');
120+
$variables['MAILGUN_KEY'] = is_null($this->option('username')) ? $this->ask('Mailgun Key') : $this->option('username');
115121
break;
116122
case 'mandrill':
117-
$variables['MANDRILL_SECRET'] = $this->ask('Mandrill Secret');
123+
$variables['MANDRILL_SECRET'] = is_null($this->option('username')) ? $this->ask('Mandrill Secret') : $this->option('username');
118124
break;
119125
case 'postmark':
120126
$variables['MAIL_DRIVER'] = 'smtp';
121127
$variables['MAIL_HOST'] = 'smtp.postmarkapp.com';
122128
$variables['MAIL_PORT'] = 587;
123-
$variables['MAIL_USERNAME'] = $this->ask('Postmark API Token');
129+
$variables['MAIL_USERNAME'] = is_null($this->option('username')) ? $this->ask('Postmark API Token') : $this->option('username');
124130
$variables['MAIL_PASSWORD'] = $variables['MAIL_USERNAME'];
125131
break;
126132
default:
@@ -129,7 +135,7 @@ public function handle()
129135
break;
130136
}
131137

132-
$variables['MAIL_FROM'] = $this->ask('Email address emails should originate from');
138+
$variables['MAIL_FROM'] = is_null($this->option('email')) ? $this->ask('Email address emails should originate from') : $this->option('email');
133139
$variables['MAIL_ENCRYPTION'] = 'tls';
134140

135141
$bar = $this->output->createProgressBar(count($variables));

0 commit comments

Comments
 (0)