Compare commits

...

138 Commits

Author SHA1 Message Date
KodeStar
c16a4847f7 Update version number 2024-02-19 11:08:45 +00:00
KodeStar
9d0209c9df Merge pull request #1293 from KodeStar/2.x
Fixes to tags and show tags on application list
2024-02-19 11:08:18 +00:00
Chris Hunt
599035b3f8 Fix empty title when creating 2024-02-19 11:06:42 +00:00
Chris Hunt
f3bc6ab618 Add tags to application list, and fix home dashboard tag 2024-02-19 10:58:19 +00:00
Chris Hunt
09e4bb8cad Fix required fields and default items and tags to pinned 2024-02-19 10:03:03 +00:00
Chris Hunt
4b8bf5156d Fix prettier complaints 2024-02-19 09:56:03 +00:00
KodeStar
809a997631 Merge pull request #1291 from KodeStar/2.x
Fix upload paths
2024-02-18 20:27:26 +00:00
Chris Hunt
fb7f9de127 Fix upload paths 2024-02-18 20:26:20 +00:00
KodeStar
002bae3fb3 Merge pull request #1290 from KodeStar/feature/add_columns
Add alternate tag types
2024-02-18 18:35:43 +00:00
Chris Hunt
b7c0fd29c6 Fix extra prettier complaints 2024-02-18 18:33:47 +00:00
Chris Hunt
70252b7a43 Fix prettier complaints 2024-02-18 18:26:34 +00:00
Chris Hunt
d276bf8b1d Add alternate tag types 2024-02-18 18:16:46 +00:00
Chris Hunt
a0726a43ad Updates 2024-02-18 09:06:37 +00:00
Chris Hunt
8fa870e8eb Initial commit 2024-02-18 09:06:03 +00:00
KodeStar
d184427016 Merge pull request #1289 from linuxserver/revert-1288-2.x
Revert "Replace Mix with Vite"
2024-02-17 21:03:02 +00:00
KodeStar
36d1d55934 Revert "Replace Mix with Vite" 2024-02-17 21:02:45 +00:00
KodeStar
3a509fca47 Merge pull request #1288 from KodeStar/2.x
Replace Mix with Vite
2024-02-17 20:00:19 +00:00
KodeStar
afc07ab9bc Update ci.yml 2024-02-17 19:59:33 +00:00
KodeStar
0de1e5bd25 Merge pull request #9 from KodeStar/shift-110402
Migrate from Laravel Mix to Vite
2024-02-17 19:57:42 +00:00
Chris Hunt
029def9d90 Update vite 2024-02-17 19:56:47 +00:00
Shift
c6c9ec1d89 Ignore build assets 2024-02-17 19:03:26 +00:00
Shift
0f19e3c5de Add .vue extension to Vue imports 2024-02-17 19:03:25 +00:00
Shift
f3a4ac3619 Rename ENV variables 2024-02-17 19:03:25 +00:00
Shift
baf7131f20 Use ES modules 2024-02-17 19:03:24 +00:00
Shift
4430b21740 Remove webpack.mix.js 2024-02-17 19:03:24 +00:00
Shift
3a3cea437b Configure Vite 2024-02-17 19:03:23 +00:00
Shift
aa5a6fce4c Update build scripts 2024-02-17 19:03:23 +00:00
Shift
8781dbc9f5 Add npm dependencies 2024-02-17 19:03:23 +00:00
KodeStar
23f3a9c343 Merge pull request #1283 from KodeStar/bugfix/unable_to_load_apps
Add missing classname
2024-02-17 17:06:44 +00:00
Chris Hunt
2899b7db61 Add missing 2024-02-17 17:05:06 +00:00
KodeStar
e9bfd9a878 Merge pull request #1280 from KodeStar/bugfix/unable_to_load_apps
Unable to load apps after update to Laravel 10
2024-02-17 16:44:33 +00:00
Chris Hunt
5825858abc Unable to load apps after update to laravel 10 2024-02-17 16:42:26 +00:00
KodeStar
379ba34fe1 Merge pull request #1278 from KodeStar/bugfix/fix_language_dropdown
Fix languages dropdown
2024-02-17 15:27:55 +00:00
Chris Hunt
a0e5111771 Fix languages 2024-02-17 15:13:43 +00:00
KodeStar
c69961b200 Merge pull request #1277 from KodeStar/2.x
Update php version in CI tests
2024-02-17 10:21:13 +00:00
KodeStar
39f23103e4 Update ci.yml 2024-02-17 10:19:12 +00:00
KodeStar
e7d581244c Update ci.yml 2024-02-17 10:14:55 +00:00
KodeStar
2fea82c21e Change to php 8.3 2024-02-17 10:08:50 +00:00
Chris Hunt
274894562c Update php version in CI tests 2024-02-17 10:04:01 +00:00
KodeStar
9fbb3457d1 Add Laravel 10 dependencies 2024-02-17 08:12:27 +00:00
KodeStar
70f212c502 Update readme.md 2024-02-16 21:44:27 +00:00
KodeStar
5e2c3a5f66 Merge pull request #1276 from KodeStar/2.x
Update Laravel from 8 to 10
2024-02-16 21:41:05 +00:00
Chris Hunt
ffb5b03704 Update version 2024-02-16 21:38:25 +00:00
Chris Hunt
d52ae0d3c3 Update dependencies 2024-02-16 21:36:54 +00:00
KodeStar
22d7a59e59 Merge pull request #8 from KodeStar/shift-110368
Laravel 10.x Shift
2024-02-16 21:30:12 +00:00
Shift
f3a5be79dc Remove redundant typing from DocBlocks 2024-02-16 21:13:14 +00:00
Shift
3487f52a6b Add type hints from DocBlocks 2024-02-16 21:13:14 +00:00
Shift
2cb837e4b5 Add type hints for Laravel 10 2024-02-16 21:13:13 +00:00
Shift
8725493fcf Rename password_resets table 2024-02-16 21:13:11 +00:00
Shift
e902b3a38a Bump Composer dependencies 2024-02-16 21:13:09 +00:00
Shift
854fb420c2 Default config files
In an effort to make upgrading the constantly changing config files
easier, Shift defaulted them and merged your true customizations -
where ENV variables may not be used.
2024-02-16 21:13:09 +00:00
Shift
5b4e14d886 Shift config files 2024-02-16 21:13:09 +00:00
Shift
ef25ec4f69 Shift core files 2024-02-16 21:13:07 +00:00
Shift
b943674881 Remove explicit call to register policies 2024-02-16 21:12:58 +00:00
Shift
3188a8f311 Convert string references to ::class
PHP 5.5.9 adds the new static `class` property which provides the fully qualified class name. This is preferred over using strings for class names since the `class` property references are checked by PHP.
2024-02-16 21:12:53 +00:00
KodeStar
095aff86c2 Merge pull request #7 from KodeStar/shift-110367
Laravel 9.x Shift
2024-02-16 21:11:51 +00:00
Shift
018996526c Shift cleanup 2024-02-16 20:33:47 +00:00
Shift
1c73cf08de Adopt anonymous migrations 2024-02-16 20:33:46 +00:00
Shift
4bfcd643e6 Use <env> tags for configuration
`<env>` tags have a lower precedence than system environment variables making it easier to overwrite PHPUnit configuration values in additional environments, such a CI.

