Skip to content

Commit

Permalink
Fix APP_KEY generation in start.bat.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bradez committed Mar 7, 2024
1 parent de1c467 commit fca5489
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion start.bat
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ if "%APP_KEY%"=="" (
echo No application key set. A new key will be generated automatically.

for /f "delims=" %%i in ('powershell -Command "$RandomBytes = New-Object byte[] 32; [Security.Cryptography.RNGCryptoServiceProvider]::Create().GetBytes($RandomBytes); $Base64String = [Convert]::ToBase64String($RandomBytes); Write-Output $Base64String"') do (
set APP_KEY=%%i
set "APP_KEY=%%i"
)

powershell -Command "(Get-Content 'configs\core\.env') | ForEach-Object {$_ -replace '\bAPP_KEY=.*', 'APP_KEY=base64:!APP_KEY!'} | Set-Content 'configs\core\.env'"
Expand Down

0 comments on commit fca5489

Please sign in to comment.