Enforce alphanumeric bucket id

fixes-2021-dec
Inex Code 2021-12-27 07:40:48 +00:00
parent e7e9209cce
commit 893c5bb5c0
1 changed files with 1 additions and 1 deletions

View File

@ -86,7 +86,7 @@ class BackupsCubit extends AppConfigDependendCubit<BackupsState> {
Future<void> createBucket() async {
emit(state.copyWith(preventActions: true));
final domain =
appConfigCubit.state.cloudFlareDomain!.domainName.replaceAll('.', '-');
appConfigCubit.state.cloudFlareDomain!.domainName.replaceAll(RegExp(r'[^a-zA-Z0-9]'), '-');
final serverId = appConfigCubit.state.hetznerServer!.id;
var bucketName = 'selfprivacy-$domain-$serverId';
// If bucket name is too long, shorten it