Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
Thiritin committed Aug 11, 2024
2 parents 341b9fe + 93c53d4 commit 2ce0f58
Show file tree
Hide file tree
Showing 69 changed files with 532 additions and 215 deletions.
3 changes: 2 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ max_line_length = unset
[*.{yml,yaml}]
indent_size = 2

[*.mo]
# Ignore for
[{*.mo,LICENSE}]
charset = unset
end_of_line = unset
indent_style = unset
Expand Down
24 changes: 12 additions & 12 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,8 @@ release-image:
--dockerfile /dev/stdin
--destination "${RELEASE_IMAGE}"
--cache=true
only:
- main
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH

.deploy_template: &deploy_definition
stage: release
Expand Down Expand Up @@ -344,8 +344,8 @@ pages:
expire_in: 1 week
paths:
- public
only:
- main
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
variables:
GIT_STRATEGY: none

Expand All @@ -370,8 +370,8 @@ deploy:
environment:
name: rsync-staging
deployment_tier: development
only:
- main
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
script:
# Check if deployment variables where set
- |-
Expand Down Expand Up @@ -498,8 +498,8 @@ deploy-production:
name: rsync-production
deployment_tier: production
when: manual
only:
- main
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
script:
# Check if deployment variables where set
- |-
Expand All @@ -522,14 +522,14 @@ deploy-k8s-production:
name: production
on_stop: stop-k8s-production
when: manual
only:
- main
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH

stop-k8s-production:
<<: *deploy_k8s_stop
needs: [ deploy-k8s-production ]
only:
- main
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
environment:
name: production
action: stop
89 changes: 45 additions & 44 deletions config/config.default.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

declare(strict_types=1);

// To change settings create a config.php
// To change or overwrite some settings, create a config.php

