feat: add hex magic env var

This commit is contained in:
Andras Bacsai
2024-11-26 13:01:42 +01:00
parent 12f93dbbae
commit 7f0094ed55
4 changed files with 53 additions and 6 deletions

View File

@@ -940,6 +940,15 @@ function generateEnvValue(string $command, Service|Application|null $service = n
case 'REALBASE64_32':
$generatedValue = base64_encode(Str::random(32));
break;
case 'HEX_32':
$generatedValue = bin2hex(Str::random(32));
break;
case 'HEX_64':
$generatedValue = bin2hex(Str::random(64));
break;
case 'HEX_128':
$generatedValue = bin2hex(Str::random(128));
break;
case 'USER':
$generatedValue = Str::random(16);
break;

View File

@@ -13,7 +13,7 @@
<x-forms.textarea rows="20" readonly id="service.docker_compose">
</x-forms.textarea>
</div>
<div class="pt-2 w-72">
<div class="pt-2 w-96">
<x-forms.checkbox label="Escape special characters in labels?"
helper="By default, $ (and other chars) is escaped. So if you write $ in the labels, it will be saved as $$.<br><br>If you want to use env variables inside the labels, turn this off."
id="service.is_container_label_escape_enabled" instantSave></x-forms.checkbox>

View File

@@ -3,7 +3,7 @@
<div class="flex items-center gap-2">
<h2>Environment Variables</h2>
<div class="flex flex-col items-center">
<x-modal-input buttonTitle="+ Add" title="New Environment Variable">
<x-modal-input buttonTitle="+ Add" title="New Environment Variable" :closeOutside="false">
<livewire:project.shared.environment-variable.add />
</x-modal-input>
</div>
@@ -38,7 +38,7 @@
<div>Environment (secrets) variables for Production.</div>
</div>
@php
$requiredEmptyVars = $resource->environment_variables->filter(function($env) {
$requiredEmptyVars = $resource->environment_variables->filter(function ($env) {
return $env->is_required && empty($env->value);
});
$otherVars = $resource->environment_variables->diff($requiredEmptyVars);
@@ -62,11 +62,13 @@
@endif
@else
<form wire:submit.prevent='submit' class="flex flex-col gap-2">
<x-forms.textarea rows="10" class="whitespace-pre-wrap" id="variables" wire:model="variables" label="Production Environment Variables"></x-forms.textarea>
<x-forms.textarea rows="10" class="whitespace-pre-wrap" id="variables" wire:model="variables"
label="Production Environment Variables"></x-forms.textarea>
@if ($showPreview)
<x-forms.textarea rows="10" class="whitespace-pre-wrap" label="Preview Deployments Environment Variables"
id="variablesPreview" wire:model="variablesPreview"></x-forms.textarea>
<x-forms.textarea rows="10" class="whitespace-pre-wrap"
label="Preview Deployments Environment Variables" id="variablesPreview"
wire:model="variablesPreview"></x-forms.textarea>
@endif
<x-forms.button type="submit" class="btn btn-primary">Save All Environment Variables</x-forms.button>

View File

@@ -0,0 +1,36 @@
# ignore: true
# documentation: https://github.com/bluesky-social/pds
# slogan: A social network for the decentralized web
# tags: pds, bluesky, social, network, decentralized
# logo:
# port: 3000
services:
pds:
image: ghcr.io/bluesky-social/pds:0.4
volumes:
- pds-data:/pds
environment:
- SERVICE_FQDN_PDS_3000
- PDS_JWT_SECRET=${SERVICE_BASE64_PDS}
- PDS_ADMIN_PASSWORD=${SERVICE_PASSWORD_PDS}
- PDS_ADMIN_EMAIL=${PDS_ADMIN_EMAIL:-admin@example.com}
- PDS_DATADIR=${PDS_DATADIR:-/pds}
- PDS_BLOBSTORE_DISK_LOCATION=${PDS_DATADIR:-/pds}/blocks
- PDS_BLOB_UPLOAD_LIMIT=${PDS_BLOB_UPLOAD_LIMIT:-52428800}
- PDS_HOSTNAME=${SERVICE_URL_PDS}
- PDS_DID_PLC_URL=https://plc.directory
- PDS_BSKY_APP_VIEW_URL=https://api.bsky.app
- PDS_BSKY_APP_VIEW_DID=did:web:api.bsky.app
- PDS_REPORT_SERVICE_URL=https://mod.bsky.app
- PDS_REPORT_SERVICE_DID=did:plc:ar7c4by46qjdydhdevvrndac
- PDS_CRAWLERS=https://bsky.network
- LOG_ENABLED=${LOG_ENABLED:-true}
- PDS_EMAIL_SMTP_URL=${PDS_EMAIL_SMTP_URL:-smtp://localhost:8025}
- PDS_EMAIL_FROM_ADDRESS=${PDS_EMAIL_FROM_ADDRESS:-admin@example.com}
- PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX=${SERVICE_HEX_32_ROTATIONKEY}
healthcheck:
test: ["CMD", "wget", "--spider", "http://127.0.0.1:3000/xrpc/_health"]
interval: 2s
timeout: 10s
retries: 10