Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Refactor server health, making it more robust against temporary connection issues ([#911])
- Calculation of server load uses the participants amount, during starting phase using a configurable min. amount ([#956])
- Layout of room features tab view ([#967])
- **Breaking:** Time periods for room token expiration ([#968])

### Fixed
- Issue frontend recompiled on every restart due to a hashing issue ([#792])
Expand Down Expand Up @@ -87,6 +88,7 @@ You can find the changelog for older versions there [here](https://github.com/TH
[#927]: https://github.com/THM-Health/PILOS/pull/927
[#956]: https://github.com/THM-Health/PILOS/pull/956
[#967]: https://github.com/THM-Health/PILOS/pull/967
[#968]: https://github.com/THM-Health/PILOS/pull/968

[unreleased]: https://github.com/THM-Health/PILOS/compare/v3.0.2...develop
[v3.0.0]: https://github.com/THM-Health/PILOS/releases/tag/v3.0.0
Expand Down
8 changes: 5 additions & 3 deletions app/Console/Commands/CleanupAttendanceCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ class CleanupAttendanceCommand extends Command
public function handle()
{
// Remove all attendance data older than the retention period
$day = now()->subDays(setting('attendance.retention_period'))->toDateString();
Log::info('Removing attendance data older than '.$day);
MeetingAttendee::where('join', '<', $day)->delete();
if (setting('attendance.retention_period') != -1) {
$day = now()->subDays(setting('attendance.retention_period'))->toDateString();
Log::info('Removing attendance data older than '.$day);
MeetingAttendee::where('join', '<', $day)->delete();
}
}
}
16 changes: 10 additions & 6 deletions app/Console/Commands/CleanupStatisticsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,17 @@ class CleanupStatisticsCommand extends Command
public function handle()
{
// Remove all server statistics data older than the retention period
$serverDay = now()->subDays(setting('statistics.servers.retention_period'))->toDateString();
Log::info('Removing server statistics data older than '.$serverDay);
ServerStat::where('created_at', '<', $serverDay)->delete();
if (setting('statistics.servers.retention_period') != -1) {
$serverDay = now()->subDays(setting('statistics.servers.retention_period'))->toDateString();
Log::info('Removing server statistics data older than '.$serverDay);
ServerStat::where('created_at', '<', $serverDay)->delete();
}

// Remove all meeting statistics data older than the retention period
$meetingDay = now()->subDays(setting('statistics.meetings.retention_period'))->toDateString();
Log::info('Removing meeting statistics data older than '.$serverDay);
MeetingStat::where('created_at', '<', $meetingDay)->delete();
if (setting('statistics.meetings.retention_period') != -1) {
$meetingDay = now()->subDays(setting('statistics.meetings.retention_period'))->toDateString();
Log::info('Removing meeting statistics data older than '.$serverDay);
MeetingStat::where('created_at', '<', $meetingDay)->delete();
}
}
}
4 changes: 2 additions & 2 deletions app/Console/Commands/DeleteObsoleteTokensCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ public function handle()
if (setting('room_token_expiration') > -1) {
$expiredTokens = RoomToken::where(function ($query) {
$query->whereNull('last_usage')
->where('created_at', '<', Carbon::now()->subMinutes(setting('room_token_expiration')));
->where('created_at', '<', Carbon::now()->subDays(setting('room_token_expiration')));
})
->orWhere(function ($query) {
$query->whereNotNull('last_usage')
->where('last_usage', '<', Carbon::now()->subMinutes(setting('room_token_expiration')));
->where('last_usage', '<', Carbon::now()->subDays(setting('room_token_expiration')));
})
->pluck('token');

Expand Down
18 changes: 18 additions & 0 deletions app/Enums/TimePeriod.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace App\Enums;

/**
* Custom status response codes of the api
*/
enum TimePeriod: int
{
case ONE_WEEK = 7;
case TWO_WEEKS = 14;
case ONE_MONTH = 30;
case THREE_MONTHS = 90;
case SIX_MONTHS = 180;
case ONE_YEAR = 365;
case TWO_YEARS = 730;
case UNLIMITED = -1;
}
15 changes: 8 additions & 7 deletions app/Http/Requests/UpdateSetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use App\Enums\LinkButtonStyle;
use App\Enums\LinkTarget;
use App\Enums\TimePeriod;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;

Expand Down Expand Up @@ -43,18 +44,18 @@ public function rules()
'legal_notice_url' => 'nullable|string|url|max:255',
'privacy_policy_url' => 'nullable|string|url|max:255',
'statistics.servers.enabled' => 'required|boolean',
'statistics.servers.retention_period' => 'required|numeric|min:1|max:365',
'statistics.servers.retention_period' => ['required', 'numeric', Rule::enum(TimePeriod::class)],
'statistics.meetings.enabled' => 'required|boolean',
'statistics.meetings.retention_period' => 'required|numeric|min:1|max:365',
'attendance.retention_period' => 'required|numeric|min:1|max:365',
'statistics.meetings.retention_period' => ['required', 'numeric', Rule::enum(TimePeriod::class)],
'attendance.retention_period' => ['required', 'numeric', Rule::enum(TimePeriod::class)],
'bbb.logo' => 'string|max:255',
'bbb.logo_file' => 'image|max:500',
'bbb.style' => 'nullable|file|max:500',
'room_token_expiration' => 'required|numeric|in:,-1,1440,10080,43200,129600,262800,525600',
'room_token_expiration' => ['required', 'numeric', Rule::enum(TimePeriod::class)],
'room_auto_delete.enabled' => 'required|boolean',
'room_auto_delete.inactive_period' => 'required|numeric|in:-1,7,14,30,90,180,365,730',
'room_auto_delete.never_used_period' => 'required|numeric|in:-1,7,14,30,90,180,365,730',
'room_auto_delete.deadline_period' => 'required|numeric|in:7,14,30',
'room_auto_delete.inactive_period' => ['required', 'numeric', Rule::enum(TimePeriod::class)],
'room_auto_delete.never_used_period' => ['required', 'numeric', Rule::enum(TimePeriod::class)],
'room_auto_delete.deadline_period' => ['required', 'numeric', Rule::enum(TimePeriod::class)->only([TimePeriod::ONE_WEEK, TimePeriod::TWO_WEEKS, TimePeriod::ONE_MONTH])],
];
}

Expand Down
2 changes: 1 addition & 1 deletion app/Models/RoomToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,6 @@ public function getFullnameAttribute()
*/
public function getExpiresAttribute()
{
return setting('room_token_expiration') > -1 ? ($this->last_usage != null ? $this->last_usage->addMinutes(setting('room_token_expiration')) : $this->created_at->addMinutes(setting('room_token_expiration'))) : null;
return setting('room_token_expiration') > -1 ? ($this->last_usage != null ? $this->last_usage->addDays(setting('room_token_expiration')) : $this->created_at->addDays(setting('room_token_expiration'))) : null;
}
}
2 changes: 2 additions & 0 deletions lang/de/meetings.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
'no_data' => 'Keine protokollierte Anwesenheit gefunden.',
'no_data_filtered' => 'Für die Suchanfrage wurde keine protokollierte Anwesenheit gefunden!',
'retention_period' => 'Die Anwesenheit wird für :days Tage gespeichert.',
'retention_period_unlimited' => 'Die Anwesenheit wird zeitlich unbegrenzt gespeichert.',
'sessions' => 'Sitzungen',
'view' => 'Anwesenheit anzeigen',
],
Expand All @@ -31,6 +32,7 @@
'no_breakout_support' => 'Die Auslastung der Breakout-Räume wird aktuell nicht unterstützt. Es wird nur die Auslastung des Hauptraums gemessen.',
'participants' => 'Teilnehmer',
'retention_period' => 'Die Auslastung der Räume wird für :days Tage gespeichert.',
'retention_period_unlimited' => 'Die Auslastung der Räume wird zeitlich unbegrenzt gespeichert.',
'time' => 'Uhrzeit',
'videos' => 'Webcams',
'voices' => 'Mikrofone',
Expand Down
1 change: 1 addition & 0 deletions lang/de/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
'banner_title' => 'Überschrift',
'color' => 'Textfarbe des Banners',
'enabled' => 'Anzeigen',
'preview' => 'Vorschau',
'icon' => 'Icon',
'icon_description' => 'Die CSS-Klasse des Fontawesome-Icons (z. B. `fa-solid fa-door-open`). Das Icon wird nur angezeigt, wenn ein Titel angegeben wurde.',
'link' => 'Anzuzeigender Link nach der Mitteilung',
Expand Down
2 changes: 2 additions & 0 deletions lang/en/meetings.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
'no_data' => 'No logged attendance found.',
'no_data_filtered' => 'For the filter query no logged attendance were found!',
'retention_period' => 'The attendance is stored for :days days.',
'retention_period_unlimited' => 'The attendance is stored indefinitely.',
'sessions' => 'Sessions',
'view' => 'Show attendance',
],
Expand All @@ -31,6 +32,7 @@
'no_breakout_support' => 'The utilisation of the breakout rooms is currently not supported. Only the utilisation of the main room is measured.',
'participants' => 'Participants',
'retention_period' => 'The utilisation of the rooms is stored for :days days.',
'retention_period_unlimited' => 'The utilisation of the rooms is stored indefinitely.',
'time' => 'Time',
'videos' => 'Webcams',
'voices' => 'Microphones',
Expand Down
1 change: 1 addition & 0 deletions lang/en/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
'banner_title' => 'Title',
'color' => 'Text color of the banner',
'enabled' => 'Show',
'preview' => 'Preview',
'icon' => 'Icon',
'icon_description' => 'The CSS class of the Fontawesome-Icon (e. g. `fa-solid fa-door-open`). The icon will only be visible, if a title is supplied.',
'link' => 'Link to show after the message',
Expand Down
7 changes: 5 additions & 2 deletions resources/js/components/RoomTabHistory.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,11 @@
>
<Divider/>
<b>{{ $t('meetings.retention_period') }}</b><br>
<span v-if="settingsStore.getSetting('statistics.meetings.enabled')">{{ $t('meetings.stats.retention_period', {'days': settingsStore.getSetting('statistics.meetings.retention_period')}) }}</span><br>
<span>{{ $t('meetings.attendance.retention_period', {'days': settingsStore.getSetting('attendance.retention_period')}) }}</span><br>
<span v-if="settingsStore.getSetting('statistics.meetings.enabled') && settingsStore.getSetting('statistics.meetings.retention_period') !== -1">{{ $t('meetings.stats.retention_period', {'days': settingsStore.getSetting('statistics.meetings.retention_period')}) }}</span><br>
<span v-if="settingsStore.getSetting('statistics.meetings.enabled') && settingsStore.getSetting('statistics.meetings.retention_period') === -1">{{ $t('meetings.stats.retention_period_unlimited') }}</span><br>

<span v-if="settingsStore.getSetting('attendance.retention_period') !== -1">{{ $t('meetings.attendance.retention_period', {'days': settingsStore.getSetting('attendance.retention_period')}) }}</span><br>
<span v-if="settingsStore.getSetting('attendance.retention_period') === -1">{{ $t('meetings.attendance.retention_period_unlimited') }}</span><br>
</div>
</div>
</template>
Expand Down
Loading