From 8babadcb9fe2d151351ed123ce9180bbe23dfc2d Mon Sep 17 00:00:00 2001 From: majora2007 Date: Tue, 12 Oct 2021 13:25:18 +0000 Subject: [PATCH 001/116] Bump versions by dotnet-bump-version. --- Kavita.Common/Kavita.Common.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kavita.Common/Kavita.Common.csproj b/Kavita.Common/Kavita.Common.csproj index 26ca78d92..0a2904361 100644 --- a/Kavita.Common/Kavita.Common.csproj +++ b/Kavita.Common/Kavita.Common.csproj @@ -4,7 +4,7 @@ net5.0 kavitareader.com Kavita - 0.4.7.0 + 0.4.7.1 en From 0e5d33e2638a9ac7e36b72ebf9043064769154df Mon Sep 17 00:00:00 2001 From: majora2007 Date: Tue, 12 Oct 2021 14:04:05 +0000 Subject: [PATCH 002/116] Bump versions by dotnet-bump-version. --- Kavita.Common/Kavita.Common.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kavita.Common/Kavita.Common.csproj b/Kavita.Common/Kavita.Common.csproj index 26ca78d92..0a2904361 100644 --- a/Kavita.Common/Kavita.Common.csproj +++ b/Kavita.Common/Kavita.Common.csproj @@ -4,7 +4,7 @@ net5.0 kavitareader.com Kavita - 0.4.7.0 + 0.4.7.1 en From c3868d657519e4acaef04efd9ea6a70039fd1762 Mon Sep 17 00:00:00 2001 From: Robbie Davis Date: Tue, 12 Oct 2021 11:28:09 -0400 Subject: [PATCH 003/116] Workflow updates (#658) # Added - Added: Added automatic character parsing for discord notifier. Now if the PR is over a certain character limit, it will trim and add an appropriate link to the full changelog. (Release for Stable, PR for Dev) # Removed - Removed: Removed Sentry map task from the workflow since Sentry is no longer used. --- .github/workflows/sentry-map.yml | 63 -------------------------------- .github/workflows/sonar-scan.yml | 28 +++++++------- 2 files changed, 14 insertions(+), 77 deletions(-) delete mode 100644 .github/workflows/sentry-map.yml diff --git a/.github/workflows/sentry-map.yml b/.github/workflows/sentry-map.yml deleted file mode 100644 index 3f53232bc..000000000 --- a/.github/workflows/sentry-map.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: Sentry Map Release -on: - workflow_dispatch: - inputs: - version: - description: "version to update package.json" - required: true - # No default - -jobs: - build: - name: Setup Sentry CLI - runs-on: ubuntu-latest - steps: - - uses: mathieu-bour/setup-sentry-cli@1.2.0 - with: - version: latest - token: ${{ secrets.SENTRY_TOKEN }} - organization: kavita-7n - project: angular - - - name: Check out repository - uses: actions/checkout@v2 - - - name: Parse Version - run: | - version='${{ github.event.inputs.version }}' - newVersion=${version%.*} - echo $newVersion - echo "::set-output name=VERSION::$newVersion" - id: parse-version - - - name: NodeJS to Compile WebUI - uses: actions/setup-node@v2.1.5 - with: - node-version: '14' - - - run: | - cd UI/Web || exit - echo 'Installing web dependencies' - npm install - - npm version --allow-same-version "${{ steps.parse-version.outputs.VERSION }}" - - echo 'Building UI' - npm run prod - - - name: Cache dependencies - uses: actions/cache@v2 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - - name: Create Release - run: sentry-cli releases new ${{ steps.parse-version.outputs.VERSION }} - - - name: Upload Source Maps - run: sentry-cli releases files ${{ steps.parse-version.outputs.VERSION }} upload-sourcemaps UI/Web/dist - - - name: Finalize Release - run: sentry-cli releases finalize ${{ steps.parse-version.outputs.VERSION }} diff --git a/.github/workflows/sonar-scan.yml b/.github/workflows/sonar-scan.yml index 97480b165..5e9ccdc94 100644 --- a/.github/workflows/sonar-scan.yml +++ b/.github/workflows/sonar-scan.yml @@ -136,6 +136,13 @@ jobs: id: parse-body run: | body="${{ steps.findPr.outputs.body }}" + if [[ ${#body} -gt 1870 ]] ; then + body=${body:0:1870} + body="${body}...and much more. + + Read full changelog: https://github.com/Kareadita/Kavita/pull/${{ steps.findPr.outputs.pr }}" + fi + body=${body//\'/} body=${body//'%'/'%25'} body=${body//$'\n'/'%0A'} @@ -180,13 +187,6 @@ jobs: dotnet-version: '5.0.x' - run: ./monorepo-build.sh - - name: Trigger Sentry workflow - uses: benc-uk/workflow-dispatch@v1 - with: - workflow: Sentry Map Release - token: ${{ secrets.REPO_GHA_PAT }} - inputs: '{ "version": "${{steps.get-version.outputs.assembly-version}}" }' - - name: Login to Docker Hub uses: docker/login-action@v1 with: @@ -238,6 +238,13 @@ jobs: id: parse-body run: | body="${{ steps.findPr.outputs.body }}" + if [[ ${#body} -gt 1870 ]] ; then + body=${body:0:1870} + body="${body}...and much more. + + Read full changelog: https://github.com/Kareadita/Kavita/releases/latest" + fi + body=${body//\'/} body=${body//'%'/'%25'} body=${body//$'\n'/'%0A'} @@ -291,13 +298,6 @@ jobs: dotnet-version: '5.0.x' - run: ./monorepo-build.sh - - name: Trigger Sentry workflow - uses: benc-uk/workflow-dispatch@v1 - with: - workflow: Sentry Map Release - token: ${{ secrets.REPO_GHA_PAT }} - inputs: '{ "version": "${{steps.get-version.outputs.assembly-version}}" }' - - name: Login to Docker Hub uses: docker/login-action@v1 with: From 40ea4235feaa90ed611426d8029cb67f8986fe8b Mon Sep 17 00:00:00 2001 From: therobbiedavis Date: Tue, 12 Oct 2021 15:38:05 +0000 Subject: [PATCH 004/116] Bump versions by dotnet-bump-version. --- Kavita.Common/Kavita.Common.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kavita.Common/Kavita.Common.csproj b/Kavita.Common/Kavita.Common.csproj index 0a2904361..ec93fcff5 100644 --- a/Kavita.Common/Kavita.Common.csproj +++ b/Kavita.Common/Kavita.Common.csproj @@ -4,7 +4,7 @@ net5.0 kavitareader.com Kavita - 0.4.7.1 + 0.4.7.2 en From 70f324669bac583172cfe272c61b48a8dc5eabf7 Mon Sep 17 00:00:00 2001 From: Joseph Milazzo Date: Wed, 13 Oct 2021 11:13:55 -0700 Subject: [PATCH 005/116] Misc Updates (#665) * Do not allow non-admins to change their passwords when authentication is disabled * Clean up the login page so that input field text is black * cleanup some resizing when typing a password and having a lot of users * Changed the LastActive for a user to not just be login, but also when they open an already authenticated session. --- API/Controllers/SettingsController.cs | 2 +- API/Data/Repositories/SettingsRepository.cs | 9 --- .../Repositories/ISettingsRepository.cs | 1 - API/SignalR/Presence/PresenceTracker.cs | 10 +++- UI/Web/src/app/admin/settings.service.ts | 5 +- .../app/user-login/user-login.component.html | 4 +- .../app/user-login/user-login.component.scss | 3 + .../app/user-login/user-login.component.ts | 2 +- .../user-preferences.component.html | 59 ++++++++++--------- .../user-preferences.component.ts | 10 +++- 10 files changed, 57 insertions(+), 48 deletions(-) diff --git a/API/Controllers/SettingsController.cs b/API/Controllers/SettingsController.cs index ef3fe8997..c8b3248ba 100644 --- a/API/Controllers/SettingsController.cs +++ b/API/Controllers/SettingsController.cs @@ -140,7 +140,7 @@ namespace API.Controllers } } - if (!_unitOfWork.HasChanges()) return Ok("Nothing was updated"); + if (!_unitOfWork.HasChanges()) return Ok(updateSettingsDto); try { diff --git a/API/Data/Repositories/SettingsRepository.cs b/API/Data/Repositories/SettingsRepository.cs index 168b5a21e..4489cf3bd 100644 --- a/API/Data/Repositories/SettingsRepository.cs +++ b/API/Data/Repositories/SettingsRepository.cs @@ -35,15 +35,6 @@ namespace API.Data.Repositories return _mapper.Map(settings); } - public ServerSettingDto GetSettingsDto() - { - var settings = _context.ServerSetting - .Select(x => x) - .AsNoTracking() - .ToList(); - return _mapper.Map(settings); - } - public Task GetSettingAsync(ServerSettingKey key) { return _context.ServerSetting.SingleOrDefaultAsync(x => x.Key == key); diff --git a/API/Interfaces/Repositories/ISettingsRepository.cs b/API/Interfaces/Repositories/ISettingsRepository.cs index 79014dce4..95178ea79 100644 --- a/API/Interfaces/Repositories/ISettingsRepository.cs +++ b/API/Interfaces/Repositories/ISettingsRepository.cs @@ -10,7 +10,6 @@ namespace API.Interfaces.Repositories { void Update(ServerSetting settings); Task GetSettingsDtoAsync(); - ServerSettingDto GetSettingsDto(); Task GetSettingAsync(ServerSettingKey key); Task> GetSettingsAsync(); diff --git a/API/SignalR/Presence/PresenceTracker.cs b/API/SignalR/Presence/PresenceTracker.cs index ac9bb28d1..1453bd0f7 100644 --- a/API/SignalR/Presence/PresenceTracker.cs +++ b/API/SignalR/Presence/PresenceTracker.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using API.Interfaces; @@ -27,7 +28,7 @@ namespace API.SignalR.Presence _unitOfWork = unitOfWork; } - public Task UserConnected(string username, string connectionId) + public async Task UserConnected(string username, string connectionId) { lock (OnlineUsers) { @@ -41,7 +42,10 @@ namespace API.SignalR.Presence } } - return Task.CompletedTask; + // Update the last active for the user + var user = await _unitOfWork.UserRepository.GetUserByUsernameAsync(username); + user.LastActive = DateTime.Now; + await _unitOfWork.CommitAsync(); } public Task UserDisconnected(string username, string connectionId) diff --git a/UI/Web/src/app/admin/settings.service.ts b/UI/Web/src/app/admin/settings.service.ts index f3ab0c3f7..9f0de0b3f 100644 --- a/UI/Web/src/app/admin/settings.service.ts +++ b/UI/Web/src/app/admin/settings.service.ts @@ -1,5 +1,6 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; +import { map } from 'rxjs/operators'; import { environment } from 'src/environments/environment'; import { ServerSettings } from './_models/server-settings'; @@ -37,6 +38,8 @@ export class SettingsService { } getAuthenticationEnabled() { - return this.http.get(this.baseUrl + 'settings/authentication-enabled', {responseType: 'text' as 'json'}); + return this.http.get(this.baseUrl + 'settings/authentication-enabled', {responseType: 'text' as 'json'}).pipe(map((res: string) => { + return res === 'true'; + })); } } diff --git a/UI/Web/src/app/user-login/user-login.component.html b/UI/Web/src/app/user-login/user-login.component.html index 9caa02e73..226b42057 100644 --- a/UI/Web/src/app/user-login/user-login.component.html +++ b/UI/Web/src/app/user-login/user-login.component.html @@ -1,6 +1,6 @@