diff --git a/.github/workflows/deploy_staging.yml b/.github/workflows/deploy_staging.yml index d90e10e2..841efbb3 100644 --- a/.github/workflows/deploy_staging.yml +++ b/.github/workflows/deploy_staging.yml @@ -16,6 +16,7 @@ jobs: port: ${{ secrets.PORT }} username: ${{ secrets.USERNAME }} privateKey: ${{ secrets.PRIVATE_KEY}} + passphrase: ${{ secrets.PRIVATE_KEY_PASSPHRASE}} - name: Discord notification uses: Ilshidur/action-discord@master env: diff --git a/app/Console/Commands/ComputeAggregateVisits.php b/app/Console/Commands/ComputeAggregateVisits.php index 17e6fc67..115dd2eb 100644 --- a/app/Console/Commands/ComputeAggregateVisits.php +++ b/app/Console/Commands/ComputeAggregateVisits.php @@ -6,6 +6,7 @@ use DB; use Carbon\Carbon; use App\User; +use App\Visit; use App\VisitAggregate; class ComputeAggregateVisits extends Command @@ -42,15 +43,16 @@ public function __construct() public function handle() { $this->info('Counting the visits count data'); - $result = $this->countSongLyricVisits(Carbon::now()->subWeeks(1)); + $result = $this->countSongLyricVisits(Carbon::now()->subWeeks(1), Carbon::now()->subMonths(4)); $this->info('Updating the visits_aggregates table'); $result->map(function ($row) { return [ 'visitable_id' => $row->id, 'visitable_type' => 'App\SongLyric', - 'count_week' => $row->count_from, - 'count_total' => $row->count_total + 'count_after_prune' => $row->count_after_prune, + 'count_week' => $row->count_week, + 'count_pruned' => $row->count_pruned + $row->count_pruned_old ]; }) ->chunk(1000) @@ -61,25 +63,40 @@ public function handle() return 0; } - private function countSongLyricVisits(Carbon $from) + private function countSongLyricVisits(Carbon $from, Carbon $prune_until) { $res = DB::select(DB::raw( "SELECT id, (select count(*) from visits - where song_lyrics.id = visits.visitable_id and visits.visitable_type = \"App\\\SongLyric\") - as count_total, + where song_lyrics.id = visits.visitable_id and visits.visitable_type = \"App\\\SongLyric\" + and created_at > :prune_until_i) + as count_after_prune, (select count(*) from visits where song_lyrics.id = visits.visitable_id and visits.visitable_type = \"App\\\SongLyric\" and created_at > :from) - as count_from + as count_week, + (select count(*) from visits + where song_lyrics.id = visits.visitable_id and visits.visitable_type = \"App\\\SongLyric\" + and created_at <= :prune_until) + as count_pruned, + + -- we don't want to ovewrite the data in visit_aggregates.count_pruned but instead to add them up + -- that's why we retrieve them here to add them wit count_pruned + (select count_pruned from visit_aggregates + where song_lyrics.id = visit_aggregates.visitable_id and visit_aggregates.visitable_type = \"App\\\SongLyric\") + as count_pruned_old from song_lyrics where song_lyrics.deleted_at is null " ), [ // 'visit_type' => $visit_type, - 'from' => $from->format('Y-m-d H:i:s') + 'prune_until_i' => $prune_until->format('Y-m-d H:i:s'), + 'from' => $from->format('Y-m-d H:i:s'), + 'prune_until' => $prune_until->format('Y-m-d H:i:s'), ]); + Visit::where('created_at', '<', $prune_until->format('Y-m-d H:i:s'))->delete(); + return collect($res); } } diff --git a/app/GraphQL/Mutations/UpdateSongLyric.php b/app/GraphQL/Mutations/UpdateSongLyric.php index c04d1f90..87f17cd3 100644 --- a/app/GraphQL/Mutations/UpdateSongLyric.php +++ b/app/GraphQL/Mutations/UpdateSongLyric.php @@ -37,18 +37,33 @@ public function __invoke($rootValue, array $args, GraphQLContext $context, Resol $song_lyric = SongLyric::find($input["id"]); // $song_lyric_old = $song_lyric->replicate(); - $this->sl_lily_service->handleLilypondOnUpdate($song_lyric, $input["lilypond"], $input["lilypond_key_major"], $input["lilypond_parts_sheet_music"]); + // if has key + if (isset($input["lilypond"])) { + $this->sl_lily_service->handleLilypondOnUpdate($song_lyric, $input["lilypond"], $input["lilypond_key_major"], $input["lilypond_parts_sheet_music"]); + } $song_lyric->update($input); // todo if has key - $this->sl_service->handleLyrics($song_lyric, $input["lyrics"]); - $this->sl_service->handleArrangementSourceUpdate($song_lyric, $input["arrangement_source"]); - $this->sl_service->handleSongGroup($song_lyric, $input["song"]); + if (isset($input["lyrics"])) { + $this->sl_service->handleLyrics($song_lyric, $input["lyrics"]); + } + if (isset($input["arrangement_source"])) { + $this->sl_service->handleArrangementSourceUpdate($song_lyric, $input["arrangement_source"]); + } + if (isset($input["song"])) { + $this->sl_service->handleSongGroup($song_lyric, $input["song"]); + } $this->sl_service->handleHasChords($song_lyric); - $this->sl_service->handleAuthors($song_lyric, $input["authors"]); - $this->sl_service->handleSongbookRecords($song_lyric, $input["songbook_records"]); + if (isset($input["authors"])) { + $this->sl_service->handleAuthors($song_lyric, $input["authors"]); + } + if (isset($input["songbook_records"])) { + $this->sl_service->handleSongbookRecords($song_lyric, $input["songbook_records"]); + } $this->sl_service->handleRevisionAssociacionsStats($song_lyric); - $this->sl_service->handleBibleReferences($song_lyric, $input['bible_refs_osis']); + if (isset($input["bible_refs_osis"])) { + $this->sl_service->handleBibleReferences($song_lyric, $input['bible_refs_osis']); + } $song_lyric->save(); diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index c318d6a3..1048e286 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -15,6 +15,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\URL; use Illuminate\Support\Facades\Validator; +use Illuminate\Support\Facades\Storage; class AppServiceProvider extends ServiceProvider { @@ -51,6 +52,31 @@ public function boot() // }); Validator::extend('recaptcha', '\App\Validators\ReCaptcha@validate'); + + try { + Storage::extend('google', function ($app, $config) { + logger($config['folder']); + + $options = []; + + if (!empty($config['teamDriveId'] ?? null)) { + $options['teamDriveId'] = $config['teamDriveId']; + } + + $client = new \Google\Client(); + $client->setClientId($config['clientId']); + $client->setClientSecret($config['clientSecret']); + $client->refreshToken($config['refreshToken']); + + $service = new \Google\Service\Drive($client); + $adapter = new \Masbug\Flysystem\GoogleDriveAdapter($service, $config['folder'] ?? '/', $options); + $driver = new \League\Flysystem\Filesystem($adapter); + + return new \Illuminate\Filesystem\FilesystemAdapter($driver, $adapter); + }); + } catch(\Exception $e) { + // your exception handling logic + } } /** diff --git a/app/Services/SongLyricModelService.php b/app/Services/SongLyricModelService.php index a77aa3e9..2b7d32f5 100644 --- a/app/Services/SongLyricModelService.php +++ b/app/Services/SongLyricModelService.php @@ -34,7 +34,8 @@ public function createSongLyric(string $name): SongLyric $song_lyric->visit_aggregate()->create([ 'count_week' => 0, - 'count_total' => 0 + 'count_after_prune' => 0, + 'count_pruned' => 0 ]); return $song_lyric; diff --git a/app/SongLyric.php b/app/SongLyric.php index af93d6a4..52145e60 100644 --- a/app/SongLyric.php +++ b/app/SongLyric.php @@ -118,7 +118,8 @@ class SongLyric extends Model 'is_sealed', 'revision_n_tags', 'revision_n_authors', - 'revision_n_songbook_records' + 'revision_n_songbook_records', + 'hymnology' ]; private static $lang_string_values = [ diff --git a/app/VisitAggregate.php b/app/VisitAggregate.php index fa3156c9..0aa34d89 100644 --- a/app/VisitAggregate.php +++ b/app/VisitAggregate.php @@ -8,7 +8,7 @@ class VisitAggregate extends Model { - protected $fillable = ['visitable_type', 'visitable_id', 'count_week', 'count_total']; + protected $fillable = ['visitable_type', 'visitable_id', 'count_week', 'count_after_prune', 'count_pruned']; public $timestamps = false; @@ -21,4 +21,8 @@ public function song_lyric(): MorphTo { return $this->morphTo(SongLyric::class, 'visitable'); } + + public function getCountTotalAttribute(): int { + return $this->count_after_prune + $this->count_pruned; + } } diff --git a/composer.json b/composer.json index 34c350ad..d182c5a2 100644 --- a/composer.json +++ b/composer.json @@ -20,6 +20,7 @@ "laravel/scout": "^9.4", "laravel/tinker": "^2.0", "laravel/ui": "^3.0", + "masbug/flysystem-google-drive-ext": "^2.2", "mll-lab/graphql-php-scalars": "^5.4", "mll-lab/laravel-graphql-playground": "^2.6", "nuwave/lighthouse": "^5.55", diff --git a/composer.lock b/composer.lock index cc3c5ae9..e02bb007 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e755e33e59fdde1742ea8c4d1d597de7", + "content-hash": "7647c0e64fab11a89c60015a051256b7", "packages": [ { "name": "babenkoivan/elastic-adapter", @@ -1502,6 +1502,69 @@ }, "time": "2020-11-24T22:02:12+00:00" }, + { + "name": "firebase/php-jwt", + "version": "v6.4.0", + "source": { + "type": "git", + "url": "https://github.com/firebase/php-jwt.git", + "reference": "4dd1e007f22a927ac77da5a3fbb067b42d3bc224" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/firebase/php-jwt/zipball/4dd1e007f22a927ac77da5a3fbb067b42d3bc224", + "reference": "4dd1e007f22a927ac77da5a3fbb067b42d3bc224", + "shasum": "" + }, + "require": { + "php": "^7.1||^8.0" + }, + "require-dev": { + "guzzlehttp/guzzle": "^6.5||^7.4", + "phpspec/prophecy-phpunit": "^1.1", + "phpunit/phpunit": "^7.5||^9.5", + "psr/cache": "^1.0||^2.0", + "psr/http-client": "^1.0", + "psr/http-factory": "^1.0" + }, + "suggest": { + "ext-sodium": "Support EdDSA (Ed25519) signatures", + "paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present" + }, + "type": "library", + "autoload": { + "psr-4": { + "Firebase\\JWT\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Neuman Vong", + "email": "neuman+pear@twilio.com", + "role": "Developer" + }, + { + "name": "Anant Narayanan", + "email": "anant@php.net", + "role": "Developer" + } + ], + "description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.", + "homepage": "https://github.com/firebase/php-jwt", + "keywords": [ + "jwt", + "php" + ], + "support": { + "issues": "https://github.com/firebase/php-jwt/issues", + "source": "https://github.com/firebase/php-jwt/tree/v6.4.0" + }, + "time": "2023-02-09T21:01:23+00:00" + }, { "name": "fruitcake/php-cors", "version": "v1.2.0", @@ -1573,6 +1636,178 @@ ], "time": "2022-02-20T15:07:15+00:00" }, + { + "name": "google/apiclient", + "version": "v2.13.2", + "source": { + "type": "git", + "url": "https://github.com/googleapis/google-api-php-client.git", + "reference": "53c3168fd1836ec21d28a768f78a8c0e44046ec4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/googleapis/google-api-php-client/zipball/53c3168fd1836ec21d28a768f78a8c0e44046ec4", + "reference": "53c3168fd1836ec21d28a768f78a8c0e44046ec4", + "shasum": "" + }, + "require": { + "firebase/php-jwt": "~2.0||~3.0||~4.0||~5.0||~6.0", + "google/apiclient-services": "~0.200", + "google/auth": "^1.10", + "guzzlehttp/guzzle": "~5.3.3||~6.0||~7.0", + "guzzlehttp/psr7": "^1.8.4||^2.2.1", + "monolog/monolog": "^1.17||^2.0||^3.0", + "php": "^5.6|^7.0|^8.0", + "phpseclib/phpseclib": "~2.0||^3.0.2" + }, + "require-dev": { + "cache/filesystem-adapter": "^0.3.2|^1.1", + "composer/composer": "^1.10.22", + "phpcompatibility/php-compatibility": "^9.2", + "phpspec/prophecy-phpunit": "^1.1||^2.0", + "phpunit/phpunit": "^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.0", + "squizlabs/php_codesniffer": "^3.0", + "symfony/css-selector": "~2.1", + "symfony/dom-crawler": "~2.1", + "yoast/phpunit-polyfills": "^1.0" + }, + "suggest": { + "cache/filesystem-adapter": "For caching certs and tokens (using Google\\Client::setCache)" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.x-dev" + } + }, + "autoload": { + "files": [ + "src/aliases.php" + ], + "psr-4": { + "Google\\": "src/" + }, + "classmap": [ + "src/aliases.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "Client library for Google APIs", + "homepage": "http://developers.google.com/api-client-library/php", + "keywords": [ + "google" + ], + "support": { + "issues": "https://github.com/googleapis/google-api-php-client/issues", + "source": "https://github.com/googleapis/google-api-php-client/tree/v2.13.2" + }, + "time": "2023-04-06T14:59:47+00:00" + }, + { + "name": "google/apiclient-services", + "version": "v0.299.0", + "source": { + "type": "git", + "url": "https://github.com/googleapis/google-api-php-client-services.git", + "reference": "cb6495dd548c6fc88133177fde3888ce9dcaabdd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/cb6495dd548c6fc88133177fde3888ce9dcaabdd", + "reference": "cb6495dd548c6fc88133177fde3888ce9dcaabdd", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "phpunit/phpunit": "^5.7||^8.5.13" + }, + "type": "library", + "autoload": { + "files": [ + "autoload.php" + ], + "psr-4": { + "Google\\Service\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "Client library for Google APIs", + "homepage": "http://developers.google.com/api-client-library/php", + "keywords": [ + "google" + ], + "support": { + "issues": "https://github.com/googleapis/google-api-php-client-services/issues", + "source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.299.0" + }, + "time": "2023-05-06T01:04:14+00:00" + }, + { + "name": "google/auth", + "version": "v1.26.0", + "source": { + "type": "git", + "url": "https://github.com/googleapis/google-auth-library-php.git", + "reference": "f1f0d0319e2e7750ebfaa523c78819792a9ed9f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/googleapis/google-auth-library-php/zipball/f1f0d0319e2e7750ebfaa523c78819792a9ed9f7", + "reference": "f1f0d0319e2e7750ebfaa523c78819792a9ed9f7", + "shasum": "" + }, + "require": { + "firebase/php-jwt": "^5.5||^6.0", + "guzzlehttp/guzzle": "^6.2.1|^7.0", + "guzzlehttp/psr7": "^1.7|^2.0", + "php": "^7.1||^8.0", + "psr/cache": "^1.0|^2.0|^3.0", + "psr/http-message": "^1.0" + }, + "require-dev": { + "guzzlehttp/promises": "0.1.1|^1.3", + "kelvinmo/simplejwt": "0.7.0", + "phpseclib/phpseclib": "^2.0.31||^3.0", + "phpspec/prophecy-phpunit": "^1.1||^2.0", + "phpunit/phpunit": "^7.5||^9.0.0", + "sebastian/comparator": ">=1.2.3", + "squizlabs/php_codesniffer": "^3.5" + }, + "suggest": { + "phpseclib/phpseclib": "May be used in place of OpenSSL for signing strings or for token management. Please require version ^2." + }, + "type": "library", + "autoload": { + "psr-4": { + "Google\\Auth\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "Google Auth Library for PHP", + "homepage": "http://github.com/google/google-auth-library-php", + "keywords": [ + "Authentication", + "google", + "oauth2" + ], + "support": { + "docs": "https://googleapis.github.io/google-auth-library-php/main/", + "issues": "https://github.com/googleapis/google-auth-library-php/issues", + "source": "https://github.com/googleapis/google-auth-library-php/tree/v1.26.0" + }, + "time": "2023-04-05T15:11:57+00:00" + }, { "name": "graham-campbell/guzzle-factory", "version": "v5.1.1", @@ -3441,6 +3676,66 @@ ], "time": "2022-06-15T10:09:46+00:00" }, + { + "name": "masbug/flysystem-google-drive-ext", + "version": "v2.2.2", + "source": { + "type": "git", + "url": "https://github.com/masbug/flysystem-google-drive-ext.git", + "reference": "3947d39be212bff9cea95b2a5252e52c9eb36cc0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/masbug/flysystem-google-drive-ext/zipball/3947d39be212bff9cea95b2a5252e52c9eb36cc0", + "reference": "3947d39be212bff9cea95b2a5252e52c9eb36cc0", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "google/apiclient": "^2.2", + "guzzlehttp/guzzle": "^6.3 | ^7.0", + "guzzlehttp/psr7": "^1.7|^2.0", + "league/flysystem": "^2.1.1|^3.0", + "php": "^7.2 | ^8.0" + }, + "require-dev": { + "league/flysystem-adapter-test-utilities": "^2.0|^3.0", + "phpunit/phpunit": "^8.0 | ^9.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Masbug\\Flysystem\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Naoki Sawada", + "email": "hypweb@gmail.com" + }, + { + "name": "Mitja Spes", + "email": "mitja@lxnav.com" + } + ], + "description": "Flysystem adapter for Google Drive with seamless virtual<=>display path translation", + "keywords": [ + "Flysystem", + "extended", + "google-drive", + "laravel", + "translated" + ], + "support": { + "issues": "https://github.com/masbug/flysystem-google-drive-ext/issues", + "source": "https://github.com/masbug/flysystem-google-drive-ext/tree/v2.2.2" + }, + "time": "2022-06-24T06:43:42+00:00" + }, { "name": "mll-lab/graphql-php-scalars", "version": "v5.4.0", @@ -4239,6 +4534,123 @@ ], "time": "2022-06-22T07:13:36+00:00" }, + { + "name": "paragonie/constant_time_encoding", + "version": "v2.6.3", + "source": { + "type": "git", + "url": "https://github.com/paragonie/constant_time_encoding.git", + "reference": "58c3f47f650c94ec05a151692652a868995d2938" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/58c3f47f650c94ec05a151692652a868995d2938", + "reference": "58c3f47f650c94ec05a151692652a868995d2938", + "shasum": "" + }, + "require": { + "php": "^7|^8" + }, + "require-dev": { + "phpunit/phpunit": "^6|^7|^8|^9", + "vimeo/psalm": "^1|^2|^3|^4" + }, + "type": "library", + "autoload": { + "psr-4": { + "ParagonIE\\ConstantTime\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com", + "role": "Maintainer" + }, + { + "name": "Steve 'Sc00bz' Thomas", + "email": "steve@tobtu.com", + "homepage": "https://www.tobtu.com", + "role": "Original Developer" + } + ], + "description": "Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)", + "keywords": [ + "base16", + "base32", + "base32_decode", + "base32_encode", + "base64", + "base64_decode", + "base64_encode", + "bin2hex", + "encoding", + "hex", + "hex2bin", + "rfc4648" + ], + "support": { + "email": "info@paragonie.com", + "issues": "https://github.com/paragonie/constant_time_encoding/issues", + "source": "https://github.com/paragonie/constant_time_encoding" + }, + "time": "2022-06-14T06:56:20+00:00" + }, + { + "name": "paragonie/random_compat", + "version": "v9.99.100", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/996434e5492cb4c3edcb9168db6fbb1359ef965a", + "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a", + "shasum": "" + }, + "require": { + "php": ">= 7" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*", + "vimeo/psalm": "^1" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "polyfill", + "pseudorandom", + "random" + ], + "support": { + "email": "info@paragonie.com", + "issues": "https://github.com/paragonie/random_compat/issues", + "source": "https://github.com/paragonie/random_compat" + }, + "time": "2020-10-15T08:29:30+00:00" + }, { "name": "php-http/client-common", "version": "2.5.0", @@ -4699,6 +5111,116 @@ ], "time": "2021-12-04T23:24:31+00:00" }, + { + "name": "phpseclib/phpseclib", + "version": "3.0.19", + "source": { + "type": "git", + "url": "https://github.com/phpseclib/phpseclib.git", + "reference": "cc181005cf548bfd8a4896383bb825d859259f95" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/cc181005cf548bfd8a4896383bb825d859259f95", + "reference": "cc181005cf548bfd8a4896383bb825d859259f95", + "shasum": "" + }, + "require": { + "paragonie/constant_time_encoding": "^1|^2", + "paragonie/random_compat": "^1.4|^2.0|^9.99.99", + "php": ">=5.6.1" + }, + "require-dev": { + "phpunit/phpunit": "*" + }, + "suggest": { + "ext-dom": "Install the DOM extension to load XML formatted public keys.", + "ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.", + "ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.", + "ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.", + "ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations." + }, + "type": "library", + "autoload": { + "files": [ + "phpseclib/bootstrap.php" + ], + "psr-4": { + "phpseclib3\\": "phpseclib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jim Wigginton", + "email": "terrafrost@php.net", + "role": "Lead Developer" + }, + { + "name": "Patrick Monnerat", + "email": "pm@datasphere.ch", + "role": "Developer" + }, + { + "name": "Andreas Fischer", + "email": "bantu@phpbb.com", + "role": "Developer" + }, + { + "name": "Hans-Jürgen Petrich", + "email": "petrich@tronic-media.com", + "role": "Developer" + }, + { + "name": "Graham Campbell", + "email": "graham@alt-three.com", + "role": "Developer" + } + ], + "description": "PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.", + "homepage": "http://phpseclib.sourceforge.net", + "keywords": [ + "BigInteger", + "aes", + "asn.1", + "asn1", + "blowfish", + "crypto", + "cryptography", + "encryption", + "rsa", + "security", + "sftp", + "signature", + "signing", + "ssh", + "twofish", + "x.509", + "x509" + ], + "support": { + "issues": "https://github.com/phpseclib/phpseclib/issues", + "source": "https://github.com/phpseclib/phpseclib/tree/3.0.19" + }, + "funding": [ + { + "url": "https://github.com/terrafrost", + "type": "github" + }, + { + "url": "https://www.patreon.com/phpseclib", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpseclib/phpseclib", + "type": "tidelift" + } + ], + "time": "2023-03-05T17:13:09+00:00" + }, { "name": "predis/predis", "version": "v1.1.10", diff --git a/config/backup.php b/config/backup.php index 0579e971..315fad4e 100644 --- a/config/backup.php +++ b/config/backup.php @@ -8,7 +8,7 @@ * The name of this application. You can use this name to monitor * the backups. */ - 'name' => env('APP_NAME', 'laravel-backup'), + 'name' => '', 'source' => [ @@ -18,7 +18,7 @@ * The list of directories and files that will be included in the backup. */ 'include' => [ - storage_path('app'), + storage_path('app/public_files'), ], /* @@ -27,8 +27,8 @@ * Directories used by the backup process will automatically be excluded. */ 'exclude' => [ - // base_path('vendor'), - // base_path('node_modules'), + storage_path('app/public_files/thumbnails'), + storage_path('app/public_files/thumbnails_externals'), ], /* @@ -96,7 +96,7 @@ * The disk names on which the backups will be stored. */ 'disks' => [ - 'dropbox', + 'google', ], ], @@ -116,12 +116,12 @@ 'notifications' => [ 'notifications' => [ - \Spatie\Backup\Notifications\Notifications\BackupHasFailed::class => ['mail'], - \Spatie\Backup\Notifications\Notifications\UnhealthyBackupWasFound::class => ['mail'], - \Spatie\Backup\Notifications\Notifications\CleanupHasFailed::class => ['mail'], - \Spatie\Backup\Notifications\Notifications\BackupWasSuccessful::class => ['mail'], - \Spatie\Backup\Notifications\Notifications\HealthyBackupWasFound::class => ['mail'], - \Spatie\Backup\Notifications\Notifications\CleanupWasSuccessful::class => ['mail'], + \Spatie\Backup\Notifications\Notifications\BackupHasFailedNotification::class => ['mail'], + \Spatie\Backup\Notifications\Notifications\UnhealthyBackupWasFoundNotification::class => ['mail'], + \Spatie\Backup\Notifications\Notifications\CleanupHasFailedNotification::class => ['mail'], + \Spatie\Backup\Notifications\Notifications\BackupWasSuccessfulNotification::class => ['mail'], + \Spatie\Backup\Notifications\Notifications\HealthyBackupWasFoundNotification::class => ['mail'], + \Spatie\Backup\Notifications\Notifications\CleanupWasSuccessfulNotification::class => ['mail'], ], /* diff --git a/config/database.php b/config/database.php index baec5735..49f59b1b 100644 --- a/config/database.php +++ b/config/database.php @@ -52,6 +52,17 @@ 'prefix' => '', 'strict' => true, 'engine' => null, + + 'dump' => [ + 'add_extra_option' => '--column-statistics=0 ', + 'excludeTables' => [ + 'migrations', + 'revisions', + 'song_lyric_lilypond_svg', + 'visits', + ], + // 'useSingleTransaction' => true, + ] ], 'migrate' => [ diff --git a/config/filesystems.php b/config/filesystems.php index 83c41d7a..74e222bc 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -67,7 +67,15 @@ 'dropbox' => [ 'authorization_token' => env('DROPBOX_API_KEY'), 'driver' => 'dropbox' - ] + ], + + 'google' => [ + 'driver' => 'google', + 'clientId' => env('GOOGLE_DRIVE_CLIENT_ID'), + 'clientSecret' => env('GOOGLE_DRIVE_CLIENT_SECRET'), + 'refreshToken' => env('GOOGLE_DRIVE_REFRESH_TOKEN'), + 'folder' => env('GOOGLE_DRIVE_FOLDER'), + ], ], diff --git a/database/migrations/2023_07_01_161022_add_count_pruned_to_visits_aggregates_table.php b/database/migrations/2023_07_01_161022_add_count_pruned_to_visits_aggregates_table.php new file mode 100644 index 00000000..c1553b72 --- /dev/null +++ b/database/migrations/2023_07_01_161022_add_count_pruned_to_visits_aggregates_table.php @@ -0,0 +1,34 @@ +unsignedInteger('count_pruned')->default(0); + $table->renameColumn('count_total', 'count_after_prune'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('visit_aggregates', function (Blueprint $table) { + $table->dropColumn('count_pruned'); + $table->renameColumn('count_after_prune', 'count_total'); + }); + } +}; diff --git a/database/migrations/2023_11_25_221411_add_hymnology_to_song_lyrics_table.php b/database/migrations/2023_11_25_221411_add_hymnology_to_song_lyrics_table.php new file mode 100644 index 00000000..175a24c2 --- /dev/null +++ b/database/migrations/2023_11_25_221411_add_hymnology_to_song_lyrics_table.php @@ -0,0 +1,32 @@ +string('hymnology')->default(''); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('song_lyrics', function (Blueprint $table) { + $table->dropColumn('hymnology'); + }); + } +}; diff --git a/graphql/song_lyric.graphql b/graphql/song_lyric.graphql index 04be1770..792250b8 100644 --- a/graphql/song_lyric.graphql +++ b/graphql/song_lyric.graphql @@ -164,6 +164,7 @@ type SongLyric { admin_note: String @guard is_sealed: Boolean base_key: SheetMusicKey @rename(attribute: "lilypond_key_major") + hymnology: String } enum SongType { @@ -289,6 +290,7 @@ input UpdateSongLyricInput { bible_refs_src: String admin_note: String is_sealed: Boolean + hymnology: String } input SyncOfficialTagsRelation { diff --git a/graphql/visit_info.graphql b/graphql/visit_info.graphql index 8e273d7a..a4a6aa31 100644 --- a/graphql/visit_info.graphql +++ b/graphql/visit_info.graphql @@ -1,4 +1,7 @@ type VisitInfo { count_week: Int count_total: Int + + # count_pruned: Int + # count_after_prune: Int } \ No newline at end of file diff --git a/resources/assets/js/admin/models/SongLyric.js b/resources/assets/js/admin/models/SongLyric.js index f00f33c5..2e250c08 100644 --- a/resources/assets/js/admin/models/SongLyric.js +++ b/resources/assets/js/admin/models/SongLyric.js @@ -119,6 +119,7 @@ const fragment = gql` admin_note is_sealed + hymnology } ${lilypond_parts_sheet_music_fragment} `; @@ -322,6 +323,7 @@ export default { admin_note: vueModel.admin_note, licence_type_cc: vueModel.licence_type_cc, is_sealed: vueModel.is_sealed, + hymnology: vueModel.hymnology, // a pivot mutator authors: { sync: vueModel.authors_pivot diff --git a/resources/assets/js/admin/pages/edit/SongLyricEdit.vue b/resources/assets/js/admin/pages/edit/SongLyricEdit.vue index afc95cef..0be294e9 100644 --- a/resources/assets/js/admin/pages/edit/SongLyricEdit.vue +++ b/resources/assets/js/admin/pages/edit/SongLyricEdit.vue @@ -95,6 +95,14 @@ + + + +

Autoři aranže