Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

Fix base64 encoding for TOTP_VAULT_KEY

Andras Bacsai96c6a198d75d
diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php
index 6e050a9b4d..621251d363 100644
--- a/bootstrap/helpers/shared.php
+++ b/bootstrap/helpers/shared.php
@@ -1054,8 +1054,8 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
serviceLabels: $serviceLabels,
is_gzip_enabled: $savedService->isGzipEnabled(),
is_stripprefix_enabled: $savedService->isStripprefixEnabled(),
- service_name: $serviceName));
-
+ service_name: $serviceName
+ ));
}
}
if ($resource->server->isLogDrainEnabled() && $savedService->isLogDrainEnabled()) {
@@ -1597,14 +1597,26 @@ function generateEnvValue(string $command, ?Service $service = null)
case 'PASSWORD_64':
$generatedValue = Str::password(length: 64, symbols: false);
break;
+ // This is not base64, it's just a random string
case 'BASE64_64':
- $generatedValue = base64_encode(Str::random(64));
+ $generatedValue = Str::random(64);
break;
case 'BASE64_128':
- $generatedValue = base64_encode(Str::random(128));
+ $generatedValue = Str::random(128);
break;
case 'BASE64':
case 'BASE64_32':
+ $generatedValue = Str::random(32);
+ break;
+ // This is base64,
+ case 'REALBASE64_64':
+ $generatedValue = base64_encode(Str::random(64));
+ break;
+ case 'REALBASE64_128':
+ $generatedValue = base64_encode(Str::random(128));
+ break;
+ case 'REALBASE64':
+ case 'REALBASE64_32':
$generatedValue = base64_encode(Str::random(32));
break;
case 'USER':
diff --git a/templates/compose/plausible.yaml b/templates/compose/plausible.yaml
index 40fd78e526..7c4b449ba7 100644
--- a/templates/compose/plausible.yaml
+++ b/templates/compose/plausible.yaml
@@ -12,7 +12,7 @@ services:
- DATABASE_URL=postgres://postgres:$SERVICE_PASSWORD_POSTGRES@plausible_db/plausible
- BASE_URL=$SERVICE_FQDN_PLAUSIBLE
- SECRET_KEY_BASE=$SERVICE_BASE64_64_PLAUSIBLE
- - TOTP_VAULT_KEY=$SERVICE_BASE64_TOTP
+ - TOTP_VAULT_KEY=$SERVICE_REALBASE64_TOTP
depends_on:
- plausible_db
- plausible_events_db