return [
// MySQL-Connection Settings
'database' => [
'host' => env('MYSQL_HOST', (env('CI', false) ? 'mariadb' : 'localhost')),
'host' => env('MYSQL_HOST', 'localhost'),
'database' => env('MYSQL_DATABASE', 'engelsystem'),
'username' => env('MYSQL_USER', 'root'),
'password' => env('MYSQL_PASSWORD', ''),
Expand All @@ -16,7 +16,7 @@
// For accessing /metrics (and /stats)
'api_key' => env('API_KEY', ''),

// Enable maintenance mode (show a static page)
// Enable maintenance mode (show a static page to all users)
'maintenance' => (bool) env('MAINTENANCE', false),

// Application name (not the event name)
Expand All @@ -30,23 +30,23 @@

// Header links
// Available link placeholders: %lang%
// To disable a header_item in the config.php, you can set its value to null
// To disable a header_item in config.php, you can set its value to null
'header_items' => [
// Name can be a translation string, permission is a engelsystem privilege
// Name can be a translation string, permission is an engelsystem privilege
// 'Name' => 'URL',
// 'Name' => ['URL', 'permission'],
// 'some.key' => ['URL', 'permission'],

//'Foo' => ['https://foo.bar/batz-%lang%.html', 'logout'], // Permission: for logged-in users
],

// Footer links
// To disable a footer item in the config.php, you can set its value to null
// To disable a footer item in config.php, you can set its value to null
'footer_items' => [
// Name can be a translation string, permission is a engelsystem privilege
// 'Name' => 'URL',
// 'Name' => ['URL', 'permission'],
// 'some.key' => ['URL', 'permission'],

// URL to the angel faq and job description
// URL to faq page
'faq.faq' => [env('FAQ_URL', '/faq'), 'faq.view'],

// Contact email address, linked on every page
Expand All @@ -60,15 +60,15 @@
'general.email' => env('CONTACT_EMAIL', 'mailto:[email protected]'),
],

// Text displayed on the FAQ page, rendered as markdown
// Additional text displayed on the FAQ page, rendered as markdown
'faq_text' => env('FAQ_TEXT'),

// Link to documentation/help
'documentation_url' => env('DOCUMENTATION_URL', 'https://engelsystem.de/doc/'),

// Email config
'email' => [
// Can be mail, smtp, sendmail or log or an symfony mailer dsn string like smtps://[usr]:[pass]@smtp.foo.bar:465
// Can be mail, smtp, sendmail, log or an symfony mailer dsn string like smtps://[usr]:[pass]@smtp.foo.bar:465
'driver' => env('MAIL_DRIVER', 'mail'),
'from' => [
// From address of all emails
Expand All @@ -78,7 +78,7 @@

'host' => env('MAIL_HOST', 'localhost'),
'port' => env('MAIL_PORT', 587),
// If tls transport encryption should be used
// If tls transport encryption should be enabled
'tls' => env('MAIL_TLS'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
Expand All @@ -88,12 +88,13 @@
// Your privacy@ contact address
'privacy_email' => env('PRIVACY_EMAIL'),

// Show opt in to save some personal data after the event on user profile and registration pages
'enable_email_goodie' => (bool) env('ENABLE_EMAIL_GOODIE', true),
// Show opt-in on user profile and registration pages to save some personal data after the event
'enable_email_goodie' => (bool) env('ENABLE_EMAIL_GOODIE', false),

// Initial admin password
// Initial admin password, configured on first migration
'setup_admin_password' => env('SETUP_ADMIN_PASSWORD'),

// Setup external authentication providers
'oauth' => [
// '[name]' => [config]
/*
Expand Down Expand Up @@ -141,18 +142,18 @@
'groups' => 'groups',
// Groups to team (angeltype) mapping (optional)
'teams' => [
'/Lorem' => 4, // 4 being the ID of the angeltype
'/Foo Mod' => ['id' => 5, 'supporter' => true], // 5 being the ID of the angeltype
'/Lorem' => 4, // 4 being the ID of the team (angeltype)
'/Foo Mod' => ['id' => 5, 'supporter' => true], // 5 being the ID of the team (angeltype)
],
],
*/
],

// Default theme, 1=style1.css
// Default theme, 1 = theme1.scss etc.
'theme' => env('THEME', 1),

// Supported themes
// To disable a theme in the config.php, you can set its value to null
// To disable a theme in config.php, you can set its value to null
'themes' => [
17 => [
'name' => 'Engelsystem 37c3 (2023)',
Expand Down Expand Up @@ -246,7 +247,7 @@
],
],

// Redirect to this site after logging in or when pressing the top-left button
// Redirect to this site after logging in or when clicking the page name
// Must be one of news, meetings, user_shifts, angeltypes, questions
'home_site' => env('HOME_SITE', 'news'),

Expand All @@ -256,7 +257,7 @@
// Users are able to sign up
'registration_enabled' => (bool) env('REGISTRATION_ENABLED', true),

// URL to external registration page, used on login page
// URL to external registration page, linked from login page
'external_registration_url' => env('EXTERNAL_REGISTRATION_URL'),

// Required user fields
Expand All @@ -269,65 +270,65 @@
'dect' => (bool) env('DECT_REQUIRED', false),
],

// Only arrived angels can sign up for shifts
// Only arrived users can sign up for shifts
'signup_requires_arrival' => (bool) env('SIGNUP_REQUIRES_ARRIVAL', false),

// Whether newly-registered user should automatically be marked as arrived
'autoarrive' => (bool) env('ANGEL_AUTOARRIVE', false),
// Whether newly-registered users should automatically be marked as arrived
'autoarrive' => (bool) env('AUTOARRIVE', false),

// Supporters of an angeltype can promote other angels of the angeltype to supporter
// Supporters of a team (angeltype) can promote other users of the team (angeltype) to supporter
'supporters_can_promote' => (bool) env('SUPPORTERS_CAN_PROMOTE', false),

// Only allow shift signup this number of hours in advance
// Setting this to 0 disables the feature
'signup_advance_hours' => env('SIGNUP_ADVANCE_HOURS', 0),

// Allow signup this many minutes after the start of the shift.
// If signup_post_fraction is set, first applies that before adding the number of minutes specified by this.
// If signup_post_fraction is set, it's first applied before adding the number of minutes specified here.
'signup_post_minutes' => env('SIGNUP_POST_MINUTES', 0),

// Allow signup this fraction of the shift length after the start of the shift.
// Example: If this is set to 1, signup is allowed until the end of a shift
// If this is set to 0.5, signup is allowd for the first half of a shift
// If signup_post_minutes is set, first applies this and then adds the signup_post_minutes on top.
// Example: If it is set to 1, signup is allowed until the end of a shift
// If it is set to 0.5, signup is allowed for the first half of a shift
// If signup_post_minutes is set, this is first applied and then the signup_post_minutes added on top.
'signup_post_fraction' => env('SIGNUP_POST_FRACTION', 0),

// Number of hours that an angel has to sign out own shifts
// Number of hours that a user can sign out of own shifts beforehand
'last_unsubscribe' => env('LAST_UNSUBSCRIBE', 3),

// Define the algorithm to use for `password_verify()`
// If the user uses an old algorithm the password will be converted to the new format
// If a user password is hashed with an old algorithm, the password will be converted to the new format on login
// See https://secure.php.net/manual/en/password.constants.php for a complete list
'password_algorithm' => env('PASSWORD_ALGORITHM', PASSWORD_DEFAULT),

// The minimum length for passwords
'min_password_length' => env('PASSWORD_MINIMUM_LENGTH', 8),
'password_min_length' => env('PASSWORD_MIN_LENGTH', 8),

// Whether the login and registration via password should be enabled (login will be hidden)
// Whether the login and registration via password should be enabled (login will be hidden if false)
// This is useful when using oauth, disabling it also disables normal registration without oauth
'enable_password' => (bool) env('ENABLE_PASSWORD', true),

// Whether the DECT field should be enabled
'enable_dect' => (bool) env('ENABLE_DECT', true),

// Whether the mobile number can be shown to other users
// Whether the mobile number will be shown to other users
'enable_mobile_show' => (bool) env('ENABLE_MOBILE_SHOW', false),

// Regular expression describing a FALSE username.
// Per default usernames must only contain alphanumeric chars, "-", "_" or ".".
'username_regex' => (string) env('USERNAME_REGEX', '/([^\p{L}\p{N}_.-]+)/ui'),

// Enables first name and last name
'enable_user_name' => (bool) env('ENABLE_USER_NAME', false),
// Enable first name and last name
'enable_full_name' => (bool) env('ENABLE_FULL_NAME', false),

// Show a users first name and last name instead of username
'display_full_name' => env('DISPLAY_FULL_NAME', false)
&& env('ENABLE_USER_NAME', false),
&& env('ENABLE_FULL_NAME', false),

// Enable displaying the pronoun fields
'enable_pronoun' => (bool) env('ENABLE_PRONOUN', true),

// Enables the planned arrival/leave date
// Enable the planned arrival/leave date
'enable_planned_arrival' => (bool) env('ENABLE_PLANNED_ARRIVAL', true),

// Whether force active should be enabled
Expand All @@ -339,10 +340,10 @@
// 'tshirt' => goodie that is called tshirt and has sizing options
'goodie_type' => env('GOODIE_TYPE', 'goodie'),

// Enables the food voucher in the user profile
// Enable (food) vouchers
'enable_voucher' => (bool) env('ENABLE_VOUCHER', true),

// Number of shifts to freeload until angel is locked for shift signup.
// Number of shifts to freeload until a user is locked from shift signup.
'max_freeloadable_shifts' => env('MAX_FREELOADABLE_SHIFTS', 2),

// Hide columns in backend user view. Possible values are any sortable parameters of the table.
Expand All @@ -369,7 +370,7 @@
'voucher_start' => env('VOUCHER_START') ?: null,
],

// Enables Driving License
// Enable Driving License
'driving_license_enabled' => (bool) env('DRIVING_LICENSE_ENABLED', true),

# Instruction in accordance with § 43 Para. 1 of the German Infection Protection Act (IfSG)
Expand All @@ -379,7 +380,7 @@
'ifsg_light_enabled' => env('IFSG_LIGHT_ENABLED', false) && env('IFSG_ENABLED', false),

// Available locales in /resources/lang/
// To disable a locale in the config.php, you can set its value to null
// To disable a locale in config.php, you can set its value to null
'locales' => [
'de_DE' => 'Deutsch',
'en_US' => 'English',
Expand All @@ -389,7 +390,7 @@
'default_locale' => env('DEFAULT_LOCALE', 'en_US'),

// Available T-Shirt sizes
// To disable a t-shirt size in the config.php, you can set its value to null
// To disable a t-shirt size in config.php, you can set its value to null
'tshirt_sizes' => [
'S' => 'Small Straight-Cut',
'S-F' => 'Small Fitted-Cut',
Expand Down Expand Up @@ -442,7 +443,7 @@
// Add additional headers
'add_headers' => (bool) env('ADD_HEADERS', true),
// Predefined headers
// To disable a header in the config.php, you can set its value to null
// To disable a header in config.php, you can set its value to null
'headers' => [
'X-Content-Type-Options' => 'nosniff',
'X-Frame-Options' => 'sameorigin',
Expand Down
3 changes: 3 additions & 0 deletions config/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ function (RouteCollector $route): void {

$route->get('/news', 'Api\NewsController@index');

$route->get('/shifttypes', 'Api\ShiftTypeController@index');
$route->get('/shifttypes/{shifttype_id:\d+}/shifts', 'Api\ShiftsController@entriesByShiftType');

$route->get('/users/{user_id:(?:\d+|self)}', 'Api\UsersController@user');
$route->get('/users/{user_id:(?:\d+|self)}/angeltypes', 'Api\AngelTypeController@ofUser');
$route->get('/users/{user_id:(?:\d+|self)}/shifts', 'Api\ShiftsController@entriesByUser');
Expand Down
6 changes: 3 additions & 3 deletions includes/pages/admin_user.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function admin_user()
$html .= ' <tr><td>' . __('Last login') . '</td><td><p class="help-block">'
. ($user_source->last_login_at ? $user_source->last_login_at->format(__('general.datetime')) : '-')
. '</p></td></tr>' . "\n";
if (config('enable_user_name')) {
if (config('enable_full_name')) {
$html .= ' <tr><td>' . __('settings.profile.firstname') . '</td><td>'
. '<input size="40" name="eName" value="' . htmlspecialchars((string) $user_source->personalData->last_name) . '" class="form-control" maxlength="64">'
. '</td></tr>' . "\n";
Expand Down Expand Up @@ -173,7 +173,7 @@ function admin_user()
$html .= '<table>' . "\n";
$html .= ' <tr><td>' . __('settings.password')
. ' <span class="bi bi-info-circle-fill text-info" data-bs-toggle="tooltip" title="'
. __('password.minimal_length', [config('min_password_length')]) . '"></span>'
. __('password.minimal_length', [config('password_min_length')]) . '"></span>'
. '</td><td>'
. '<input type="password" size="40" name="new_pw" value="" class="form-control" autocomplete="new-password">'
. '</td></tr>' . "\n";
Expand Down Expand Up @@ -313,7 +313,7 @@ function admin_user()
}
$user_source->save();

if (config('enable_user_name')) {
if (config('enable_full_name')) {
$user_source->personalData->first_name = $request->postData('eVorname');
$user_source->personalData->last_name = $request->postData('eName');
}
Expand Down
2 changes: 1 addition & 1 deletion includes/sys_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ function form_password($name, $label, $autocomplete, $disabled = false)
sprintf(
'<input class="form-control" id="form_%1$s" type="password" name="%1$s" minlength="%2$s" value="" autocomplete="%3$s" %4$s>',
$name,
config('min_password_length'),
config('password_min_length'),
$autocomplete,
$disabled
),
Expand Down
Loading

0 comments on commit 2ce0f58

Please sign in to comment.