Review this blog post for more details on configuration precedence when testing Laravel: https://jasonmccreary.me/articles/laravel-testing-configuration-precedence/
2024-02-16 20:33:44 +00:00
Shift
04b8ede8db Bump Composer dependencies 2024-02-16 20:33:43 +00:00
Shift
a6ae60270f Default config files
In an effort to make upgrading the constantly changing config files
easier, Shift defaulted them and merged your true customizations -
where ENV variables may not be used.
2024-02-16 20:33:43 +00:00
Shift
ee3361d9c9 Shift config files 2024-02-16 20:33:43 +00:00
Shift
42b5a294d0 Adopt class based routes 2024-02-16 20:33:38 +00:00
Shift
14b89ac44d Convert route options to fluent methods
Laravel 8 adopts the tuple syntax for controller actions. Since the old options array is incompatible with this syntax, Shift converted them to use modern, fluent methods.
2024-02-16 20:33:37 +00:00
Shift
ad86e54f37 Remove unnecessary $model property 2024-02-16 20:33:37 +00:00
Shift
0f4b336d82 Remove web.config 2024-02-16 20:33:37 +00:00
Shift
6423ccd075 Shift core files 2024-02-16 20:33:36 +00:00
Shift
72cd16afa1 Upgrade to Flysystem 3.0 2024-02-16 20:33:33 +00:00
Shift
d41c4c8d4c Replace deprecated HEADER_X_FORWARDED_ALL constant 2024-02-16 20:33:33 +00:00
Shift
2b602ce66d Streamline $commands property 2024-02-16 20:33:32 +00:00
Shift
aa72ce0a3f Shift registered middleware 2024-02-16 20:33:32 +00:00
Shift
825ff6a6c8 Move resources/lang folder 2024-02-16 20:33:30 +00:00
Shift
be93195188 Convert string references to ::class
PHP 5.5.9 adds the new static `class` property which provides the fully qualified class name. This is preferred over using strings for class names since the `class` property references are checked by PHP.
2024-02-16 20:33:27 +00:00
Shift
51b30e55cd Adopt short array syntax
Since PHP 5.4 the short array syntax `[]` may be used instead of `array()`.
2024-02-16 20:33:26 +00:00
KodeStar
ecb668a8f3 Merge pull request #1155 from TheDen/add-search-application-item
add search via select2 for application dropdown
2024-02-12 19:44:23 +00:00
KodeStar
2e96b7bd09 Update app.php version 2023-11-11 15:04:44 +00:00
KodeStar
768e7a6576 Merge pull request #1222 from fyutins/2.x
Fix and add SVG support
2023-11-11 14:58:41 +00:00
Fyutins
431eafb2b6 Fix and add SVG support 2023-09-26 18:51:12 +02:00
Ian Jones
d2184eef0a Update readme.md (#1186)
Spelling and Grammar, included a few apostrophes for correct plural form or possessive. 

Added Capitalization to proper nouns

Included a single colon for consistency to match the styling of  it's predecessor paragraph
2023-08-09 11:21:57 +02:00
Attila Kerekes
fbd050d4e4 fix: validate icons to be images (#1173) 2023-06-06 12:08:47 +02:00
Attila Kerekes
5d67f570a9 fix: validate icons to be images (#1167) 2023-06-05 18:27:30 +02:00
Attila Kerekes
7d016cdaa6 fix: Remove mix from trianglify.js (#1166) 2023-05-26 13:36:07 +02:00
ullbergm
6e954a355d Add Trianglify (#1158) 2023-05-26 10:23:06 +02:00
KodeStar
60faccad27 Remove register route (#1163) 2023-05-20 21:56:34 +02:00
jatdung
1f5493ac98 fix sortable tooltip (#1130) 2023-05-16 16:42:17 +02:00
TheDen
427353bdfc add search via select2 for application dropdown 2023-04-29 18:25:02 +10:00
aptalca
9c117b7946 Merge pull request #1150 from linuxserver/2.x-project
handle issue-pr close and review submitted actions
2023-04-19 09:22:36 -04:00
aptalca
c72fee9644 handle issue-pr close and review submitted actions 2023-04-14 15:31:46 -04:00
aptalca
0999bebcb4 Merge pull request #1147 from linuxserver/2.x-issues
add issue-pr workflows
2023-04-08 19:00:40 -04:00
aptalca
1c41e3d1ef add issue-pr workflows 2023-04-06 15:25:53 -04:00
Chris Hunt
ed3cd79c92 Change minor version ready for next release 2023-03-09 16:17:32 +00:00
Chris Hunt
192002f898 Update minor version 2023-03-09 16:10:51 +00:00
jatdung
18f7306b2c Update Chinese language. (#1124) 2023-03-07 17:51:19 +01:00
jatdung
e9754519be fix Request class error (#1126) 2023-03-07 12:32:58 +01:00
ShiftHackZ
1c276fbfc2 feat: Added Ukrainian translation (#1125) 2023-03-07 12:32:01 +01:00
jatdung
cefe07d218 fix language setting only available in view (#1117) 2023-02-23 18:24:11 +01:00
jatdung
cd4b522935 use sortablejs instead of jquery-ui (#1115) 2023-02-10 21:32:58 +01:00
angrystar170
1ad5603c3e Update Korean language. (#1116) 2023-02-10 21:30:38 +01:00
Attila Kerekes
302e04bb12 fix: Update jquery, jquery-ui (#1113) 2023-02-04 20:34:49 +01:00
Attila Kerekes
49dab6e72b fix: Add more error handling for app test (#1111) 2023-02-01 11:43:26 +01:00
Filipe F Moreira
c5d0769afb Add BR translations (#1080) 2023-01-16 20:14:33 +01:00
KodeStar
4005894c16 Update app.php 2023-01-09 19:28:56 +00:00
Attila Kerekes
a4022ce517 fix: Escape app title and tag title on list pages CVE-2022-47968 (#1088) 2023-01-05 20:31:15 +01:00
Attila Kerekes
cd07d47445 fix: Add more verbose error when uploading background image (#1082) 2022-12-24 10:56:00 +01:00
Attila Kerekes
df70dcc521 feat: Add tags as classes to items (#1079) 2022-12-19 14:40:38 +01:00
Attila Kerekes
9e6321e500 fix: Enable tag slug creation from CN characters (#1077) 2022-12-16 10:26:00 +01:00
KodeStar
0d9850c1c7 Merge pull request #1073 from linuxserver/fix/395
fix: Autologin forces logout
2022-12-15 23:38:36 +00:00
Attila Kerekes
4d3083886e fix: Autologin forces logout 2022-12-15 22:21:16 +01:00
KodeStar
52f59afe63 Merge pull request #1072 from linuxserver/fix/895
fix: Public access to front also applies to tags
2022-12-15 19:48:54 +00:00
Attila Kerekes
aa886e4f77 fix: Public access to front also applies to tags 2022-12-15 20:17:08 +01:00
Attila Kerekes
3c9f361f5f chore: Add eslint github check (#1067) 2022-12-11 18:44:37 +01:00
Attila Kerekes
5eb1f55b82 chore: Add php code sniffer github check (#1066) 2022-12-11 11:58:58 +01:00
KodeStar
d910f8e4f7 Merge pull request #1065 from linuxserver/feat/health
feat: Add health endpoint
2022-12-11 09:46:20 +00:00
Attila Kerekes
751b23a5e4 feat: Add health endpoint 2022-12-11 01:39:39 +01:00
Yusuke Arakawa
a4fa490fb4 feat: Add Japanese language (#1064)
Co-authored-by: Yusuke Arakawa <nekolaboratory@users.noreply.github.com>
2022-12-09 23:43:23 +01:00
Yusuke Arakawa
662f6ac3eb chore: Sort the supported language list of readme.md (#1062) 2022-12-09 09:40:52 +01:00
Attila Kerekes
11257a272e feat: Introduce queue based live stat refresh (#1059) 2022-12-05 16:29:06 +01:00
Attila Kerekes
6b93f8ed5c test: Add item create test (#1058) 2022-12-05 16:28:18 +01:00
Attila Kerekes
8f9b2959b2 feat: Add basic import screen (#1056)
Co-authored-by: Chris Hunt <chris.hunt@kasmweb.com>
2022-12-04 22:12:54 +01:00
Attila Kerekes
45cc84c99c test: Add feature tests 2022-12-04 17:21:03 +00:00
Attila Kerekes
52620bc331 chore: Add laravel ide helper 2022-12-01 09:17:54 +00:00
Attila Kerekes
bd76efc613 chore: Migrate route definition to Laravel 8 format 2022-11-29 21:34:11 +00:00
Attila Kerekes
6dead1c529 fix: Make supportedApps legacy interface compatible 2022-11-29 19:26:07 +00:00
Attila Kerekes
bb5a078f35 feat: Add export import 2022-11-29 17:32:46 +00:00
Attila Kerekes
2ee5d07e48 fix: Make supportedapps compatible with legacy interface 2022-11-29 17:26:40 +00:00
Attila Kerekes
d30edb6749 chore: Add eslint prettier phpcs config PSR2 2022-11-28 19:47:10 +00:00
Chris Hunt
a53192beeb FIx: Blur onauxclick as well 2022-11-28 08:33:05 +00:00
Chris Hunt
ef1ffe880d Update version to 2.5.4 2022-11-28 08:30:34 +00:00
KodeStar
877b31f947 Merge pull request #1041 from linuxserver/bug/links_opening_in_new_tab_keep_focus
Blur tiles after clicking on them
2022-11-26 17:02:45 +00:00
Chris Hunt
827088df76 Blur tiles after clicking on them 2022-11-26 14:48:54 +00:00
Attila Kerekes
a12c1d559d fix: Use correct appTest argument type 2022-11-26 13:31:05 +00:00
KodeStar
f0b60fc19a Merge pull request #1039 from linuxserver/fix/1038
fix: Enter should open search when not tile search is selected
2022-11-26 12:00:43 +00:00
Attila Kerekes
7c4619adb9 fix: Enter should open search when not tile search is selected 2022-11-26 12:22:12 +01:00
KodeStar
aa49a5fb42 Fixes #371 Tagged items when pinning/unpinning (#1036) 2022-11-25 23:21:45 +00:00
Attila Jozsef Kerekes
7565bd4028 chore: Add php code sniffer and apply fixes 2022-11-25 23:05:58 +00:00
Chris Hunt
181b7564e8 Merge branch '2.x' of github.com:linuxserver/Heimdall into 2.x 2022-11-25 16:23:40 +00:00
Chris Hunt
0d3640b67a Fix asset links 2022-11-25 16:23:34 +00:00
Attila Kerekes
82b209d4b5 fix: Test enhanced app with apikey 2022-11-25 16:11:39 +00:00
10849 changed files with 707443 additions and 269421 deletions

3
.eslintignore Normal file
View File

@@ -0,0 +1,3 @@
huebee.js
jquery-ui.min.js
bootstrap.js

13
.eslintrc Normal file
View File

@@ -0,0 +1,13 @@
{
"extends": ["airbnb-base", "prettier"],
"plugins": ["prettier"],
"rules": {
"prettier/prettier": ["error"]
},
"env": {
"browser": true
},
"globals": {
"$": true
}
}

View File

@@ -0,0 +1,16 @@
name: Issue & PR Tracker
on:
issues:
types: [opened,reopened,labeled,unlabeled,closed]
pull_request_target:
types: [opened,reopened,review_requested,review_request_removed,labeled,unlabeled,closed]
pull_request_review:
types: [submitted,edited,dismissed]
jobs:
manage-project:
permissions:
issues: write
uses: linuxserver/github-workflows/.github/workflows/issue-pr-tracker.yml@v1
secrets: inherit

13
.github/workflows/call_issues_cron.yml vendored Normal file
View File

@@ -0,0 +1,13 @@
name: Mark stale issues and pull requests
on:
schedule:
- cron: '35 15 * * *'
workflow_dispatch:
jobs:
stale:
permissions:
issues: write
pull-requests: write
uses: linuxserver/github-workflows/.github/workflows/issues-cron.yml@v1
secrets: inherit

View File

@@ -12,7 +12,7 @@ jobs:
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: '7.4'
php-version: '8.3'
extensions: mbstring, dom, fileinfo, mysql, libxml, xml, xmlwriter, dom, tokenizer, filter, json, phar, pcre, openssl, pdo, intl, curl
- name: Cache composer dependencies
@@ -21,10 +21,10 @@ jobs:
path: vendor
key: composer-${{ hashFiles('composer.lock') }}
- name: Run composer install
run: composer install -n --prefer-dist
env:
APP_ENV: testing
#- name: Run composer install
# run: composer install -n --prefer-dist
# env:
# APP_ENV: testing
- name: Prepare Laravel Application
run: |
@@ -40,14 +40,20 @@ jobs:
- name: Run yarn
run: yarn && yarn dev
- name: Run ESLint
run: yarn lint
- name: Run tests
run: ./vendor/bin/phpunit
run: php artisan test
env:
APP_ENV: testing
- name: Php code sniffer
run: ./vendor/bin/phpcs --config-set ignore_warnings_on_exit 1
- name: Upload artifacts
uses: actions/upload-artifact@master
if: failure()
with:
name: Logs
path: ./storage/logs
path: ./storage/logs

2339
.phpstorm.meta.php Normal file

File diff suppressed because it is too large Load Diff

22155
_ide_helper.php Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -2,9 +2,43 @@
namespace App;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
/**
* App\Application
*
* @property string $appid
* @property string $name
* @property string|null $sha
* @property string|null $icon
* @property string|null $website
* @property string|null $license
* @property string|null $description
* @property int $enhanced
* @property string $tile_background
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property string|null $class
* @method static Builder|Application newModelQuery()
* @method static Builder|Application newQuery()
* @method static Builder|Application query()
* @method static Builder|Application whereAppid($value)
* @method static Builder|Application whereClass($value)
* @method static Builder|Application whereCreatedAt($value)
* @method static Builder|Application whereDescription($value)
* @method static Builder|Application whereEnhanced($value)
* @method static Builder|Application whereIcon($value)
* @method static Builder|Application whereLicense($value)
* @method static Builder|Application whereName($value)
* @method static Builder|Application whereSha($value)
* @method static Builder|Application whereTileBackground($value)
* @method static Builder|Application whereUpdatedAt($value)
* @method static Builder|Application whereWebsite($value)
*/
class Application extends Model
{
/**
@@ -32,17 +66,11 @@ class Application extends Model
return $this->icon;
}
/**
* @return string
*/
public function iconView(): string
{
return asset('storage/'.$this->icon);
}
/**
* @return string
*/
public function defaultColour(): string
{
// check if light or dark
@@ -53,36 +81,27 @@ class Application extends Model
return '#161b1f';
}
/**
* @return string
*/
public function class(): string
{
$name = $this->name;
$name = preg_replace('/[^\p{L}\p{N}]/u', '', $name);
$class = '\App\SupportedApps\\'.$name.'\\'.$name;
return $class;
return \App\SupportedApps::class.'\\'.$name.'\\'.$name;
}
/**
* @param $name
* @return string
*/
public static function classFromName($name)
public static function classFromName($name): string
{
$name = preg_replace('/[^\p{L}\p{N}]/u', '', $name);
$class = '\App\SupportedApps\\'.$name.'\\'.$name;
$class = \App\SupportedApps::class.'\\'.$name.'\\'.$name;
return $class;
}
/**
* @return \Illuminate\Support\Collection
*/
public static function apps(): \Illuminate\Support\Collection
public static function apps(): Collection
{
$json = json_decode(file_get_contents(storage_path('app/supportedapps.json'))) ?? [];
$apps = collect($json->apps);
@@ -90,9 +109,6 @@ class Application extends Model
return $apps->sortBy('name', SORT_NATURAL | SORT_FLAG_CASE);
}
/**
* @return array
*/
public static function autocomplete(): array
{
$apps = self::apps();
@@ -110,6 +126,7 @@ class Application extends Model
/**
* @param $appid
* @return mixed|null
* @throws GuzzleException
*/
public static function getApp($appid)
{
@@ -121,13 +138,12 @@ class Application extends Model
$application = ($localapp) ? $localapp : new self;
// Files missing? || app not in db || old sha version
if (
! file_exists(app_path('SupportedApps/'.className($app->name))) ||
if (! file_exists(app_path('SupportedApps/'.className($app->name))) ||
! $localapp ||
$localapp->sha !== $app->sha
) {
$gotFiles = SupportedApps::getFiles($app);
if($gotFiles) {
if ($gotFiles) {
$app = SupportedApps::saveApp($app, $application);
}
}
@@ -147,7 +163,7 @@ class Application extends Model
if ($app === null) {
// Try in db for Private App
$appModel = self::where('appid', $appid)->first();
if($appModel) {
if ($appModel) {
$app = json_decode($appModel->toJson());
}
}
@@ -156,14 +172,11 @@ class Application extends Model
return null;
}
$classname = preg_replace('/[^\p{L}\p{N}]/u', '', $app->name);
$app->class = '\App\SupportedApps\\'.$classname.'\\'.$classname;
$app->class = \App\SupportedApps::class.'\\'.$classname.'\\'.$classname;
return $app;
}
/**
* @return array
*/
public static function applist(): array
{
$list = [];
@@ -176,7 +189,7 @@ class Application extends Model
// Check for private apps in the db
$appsListFromDB = self::all(['appid', 'name']);
foreach($appsListFromDB as $app) {
foreach ($appsListFromDB as $app) {
// Already existing keys are overwritten,
// only private apps should be added at the end
$list[$app->appid] = $app->name;

View File

@@ -35,10 +35,8 @@ class RegisterApp extends Command
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
public function handle(): void
{
$folder = $this->argument('folder');
if ($folder == 'all') {
@@ -54,7 +52,10 @@ class RegisterApp extends Command
}
}
public function addApp($folder, $remove = false)
/**
* @param $folder
*/
public function addApp($folder, bool $remove = false): void
{
$json = app_path('SupportedApps/'.$folder.'/app.json');
@@ -88,7 +89,12 @@ class RegisterApp extends Command
$this->info('Application Added - ' . $app->name . ' - ' . $app->appid);
}
private function saveIcon($appFolder, $icon) {
/**
* @param $appFolder
* @param $icon
*/
private function saveIcon($appFolder, $icon): void
{
$iconPath = app_path('SupportedApps/' . $appFolder . '/' . $icon);
$contents = file_get_contents($iconPath);
Storage::disk('public')->put('icons/'.$icon, $contents);

View File

@@ -7,22 +7,10 @@ use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
//
];
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
protected function schedule(Schedule $schedule): void
{
// $schedule->command('inspire')
// ->hourly();
@@ -30,10 +18,8 @@ class Kernel extends ConsoleKernel
/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
protected function commands(): void
{
$this->load(__DIR__.'/Commands');

View File

@@ -8,18 +8,9 @@ use Throwable;
class Handler extends ExceptionHandler
{
/**
* A list of the exception types that are not reported.
* The list of the inputs that are never flashed to the session on validation exceptions.
*
* @var array
*/
protected $dontReport = [
//
];
/**
* A list of the inputs that are never flashed for validation exceptions.
*
* @var array
* @var array<int, string>
*/
protected $dontFlash = [
'current_password',
@@ -29,10 +20,8 @@ class Handler extends ExceptionHandler
/**
* Register the exception handling callbacks for the application.
*
* @return void
*/
public function register()
public function register(): void
{
$this->reportable(function (Throwable $e) {
//

View File

@@ -2,43 +2,61 @@
use Illuminate\Support\Str;
function format_bytes($bytes, $is_drive_size = true, $beforeunit = '', $afterunit = '')
/**
* @param $bytes
* @param bool $is_drive_size
* @param string $beforeunit
* @param string $afterunit
* @return string
*/
function format_bytes($bytes, bool $is_drive_size = true, string $beforeunit = '', string $afterunit = ''): string
{
$btype = ($is_drive_size === true) ? 1000 : 1024;
$labels = ['B', 'KB', 'MB', 'GB', 'TB'];
for ($x = 0; $bytes >= $btype && $x < (count($labels) - 1); $bytes /= $btype, $x++); // use 1000 rather than 1024 to simulate HD size not real size
// use 1000 rather than 1024 to simulate HD size not real size
for ($x = 0; $bytes >= $btype && $x < (count($labels) - 1); $bytes /= $btype, $x++) ;
if ($labels[$x] == 'TB') {
return round($bytes, 3).$beforeunit.$labels[$x].$afterunit;
return round($bytes, 3) . $beforeunit . $labels[$x] . $afterunit;
} elseif ($labels[$x] == 'GB') {
return round($bytes, 2).$beforeunit.$labels[$x].$afterunit;
return round($bytes, 2) . $beforeunit . $labels[$x] . $afterunit;
} elseif ($labels[$x] == 'MB') {
return round($bytes, 2).$beforeunit.$labels[$x].$afterunit;
return round($bytes, 2) . $beforeunit . $labels[$x] . $afterunit;
} else {
return round($bytes, 0).$beforeunit.$labels[$x].$afterunit;
return round($bytes, 0) . $beforeunit . $labels[$x] . $afterunit;
}
}
function str_slug($title, $separator = '-', $language = 'en')
/**
* @param $title
* @param string $separator
* @param string $language
* @return string
*/
function str_slug($title, string $separator = '-', string $language = 'en'): string
{
return Str::slug($title, $separator, $language);
}
if (! function_exists('str_is')) {
if (!function_exists('str_is')) {
/**
* Determine if a given string matches a given pattern.
*
* @param string|array $pattern
* @param string $value
* @param string|array $pattern
* @param string $value
* @return bool
*
* @deprecated Str::is() should be used directly instead. Will be removed in Laravel 6.0.
*/
function str_is($pattern, $value)
function str_is($pattern, string $value): bool
{
return Str::is($pattern, $value);
}
}
/**
* @param $hex
* @return float|int
*/
function get_brightness($hex)
{
// returns brightness value from 0 to 255
@@ -46,7 +64,7 @@ function get_brightness($hex)
// $hex = str_replace('#', '', $hex);
$hex = preg_replace("/[^0-9A-Fa-f]/", '', $hex);
if (strlen($hex) == 3) {
$hex = $hex[0].$hex[0].$hex[1].$hex[1].$hex[2].$hex[2];
$hex = $hex[0] . $hex[0] . $hex[1] . $hex[1] . $hex[2] . $hex[2];
}
$c_r = hexdec(substr($hex, 0, 2));
@@ -56,7 +74,11 @@ function get_brightness($hex)
return (($c_r * 299) + ($c_g * 587) + ($c_b * 114)) / 1000;
}
function title_color($hex)
/**
* @param $hex
* @return string
*/
function title_color($hex): string
{
if (get_brightness($hex) > 130) {
return ' black';
@@ -65,20 +87,52 @@ function title_color($hex)
}
}
function getLinkTargetAttribute()
/**
* @return string
*/
function getLinkTargetAttribute(): string
{
$target = \App\Setting::fetch('window_target');
if ($target === 'current') {
return '';
} else {
return ' target="'.$target.'"';
return ' target="' . $target . '"';
}
}
/**
* @param $name
* @return array|string|string[]|null
*/
function className($name)
{
$name = preg_replace('/[^\p{L}\p{N}]/u', '', $name);
return $name;
return preg_replace('/[^\p{L}\p{N}]/u', '', $name);
}
/**
* @param string $file
* @param string $extension
* @return bool
*/
function isImage(string $file, string $extension): bool
{
$allowedExtensions = ['jpg', 'jpeg', 'png', 'bmp', 'gif', 'svg', 'webp'];
if (!in_array($extension, $allowedExtensions)) {
return false;
}
$tempFileName = @tempnam("/tmp", "image-check-");
$handle = fopen($tempFileName, "w");
fwrite($handle, $file);
fclose($handle);
if ($extension == 'svg') {
return 'image/svg+xml' === mime_content_type($tempFileName);
}
$size = @getimagesize($tempFileName);
return is_array($size) && str_starts_with($size['mime'], 'image');
}

View File

@@ -4,11 +4,17 @@ namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\User;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Contracts\View\Factory;
use Illuminate\Contracts\View\View;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Session;
use Illuminate\Support\Facades\URL;
use Illuminate\Validation\ValidationException;
use Symfony\Component\HttpFoundation\Response;
class LoginController extends Controller
{
@@ -30,7 +36,7 @@ class LoginController extends Controller
*
* @var string
*/
protected $redirectTo = '/';
protected string $redirectTo = '/';
/**
* Create a new controller instance.
@@ -40,10 +46,10 @@ class LoginController extends Controller
public function __construct()
{
Session::put('backUrl', URL::previous());
$this->middleware('guest')->except('logout');
$this->middleware('guest')->except(['logout','autologin']);
}
public function username()
public function username(): string
{
return 'username';
}
@@ -51,12 +57,10 @@ class LoginController extends Controller
/**
* Handle a login request to the application.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\Response|\Illuminate\Http\JsonResponse
*
* @throws \Illuminate\Validation\ValidationException
* @throws ValidationException
*/
public function login(Request $request)
public function login(Request $request): Response
{
$current_user = User::currentUser();
$request->merge(['username' => $current_user->username, 'remember' => true]);
@@ -88,7 +92,7 @@ class LoginController extends Controller
{
}
public function setUser(User $user)
public function setUser(User $user): RedirectResponse
{
Auth::logout();
session(['current_user' => $user]);
@@ -96,10 +100,21 @@ class LoginController extends Controller
return redirect()->route('dash');
}
public function autologin($uuid)
/**
* @param $uuid
*/
public function autologin($uuid): RedirectResponse
{
Auth::logout();
$user = User::where('autologin', $uuid)->first();
if (!$user) {
return redirect()->route('dash');
}
Auth::login($user, true);
session(['current_user' => $user]);
return redirect()->route('dash');
@@ -108,18 +123,24 @@ class LoginController extends Controller
/**
* Show the application's login form.
*
* @return \Illuminate\Http\Response
* @return Application|Factory|View
*/
public function showLoginForm()
public function showLoginForm(): \Illuminate\View\View
{
return view('auth.login');
}
protected function authenticated(Request $request, $user)
/**
* @param $user
*/
protected function authenticated(Request $request, $user): RedirectResponse
{
return back();
}
/**
* @return mixed|string
*/
public function redirectTo()
{
return Session::get('url.intended') ? Session::get('url.intended') : $this->redirectTo;

View File

@@ -27,7 +27,7 @@ class RegisterController extends Controller
*
* @var string
*/
protected $redirectTo = '/';
protected string $redirectTo = '/';
/**
* Create a new controller instance.
@@ -41,11 +41,8 @@ class RegisterController extends Controller
/**
* Get a validator for an incoming registration request.
*
* @param array $data
* @return \Illuminate\Contracts\Validation\Validator
*/
protected function validator(array $data)
protected function validator(array $data): \Illuminate\Contracts\Validation\Validator
{
return Validator::make($data, [
'name' => 'required|string|max:255',
@@ -56,11 +53,8 @@ class RegisterController extends Controller
/**
* Create a new user instance after a valid registration.
*
* @param array $data
* @return \App\User
*/
protected function create(array $data)
protected function create(array $data): User
{
return User::create([
'name' => $data['name'],

View File

@@ -25,7 +25,7 @@ class ResetPasswordController extends Controller
*
* @var string
*/
protected $redirectTo = '/';
protected string $redirectTo = '/';
/**
* Create a new controller instance.

View File

@@ -4,13 +4,12 @@ namespace App\Http\Controllers;
use App\User;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;
class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
use AuthorizesRequests, ValidatesRequests;
protected $user;

View File

@@ -0,0 +1,51 @@
<?php
namespace App\Http\Controllers;
use App\Item;
use App\User;
use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\RateLimiter;
class HealthController extends Controller
{
private static function getUsers(): int
{
return User::count();
}
private static function getItems(): int
{
return Item::select('id')
->where('deleted_at', null)
->where('type', '0')
->count();
}
/**
* Handle the incoming request.
*
* @return JsonResponse|Response
* @throws BindingResolutionException
*/
public function __invoke(Request $request)
{
$REQUESTS_MAX_PER_MIN = 30;
$STATUS_TOO_MANY_REQUESTS = 429;
if (RateLimiter::remaining('health', $REQUESTS_MAX_PER_MIN) < 1) {
return response()->make('Too many attempts.', $STATUS_TOO_MANY_REQUESTS);
}
RateLimiter::hit('health');
return response()->json([
'status' => 'ok',
'items' => self::getItems(),
'users' => self::getUsers(),
]);
}
}

View File

@@ -19,8 +19,6 @@ class HomeController extends Controller
/**
* Show the application dashboard.
*
* @return RedirectResponse
*/
public function index(): RedirectResponse
{

View File

@@ -0,0 +1,28 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\View\View;
class ImportController extends Controller
{
/**
* Instantiate a new controller instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
$this->middleware('allowed');
}
/**
* Handle the incoming request.
*/
public function __invoke(Request $request): View
{
return view('items.import');
}
}

View File

@@ -6,17 +6,21 @@ use App\Application;
use App\Item;
use App\Jobs\ProcessApps;
use App\User;
use Artisan;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\ConnectException;
use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\Exception\ServerException;
use Illuminate\Contracts\View\View;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Routing\Redirector;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\URL;
use Illuminate\Validation\ValidationException;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\StreamInterface;
class ItemController extends Controller
{
@@ -28,21 +32,39 @@ class ItemController extends Controller
/**
* Display a listing of the resource on the dashboard.
*
* @return View
*/
public function dash(): View
{
$data['apps'] = Item::whereHas('parents', function ($query) {
$query->where('id', 0);
})->orWhere('type', 1)->pinned()->orderBy('order', 'asc')->get();
$treat_tags_as = \App\Setting::fetch('treat_tags_as');
$data['all_apps'] = Item::whereHas('parents', function ($query) {
$query->where('id', 0);
})->orWhere('type', 1)->orderBy('order', 'asc')->get();
$data["treat_tags_as"] = $treat_tags_as;
if ($treat_tags_as == 'categories') {
$data['categories'] = Item::whereHas('children')->with('children', function ($query) {
$query->pinned()->orderBy('order', 'asc');
})->pinned()->orderBy('order', 'asc')->get();
} elseif ($treat_tags_as == 'tags') {
$data['apps'] = Item::with('parents')->where('type', 0)->pinned()->orderBy('order', 'asc')->get();
$data['all_apps'] = Item::where('type', 0)->orderBy('order', 'asc')->get();
$data['taglist'] = Item::where('id', 0)->orWhere(function($query) {
$query->where('type', 1)->pinned();
})->orderBy('order', 'asc')->get();
} else {
$data['apps'] = Item::whereHas('parents', function ($query) {
$query->where('id', 0);
})->orWhere('type', 1)->pinned()->orderBy('order', 'asc')->get();
$data['all_apps'] = Item::whereHas('parents', function ($query) {
$query->where('id', 0);
})->orWhere(function ($query) {
$query->where('type', 1)->whereNot('id', 0);
})->orderBy('order', 'asc')->get();
}
//$data['all_apps'] = Item::doesntHave('parents')->get();
//die(print_r($data['apps']));
// die(print_r($data));
return view('welcome', $data);
}
@@ -65,7 +87,6 @@ class ItemController extends Controller
* Pin item on the dashboard.
*
* @param $id
* @return RedirectResponse
*/
public function pin($id): RedirectResponse
{
@@ -81,7 +102,6 @@ class ItemController extends Controller
* Unpin item on the dashboard.
*
* @param $id
* @return RedirectResponse
*/
public function unpin($id): RedirectResponse
{
@@ -104,13 +124,21 @@ class ItemController extends Controller
$new = !(((bool)$item->pinned === true));
$item->pinned = $new;
$item->save();
if ($ajax) {
if (is_numeric($tag) && $tag > 0) {
$item = Item::whereId($tag)->first();
$data['apps'] = $item->children()->pinned()->orderBy('order', 'asc')->get();
} else {
$data['apps'] = Item::pinned()->orderBy('order', 'asc')->get();
$item = Item::whereId($tag)->first();
$data['apps'] = new Collection;
if ((int)$tag === 0) {
$tags = Item::where('type', 1)->pinned()->orderBy('order', 'asc')->get();
$data['apps'] = $data['apps']->merge($tags);
}
$apps = $item->children()->pinned()->orderBy('order', 'asc')->get();
$data['apps'] = $data['apps']->merge($apps);
$data['ajax'] = true;
return view('sortable', $data);
@@ -123,12 +151,10 @@ class ItemController extends Controller
/**
* Display a listing of the resource.
*
* @return View
*/
public function index(Request $request)
public function index(Request $request): View
{
$trash = (bool) $request->input('trash');
$trash = (bool)$request->input('trash');
$data['apps'] = Item::ofType('item')->orderBy('title', 'asc')->get();
$data['trash'] = Item::ofType('item')->onlyTrashed()->get();
@@ -141,8 +167,6 @@ class ItemController extends Controller
/**
* Show the form for creating a new resource.
*
* @return View
*/
public function create(): View
{
@@ -156,9 +180,6 @@ class ItemController extends Controller
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return View
*/
public function edit(int $id): View
{
@@ -181,47 +202,48 @@ class ItemController extends Controller
}
/**
* @param Request $request
* @param $id
* @return void
* @param null $id
* @throws ValidationException
*/
public function storelogic(Request $request, $id = null)
public static function storelogic(Request $request, $id = null): Item
{
$application = Application::single($request->input('appid'));
$validatedData = $request->validate([
'title' => 'required|max:255',
'url' => 'required',
'file' => 'image'
]);
if ($request->hasFile('file')) {
$path = $request->file('file')->store('icons');
$path = $request->file('file')->store('icons', 'public');
$request->merge([
'icon' => $path,
]);
} elseif (strpos($request->input('icon'), 'http') === 0) {
$options=array(
"ssl"=>array(
"verify_peer"=>false,
"verify_peer_name"=>false,
),
);
$options = [
"ssl" => [
"verify_peer" => false,
"verify_peer_name" => false,
],
];
$file = $request->input('icon');
$path_parts = pathinfo($file);
$extension = $path_parts['extension'];
$contents = file_get_contents($request->input('icon'), false, stream_context_create($options));
if ($application) {
$icon = $application->icon;
} else {
$file = $request->input('icon');
$path_parts = pathinfo($file);
$icon = md5($contents);
$icon .= '.'.$path_parts['extension'];
if (!isImage($contents, $extension)) {
throw ValidationException::withMessages(['file' => 'Icon must be an image.']);
}
$path = 'icons/'.$icon;
$path = 'icons/' . ($application ? $application->icon : md5($contents) . '.' . $extension);
// Private apps could have here duplicated icons folder
if (strpos($path, 'icons/icons/') !== false) {
$path = str_replace('icons/icons/','icons/',$path);
$path = str_replace('icons/icons/', 'icons/', $path);
}
if(! Storage::disk('public')->exists($path)) {
if (!Storage::disk('public')->exists($path)) {
Storage::disk('public')->put($path, $contents);
}
$request->merge([
@@ -266,17 +288,15 @@ class ItemController extends Controller
}
$item->parents()->sync($request->tags);
return $item;
}
/**
* Store a newly created resource in storage.
*
* @param Request $request
* @return RedirectResponse
*/
public function store(Request $request): RedirectResponse
{
$this->storelogic($request);
self::storelogic($request);
$route = route('dash', []);
@@ -286,9 +306,6 @@ class ItemController extends Controller
/**
* Display the specified resource.
*
* @param int $id
* @return void
*/
public function show(int $id): void
{
@@ -297,14 +314,10 @@ class ItemController extends Controller
/**
* Update the specified resource in storage.
*
* @param Request $request
* @param int $id
* @return RedirectResponse
*/
public function update(Request $request, int $id): RedirectResponse
{
$this->storelogic($request, $id);
self::storelogic($request, $id);
$route = route('dash', []);
return redirect($route)
@@ -313,15 +326,11 @@ class ItemController extends Controller
/**
* Remove the specified resource from storage.
*
* @param Request $request
* @param int $id
* @return RedirectResponse
*/
public function destroy(Request $request, int $id): RedirectResponse
{
//
$force = (bool) $request->input('force');
$force = (bool)$request->input('force');
if ($force) {
Item::withTrashed()
->where('id', $id)
@@ -338,16 +347,13 @@ class ItemController extends Controller
/**
* Restore the specified resource from soft deletion.
*
* @param int $id
* @return RedirectResponse
*/
public function restore(int $id): RedirectResponse
{
//
Item::withTrashed()
->where('id', $id)
->restore();
->where('id', $id)
->restore();
$route = route('items.index', []);
@@ -358,8 +364,7 @@ class ItemController extends Controller
/**
* Return details for supported apps
*
* @param Request $request
* @return string|null
* @throws GuzzleException
*/
public function appload(Request $request): ?string
{
@@ -374,32 +379,35 @@ class ItemController extends Controller
$output['custom'] = null;
$app = Application::single($appid);
$output = (array) $app;
$output = (array)$app;
$appdetails = Application::getApp($appid);
if ((bool) $app->enhanced === true) {
if ((bool)$app->enhanced === true) {
// if(!isset($app->config)) { // class based config
$output['custom'] = className($appdetails->name).'.config';
$output['custom'] = className($appdetails->name) . '.config';
// }
}
$output['colour'] = ($app->tile_background == 'light') ? '#fafbfc' : '#161b1f';
if(strpos($app->icon, '://') !== false) {
if (strpos($app->icon, '://') !== false) {
$output['iconview'] = $app->icon;
} elseif(strpos($app->icon, 'icons/') !== false) {
} elseif (strpos($app->icon, 'icons/') !== false) {
// Private apps have the icon locally
$output['iconview'] = URL::to('/').'/storage/'.$app->icon;
$output['iconview'] = URL::to('/') . '/storage/' . $app->icon;
$output['icon'] = str_replace('icons/', '', $output['icon']);
} else {
$output['iconview'] = config('app.appsource').'icons/'.$app->icon;
$output['iconview'] = config('app.appsource') . 'icons/' . $app->icon;
}
return json_encode($output);
}
/**
* @return void
*/
public function testConfig(Request $request)
{
$data = $request->input('data');
@@ -408,7 +416,10 @@ class ItemController extends Controller
$app = $single->class;
// If password is not resubmitted fill it from the database when in edit mode
if ($data['password'] === null && array_key_exists('id', $data)) {
if (array_key_exists('password', $data) &&
$data['password'] === null &&
array_key_exists('id', $data)
) {
$item = Item::find($data['id']);
if ($item) {
$itemConfig = $item->getConfig();
@@ -417,21 +428,24 @@ class ItemController extends Controller
}
$app_details = new $app();
$app_details->config = (object) $data;
$app_details->config = (object)$data;
$app_details->test();
}
public function execute($url, $attrs = [], $overridevars = false)
/**
* @param $url
* @param array|bool $overridevars
* @throws GuzzleException
*/
public function execute($url, array $attrs = [], $overridevars = false): ?ResponseInterface
{
$res = null;
$vars = ($overridevars !== false) ?
$overridevars : [
'http_errors' => false,
'timeout' => 15,
'connect_timeout' => 15,
'verify' => false,
];
$overridevars : [
'http_errors' => false,
'timeout' => 15,
'connect_timeout' => 15,
'verify' => false,
];
$client = new Client($vars);
@@ -446,10 +460,14 @@ class ItemController extends Controller
Log::debug($e->getMessage());
}
return $res;
return null;
}
public function websitelookup($url)
/**
* @param $url
* @throws GuzzleException
*/
public function websitelookup($url): StreamInterface
{
$url = base64_decode($url);
$data = $this->execute($url);
@@ -457,6 +475,10 @@ class ItemController extends Controller
return $data->getBody();
}
/**
* @param $id
* @return void
*/
public function getStats($id)
{
$item = Item::find($id);
@@ -469,7 +491,10 @@ class ItemController extends Controller
}
}
public function checkAppList()
/**
* @return \Illuminate\Contracts\Foundation\Application|RedirectResponse|Redirector
*/
public function checkAppList(): RedirectResponse
{
ProcessApps::dispatch();
$route = route('items.index');

View File

@@ -0,0 +1,93 @@
<?php
namespace App\Http\Controllers;
use App\Item;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Collection;
class ItemRestController extends Controller
{
public function __construct()
{
parent::__construct();
$this->middleware('allowed');
}
/**
* Display a listing of the resource.
*/
public function index(): Collection
{
$columns = [
'title',
'colour',
'url',
'description',
'appid',
'appdescription',
];
return Item::select($columns)
->where('deleted_at', null)
->where('type', '0')
->orderBy('order', 'asc')
->get();
}
/**
* Show the form for creating a new resource.
*
* @return void
*/
public function create()
{
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request): object
{
$item = ItemController::storelogic($request);
if ($item) {
return (object) ['status' => 'OK'];
}
return (object) ['status' => 'FAILED'];
}
/**
* Display the specified resource.
*/
public function show(Item $item): Response
{
//
}
/**
* Show the form for editing the specified resource.
*/
public function edit(Item $item): Response
{
//
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, Item $item): Response
{
//
}
/**
* Remove the specified resource from storage.
*/
public function destroy(Item $item): Response
{
//
}
}

View File

@@ -3,10 +3,16 @@
namespace App\Http\Controllers;
use App\Search;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Routing\Redirector;
class SearchController extends Controller
{
/**
* @return Application|RedirectResponse|Redirector|mixed|void
*/
public function index(Request $request)
{
$requestprovider = $request->input('provider');

View File

@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
use App\Setting;
use App\SettingGroup;
use Exception;
use Illuminate\Contracts\View\View;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
@@ -16,9 +17,6 @@ class SettingsController extends Controller
$this->middleware('allowed');
}
/**
* @return View
*/
public function index(): View
{
$settings = SettingGroup::with([
@@ -31,7 +29,6 @@ class SettingsController extends Controller
}
/**
* @param int $id
*
* @return RedirectResponse|View
*/
@@ -53,60 +50,60 @@ class SettingsController extends Controller
return redirect($route)
->with([
'error' => __('app.alert.error.not_exist'),
'errors' => collect([__('app.alert.error.not_exist')]),
]);
}
}
/**
* @param Request $request
* @param int $id
*
* @return RedirectResponse
*/
public function update(Request $request, int $id): RedirectResponse
{
$setting = Setting::find($id);
$user = $this->user();
$route = route('settings.index', []);
if (! is_null($setting)) {
$data = Setting::getInput($request);
try {
if (is_null($setting)) {
throw new Exception('not_exists');
}
$setting_value = null;
if ($setting->type === 'image') {
$validatedData = $request->validate([
'value' => 'image'
]);
if ($setting->type == 'image') {
if ($request->hasFile('value')) {
$path = $request->file('value')->store('backgrounds');
$setting_value = $path;
if (!$request->hasFile('value')) {
throw new \Exception(
'file_too_big'
);
}
$path = $request->file('value')->store('backgrounds', 'public');
if ($path === null) {
throw new \Exception('file_not_stored');
}
$setting_value = $path;
} else {
$data = Setting::getInput($request);
$setting_value = $data->value;
}
$user->settings()->detach($setting->id);
$user->settings()->save($setting, ['uservalue' => $setting_value]);
$route = route('settings.index', []);
return redirect($route)
->with([
'success' => __('app.alert.success.setting_updated'),
]);
} else {
$route = route('settings.index', []);
->with([
'success' => __('app.alert.success.setting_updated'),
]);
} catch (Exception $e) {
return redirect($route)
->with([
'error' => __('app.alert.error.not_exist'),
]);
->with([
'errors' => collect([__('app.alert.error.'.$e->getMessage())]),
]);
}
}
/**
* @param int $id
*
* @return RedirectResponse
*/
public function clear(int $id): RedirectResponse
{
$user = $this->user();

View File

@@ -4,11 +4,11 @@ namespace App\Http\Controllers;
use App\Item;
use App\User;
use DB;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Contracts\View\Factory;
use Illuminate\Contracts\View\View;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
class TagController extends Controller
{
@@ -20,9 +20,9 @@ class TagController extends Controller
/**
* Display a listing of the resource.
*
* @return Response
* @return Application|Factory|View
*/
public function index(Request $request)
public function index(Request $request): \Illuminate\View\View
{
$trash = (bool) $request->input('trash');
@@ -38,9 +38,9 @@ class TagController extends Controller
/**
* Show the form for creating a new resource.
*
* @return Response
* @return Application|Factory|View
*/
public function create()
public function create(): \Illuminate\View\View
{
$data = [];
@@ -49,24 +49,22 @@ class TagController extends Controller
/**
* Store a newly created resource in storage.
*
* @param Request $request
* @return RedirectResponse
*/
public function store(Request $request): RedirectResponse
{
$validatedData = $request->validate([
'title' => 'required|max:255',
'file' => 'image'
]);
if ($request->hasFile('file')) {
$path = $request->file('file')->store('icons');
$path = $request->file('file')->store('icons', 'public');
$request->merge([
'icon' => $path,
]);
}
$slug = str_slug($request->title, '-');
$slug = str_slug($request->title, '-', 'en_US');
$current_user = User::currentUser();
@@ -89,7 +87,6 @@ class TagController extends Controller
* Display the specified resource.
*
* @param $slug
* @return View
*/
public function show($slug): View
{
@@ -104,9 +101,6 @@ class TagController extends Controller
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return View
*/
public function edit(int $id): View
{
@@ -120,25 +114,22 @@ class TagController extends Controller
/**
* Update the specified resource in storage.
*
* @param Request $request
* @param int $id
* @return RedirectResponse
*/
public function update(Request $request, int $id): RedirectResponse
{
$validatedData = $request->validate([
'title' => 'required|max:255',
'file' => 'image'
]);
if ($request->hasFile('file')) {
$path = $request->file('file')->store('icons');
$path = $request->file('file')->store('icons', 'public');
$request->merge([
'icon' => $path,
]);
}
$slug = str_slug($request->title, '-');
$slug = str_slug($request->title, '-', 'en_US');
// set item type to tag
$request->merge([
'url' => $slug,
@@ -154,9 +145,6 @@ class TagController extends Controller
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return RedirectResponse
*/
public function destroy(Request $request, int $id): RedirectResponse
{
@@ -178,9 +166,6 @@ class TagController extends Controller
/**
* Restore the specified resource from soft deletion.
*
* @param int $id
* @return RedirectResponse
*/
public function restore(int $id): RedirectResponse
{

View File

@@ -19,8 +19,6 @@ class UserController extends Controller
/**
* Display a listing of the resource.
*
* @return View
*/
public function index(): View
{
@@ -31,8 +29,6 @@ class UserController extends Controller
/**
* Show the form for creating a new resource.
*
* @return View
*/
public function create(): View
{
@@ -41,7 +37,7 @@ class UserController extends Controller
return view('users.create', $data);
}
public function selectUser()
public function selectUser(): \Illuminate\View\View
{
Auth::logout();
$data['users'] = User::all();
@@ -51,9 +47,6 @@ class UserController extends Controller
/**
* Store a newly created resource in storage.
*
* @param Request $request
* @return RedirectResponse
*/
public function store(Request $request): RedirectResponse
{
@@ -62,7 +55,7 @@ class UserController extends Controller
'email' => 'required|email',
'password' => 'nullable|confirmed',
'password_confirmation' => 'nullable',
'file' => 'image'
]);
$user = new User;
$user->username = $request->input('username');
@@ -75,7 +68,7 @@ class UserController extends Controller
}
if ($request->hasFile('file')) {
$path = $request->file('file')->store('avatars');
$path = $request->file('file')->store('avatars', 'public');
$user->avatar = $path;
}
@@ -93,9 +86,6 @@ class UserController extends Controller
/**
* Display the specified resource.
*
* @param int $id
* @return void
*/
public function show(int $id): void
{
@@ -104,9 +94,6 @@ class UserController extends Controller
/**
* Show the form for editing the specified resource.
*
* @param User $user
* @return View
*/
public function edit(User $user): View
{
@@ -117,10 +104,6 @@ class UserController extends Controller
/**
* Update the specified resource in storage.
*
* @param Request $request
* @param User $user
* @return RedirectResponse
*/
public function update(Request $request, User $user): RedirectResponse
{
@@ -129,6 +112,7 @@ class UserController extends Controller
'email' => 'required|email',
'password' => 'nullable|confirmed',
'password_confirmation' => 'nullable',
'file' => 'image'
]);
//die(print_r($request->all()));
@@ -144,7 +128,7 @@ class UserController extends Controller
}
if ($request->hasFile('file')) {
$path = $request->file('file')->store('avatars');
$path = $request->file('file')->store('avatars', 'public');
$user->avatar = $path;
}
@@ -165,7 +149,6 @@ class UserController extends Controller
/**
* Remove the specified resource from storage.
*
* @param User $user
* @return RedirectResponse | void
*/
public function destroy(User $user): RedirectResponse

View File

@@ -31,26 +31,25 @@ class Kernel extends HttpKernel
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
// \Illuminate\Session\Middleware\AuthenticateSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
'api' => [
'throttle:60,1',
\Illuminate\Routing\Middleware\ThrottleRequests::class.':60,1',
'bindings',
],
];
/**
* The application's route middleware.
* The application's middleware aliases.
*
* These middleware may be assigned to groups or used individually.
* Aliases may be used to conveniently assign middleware to routes and groups.
*
* @var array
*/
protected $routeMiddleware = [
protected $middlewareAliases = [
'allowed' => \App\Http\Middleware\CheckAllowed::class,
'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,

View File

@@ -2,8 +2,11 @@
namespace App\Http\Middleware;
use Symfony\Component\HttpFoundation\Response;
use App\User;
use Closure;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Route;
use Session;
@@ -13,11 +16,9 @@ class CheckAllowed
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
* @throws AuthenticationException
*/
public function handle($request, Closure $next)
public function handle(Request $request, Closure $next): Response
{
$route = Route::currentRouteName();
$current_user = User::currentUser();
@@ -30,9 +31,7 @@ class CheckAllowed
}
// Public access to frontpage
if ($route == 'dash') {
//print_r(User::all());
//die("here".var_dump($current_user->password));
if ($route === 'dash' || $route === 'tags.show') {
if ((bool)$current_user->public_front === true) {
return $next($request);
}

View File

@@ -2,20 +2,17 @@
namespace App\Http\Middleware;
use Symfony\Component\HttpFoundation\Response;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
class RedirectIfAuthenticated
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param string|null $guard
* @return mixed
*/
public function handle($request, Closure $next, $guard = null)
public function handle(Request $request, Closure $next, string $guard = null): Response
{
if (Auth::guard($guard)->check()) {
return redirect()->intended();

View File

@@ -9,9 +9,10 @@ class TrimStrings extends Middleware
/**
* The names of the attributes that should not be trimmed.
*
* @var array
* @var array<int, string>
*/
protected $except = [
'current_password',
'password',
'password_confirmation',
];

View File

@@ -2,7 +2,7 @@
namespace App\Http\Middleware;
use Fideloper\Proxy\TrustProxies as Middleware;
use Illuminate\Http\Middleware\TrustProxies as Middleware;
use Illuminate\Http\Request;
class TrustProxies extends Middleware
@@ -19,5 +19,5 @@ class TrustProxies extends Middleware
*
* @var array
*/
protected $headers = Request::HEADER_X_FORWARDED_ALL;
protected $headers = Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO | Request::HEADER_X_FORWARDED_AWS_ELB;
}

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Routing\Middleware\ValidateSignature as Middleware;
class ValidateSignature extends Middleware
{
/**
* The names of the query string parameters that should be ignored.
*
* @var array<int, string>
*/
protected $except = [
// 'fbclid',
// 'utm_campaign',
// 'utm_content',
// 'utm_medium',
// 'utm_source',
// 'utm_term',
];
}

View File

@@ -18,5 +18,4 @@ class VerifyCsrfToken extends Middleware
'test_config',
//'get_stats'
];
}

View File

@@ -2,16 +2,82 @@
namespace App;
use Illuminate\Contracts\Routing\UrlGenerator;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Casts\Attribute;
use stdClass;
use Symfony\Component\ClassLoader\ClassMapGenerator;
// @codingStandardsIgnoreStart
/**
* App\Item
*
* @property int $id
* @property string $title
* @property string|null $colour
* @property string|null $icon
* @property string $url
* @property string|null $description
* @property int $pinned
* @property int $order
* @property \Illuminate\Support\Carbon|null $deleted_at
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property int $type
* @property int $user_id
* @property string|null $class
* @property string|null $appid
* @property string|null $appdescription
* @property-read \Illuminate\Database\Eloquent\Collection|Item[] $children
* @property-read int|null $children_count
* @property-read string $droppable
* @property-read \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\Routing\UrlGenerator|mixed|string $link
* @property-read string $link_icon
* @property-read string $link_target
* @property-read string $link_type
* @property-read \Illuminate\Database\Eloquent\Collection|Item[] $parents
* @property-read int|null $parents_count
* @property-read \App\User|null $user
* @method static \Database\Factories\ItemFactory factory(...$parameters)
* @method static Builder|Item newModelQuery()
* @method static Builder|Item newQuery()
* @method static Builder|Item ofType($type)
* @method static \Illuminate\Database\Query\Builder|Item onlyTrashed()
* @method static Builder|Item pinned()
* @method static Builder|Item query()
* @method static Builder|Item whereAppdescription($value)
* @method static Builder|Item whereAppid($value)
* @method static Builder|Item whereClass($value)
* @method static Builder|Item whereColour($value)
* @method static Builder|Item whereCreatedAt($value)
* @method static Builder|Item whereDeletedAt($value)
* @method static Builder|Item whereDescription($value)
* @method static Builder|Item whereIcon($value)
* @method static Builder|Item whereId($value)
* @method static Builder|Item whereOrder($value)
* @method static Builder|Item wherePinned($value)
* @method static Builder|Item whereTitle($value)
* @method static Builder|Item whereType($value)
* @method static Builder|Item whereUpdatedAt($value)
* @method static Builder|Item whereUrl($value)
* @method static Builder|Item whereUserId($value)
* @method static \Illuminate\Database\Query\Builder|Item withTrashed()
* @method static \Illuminate\Database\Query\Builder|Item withoutTrashed()
* @mixin \Eloquent
*/
// @codingStandardsIgnoreEnd
class Item extends Model
{
use SoftDeletes;
protected static function boot()
use HasFactory;
protected static function boot(): void
{
parent::boot();
@@ -25,20 +91,28 @@ class Item extends Model
});
}
//
protected $fillable = [
'title', 'url', 'colour', 'icon', 'appdescription', 'description', 'pinned', 'order', 'type', 'class', 'user_id', 'tag_id', 'appid',
'title',
'url',
'colour',
'icon',
'appdescription',
'description',
'pinned',
'order',
'type',
'class',
'user_id',
'tag_id',
'appid',
];
/**
* Scope a query to only include pinned items.
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopePinned($query)
public function scopePinned(Builder $query): Builder
{
return $query->where('pinned', 1);
}
@@ -60,30 +134,68 @@ class Item extends Model
$id = $this->id;
$tags = ItemTag::select('tag_id')->where('item_id', $id)->pluck('tag_id')->toArray();
$tagdetails = self::select('id', 'title', 'url', 'pinned')->whereIn('id', $tags)->get();
//print_r($tags);
if (in_array(0, $tags)) {
$details = new self([
'id' => 0,
'title' => __('app.dashboard'),
'url' => '',
'pinned' => 0,
]);
$tagdetails->prepend($details);
}
return $tagdetails;
}
public function parents()
protected function title(): Attribute
{
return $this->belongsToMany(\App\Item::class, 'item_tag', 'item_id', 'tag_id');
return Attribute::make(
get: fn (mixed $value) => ($value === 'app.dashboard' ? __('app.dashboard') : $value),
);
}
public function children()
protected function tagUrl(): Attribute
{
return $this->belongsToMany(\App\Item::class, 'item_tag', 'tag_id', 'item_id');
return Attribute::make(
get: fn (mixed $value, array $attributes) => ($attributes['id'] === 0 ? '0-dash' : $attributes['url']),
);
}
public function getTagClass(): string
{
$tags = $this->tags();
$slugs = [];
foreach ($tags as $tag) {
if ($tag->id === 0) {
$tag->url = '0-dash';
}
if ($tag->url) {
$slugs[] = 'tag-'.$tag->url;
}
}
return implode(' ', $slugs);
}
public function getTagList(): string
{
$tags = $this->tags();
$titles = [];
// print_r($tags);
foreach ($tags as $tag) {
if ($tag->title) {
$titles[] = $tag->title;
}
}
return implode(', ', $titles);
}
public function parents(): BelongsToMany
{
return $this->belongsToMany(Item::class, 'item_tag', 'item_id', 'tag_id');
}
public function children(): BelongsToMany
{
return $this->belongsToMany(Item::class, 'item_tag', 'tag_id', 'item_id');
}
/**
* @return \Illuminate\Contracts\Foundation\Application|UrlGenerator|mixed|string
*/
public function getLinkAttribute()
{
if ((int) $this->type === 1) {
@@ -93,7 +205,7 @@ class Item extends Model
}
}
public function getDroppableAttribute()
public function getDroppableAttribute(): string
{
if ((int) $this->type === 1) {
return ' droppable';
@@ -102,7 +214,7 @@ class Item extends Model
}
}
public function getLinkTargetAttribute()
public function getLinkTargetAttribute(): string
{
$target = Setting::fetch('window_target');
@@ -113,7 +225,7 @@ class Item extends Model
}
}
public function getLinkIconAttribute()
public function getLinkIconAttribute(): string
{
if ((int) $this->type === 1) {
return 'fa-tag';
@@ -122,7 +234,7 @@ class Item extends Model
}
}
public function getLinkTypeAttribute()
public function getLinkTypeAttribute(): string
{
if ((int) $this->type === 1) {
return 'tags';
@@ -131,6 +243,10 @@ class Item extends Model
}
}
/**
* @param $class
* @return false|mixed|string
*/
public static function nameFromClass($class)
{
$explode = explode('\\', $class);
@@ -139,6 +255,11 @@ class Item extends Model
return $name;
}
/**
* @param $query
* @param $type
* @return mixed
*/
public function scopeOfType($query, $type)
{
switch ($type) {
@@ -153,7 +274,7 @@ class Item extends Model
return $query->where('type', $typeid);
}
public function enhanced()
public function enhanced(): bool
{
/*if(isset($this->class) && !empty($this->class)) {
$app = new $this->class;
@@ -164,16 +285,23 @@ class Item extends Model
return $this->description !== null;
}
public static function isEnhanced($class)
/**
* @param $class
*/
public static function isEnhanced($class): bool
{
if (!class_exists($class, false) || $class === null || $class === 'null') {
return false;
}
$app = new $class;
return (bool) ($app instanceof \App\EnhancedApps);
return (bool) ($app instanceof EnhancedApps);
}
/**
* @param $class
* @return false|mixed
*/
public static function isSearchProvider($class)
{
if (!class_exists($class, false) || $class === null || $class === 'null') {
@@ -181,10 +309,10 @@ class Item extends Model
}
$app = new $class;
return ((bool) ($app instanceof \App\SearchInterface)) ? $app : false;
return ((bool) ($app instanceof SearchInterface)) ? $app : false;
}
public function enabled()
public function enabled(): bool
{
if ($this->enhanced()) {
$config = $this->getconfig();
@@ -196,12 +324,15 @@ class Item extends Model
return false;
}
/**
* @return mixed|stdClass
*/
public function getconfig()
{
// $explode = explode('\\', $this->class);
if (! isset($this->description) || empty($this->description)) {
$config = new \stdClass;
$config = new stdClass;
// $config->name = end($explode);
$config->enabled = false;
$config->override_url = null;
@@ -224,7 +355,10 @@ class Item extends Model
return $config;
}
public static function applicationDetails($class)
/**
* @param $class
*/
public static function applicationDetails($class): ?Application
{
if (! empty($class)) {
$name = self::nameFromClass($class);
@@ -234,13 +368,16 @@ class Item extends Model
}
}
return false;
return null;
}
public static function getApplicationDescription($class)
/**
* @param $class
*/
public static function getApplicationDescription($class): string
{
$details = self::applicationDetails($class);
if ($details !== false) {
if ($details !== null) {
return $details->description.' - '.$details->license;
}
@@ -250,8 +387,8 @@ class Item extends Model
/**
* Get the user that owns the item.
*/
public function user()
public function user(): BelongsTo
{
return $this->belongsTo(\App\User::class);
return $this->belongsTo(User::class);
}
}

View File

@@ -2,8 +2,26 @@
namespace App;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\Pivot;
/**
* App\ItemTag
*
* @property int $item_id
* @property int $tag_id
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @method static \Illuminate\Database\Eloquent\Builder|ItemTag newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|ItemTag newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|ItemTag query()
* @method static \Illuminate\Database\Eloquent\Builder|ItemTag whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|ItemTag whereItemId($value)
* @method static \Illuminate\Database\Eloquent\Builder|ItemTag whereTagId($value)
* @method static \Illuminate\Database\Eloquent\Builder|ItemTag whereUpdatedAt($value)
* @mixin \Eloquent
*/
class ItemTag extends Pivot
{
use HasFactory;
}

View File

@@ -5,6 +5,7 @@ namespace App\Jobs;
use App\Application;
use App\Item;
use App\SupportedApps;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
@@ -31,9 +32,9 @@ class ProcessApps implements ShouldQueue, ShouldBeUnique
/**
* Execute the job.
*
* @return void
* @throws GuzzleException
*/
public function handle()
public function handle(): void
{
Log::debug('Process Apps dispatched');
$localapps = Application::whereNull('class')->get();

View File

@@ -3,6 +3,7 @@
namespace App\Jobs;
use App\Application;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
@@ -29,9 +30,9 @@ class UpdateApps implements ShouldQueue, ShouldBeUnique
/**
* Execute the job.
*
* @return void
* @throws GuzzleException
*/
public function handle()
public function handle(): void
{
Log::debug('Update of all apps triggered!');
$apps = Application::all('appid')->toArray();
@@ -48,10 +49,7 @@ class UpdateApps implements ShouldQueue, ShouldBeUnique
Cache::lock('updateApps')->forceRelease();
}
/**
* @return void
*/
public function failed($exception)
public function failed($exception): void
{
Cache::lock('updateApps')->forceRelease();
}

View File

@@ -7,19 +7,20 @@ use App\Jobs\ProcessApps;
use App\Jobs\UpdateApps;
use App\Setting;
use App\User;
use Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\ServiceProvider;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
public function boot(): void
{
if (! class_exists('ZipArchive')) {
die('You are missing php-zip');
@@ -40,6 +41,9 @@ class AppServiceProvider extends ServiceProvider
ProcessApps::dispatch();
}
$lang = Setting::fetch('language');
\App::setLocale($lang);
// User specific settings need to go here as session isn't available at this point in the app
view()->composer('*', function ($view) {
if (isset($_SERVER['HTTP_AUTHORIZATION']) && ! empty($_SERVER['HTTP_AUTHORIZATION'])) {
@@ -67,17 +71,21 @@ class AppServiceProvider extends ServiceProvider
}
$alt_bg = '';
if ($bg_image = Setting::fetch('background_image')) {
$trianglify = 'false';
$trianglify_seed = null;
if (Setting::fetch('trianglify')) {
$trianglify = 'true';
$trianglify_seed = Setting::fetch('trianglify_seed');
} elseif ($bg_image = Setting::fetch('background_image')) {
$alt_bg = ' style="background-image: url(storage/'.$bg_image.')"';
}
$allusers = User::all();
$current_user = User::currentUser();
$lang = Setting::fetch('language');
\App::setLocale($lang);
$view->with('alt_bg', $alt_bg);
$view->with('trianglify', $trianglify);
$view->with('trianglify_seed', $trianglify_seed);
$view->with('allusers', $allusers);
$view->with('current_user', $current_user);
});
@@ -95,10 +103,8 @@ class AppServiceProvider extends ServiceProvider
/**
* Generate app key if missing and .env exists
*
* @return void
*/
public function genKey()
public function genKey(): void
{
if (is_file(base_path('.env'))) {
if (empty(env('APP_KEY'))) {
@@ -109,11 +115,13 @@ class AppServiceProvider extends ServiceProvider
/**
* Register any application services.
*
* @return void
*/
public function register()
public function register(): void
{
if ($this->app->isLocal()) {
$this->app->register(IdeHelperServiceProvider::class);
}
$this->app->singleton('settings', function () {
return new Setting();
});
@@ -122,14 +130,18 @@ class AppServiceProvider extends ServiceProvider
/**
* Check if database needs an update or do first time database setup
*
* @return void
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function setupDatabase(): void
{
$db_type = config()->get('database.default');
if ($db_type == 'sqlite' && ! is_file(database_path('app.sqlite'))) {
touch(database_path('app.sqlite'));
if ($db_type == 'sqlite') {
$db_file = database_path(env('DB_DATABASE', 'app.sqlite'));
if (! is_file($db_file)) {
touch($db_file);
}
}
if ($this->needsDBUpdate()) {
@@ -139,9 +151,6 @@ class AppServiceProvider extends ServiceProvider
}
}
/**
* @return void
*/
public function createEnvFile(): void
{
if (!is_file(base_path('.env'))) {
@@ -151,9 +160,6 @@ class AppServiceProvider extends ServiceProvider
$this->genKey();
}
/**
* @return bool
*/
private function needsDBUpdate(): bool
{
if (!Schema::hasTable('settings')) {
@@ -166,10 +172,7 @@ class AppServiceProvider extends ServiceProvider
return version_compare($app_version, $db_version) === 1;
}
/**
* @return void
*/
private function updateApps()
private function updateApps(): void
{
// This lock ensures that the job is not invoked multiple times.
// In 5 minutes all app updates should be finished.

View File

@@ -17,13 +17,9 @@ class AuthServiceProvider extends ServiceProvider
/**
* Register any authentication / authorization services.
*
* @return void
*/
public function boot()
public function boot(): void
{
$this->registerPolicies();
//
}
}

View File

@@ -9,10 +9,8 @@ class BroadcastServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
public function boot(): void
{
Broadcast::routes();

View File

@@ -19,13 +19,19 @@ class EventServiceProvider extends ServiceProvider
/**
* Register any events for your application.
*
* @return void
*/
public function boot()
public function boot(): void
{
parent::boot();
//
}
/**
* Determine if events and listeners should be automatically discovered.
*/
public function shouldDiscoverEvents(): bool
{
return false;
}
}

View File

@@ -12,16 +12,13 @@ class RouteServiceProvider extends ServiceProvider
*
* In addition, it is set as the URL generator's root namespace.
*
* @var string
* REMOVED WITH LARAVEL 8 UPGRADE
*/
protected $namespace = 'App\Http\Controllers';
/**
* Define your route model bindings, pattern filters, etc.
*
* @return void
*/
public function boot()
public function boot(): void
{
//
@@ -30,10 +27,8 @@ class RouteServiceProvider extends ServiceProvider
/**
* Define the routes for the application.
*
* @return void
*/
public function map()
public function map(): void
{
$this->mapApiRoutes();
@@ -46,13 +41,10 @@ class RouteServiceProvider extends ServiceProvider
* Define the "web" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapWebRoutes()
protected function mapWebRoutes(): void
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/web.php'));
}
@@ -60,14 +52,11 @@ class RouteServiceProvider extends ServiceProvider
* Define the "api" routes for the application.
*
* These routes are typically stateless.
*
* @return void
*/
protected function mapApiRoutes()
protected function mapApiRoutes(): void
{
Route::prefix('api')
->middleware('api')
->namespace($this->namespace)
->group(base_path('routes/api.php'));
}
}

View File

@@ -4,6 +4,7 @@ namespace App;
use Cache;
use Form;
use Illuminate\Support\Collection;
use Yaml;
abstract class Search
@@ -11,9 +12,9 @@ abstract class Search
/**
* List of all search providers
*
* @return \Illuminate\Support\Collection
* @return Collection
*/
public static function providers()
public static function providers(): Collection
{
$providers = self::standardProviders();
$providers = $providers + self::appProviders();
@@ -61,7 +62,7 @@ abstract class Search
*
* @return array
*/
public static function appProviders()
public static function appProviders(): array
{
$providers = [];
$userapps = Item::all();
@@ -121,7 +122,15 @@ abstract class Search
$output .= '<option value="'.$key.'"'.$selected.'>'.$searchprovider['name'].'</option>';
}
$output .= '</select>';
$output .= Form::text('q', null, ['class' => 'homesearch', 'autofocus' => 'autofocus', 'placeholder' => __('app.settings.search').'...']);
$output .= Form::text(
'q',
null,
[
'class' => 'homesearch',
'autofocus' => 'autofocus',
'placeholder' => __('app.settings.search').'...'
]
);
$output .= '<button type="submit">'.ucwords(__('app.settings.search')).'</button>';
$output .= '</div>';
$output .= '</form>';

View File

@@ -3,10 +3,46 @@
namespace App;
use Form;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Http\Request;
use Illuminate\Session\SessionManager;
use Illuminate\Session\Store;
use Illuminate\Support\Facades\Input;
/**
* App\Setting
*
* @mixin Builder
* @property int $id
* @property int $group_id
* @property string $key
* @property string $type
* @property string|null $options
* @property string $label
* @property string|null $value
* @property string $order
* @property int $system
* @property-read mixed $edit_value
* @property-read mixed $list_value
* @property-read \App\SettingGroup|null $group
* @property-read \Illuminate\Database\Eloquent\Collection|\App\User[] $users
* @property-read int|null $users_count
* @method static Builder|Setting newModelQuery()
* @method static Builder|Setting newQuery()
* @method static Builder|Setting query()
* @method static Builder|Setting whereGroupId($value)
* @method static Builder|Setting whereId($value)
* @method static Builder|Setting whereKey($value)
* @method static Builder|Setting whereLabel($value)
* @method static Builder|Setting whereOptions($value)
* @method static Builder|Setting whereOrder($value)
* @method static Builder|Setting whereSystem($value)
* @method static Builder|Setting whereType($value)
* @method static Builder|Setting whereValue($value)
*/
class Setting extends Model
{
/**
@@ -34,10 +70,6 @@ class Setting extends Model
*/
protected static $cache = [];
/**
* @param Request $request
* @return object
*/
public static function getInput(Request $request): object
{
return (object) [
@@ -57,7 +89,11 @@ class Setting extends Model
switch ($this->type) {
case 'image':
if (! empty($this->value)) {
$value = '<a href="'.asset('storage/'.$this->value).'" title="'.__('app.settings.view').'" target="_blank">'.__('app.settings.view').'</a>';
$value = '<a href="'.asset('storage/'.$this->value).'" title="'.
__('app.settings.view').
'" target="_blank">'.
__('app.settings.view').
'</a>';
} else {
$value = __('app.options.none');
}
@@ -75,7 +111,9 @@ class Setting extends Model
if ($this->key === 'search_provider') {
$options = Search::providers()->pluck('name', 'id')->toArray();
}
$value = (array_key_exists($this->value, $options)) ? __($options[$this->value]) : __('app.options.none');
$value = (array_key_exists($this->value, $options))
? __($options[$this->value])
: __('app.options.none');
} else {
$value = __('app.options.none');
}
@@ -100,11 +138,24 @@ class Setting extends Model
case 'image':
$value = '';
if (isset($this->value) && ! empty($this->value)) {
$value .= '<a class="setting-view-image" href="'.asset('storage/'.$this->value).'" title="'.__('app.settings.view').'" target="_blank"><img src="'.asset('storage/'.$this->value).'" /></a>';
$value .= '<a class="setting-view-image" href="'.
asset('storage/'.$this->value).
'" title="'.
__('app.settings.view').
'" target="_blank"><img src="'.
asset('storage/'.
$this->value).
'" /></a>';
}
$value .= Form::file('value', ['class' => 'form-control']);
if (isset($this->value) && ! empty($this->value)) {
$value .= '<a class="settinglink" href="'.route('settings.clear', $this->id).'" title="'.__('app.settings.remove').'">'.__('app.settings.reset').'</a>';
$value .= '<a class="settinglink" href="'.
route('settings.clear', $this->id).
'" title="'.
__('app.settings.remove').
'">'.
__('app.settings.reset').
'</a>';
}
break;
@@ -143,30 +194,30 @@ class Setting extends Model
return $value;
}
public function group()
public function group(): BelongsTo
{
return $this->belongsTo(\App\SettingGroup::class, 'group_id');
}
/**
* @param string $key
*
* @return mixed
*/
public static function fetch($key)
public static function fetch(string $key)
{
$user = self::user();
return self::_fetch($key, $user);
}
// @codingStandardsIgnoreStart
/**
* @param string $key
*
* @return mixed
*/
public static function _fetch($key, $user = null)
public static function _fetch(string $key, $user = null)
{
// @codingStandardsIgnoreEnd
//$cachekey = ($user === null) ? $key : $key.'-'.$user->id;
//if (Setting::cached($cachekey)) {
// return Setting::$cache[$cachekey];
@@ -207,20 +258,14 @@ class Setting extends Model
}
/**
* @param string $key
* @param $value
*/
public static function add($key, $value)
public static function add(string $key, $value)
{
self::$cache[$key] = $value;
}
/**
* @param string $key
*
* @return bool
*/
public static function cached($key)
public static function cached(string $key): bool
{
return array_key_exists($key, self::$cache);
}
@@ -228,11 +273,14 @@ class Setting extends Model
/**
* The users that belong to the setting.
*/
public function users()
public function users(): BelongsToMany
{
return $this->belongsToMany(\App\User::class)->using(\App\SettingUser::class)->withPivot('uservalue');
}
/**
* @return \Illuminate\Contracts\Foundation\Application|SessionManager|Store|mixed
*/
public static function user()
{
return User::currentUser();

View File

@@ -3,7 +3,24 @@
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
/**
* App\SettingGroup
*
* @property int $id
* @property string $title
* @property int $order
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Setting[] $settings
* @property-read int|null $settings_count
* @method static \Illuminate\Database\Eloquent\Builder|SettingGroup newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|SettingGroup newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|SettingGroup query()
* @method static \Illuminate\Database\Eloquent\Builder|SettingGroup whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|SettingGroup whereOrder($value)
* @method static \Illuminate\Database\Eloquent\Builder|SettingGroup whereTitle($value)
* @mixin \Eloquent
*/
class SettingGroup extends Model
{
/**
@@ -20,7 +37,7 @@ class SettingGroup extends Model
*/
public $timestamps = false;
public function settings()
public function settings(): HasMany
{
return $this->hasMany(\App\Setting::class, 'group_id');
}

View File

@@ -4,6 +4,20 @@ namespace App;
use Illuminate\Database\Eloquent\Relations\Pivot;
/**
* App\SettingUser
*
* @property int $setting_id
* @property int $user_id
* @property string|null $uservalue
* @method static \Illuminate\Database\Eloquent\Builder|SettingUser newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|SettingUser newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|SettingUser query()
* @method static \Illuminate\Database\Eloquent\Builder|SettingUser whereSettingId($value)
* @method static \Illuminate\Database\Eloquent\Builder|SettingUser whereUserId($value)
* @method static \Illuminate\Database\Eloquent\Builder|SettingUser whereUservalue($value)
* @mixin \Eloquent
*/
class SettingUser extends Pivot
{
//

View File

@@ -3,7 +3,11 @@
namespace App;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\ConnectException;
use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\Exception\ServerException;
use Illuminate\Support\Facades\Log;
use Psr\Http\Message\ResponseInterface;
abstract class SupportedApps
{
@@ -13,7 +17,13 @@ abstract class SupportedApps
protected $error;
public function appTest($url, $attrs = [], $overridevars = false)
/**
* @param $url
* @param array $attrs
* @return object
* @throws GuzzleException
*/
public function appTest($url, array $attrs = []): object
{
if (empty($this->config->url)) {
return (object) [
@@ -52,28 +62,41 @@ abstract class SupportedApps
];
}
public function execute($url, $attrs = [], $overridevars = false, $overridemethod = false)
{
/**
* @param $url
* @param array $attrs
* @param array|bool|null $overridevars
* @param string|bool|null $overridemethod
* @return ResponseInterface|null
* @throws GuzzleException
*/
public function execute(
$url,
array $attrs = [],
$overridevars = null,
$overridemethod = null
): ?ResponseInterface {
$res = null;
$vars = ($overridevars !== false) ?
$overridevars : [
$vars = ($overridevars === null || $overridevars === false) ?
[
'http_errors' => false,
'timeout' => 15,
'connect_timeout' => 15,
];
] : $overridevars;
$client = new Client($vars);
$method = ($overridemethod !== false) ? $overridemethod : $this->method;
$method = ($overridemethod === null || $overridemethod === false) ? $this->method : $overridemethod;
try {
return $client->request($method, $url, $attrs);
} catch (\GuzzleHttp\Exception\ConnectException $e) {
} catch (ConnectException $e) {
Log::error('Connection refused');
Log::debug($e->getMessage());
$this->error = 'Connection refused - '.(string) $e->getMessage();
} catch (\GuzzleHttp\Exception\ServerException $e) {
} catch (ServerException $e) {
Log::debug($e->getMessage());
$this->error = (string) $e->getResponse()->getBody();
}
@@ -82,11 +105,19 @@ abstract class SupportedApps
return $res;
}
/**
* @return void
*/
public function login()
{
}
public function normaliseurl($url, $addslash = true)
/**
* @param string $url
* @param bool $addslash
* @return string
*/
public function normaliseurl(string $url, bool $addslash = true): string
{
$url = rtrim($url, '/');
if ($addslash) {
@@ -96,9 +127,14 @@ abstract class SupportedApps
return $url;
}
/**
* @param $status
* @param $data
* @return false|string
*/
public function getLiveStats($status, $data)
{
$className = get_class($this);
$className = $this::class;
$explode = explode('\\', $className);
$name = end($explode);
@@ -108,7 +144,11 @@ abstract class SupportedApps
//return
}
public static function getList()
/**
* @return ResponseInterface
* @throws GuzzleException
*/
public static function getList(): ResponseInterface
{
// $list_url = 'https://apps.heimdall.site/list';
$list_url = config('app.appsource').'list.json';
@@ -129,7 +169,7 @@ abstract class SupportedApps
/**
* @param $app
* @return bool|false
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public static function getFiles($app): bool
{
@@ -165,6 +205,11 @@ abstract class SupportedApps
return true;
}
/**
* @param $details
* @param $app
* @return mixed
*/
public static function saveApp($details, $app)
{
$app->appid = $details->appid;

View File

@@ -2,15 +2,54 @@
namespace App;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
// @codingStandardsIgnoreStart
/**
* App\User
*
* @property int $id
* @property string $username
* @property string $email
* @property string|null $avatar
* @property string|null $password
* @property string|null $autologin
* @property int $public_front
* @property string|null $remember_token
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Item[] $items
* @property-read int|null $items_count
* @property-read \Illuminate\Notifications\DatabaseNotificationCollection|\Illuminate\Notifications\DatabaseNotification[] $notifications
* @property-read int|null $notifications_count
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Setting[] $settings
* @property-read int|null $settings_count
* @method static \Illuminate\Database\Eloquent\Builder|User newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|User newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|User query()
* @method static \Illuminate\Database\Eloquent\Builder|User whereAutologin($value)
* @method static \Illuminate\Database\Eloquent\Builder|User whereAvatar($value)
* @method static \Illuminate\Database\Eloquent\Builder|User whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|User whereEmail($value)
* @method static \Illuminate\Database\Eloquent\Builder|User whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|User wherePassword($value)
* @method static \Illuminate\Database\Eloquent\Builder|User wherePublicFront($value)
* @method static \Illuminate\Database\Eloquent\Builder|User whereRememberToken($value)
* @method static \Illuminate\Database\Eloquent\Builder|User whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|User whereUsername($value)
* @mixin \Eloquent
*/
// @codingStandardsIgnoreEnd
class User extends Authenticatable
{
use Notifiable;
use HasFactory;
/**
* The attributes that are mass assignable.
*

View File

@@ -8,26 +8,28 @@
"license": "MIT",
"type": "project",
"require": {
"php": ">=7.4.32",
"facade/ignition": "^2.3.6",
"fideloper/proxy": "^4.0",
"graham-campbell/github": "^10.5",
"php": "^8.1",
"graham-campbell/github": "^12.0",
"guzzlehttp/guzzle": "^7.4",
"laravel/framework": "^8.0",
"laravel/tinker": "^2.0",
"laravel/ui": "^3.0",
"laravelcollective/html": "^6.0",
"nunomaduro/collision": "^5.0",
"symfony/yaml": "^5.4",
"laravel/framework": "^10.44",
"laravel/tinker": "^2.8",
"laravel/ui": "^4.2",
"laravelcollective/html": "^6.4",
"nunomaduro/collision": "^6.3",
"symfony/yaml": "^6.2",
"ext-json": "*",
"ext-intl": "*"
"ext-intl": "*",
"league/flysystem-aws-s3-v3": "^3.0",
"spatie/laravel-ignition": "^2.0"
},
"require-dev": {
"filp/whoops": "~2.0",
"fzaninotto/faker": "~1.4",
"mockery/mockery": "~1.0",
"phpunit/phpunit": "~9.0",
"symfony/thanks": "^1.0"
"barryvdh/laravel-ide-helper": "^2.13",
"filp/whoops": "^2.8",
"mockery/mockery": "^1.4.4",
"phpunit/phpunit": "^9.5.10",
"squizlabs/php_codesniffer": "3.*",
"symfony/thanks": "^1.2",
"fakerphp/faker": "^1.9.1"
},
"autoload": {
"classmap": [
@@ -51,6 +53,7 @@
"extra": {
"laravel": {
"dont-discover": [
"barryvdh/laravel-ide-helper"
]
}
},
@@ -64,6 +67,12 @@
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"@php artisan ide-helper:generate",
"@php artisan ide-helper:meta",
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
]
},
"config": {
@@ -72,7 +81,10 @@
"optimize-autoloader": true,
"allow-plugins": {
"kylekatarnls/update-helper": true,
"symfony/thanks": true
"symfony/thanks": true,
"php-http/discovery": true
}
}
},
"minimum-stability": "stable",
"prefer-stable": true
}

5239
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,8 @@
<?php
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Facade;
return [
/*
@@ -14,7 +17,7 @@ return [
*/
'name' => env('APP_NAME', 'Heimdall'),
'version' => '2.5.1',
'version' => '2.6.1',
/*
|--------------------------------------------------------------------------
@@ -125,6 +128,24 @@ return [
'cipher' => 'AES-256-CBC',
/*
|--------------------------------------------------------------------------
| Maintenance Mode Driver
|--------------------------------------------------------------------------
|
| These configuration options determine the driver used to determine and
| manage Laravel's "maintenance mode" status. The "cache" driver will
| allow maintenance mode to be controlled across multiple machines.
|
| Supported drivers: "file", "cache"
|
*/
'maintenance' => [
'driver' => 'file',
// 'store' => 'redis',
],
/*
|--------------------------------------------------------------------------
| Autoloaded Service Providers
@@ -136,34 +157,7 @@ return [
|
*/
'providers' => [
/*
* Laravel Framework Service Providers...
*/
Illuminate\Auth\AuthServiceProvider::class,
Illuminate\Broadcasting\BroadcastServiceProvider::class,
Illuminate\Bus\BusServiceProvider::class,
Illuminate\Cache\CacheServiceProvider::class,
Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
Illuminate\Cookie\CookieServiceProvider::class,
Illuminate\Database\DatabaseServiceProvider::class,
Illuminate\Encryption\EncryptionServiceProvider::class,
Illuminate\Filesystem\FilesystemServiceProvider::class,
Illuminate\Foundation\Providers\FoundationServiceProvider::class,
Illuminate\Hashing\HashServiceProvider::class,
Illuminate\Mail\MailServiceProvider::class,
Illuminate\Notifications\NotificationServiceProvider::class,
Illuminate\Pagination\PaginationServiceProvider::class,
Illuminate\Pipeline\PipelineServiceProvider::class,
Illuminate\Queue\QueueServiceProvider::class,
Illuminate\Redis\RedisServiceProvider::class,
Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
Illuminate\Session\SessionServiceProvider::class,
Illuminate\Translation\TranslationServiceProvider::class,
Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class,
'providers' => ServiceProvider::defaultProviders()->merge([
/*
* Package Service Providers...
*/
@@ -176,8 +170,7 @@ return [
// App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
],
])->toArray(),
/*
|--------------------------------------------------------------------------
@@ -190,51 +183,13 @@ return [
|
*/
'aliases' => [
'App' => Illuminate\Support\Facades\App::class,
'Arr' => Illuminate\Support\Arr::class,
'Artisan' => Illuminate\Support\Facades\Artisan::class,
'Auth' => Illuminate\Support\Facades\Auth::class,
'Blade' => Illuminate\Support\Facades\Blade::class,
'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
'Bus' => Illuminate\Support\Facades\Bus::class,
'Cache' => Illuminate\Support\Facades\Cache::class,
'Config' => Illuminate\Support\Facades\Config::class,
'Cookie' => Illuminate\Support\Facades\Cookie::class,
'Crypt' => Illuminate\Support\Facades\Crypt::class,
'DB' => Illuminate\Support\Facades\DB::class,
'Eloquent' => Illuminate\Database\Eloquent\Model::class,
'Event' => Illuminate\Support\Facades\Event::class,
'File' => Illuminate\Support\Facades\File::class,
'Form' => Collective\Html\FormFacade::class,
'Gate' => Illuminate\Support\Facades\Gate::class,
'Hash' => Illuminate\Support\Facades\Hash::class,
'Html' => Collective\Html\HtmlFacade::class,
'Http' => Illuminate\Support\Facades\Http::class,
'Lang' => Illuminate\Support\Facades\Lang::class,
'Log' => Illuminate\Support\Facades\Log::class,
'Mail' => Illuminate\Support\Facades\Mail::class,
'Notification' => Illuminate\Support\Facades\Notification::class,
'Password' => Illuminate\Support\Facades\Password::class,
'Queue' => Illuminate\Support\Facades\Queue::class,
'Redirect' => Illuminate\Support\Facades\Redirect::class,
'Redis' => Illuminate\Support\Facades\Redis::class,
'Request' => Illuminate\Support\Facades\Request::class,
'Response' => Illuminate\Support\Facades\Response::class,
'Route' => Illuminate\Support\Facades\Route::class,
'Schema' => Illuminate\Support\Facades\Schema::class,
'Session' => Illuminate\Support\Facades\Session::class,
'Storage' => Illuminate\Support\Facades\Storage::class,
'Str' => Illuminate\Support\Str::class,
'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
'Yaml' => Symfony\Component\Yaml\Yaml::class,
'SupportedApps' => App\SupportedApps::class,
'aliases' => Facade::defaultAliases()->merge([
'EnhancedApps' => App\EnhancedApps::class,
],
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
'Redis' => Illuminate\Support\Facades\Redis::class,
'SupportedApps' => App\SupportedApps::class,
'Yaml' => Symfony\Component\Yaml\Yaml::class,
])->toArray(),
];

View File

@@ -31,7 +31,7 @@ return [
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
| Supported: "session", "token"
| Supported: "session"
|
*/
@@ -86,16 +86,20 @@ return [
| than one user table or model in the application and you want to have
| separate password reset settings based on the specific user types.
|
| The expire time is the number of minutes that the reset token should be
| The expiry time is the number of minutes that each reset token will be
| considered valid. This security feature keeps tokens short-lived so
| they have less time to be guessed. You may change this as needed.
|
| The throttle setting is the number of seconds a user must wait before
| generating more password reset tokens. This prevents the user from
| quickly generating a very large amount of password reset tokens.
|
*/
'passwords' => [
'users' => [
'provider' => 'users',
'table' => 'password_resets',
'table' => 'password_reset_tokens',
'expire' => 60,
'throttle' => 60,
],

View File

@@ -11,7 +11,7 @@ return [
| framework when an event needs to be broadcast. You may set this to
| any of the connections defined in the "connections" array below.
|
| Supported: "pusher", "redis", "log", "null"
| Supported: "pusher", "ably", "redis", "log", "null"
|
*/
@@ -37,8 +37,20 @@ return [
'app_id' => env('PUSHER_APP_ID'),
'options' => [
'cluster' => env('PUSHER_APP_CLUSTER'),
'useTLS' => true,
'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com',
'port' => env('PUSHER_PORT', 443),
'scheme' => env('PUSHER_SCHEME', 'https'),
'encrypted' => true,
'useTLS' => env('PUSHER_SCHEME', 'https') === 'https',
],
'client_options' => [
// Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html
],
],
'ably' => [
'driver' => 'ably',
'key' => env('ABLY_KEY'),
],
'redis' => [

View File

@@ -13,8 +13,6 @@ return [
| using this caching library. This connection is used when another is
| not explicitly specified when executing a given caching function.
|
| Supported: "apc", "array", "database", "file", "memcached", "redis"
|
*/
'default' => env('CACHE_DRIVER', 'file'),
@@ -28,6 +26,9 @@ return [
| well as their drivers. You may even define multiple stores for the
| same cache driver to group types of items stored in your caches.
|
| Supported drivers: "apc", "array", "database", "file",
| "memcached", "redis", "dynamodb", "octane", "null"
|
*/
'stores' => [
@@ -45,11 +46,13 @@ return [
'driver' => 'database',
'table' => 'cache',
'connection' => null,
'lock_connection' => null,
],
'file' => [
'driver' => 'file',
'path' => storage_path('framework/cache/data'),
'lock_path' => storage_path('framework/cache/data'),
],
'memcached' => [
@@ -60,7 +63,7 @@ return [
env('MEMCACHED_PASSWORD'),
],
'options' => [
// Memcached::OPT_CONNECT_TIMEOUT => 2000,
// Memcached::OPT_CONNECT_TIMEOUT => 2000,
],
'servers' => [
[
@@ -74,6 +77,7 @@ return [
'redis' => [
'driver' => 'redis',
'connection' => 'default',
'lock_connection' => 'default',
],
'dynamodb' => [
@@ -85,6 +89,10 @@ return [
'endpoint' => env('DYNAMODB_ENDPOINT'),
],
'octane' => [
'driver' => 'octane',
],
],
/*
@@ -92,12 +100,12 @@ return [
| Cache Key Prefix
|--------------------------------------------------------------------------
|
| When utilizing a RAM based store such as APC or Memcached, there might
| be other applications utilizing the same cache. So, we'll specify a
| value to get prefixed to all our keys so we can avoid collisions.
| When utilizing the APC, database, memcached, Redis, or DynamoDB cache
| stores there might be other applications using the same cache. For
| that reason, you may prefix every cache key to avoid collisions.
|
*/
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'),
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'),
];

34
config/cors.php Normal file
View File

@@ -0,0 +1,34 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Cross-Origin Resource Sharing (CORS) Configuration
|--------------------------------------------------------------------------
|
| Here you may configure your settings for cross-origin resource sharing
| or "CORS". This determines what cross-origin operations may execute
| in web browsers. You are free to adjust these settings as needed.
|
| To learn more: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
|
*/
'paths' => ['api/*', 'sanctum/csrf-cookie'],
'allowed_methods' => ['*'],
'allowed_origins' => ['*'],
'allowed_origins_patterns' => [],
'allowed_headers' => ['*'],
'exposed_headers' => [],
'max_age' => 0,
'supports_credentials' => false,
];

View File

@@ -15,7 +15,7 @@ return [
|
*/
'default' => env('DB_CONNECTION', 'sqlite'),
'default' => env('DB_CONNECTION', 'mysql'),
/*
|--------------------------------------------------------------------------
@@ -37,9 +37,10 @@ return [
'sqlite' => [
'driver' => 'sqlite',
//'database' => env('DB_DATABASE', database_path('database.sqlite')),
'database' => database_path(env('DB_DATABASE', 'app.sqlite')),
'url' => env('DATABASE_URL'),
'database' => database_path(env('DB_DATABASE', 'database.sqlite')),
'prefix' => '',
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
],
'mysql' => [
@@ -73,7 +74,7 @@ return [
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
'schema' => 'public',
'search_path' => 'public',
'sslmode' => 'prefer',
],
@@ -88,8 +89,10 @@ return [
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
// 'encrypt' => env('DB_ENCRYPT', 'yes'),
// 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'),
],
],
/*
@@ -111,7 +114,7 @@ return [
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer set of commands than a typical key-value systems
| provides a richer body of commands than a typical key-value system
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
*/
@@ -128,7 +131,8 @@ return [
'default' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'username' => env('REDIS_USERNAME'),
'password' => env('REDIS_PASSWORD'),
'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_DB', '0'),
],
@@ -136,7 +140,8 @@ return [
'cache' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'username' => env('REDIS_USERNAME'),
'password' => env('REDIS_PASSWORD'),
'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_CACHE_DB', '1'),
],

View File

@@ -13,18 +13,7 @@ return [
|
*/
'default' => env('FILESYSTEM_DRIVER', 'public'),
/*
|--------------------------------------------------------------------------
| Default Cloud Filesystem Disk
|--------------------------------------------------------------------------
|
| Many applications store files both locally and in the cloud. For this
| reason, you may specify a default "cloud" driver here. This driver
| will be bound as the Cloud disk implementation in the container.
|
*/
'default' => env('FILESYSTEM_DISK', 'local'),
'cloud' => env('FILESYSTEM_CLOUD', 's3'),
@@ -35,9 +24,9 @@ return [
|
| Here you may configure as many filesystem "disks" as you wish, and you
| may even configure multiple disks of the same driver. Defaults have
| been setup for each driver as an example of the required options.
| been set up for each driver as an example of the required values.
|
| Supported Drivers: "local", "ftp", "s3", "rackspace"
| Supported Drivers: "local", "ftp", "sftp", "s3"
|
*/
@@ -46,6 +35,7 @@ return [
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
'throw' => false,
],
'public' => [
@@ -53,6 +43,7 @@ return [
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
'throw' => false,
],
's3' => [
@@ -63,8 +54,25 @@ return [
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
'throw' => false,
],
],
/*
|--------------------------------------------------------------------------
| Symbolic Links
|--------------------------------------------------------------------------
|
| Here you may configure the symbolic links that will be created when the
| `storage:link` Artisan command is executed. The array keys should be
| the locations of the links and the values should be their targets.
|
*/
'links' => [
public_path('storage') => storage_path('app/public'),
],
];

View File

@@ -29,7 +29,8 @@ return [
*/
'bcrypt' => [
'rounds' => env('BCRYPT_ROUNDS', 10),
'rounds' => env('BCRYPT_ROUNDS', 12),
'verify' => true,
],
/*
@@ -44,9 +45,10 @@ return [
*/
'argon' => [
'memory' => 1024,
'threads' => 2,
'time' => 2,
'memory' => 65536,
'threads' => 1,
'time' => 4,
'verify' => true,
],
];
];

View File

@@ -3,6 +3,7 @@
use Monolog\Handler\NullHandler;
use Monolog\Handler\StreamHandler;
use Monolog\Handler\SyslogUdpHandler;
use Monolog\Processor\PsrLogMessageProcessor;
return [
@@ -17,7 +18,23 @@ return [
|
*/
'default' => env('LOG_CHANNEL', 'daily'),
'default' => env('LOG_CHANNEL', 'stack'),
/*
|--------------------------------------------------------------------------
| Deprecations Log Channel
|--------------------------------------------------------------------------
|
| This option controls the log channel that should be used to log warnings
| regarding deprecated PHP and library features. This allows you to get
| your application ready for upcoming major versions of dependencies.
|
*/
'deprecations' => [
'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
'trace' => false,
],
/*
|--------------------------------------------------------------------------
@@ -44,14 +61,16 @@ return [
'single' => [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
'level' => 'debug',
'level' => env('LOG_LEVEL', 'debug'),
'replace_placeholders' => true,
],
'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/laravel.log'),
'level' => 'debug',
'level' => env('LOG_LEVEL', 'debug'),
'days' => 14,
'replace_placeholders' => true,
],
'slack' => [
@@ -59,36 +78,44 @@ return [
'url' => env('LOG_SLACK_WEBHOOK_URL'),
'username' => 'Laravel Log',
'emoji' => ':boom:',
'level' => 'critical',
'level' => env('LOG_LEVEL', 'critical'),
'replace_placeholders' => true,
],
'papertrail' => [
'driver' => 'monolog',
'level' => 'debug',
'handler' => SyslogUdpHandler::class,
'level' => env('LOG_LEVEL', 'debug'),
'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class),
'handler_with' => [
'host' => env('PAPERTRAIL_URL'),
'port' => env('PAPERTRAIL_PORT'),
'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'),
],
'processors' => [PsrLogMessageProcessor::class],
],
'stderr' => [
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
'handler' => StreamHandler::class,
'formatter' => env('LOG_STDERR_FORMATTER'),
'with' => [
'stream' => 'php://stderr',
],
'processors' => [PsrLogMessageProcessor::class],
],
'syslog' => [
'driver' => 'syslog',
'level' => 'debug',
'level' => env('LOG_LEVEL', 'debug'),
'facility' => LOG_USER,
'replace_placeholders' => true,
],
'errorlog' => [
'driver' => 'errorlog',
'level' => 'debug',
'level' => env('LOG_LEVEL', 'debug'),
'replace_placeholders' => true,
],
'null' => [

View File

@@ -4,45 +4,97 @@ return [
/*
|--------------------------------------------------------------------------
| Mail Driver
| Default Mailer
|--------------------------------------------------------------------------
|
| Laravel supports both SMTP and PHP's "mail" function as drivers for the
| sending of e-mail. You may specify which one you're using throughout
| your application here. By default, Laravel is setup for SMTP mail.
|
| Supported: "smtp", "sendmail", "mailgun", "mandrill", "ses",
| "sparkpost", "log", "array"
| This option controls the default mailer that is used to send any email
| messages sent by your application. Alternative mailers may be setup
| and used as needed; however, this mailer will be used by default.
|
*/
'driver' => env('MAIL_DRIVER', 'smtp'),
'default' => env('MAIL_MAILER', 'smtp'),
/*
|--------------------------------------------------------------------------
| SMTP Host Address
| Mailer Configurations
|--------------------------------------------------------------------------
|
| Here you may provide the host address of the SMTP server used by your
| applications. A default option is provided that is compatible with
| the Mailgun mail service which will provide reliable deliveries.
| Here you may configure all of the mailers used by your application plus
| their respective settings. Several examples have been configured for
| you and you are free to add your own as your application requires.
|
| Laravel supports a variety of mail "transport" drivers to be used while
| sending an e-mail. You will specify which one you are using for your
| mailers below. You are free to add additional mailers as required.
|
| Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2",
| "postmark", "log", "array", "failover", "roundrobin"
|
*/
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
'mailers' => [
'smtp' => [
'transport' => 'smtp',
'url' => env('MAIL_URL'),
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
'port' => env('MAIL_PORT', 587),
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'timeout' => null,
'local_domain' => env('MAIL_EHLO_DOMAIN'),
],
/*
|--------------------------------------------------------------------------
| SMTP Host Port
|--------------------------------------------------------------------------
|
| This is the SMTP port used by your application to deliver e-mails to
| users of the application. Like the host we have set this value to
| stay compatible with the Mailgun e-mail application by default.
|
*/
'ses' => [
'transport' => 'ses',
],
'port' => env('MAIL_PORT', 587),
'postmark' => [
'transport' => 'postmark',
// 'message_stream_id' => null,
// 'client' => [
// 'timeout' => 5,
// ],
],
'mailgun' => [
'transport' => 'mailgun',
// 'client' => [
// 'timeout' => 5,
// ],
],
'sendmail' => [
'transport' => 'sendmail',
'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'),
],
'log' => [
'transport' => 'log',
'channel' => env('MAIL_LOG_CHANNEL'),
],
'array' => [
'transport' => 'array',
],
'failover' => [
'transport' => 'failover',
'mailers' => [
'smtp',
'log',
],
],
'roundrobin' => [
'transport' => 'roundrobin',
'mailers' => [
'ses',
'postmark',
],
],
],
/*
|--------------------------------------------------------------------------
@@ -60,47 +112,6 @@ return [
'name' => env('MAIL_FROM_NAME', 'Example'),
],
/*
|--------------------------------------------------------------------------
| E-Mail Encryption Protocol
|--------------------------------------------------------------------------
|
| Here you may specify the encryption protocol that should be used when
| the application send e-mail messages. A sensible default using the
| transport layer security protocol should provide great security.
|
*/
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
/*
|--------------------------------------------------------------------------
| SMTP Server Username
|--------------------------------------------------------------------------
|
| If your SMTP server requires a username for authentication, you should
| set it here. This will get used to authenticate with your server on
| connection. You may also set the "password" value below this one.
|
*/
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
/*
|--------------------------------------------------------------------------
| Sendmail System Path
|--------------------------------------------------------------------------
|
| When using the "sendmail" driver to send e-mails, we will need to know
| the path to where Sendmail lives on this server. A default path has
| been provided here, which will work well on most of your systems.
|
*/
'sendmail' => '/usr/sbin/sendmail -bs',
/*
|--------------------------------------------------------------------------
| Markdown Mail Settings

View File

@@ -39,6 +39,7 @@ return [
'table' => 'jobs',
'queue' => 'default',
'retry_after' => 90,
'after_commit' => false,
],
'beanstalkd' => [
@@ -47,6 +48,7 @@ return [
'queue' => 'default',
'retry_after' => 90,
'block_for' => 0,
'after_commit' => false,
],
'sqs' => [
@@ -54,9 +56,10 @@ return [
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
'queue' => env('SQS_QUEUE', 'your-queue-name'),
'queue' => env('SQS_QUEUE', 'default'),
'suffix' => env('SQS_SUFFIX'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'after_commit' => false,
],
'redis' => [
@@ -65,6 +68,7 @@ return [
'queue' => env('REDIS_QUEUE', 'default'),
'retry_after' => 90,
'block_for' => null,
'after_commit' => false,
],
],
@@ -81,7 +85,7 @@ return [
*/
'failed' => [
'driver' => env('QUEUE_FAILED_DRIVER', 'database'),
'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
'database' => env('DB_CONNECTION', 'mysql'),
'table' => 'failed_jobs',
],

View File

@@ -18,6 +18,7 @@ return [
'domain' => env('MAILGUN_DOMAIN'),
'secret' => env('MAILGUN_SECRET'),
'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
'scheme' => 'https',
],
'postmark' => [
@@ -29,5 +30,5 @@ return [
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
],
];

View File

@@ -14,7 +14,7 @@ return [
| you may specify any of the other wonderful drivers provided here.
|
| Supported: "file", "cookie", "database", "apc",
| "memcached", "redis", "array"
| "memcached", "redis", "dynamodb", "array"
|
*/
@@ -72,7 +72,7 @@ return [
|
*/
'connection' => env('SESSION_CONNECTION', null),
'connection' => env('SESSION_CONNECTION'),
/*
|--------------------------------------------------------------------------
@@ -92,13 +92,15 @@ return [
| Session Cache Store
|--------------------------------------------------------------------------
|
| When using the "apc" or "memcached" session drivers, you may specify a
| cache store that should be used for these sessions. This value must
| correspond with one of the application's configured cache stores.
| While using one of the framework's cache driven session backends you may
| list a cache store that should be used for these sessions. This value
| must match with one of the application's configured cache "stores".
|
| Affects: "apc", "dynamodb", "memcached", "redis"
|
*/
'store' => env('SESSION_STORE', null),
'store' => env('SESSION_STORE'),
/*
|--------------------------------------------------------------------------
@@ -153,7 +155,7 @@ return [
|
*/
'domain' => env('SESSION_DOMAIN', null),
'domain' => env('SESSION_DOMAIN'),
/*
|--------------------------------------------------------------------------
@@ -162,7 +164,7 @@ return [
|
| By setting this option to true, session cookies will only be sent back
| to the server if the browser has a HTTPS connection. This will keep
| the cookie from being sent to you if it can not be done securely.
| the cookie from being sent to you when it can't be done securely.
|
*/
@@ -188,12 +190,25 @@ return [
|
| This option determines how your cookies behave when cross-site requests
| take place, and can be used to mitigate CSRF attacks. By default, we
| do not enable this as other CSRF protection services are in place.
| will set this value to "lax" since this is a secure default value.
|
| Supported: "lax", "strict"
| Supported: "lax", "strict", "none", null
|
*/
'same_site' => null,
/*
|--------------------------------------------------------------------------
| Partitioned Cookies
|--------------------------------------------------------------------------
|
| Setting this value to true will tie the cookie to the top-level site for
| a cross-site context. Partitioned cookies are accepted by the browser
| when flagged "secure" and the Same-Site attribute is set to "none".
|
*/
'partitioned' => false,
];

View File

@@ -33,4 +33,4 @@ return [
realpath(storage_path('framework/views'))
),
];
];

View File

@@ -0,0 +1,20 @@
<?php
namespace Database\Factories;
use App\Item;
use Illuminate\Database\Eloquent\Factories\Factory;
class ItemFactory extends Factory
{
/**
* Define the model's default state.
*/
public function definition(): array
{
return [
'title' => $this->faker->unique()->text(),
'url' => $this->faker->unique()->url(),
];
}
}

View File

@@ -0,0 +1,18 @@
<?php
namespace Database\Factories;
use App\Item;
use App\ItemTag;
use Illuminate\Database\Eloquent\Factories\Factory;
class ItemTagFactory extends Factory
{
/**
* Define the model's default state.
*/
public function definition(): array
{
return [];
}
}

View File

@@ -2,6 +2,8 @@
namespace Database\Factories;
use Illuminate\Support\Facades\Hash;
use App\User;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
@@ -12,23 +14,23 @@ class UserFactory extends Factory
*
* @return array
*/
public function definition()
protected static ?string $password;
public function definition(): array
{
return [
'name' => $this->faker->name(),
'username' => $this->faker->name(),
'email' => $this->faker->unique()->safeEmail(),
'email_verified_at' => now(),
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
'password' => static::$password ??= Hash::make('password'),
'public_front' => 1,
'remember_token' => Str::random(10),
];
}
/**
* Indicate that the model's email address should be unverified.
*
* @return \Illuminate\Database\Eloquent\Factories\Factory
*/
public function unverified()
public function unverified(): Factory
{
return $this->state(function (array $attributes) {
return [
@@ -36,4 +38,4 @@ class UserFactory extends Factory
];
});
}
}
}

View File

@@ -4,14 +4,12 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateItemsTable extends Migration
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
public function up(): void
{
Schema::create('items', function (Blueprint $table) {
$table->increments('id');
@@ -29,11 +27,9 @@ class CreateItemsTable extends Migration
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
public function down(): void
{
Schema::dropIfExists('items');
}
}
};

View File

@@ -4,14 +4,12 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateSettingsTable extends Migration
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
public function up(): void
{
Schema::create('settings', function (Blueprint $table) {
$table->increments('id');
@@ -28,11 +26,9 @@ class CreateSettingsTable extends Migration
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
public function down(): void
{
Schema::dropIfExists('settings');
}
}
};

View File

@@ -4,14 +4,12 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateSettingGroupsTable extends Migration
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
public function up(): void
{
Schema::create('setting_groups', function (Blueprint $table) {
$table->increments('id');
@@ -22,11 +20,9 @@ class CreateSettingGroupsTable extends Migration
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
public function down(): void
{
Schema::dropIfExists('setting_groups');
}
}
};

View File

@@ -4,14 +4,12 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddColumnsToItemsForGroups extends Migration
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
public function up(): void
{
Schema::table('items', function (Blueprint $table) {
$table->integer('type')->default(0)->index(); // 0 = item, 1 = category
@@ -20,13 +18,11 @@ class AddColumnsToItemsForGroups extends Migration
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
public function down(): void
{
Schema::table('items', function (Blueprint $table) {
$table->dropColumn(['type']);
});
}
}
};

View File

@@ -4,14 +4,12 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class ItemTag extends Migration
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
public function up(): void
{
Schema::create('item_tag', function (Blueprint $table) {
$table->integer('item_id')->unsigned()->index();
@@ -25,11 +23,9 @@ class ItemTag extends Migration
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
public function down(): void
{
Schema::dropIfExists('item_tag');
}
}
};

View File

@@ -4,14 +4,12 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateUsersTable extends Migration
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
public function up(): void
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
@@ -28,11 +26,9 @@ class CreateUsersTable extends Migration
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
public function down(): void
{
Schema::dropIfExists('users');
}
}
};

View File

@@ -4,14 +4,12 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePasswordResetsTable extends Migration
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
public function up(): void
{
Schema::create('password_resets', function (Blueprint $table) {
$table->string('email')->index();
@@ -22,11 +20,9 @@ class CreatePasswordResetsTable extends Migration
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
public function down(): void
{
Schema::dropIfExists('password_resets');
}
}
};

View File

@@ -4,14 +4,12 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddUserIdToItemsTable extends Migration
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
public function up(): void
{
Schema::table('items', function (Blueprint $table) {
$table->integer('user_id')->default(1)->index(); // 0 = item, 1 = category
@@ -20,13 +18,11 @@ class AddUserIdToItemsTable extends Migration
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
public function down(): void
{
Schema::table('items', function (Blueprint $table) {
$table->dropColumn(['user_id']);
});
}
}
};

View File

@@ -4,14 +4,12 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateSettingUserPivotTable extends Migration
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
public function up(): void
{
Schema::create('setting_user', function (Blueprint $table) {
$table->integer('setting_id')->unsigned()->index();
@@ -25,11 +23,9 @@ class CreateSettingUserPivotTable extends Migration
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
public function down(): void
{
Schema::dropIfExists('setting_user');
}
}
};

View File

@@ -4,14 +4,12 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateApplicationsTable extends Migration
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
public function up(): void
{
Schema::create('applications', function (Blueprint $table) {
$table->string('appid')->unique();
@@ -30,11 +28,9 @@ class CreateApplicationsTable extends Migration
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
public function down(): void
{
Schema::dropIfExists('applications');
}
}
};

View File

@@ -4,14 +4,12 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddClassToItemsTable extends Migration
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
public function up(): void
{
Schema::table('items', function (Blueprint $table) {
$table->string('class')->nullable();
@@ -20,13 +18,11 @@ class AddClassToItemsTable extends Migration
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
public function down(): void
{
Schema::table('items', function (Blueprint $table) {
$table->dropColumn(['class']);
});
}
}
};

View File

@@ -4,14 +4,12 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateJobsTable extends Migration
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
public function up(): void
{
Schema::create('jobs', function (Blueprint $table) {
$table->bigIncrements('id');
@@ -26,11 +24,9 @@ class CreateJobsTable extends Migration
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
public function down(): void
{
Schema::dropIfExists('jobs');
}
}
};

View File

@@ -4,14 +4,12 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateFailedJobsTable extends Migration
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
public function up(): void
{
Schema::create('failed_jobs', function (Blueprint $table) {
$table->bigIncrements('id');
@@ -25,11 +23,9 @@ class CreateFailedJobsTable extends Migration
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
public function down(): void
{
Schema::dropIfExists('failed_jobs');
}
}
};

View File

@@ -4,14 +4,12 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddAppidToItems extends Migration
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
public function up(): void
{
Schema::table('items', function (Blueprint $table) {
$table->string('appid')->nullable();
@@ -20,13 +18,11 @@ class AddAppidToItems extends Migration
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
public function down(): void
{
Schema::table('items', function (Blueprint $table) {
$table->dropColumn(['appid']);
});
}
}
};

View File

@@ -4,14 +4,12 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddClassToApplication extends Migration
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
public function up(): void
{
Schema::table('applications', function (Blueprint $table) {
$table->string('class')->nullable()->index();
@@ -20,13 +18,11 @@ class AddClassToApplication extends Migration
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
public function down(): void
{
Schema::table('applications', function (Blueprint $table) {
$table->dropColumn(['class']);
});
}
}
};

View File

@@ -4,14 +4,12 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddAppDescriptionToItems extends Migration
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
public function up(): void
{
Schema::table('items', function (Blueprint $table) {
$table->text('appdescription')->nullable();
@@ -20,13 +18,11 @@ class AddAppDescriptionToItems extends Migration
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
public function down(): void
{
Schema::table('items', function (Blueprint $table) {
//
});
}
}
};

View File

@@ -0,0 +1,24 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::rename('password_resets', 'password_reset_tokens');
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::rename('password_reset_tokens', 'password_resets');
}
};

View File

@@ -8,10 +8,8 @@ class DatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
public function run(): void
{
$this->call(SettingsSeeder::class);
$this->call(UsersSeeder::class);

View File

@@ -22,12 +22,16 @@ class SettingsSeeder extends Seeder
return json_encode(['en' => 'English']);
}
$languageDirectories = array_filter(glob(resource_path().'/lang/*'), 'is_dir');
$languageDirectories = array_filter(glob(lang_path().'/*'), 'is_dir');
$result = [];
foreach ($languageDirectories as $languageDirectory) {
$language = self::getLanguageFromDirectory($languageDirectory);
$resultNative = mb_convert_case(Locale::getDisplayLanguage($language.'-', $language), MB_CASE_TITLE, 'UTF-8');
$resultNative = mb_convert_case(
Locale::getDisplayLanguage($language.'-', $language),
MB_CASE_TITLE,
'UTF-8'
);
$resultEn = ucfirst(Locale::getDisplayLanguage($language, 'en'));
$result[$language] = "$resultNative ($resultEn)";
}
@@ -48,10 +52,8 @@ class SettingsSeeder extends Seeder
/**
* Run the database seeds.
*
* @return void
*/
public function run()
public function run(): void
{
// Groups
if (! $setting_group = SettingGroup::find(1)) {
@@ -176,6 +178,33 @@ class SettingsSeeder extends Seeder
$setting->value = 'en';
$setting->save();
}
if (! $setting = Setting::find(12)) {
$setting = new Setting;
$setting->id = 12;
$setting->group_id = 2;
$setting->key = 'trianglify';
$setting->type = 'boolean';
$setting->label = 'app.settings.trianglify';
$setting->save();
} else {
$setting->label = 'app.settings.trianglify';
$setting->save();
}
if (! $setting = Setting::find(13)) {
$setting = new Setting;
$setting->id = 13;
$setting->group_id = 2;
$setting->key = 'trianglify_seed';
$setting->type = 'text';
$setting->value = 'heimdall';
$setting->label = 'app.settings.trianglify_seed';
$setting->save();
} else {
$setting->label = 'app.settings.trianglify_seed';
$setting->save();
}
$window_target_options = json_encode([
'current' => 'app.settings.window_target.current',
@@ -201,7 +230,12 @@ class SettingsSeeder extends Seeder
if ($support = Setting::find(8)) {
$support->label = 'app.settings.support';
$support->value = '<a rel="noopener" target="_blank" href="https://discord.gg/CCjHKn4">Discord</a> | <a rel="noopener" target="_blank" href="https://github.com/linuxserver/Heimdall">Github</a> | <a rel="noopener" target="_blank" href="https://blog.heimdall.site/">Blog</a>';
$support->value =
'<a rel="noopener" target="_blank" href="https://discord.gg/CCjHKn4">Discord</a>'.
' | '.
'<a rel="noopener" target="_blank" href="https://github.com/linuxserver/Heimdall">Github</a>'.
' | '.
'<a rel="noopener" target="_blank" href="https://blog.heimdall.site/">Blog</a>';
$support->save();
} else {
$setting = new Setting;
@@ -210,7 +244,11 @@ class SettingsSeeder extends Seeder
$setting->key = 'support';
$setting->type = 'text';
$setting->label = 'app.settings.support';
$setting->value = '<a rel="noopener" target="_blank" href="https://discord.gg/CCjHKn4">Discord</a> | <a rel="noopener" target="_blank" href="https://github.com/linuxserver/Heimdall">Github</a> | <a rel="noopener" target="_blank" href="https://blog.heimdall.site/">Blog</a>';
$setting->value = '<a rel="noopener" target="_blank" href="https://discord.gg/CCjHKn4">Discord</a>'.
' | '.
'<a rel="noopener" target="_blank" href="https://github.com/linuxserver/Heimdall">Github</a>'.
' | '.
'<a rel="noopener" target="_blank" href="https://blog.heimdall.site/">Blog</a>';
$setting->system = true;
$setting->save();
}
@@ -275,7 +313,7 @@ class SettingsSeeder extends Seeder
$home_tag->save();
$home_tag_id = $home_tag->id;
if($home_tag_id != 0) {
if ($home_tag_id != 0) {
Log::info("Home Tag returned with id $home_tag_id from db! Changing to 0.");
DB::update('update items set id = 0 where id = ?', [$home_tag_id]);
@@ -289,5 +327,28 @@ class SettingsSeeder extends Seeder
$app->parents()->attach(0);
}
}
$tag_options = json_encode([
'folders' => 'app.settings.folders',
'tags' => 'app.settings.tags',
'categories' => 'app.settings.categories',
]);
if (! $setting = Setting::find(14)) {
$setting = new Setting;
$setting->id = 14;
$setting->group_id = 2;
$setting->key = 'treat_tags_as';
$setting->type = 'select';
$setting->options = $tag_options;
$setting->value = 'folders';
$setting->label = 'app.settings.treat_tags_as';
$setting->save();
} else {
$setting->options = $tag_options;
$setting->label = 'app.settings.treat_tags_as';
$setting->save();
}
}
}

View File

@@ -9,13 +9,11 @@ class UsersSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
public function run(): void
{
// Groups
if (! $user = User::find(1)) {
if (!User::find(1)) {
$user = new User;
$user->username = 'admin';
$user->email = 'admin@test.com';
@@ -24,13 +22,11 @@ class UsersSeeder extends Seeder
$user_id = $user->id;
if($user_id != 1) {
if ($user_id != 1) {
Log::info("First User returned with id $user_id from db! Changing to 1.");
DB::update('update users set id = 1 where id = ?', [$user_id]);
}
} else {
//$user->save();
}
}
}

133
lang/br/app.php Normal file
View File

@@ -0,0 +1,133 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| App Language Lines
|--------------------------------------------------------------------------
|
*/
'settings.system' => 'Sistema',
'settings.appearance' => 'Aparência',
'settings.miscellaneous' => 'Diversos',
'settings.support' => 'Ajuda',
'settings.donate' => 'Doar',
'settings.version' => 'Versão',
'settings.background_image' => 'Imagem de fundo',
'settings.trianglify' => 'Trianglify',
'settings.trianglify_seed' => 'Trianglify Random Seed',
'settings.window_target' => 'Link é aberto em',
'settings.window_target.current' => 'Abra nesta aba',
'settings.window_target.one' => 'Abra na mesma aba',
'settings.window_target.new' => 'Abra em uma nova aba',
'settings.homepage_search' => 'Pesquisa na página inicial',
'settings.search_provider' => 'Provedor de pesquisa',
'settings.language' => 'Idioma',
'settings.reset' => 'Redefinir de volta ao padrão',
'settings.remove' => 'Remover',
'settings.search' => 'busca',
'settings.no_items' => 'Nenhum item encontrado',
'settings.advanced' => 'Avançado',
'settings.custom_css' => 'CSS Customizado',
'settings.custom_js' => 'JavaScript Customizado',
'settings.label' => 'Rótulo',
'settings.value' => 'Valor',
'settings.edit' => 'Editar',
'settings.view' => 'Ver',
'options.none' => '- não configurado -',
'options.google' => 'Google',
'options.ddg' => 'DuckDuckGo',
'options.bing' => 'Bing',
'options.qwant' => 'Qwant',
'options.startpage' => 'Página inicial',
'options.yes' => 'Sim',
'options.no' => 'Não',
'options.nzbhydra' => 'NZBHydra',
'options.jackett' => 'Jackett',
'buttons.save' => 'Salvar',
'buttons.cancel' => 'Cancelar',
'buttons.add' => 'Adicionar',
'buttons.upload' => 'Carregar um arquivo',
'buttons.downloadapps' => 'Atualizar lista de Apps',
'dashboard' => 'Página Inicial do dashboard',
'dashboard.reorder' => 'Reordenar e fixar itens',
'dashboard.settings' => 'Configurações',
'dash.pin_item' => 'Fixar o item na dashboard',
'dash.no_apps' => 'Atualmente não há aplicativos fixados, :link1 ou :link2',
'dash.link1' => 'Adicionar um aplivativo aqui',
'dash.link2' => 'Fixar um item na dashboard',
'dash.pinned_items' => 'Itens fixados',
'apps.app_list' => 'Lista de aplicativos',
'apps.view_trash' => 'Ver lixo',
'apps.add_application' => 'Adicionar aplicativo',
'apps.application_name' => 'Nome do aplicativo',
'apps.colour' => 'Cor',
'apps.icon' => 'Ícone',
'app.import' => 'Importar',
'apps.pinned' => 'Fixado',
'apps.title' => 'Título',
'apps.hex' => 'Cor hexadecimal',
'apps.username' => 'Nome de usuário',
'apps.password' => 'Senha',
'apps.config' => 'Configuração',
'apps.apikey' => 'API Key',
'apps.enable' => 'Habilitar',
'apps.tag_list' => 'Lista de tags',
'apps.add_tag' => 'Adicionar tag',
'apps.tag_name' => 'Nome da tag',
'apps.tags' => 'Tags',
'apps.override' => 'Se diferente do URL principal',
'apps.preview' => 'Vizualizar',
'apps.apptype' => 'Tipo de Aplicativo',
'apps.website' => 'Website',
'apps.description' => 'Descrição',
'apps.only_admin_account' => 'Somente se tiver conta admin!',
'apps.autologin_url' => 'URL de login automático',
'apps.show_deleted' => 'Mostrando Aplicativos Apagados',
'user.user_list' => 'Comercial',
'user.add_user' => 'Adicionar usuários',
'user.username' => 'Nome de usuário',
'user.avatar' => 'Avatar',
'user.email' => 'O email',
'user.password_confirm' => 'Confirme a Senha',
'user.secure_front' => 'Permitir acesso público à frente - Aplicado apenas se uma senha for definida.',
'user.autologin' => 'Permitir o login a partir de um URL específico. Qualquer pessoa com o link pode fazer o login.',
'url' => 'URL',
'title' => 'Título',
'delete' => 'Apagar',
'optional' => 'Opcional',
'restore' => 'Restaurar',
'export' => 'Exportar',
'import' => 'Importar',
'alert.success.item_created' => 'Item criado com sucesso',
'alert.success.item_updated' => 'Item atualizado com sucesso',
'alert.success.item_deleted' => 'Item apagado com sucesso',
'alert.success.item_restored' => 'Item restaurado com sucesso',
'alert.success.tag_created' => 'Tag criada com sucesso',
'alert.success.tag_updated' => 'Tag atualizada com sucesso',
'alert.success.tag_deleted' => 'Tag apagada com sucesso',
'alert.success.tag_restored' => 'Tag restaurada com sucesso',
'alert.success.updating'=> 'Atualizando lista de apps',
'alert.success.setting_updated' => 'Você editou com sucesso essa configuração',
'alert.error.not_exist' => 'Essa configuração não existe.',
'alert.success.updating' => 'Atualizando lista de Apps',
'alert.success.user_created' => 'Usuário criado com sucesso',
'alert.success.user_updated' => 'Usuário atualizado com sucesso',
'alert.success.user_deleted' => 'Usuário excluído com sucesso',
'alert.success.user_restored' => 'Usuário restaurado com sucesso',
];

108
lang/cs/app.php Normal file
View File

@@ -0,0 +1,108 @@
<?php
return array (
'settings.system' => 'Systém',
'settings.appearance' => 'Vzhled',
'settings.miscellaneous' => 'Různé',
'settings.advanced' => 'Rozšířené nastavení',
'settings.support' => 'Podpora',
'settings.donate' => 'Podpořte nás',
'settings.version' => 'Verze',
'settings.background_image' => 'Obrázek pozadí',
'settings.trianglify' => 'Trianglify',
'settings.trianglify_seed' => 'Trianglify Random Seed',
'settings.window_target' => 'Odkazy otevírat v',
'settings.window_target.current' => 'Otevřít v této záložce',
'settings.window_target.one' => 'Otevřít ve stejné záložce',
'settings.window_target.new' => 'Otevřít v nové záložce',
'settings.homepage_search' => 'Vyhledávání na domovské stránce',
'settings.search_provider' => 'Vyhledávat pomocí',
'settings.language' => 'Jazyk',
'settings.reset' => 'Obnovit výchozí nastavení',
'settings.remove' => 'Odstranit',
'settings.search' => 'hledat',
'settings.no_items' => 'Žadné položky nenalezeny',
'settings.label' => 'Název',
'settings.value' => 'Hodnota',
'settings.edit' => 'Upravit',
'settings.view' => 'Náhled',
'settings.custom_css' => 'Vlastní CSS',
'settings.custom_js' => 'Vlastní JavaScript',
'options.none' => '- nenastaveno -',
'options.google' => 'Google',
'options.ddg' => 'DuckDuckGo',
'options.bing' => 'Bing',
'options.qwant' => 'Qwant',
'options.startpage' => 'StartPage',
'options.yes' => 'Ano',
'options.no' => 'Ne',
'options.nzbhydra' => 'NZBHydra',
'options.jackett' => 'Jackett',
'buttons.save' => 'Uložit',
'buttons.cancel' => 'Zrušit',
'buttons.add' => 'Přidat',
'buttons.upload' => 'Nahrát ikonu',
'buttons.downloadapps' => 'Aktualizovat seznam aplikací',
'dash.pin_item' => 'Připnout na dashboard',
'dash.no_apps' => 'Aktuálně nemáte žádné připnuté aplikace, :link1 nebo :link2',
'dash.link1' => 'Přidejte zde aplikacei',
'dash.link2' => 'Připnout na dashboard',
'dash.pinned_items' => 'Připnuté položky',
'apps.app_list' => 'Seznam aplikací',
'apps.view_trash' => 'Zobrazit koš',
'apps.add_application' => 'Přidat aplikaci',
'apps.application_name' => 'Název aplikace',
'apps.colour' => 'Barva',
'apps.icon' => 'Ikona',
'apps.pinned' => 'Připnuto',
'apps.title' => 'Název',
'apps.hex' => 'Hex barva',
'apps.username' => 'Uživatelské jméno',
'apps.password' => 'Heslo',
'apps.config' => 'Config',
'apps.apikey' => 'API Klíč',
'apps.enable' => 'Povolit',
'apps.tag_list' => 'Seznam tagů',
'apps.add_tag' => 'Přidat tag',
'apps.tag_name' => 'Název tagu',
'apps.tags' => 'Tagy',
'apps.override' => 'Pokud je různá od hlavní url',
'apps.preview' => 'Náhled',
'apps.apptype' => 'Typ apliakce',
'apps.website' => 'Webová stránka',
'apps.description' => 'Popis',
'apps.only_admin_account' => 'Pouze pokud máte administrátorský účet!',
'apps.autologin_url' => 'URL automatického přihlášení',
'apps.show_deleted' => 'Zobrazit smazané aplikace',
'dashboard' => 'Domácí obrazovka',
'user.user_list' => 'Uživatelé',
'user.add_user' => 'Přidat uživatele',
'user.username' => 'Uživatelské jméno',
'user.avatar' => 'Avatar',
'user.email' => 'Email',
'user.password_confirm' => 'Potvrdit heslo',
'user.secure_front' => 'Povolit veřejný přístup k rozhraní - Nastavte pouze pokud je nastaveno heslo.',
'user.autologin' => 'Povolit přihlášení ze specifické URL. Kdokoliv s odkazem se může přihlásit.',
'url' => 'URL',
'title' => 'Název',
'delete' => 'Smazat',
'optional' => 'Volitelné',
'restore' => 'Obnovit',
'alert.success.item_created' => 'Položka úspěšně vytvořena',
'alert.success.item_updated' => 'Položka úspěšně aktualizována',
'alert.success.item_deleted' => 'Položka úspěšně smazána',
'alert.success.item_restored' => 'Položka úspěšně obnovena',
'alert.success.updating' => 'Aktualizuji seznam aplikací',
'alert.success.tag_created' => 'Tag úspěšně vytvořen',
'alert.success.tag_updated' => 'Tag úspěšně aktualizován',
'alert.success.tag_deleted' => 'Tag úspěšně smazán',
'alert.success.tag_restored' => 'Tag úspěšně obnoven',
'alert.success.setting_updated' => 'Úspěšně jste aktualizovali nastavení',
'alert.error.not_exist' => 'Tohle nastavení neexistuje.',
'alert.success.user_created' => 'Uživatel úspěšně vytovřen',
'alert.success.user_updated' => 'Uživatel úspěšně aktualizován',
'alert.success.user_deleted' => 'Uživatel úspěšně smazán',
'alert.success.user_restored' => 'Uživatel úspěšně obnoven',
'dashboard.reorder' => 'Změňte pořadí a připněte položky',
'dashboard.settings' => 'Nastavení',
);

108
lang/da/app.php Normal file
View File

@@ -0,0 +1,108 @@
<?php
return array (
'settings.system' => 'System',
'settings.appearance' => 'Appearance',
'settings.miscellaneous' => 'Miscellaneous',
'settings.advanced' => 'Fremskreden',
'settings.support' => 'Support',
'settings.donate' => 'Doner',
'settings.version' => 'Version',
'settings.background_image' => 'Baggrundsbillede',
'settings.trianglify' => 'Trianglify',
'settings.trianglify_seed' => 'Trianglify Random Seed',
'settings.window_target' => 'Link opens in',
'settings.window_target.current' => 'Åbn i denne fane',
'settings.window_target.one' => 'Åbn i den samme fane',
'settings.window_target.new' => 'Åbn i en ny fane',
'settings.homepage_search' => 'Homepage Search',
'settings.search_provider' => 'Standardsøgemaskine',
'settings.language' => 'Sprog',
'settings.reset' => 'Nulstil tilbage til standard',
'settings.remove' => 'Fjern',
'settings.search' => 'søg',
'settings.no_items' => 'Intet fundet',
'settings.label' => 'Etiket',
'settings.value' => 'Værdi',
'settings.edit' => 'Rediger',
'settings.view' => 'Vis',
'settings.custom_css' => 'Brugerdefineret CSS',
'settings.custom_js' => 'Brugerdefineret JavaScript',
'options.none' => '- ikke indstillet -',
'options.google' => 'Google',
'options.ddg' => 'DuckDuckGo',
'options.bing' => 'Bing',
'options.qwant' => 'Qwant',
'options.startpage' => 'Startside',
'options.yes' => 'Ja',
'options.no' => 'Nej',
'options.nzbhydra' => 'NZBHydra',
'options.jackett' => 'Jackett',
'buttons.save' => 'Gem',
'buttons.cancel' => 'Afbryd',
'buttons.add' => 'Tilføj',
'buttons.upload' => 'Upload et ikon',
'buttons.downloadapps' => 'Opdater apps-listen',
'dash.pin_item' => 'Fastgør element til dashboard',
'dash.no_apps' => 'Der er i øjeblikket ingen fastgjorte applikationer, :link1 eller :link2',
'dash.link1' => 'Add an application here',
'dash.link2' => 'Pin an item to the dash',
'dash.pinned_items' => 'Fastgjorte elementer',
'apps.app_list' => 'Applikations liste',
'apps.view_trash' => 'View trash',
'apps.add_application' => 'Tilføj applikation',
'apps.application_name' => 'Applikations navn',
'apps.colour' => 'Farver',
'apps.icon' => 'Ikon',
'apps.pinned' => 'Fastgjort',
'apps.title' => 'Titel',
'apps.hex' => 'Hex farver',
'apps.username' => 'brugernavn',
'apps.password' => 'kodeord',
'apps.config' => 'Config',
'apps.apikey' => 'API nøgle',
'apps.enable' => 'Aktiver',
'apps.tag_list' => 'Tags liste',
'apps.add_tag' => 'Tilføj tag',
'apps.tag_name' => 'Tag navn',
'apps.tags' => 'Tags',
'apps.override' => 'Hvis det er anderledes end hovedwebadressen',
'apps.preview' => 'Eksempel',
'apps.apptype' => 'Applikationstype',
'apps.website' => 'Internet side',
'apps.description' => 'Beskrivelse',
'apps.only_admin_account' => 'Kun hvis du har en admin-konto!',
'apps.autologin_url' => 'Auto login url',
'apps.show_deleted' => 'Viser slettede applikationer',
'dashboard' => 'Home dashboard',
'user.user_list' => 'Brugere',
'user.add_user' => 'Tilføj bruger',
'user.username' => 'Brugernavn',
'user.avatar' => 'Avatar',
'user.email' => 'E-mail',
'user.password_confirm' => 'Bekræft kodeord',
'user.secure_front' => 'Tillad offentlig adgang til forsiden - Kun håndhævet, hvis der er angivet en adgangskode.',
'user.autologin' => 'Tillad at logge ind fra en bestemt URL. Alle med linket kan logge ind.',
'url' => 'URL',
'title' => 'Title',
'delete' => 'Slet',
'optional' => 'Valgfri',
'restore' => 'Genskab',
'alert.success.item_created' => 'Item created successfully',
'alert.success.item_updated' => 'Item updated successfully',
'alert.success.item_deleted' => 'Item deleted successfully',
'alert.success.item_restored' => 'Item restored successfully',
'alert.success.updating' => 'Updating apps list',
'alert.success.tag_created' => 'Tag oprettet med succes',
'alert.success.tag_updated' => 'Tag opdateret med succes',
'alert.success.tag_deleted' => 'Tag slettet med succes',
'alert.success.tag_restored' => 'Tag genskabt med succes',
'alert.success.setting_updated' => 'You have successfully edited this setting',
'alert.error.not_exist' => 'Denne indstilling findes ikke.',
'alert.success.user_created' => 'Bruger oprettet med succes',
'alert.success.user_updated' => 'Bruger opdateret med succes',
'alert.success.user_deleted' => 'Bruger slettet med succes',
'alert.success.user_restored' => 'Bruger genskabt med succes',
'dashboard.reorder' => 'Genbestil og fastgør varer',
'dashboard.settings' => 'Indstillinger',
);

108
lang/de/app.php Normal file
View File

@@ -0,0 +1,108 @@
<?php
return array (
'settings.system' => 'System',
'settings.appearance' => 'Aussehen',
'settings.miscellaneous' => 'Sonstiges',
'settings.advanced' => 'Erweitert',
'settings.support' => 'Unterstütze',
'settings.donate' => 'Spende',
'settings.version' => 'Version',
'settings.background_image' => 'Hintergrundbild',
'settings.trianglify' => 'Trianglify',
'settings.trianglify_seed' => 'Trianglify Random Seed',
'settings.window_target' => 'Link öffnen in',
'settings.window_target.current' => 'In diesem Tab öffnen',
'settings.window_target.one' => 'Im selben Tab öffnen',
'settings.window_target.new' => 'Im neuen Tab öffnen',
'settings.homepage_search' => 'Startseite Sucheingabe',
'settings.search_provider' => 'Suchanbieter',
'settings.language' => 'Sprache',
'settings.reset' => 'Zurücksetzen auf Standard',
'settings.remove' => 'Entfernen',
'settings.search' => 'suche',
'settings.no_items' => 'Keine Elemente gefunden',
'settings.label' => 'Bezeichnung',
'settings.value' => 'Wert',
'settings.edit' => 'Bearbeiten',
'settings.view' => 'Ansicht',
'settings.custom_css' => 'Angepasstes CSS',
'settings.custom_js' => 'Angepasstes JavaScript',
'options.none' => '- nicht festgelegt -',
'options.google' => 'Google',
'options.ddg' => 'DuckDuckGo',
'options.bing' => 'Bing',
'options.qwant' => 'Qwant',
'options.startpage' => 'StartSeite',
'options.yes' => 'Ja',
'options.no' => 'Nein',
'options.nzbhydra' => 'NZBHydra',
'options.jackett' => 'Jackett',
'buttons.save' => 'Speichern',
'buttons.cancel' => 'Abbrechen',
'buttons.add' => 'Hinzufügen',
'buttons.upload' => 'Hochladen einer Datei',
'buttons.downloadapps' => 'Update der Anwendungsliste',
'dash.pin_item' => 'Element auf dem Dashboard anheften',
'dash.no_apps' => 'Derzeit gibt es keine angeheftete Anwendungen. :link1 oder :link2',
'dash.link1' => 'Anwendung neu hinzufügen',
'dash.link2' => 'anheften',
'dash.pinned_items' => 'Angeheftete Elemente',
'apps.app_list' => 'Anwendungsliste',
'apps.view_trash' => 'Ansicht Papierkorb',
'apps.add_application' => 'Anwendung hinzufügen',
'apps.application_name' => 'Anwendungsname',
'apps.colour' => 'Farbe',
'apps.icon' => 'Symbol',
'apps.pinned' => 'Angeheftet',
'apps.title' => 'Titel',
'apps.hex' => 'Hex-Farbe',
'apps.username' => 'Benutzername',
'apps.password' => 'Passwort',
'apps.config' => 'Konfiguration',
'apps.apikey' => 'API Key',
'apps.enable' => 'Aktivieren',
'apps.tag_list' => 'Tags Liste',
'apps.add_tag' => 'Tag hinzufügen',
'apps.tag_name' => 'Tag Name',
'apps.tags' => 'Tags',
'apps.override' => 'Fals anders zur Haupt-URL',
'apps.preview' => 'Vorschau',
'apps.apptype' => 'Anwendungstyp',
'apps.website' => 'Webseite',
'apps.description' => 'Beschreibung',
'apps.only_admin_account' => 'Nur mit Admin-Konto!',
'apps.autologin_url' => 'Auto Login URL',
'apps.show_deleted' => 'Gelöschte Anwendung anzeigen',
'dashboard' => 'Home Dashboard',
'user.user_list' => 'Nutzer',
'user.add_user' => 'Nutzer hinzufügen',
'user.username' => 'Benutzername',
'user.avatar' => 'Avatar',
'user.email' => 'Email',
'user.password_confirm' => 'Passwort bestätigen',
'user.secure_front' => 'Öffentlichen Zugang erlauben - Tritt nur bei gesetztem Passwort in kraft.',
'user.autologin' => 'Anmelden von spezieller URL erlauben. Jeder mit diesem Link kann sich anmelden.',
'url' => 'URL',
'title' => 'Titel',
'delete' => 'Löschen',
'optional' => 'Optional',
'restore' => 'Wiederherstellen',
'alert.success.item_created' => 'Element erfolgreich erstellt',
'alert.success.item_updated' => 'Element erfolgreich aktualisiert',
'alert.success.item_deleted' => 'Element erfolgreich gelöscht',
'alert.success.item_restored' => 'Element erfolgreich wiederhergestellt',
'alert.success.updating' => 'Aktualisiere Anwendungsliste',
'alert.success.tag_created' => 'Tag erfolgreich erstellt',
'alert.success.tag_updated' => 'Tag erfolgreich aktualisiert',
'alert.success.tag_deleted' => 'Tag erfolgreich gelöscht',
'alert.success.tag_restored' => 'Tag erfolgreich wiederhergestellt',
'alert.success.setting_updated' => 'Die Einstellungen wurden übernommen',
'alert.error.not_exist' => 'Diese Einstellung existiert nicht.',
'alert.success.user_created' => 'Nutzer erfolgreich erstellt',
'alert.success.user_updated' => 'Nutzer erfolgreich aktualisiert',
'alert.success.user_deleted' => 'Nutzer erfolgreich gelöscht',
'alert.success.user_restored' => 'Nutzer erfolgreich wiederhergestellt',
'dashboard.reorder' => 'Elemente neu anordnen und anheften',
'dashboard.settings' => 'Einstellungen',
);

Some files were not shown because too many files have changed in this diff Show More