Skip to content

ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.

feat: add effective environment inspector with browser regression checks

Juan Denis355157856f72
diff --git a/.github/workflows/frontend-ci.yml b/.github/workflows/frontend-ci.yml
index 5518f496..89e61d53 100644
--- a/.github/workflows/frontend-ci.yml
+++ b/.github/workflows/frontend-ci.yml
@@ -80,6 +80,9 @@ jobs:
- name: File Manager browser regressions
working-directory: frontend
run: npm run test:file-manager
+ - name: Effective environment and preview browser regressions
+ working-directory: frontend
+ run: node scripts/effective-environment-browser.mjs
- name: Upload Settings screenshots
if: always()
uses: actions/upload-artifact@v4
diff --git a/backend/app/services/env_service.py b/backend/app/services/env_service.py
index 38069580..aaa32590 100644
--- a/backend/app/services/env_service.py
+++ b/backend/app/services/env_service.py
@@ -124,6 +124,7 @@ class EnvService:
merged[key]['value'] = entry.get('value')
except Exception:
complete = False
+ merged.clear()
logger.warning('Shared variable resolution failed for app %s', app.id)
if local_vars is None:
diff --git a/backend/tests/test_env_vars_api.py b/backend/tests/test_env_vars_api.py
index c45ea16e..aecfc6f9 100644
--- a/backend/tests/test_env_vars_api.py
+++ b/backend/tests/test_env_vars_api.py
@@ -64,3 +64,28 @@ def test_effective_view_is_value_free_and_app_scoped(app, client):
assert client.get(url, headers=stranger_headers).status_code in (403, 404)
assert client.get(url).status_code == 401
assert client.get(url + '&service=bad/name', headers=owner_headers).status_code == 400
+
+
+def test_effective_view_grant_never_reveals_values_and_tombstone_denied(app, client):
+ from datetime import datetime
+ from factories import headers_for, make_user
+ from app.services.resource_grant_service import ResourceGrantService
+ from app.services.env_service import EnvService
+ with app.app_context():
+ application, owner = _seed_var(app)
+ EnvService.set_env_var(application.id, 'PASSWORD', 'super-private', is_secret=True)
+ viewer = make_user(db, role='viewer')
+ ResourceGrantService.grant(user_id=viewer.id, resource_type='application',
+ resource_id=application.id, granted_by=owner.id, role='viewer')
+ headers = headers_for(viewer)
+ app_id = application.id
+ url = f'/api/v1/apps/{app_id}/env?view=effective&mask=false'
+ response = client.get(url, headers=headers)
+ assert response.status_code == 200
+ assert 'super-private' not in response.get_data(as_text=True)
+ assert all('value' not in row for row in response.get_json()['env_vars'])
+ with app.app_context():
+ row = db.session.get(Application, app_id)
+ row.deleted_at = datetime.utcnow()
+ db.session.commit()
+ assert client.get(url, headers=headers).status_code == 404
diff --git a/docs/CORE_BOUNDARIES.md b/docs/CORE_BOUNDARIES.md
index 1709f37b..b679d26b 100644
--- a/docs/CORE_BOUNDARIES.md
+++ b/docs/CORE_BOUNDARIES.md
@@ -124,3 +124,43 @@ output change backed by semantic tests and, where relevant, real nginx parsing.
These checks already run through the existing frontend/backend CI workflows.
Do not raise a size ceiling or allow a new dependency just to make a check pass;
first decide which existing owner should contain the behavior.
+
+
+## Effective environment and preview truthfulness
+
+`EnvService._effective_entries` owns the shared/local merge used by both
+single-container and per-service Compose deployment, and by the read-only
+`GET /api/v1/apps/<id>/env?view=effective&service=<name>` projection. Preserve
+workspace → project → environment → attached group → local precedence and
+filter service targets before merging. Shared interpolation precedes local
+overrides, as in the existing deployment path.
+
+The effective view is managed configuration for the next deploy/restart, not
+an inspection of the running container or of image/Compose-file defaults.
+Its explicit field allowlist excludes **all values**, including non-secret
+variables that could interpolate a secret. Local references are not resolved
+for this view. Existing app access checks apply; `mask=false` cannot enable
+values. A shared-resolution failure returns `complete: false`, with local
+rows only. Do not present that fallback as complete configuration.
+
+`components/environment/EnvironmentPanel` composes the existing local editor
+with `EffectiveEnvironment`. The view renders provenance; the hook owns service
+discovery, fetching and stale-response suppression. Keep precedence on the
+backend. A service-discovery request failure must not silently fall back to
+unfiltered winners. The existing discovery endpoint returns an empty list for
+both non-Compose apps and unreadable Compose files, so that case is explicitly
+labelled as unfiltered configuration.
+
+A preview can be advertised as running only after an explicit successful
+provider result with runtime IDs. Generic manifest configuration generation is
+not deployment and reports `unavailable`. Legacy running rows without IDs are
+projected as unavailable without mutating them on read. Only running previews
+with recorded IDs expose a URL. These checks establish provisioning evidence;
+they do not claim live container health or validate DNS reachability.
+
+Regression coverage: `test_effective_env.py`, `test_env_vars_api.py`,
+`test_compose_env_overlay.py`, `test_previews.py`, and
+`node scripts/effective-environment-browser.mjs` (in `frontend`). The browser
+check runs in frontend CI and covers service switching with late replies,
+failed discovery, masking, incomplete results, retry, the local editor, and
+preview link/toast behavior.
diff --git a/frontend/scripts/effective-environment-browser.mjs b/frontend/scripts/effective-environment-browser.mjs
new file mode 100644
index 00000000..80684d69
--- /dev/null
+++ b/frontend/scripts/effective-environment-browser.mjs
@@ -0,0 +1,118 @@
+import assert from 'node:assert/strict';
+import { existsSync } from 'node:fs';
+import path from 'node:path';
+import { fileURLToPath } from 'node:url';
+import { createServer } from 'vite';
+import react from '@vitejs/plugin-react';
+import { chromium } from 'playwright';
+
+
+const root = fileURLToPath(new URL('../', import.meta.url));
+const fixture = `
+import React from 'react';
+import {createRoot} from 'react-dom/client';
+import {MemoryRouter} from 'react-router-dom';
+import EnvironmentPanel from '/src/components/environment/EnvironmentPanel.jsx';
+import PreviewList from '/src/components/previews/PreviewList.jsx';
+import {ConfirmProvider} from '/src/contexts/ConfirmContext.jsx';
+window.pending=[]; window.calls=[]; window.toasts=[];
+window.answer=(service,data)=>window.pending.splice(window.pending.findIndex(x=>x.service===service),1)[0].resolve(data);
+window.testApi={
+ getEnvVars:()=>Promise.resolve({env_vars:[]}),
+ getComposeServices:()=>window.discoveryError?Promise.reject(Error('no discovery')):Promise.resolve({services:['web','worker']}),
+ getEffectiveEnvVars:(id,service)=>{window.calls.push(service);return new Promise((resolve,reject)=>window.pending.push({service,resolve,reject}));},
+ getPreviews:()=>Promise.resolve({previews:[{id:1,pr_number:1,status:'unavailable',domain:'unavailable.test',url:'https://unavailable.test'},{id:2,pr_number:2,status:'running',domain:'running.test',url:'https://running.test'}]}),
+ getPreviewSettings:()=>Promise.resolve({enabled:true}),
+ redeployPreview:()=>Promise.resolve({status:'unavailable'}),
+};
+createRoot(document.getElementById('root')).render(<MemoryRouter><ConfirmProvider>{location.search==='?preview'?<PreviewList appId={1}/>:<EnvironmentPanel appId={1}/>}</ConfirmProvider></MemoryRouter>);
+`;
+const server = await createServer({
+ root, configFile: false, logLevel: 'error', resolve: { alias: { '@': path.join(root, 'src') } },
+ cacheDir: path.join(root, 'node_modules/.vite-effective-environment-regression'),
+ optimizeDeps: { entries: [] }, server: { host: '127.0.0.1', port: 0 },
+ plugins: [{
+ name: 'effective-environment-fixtures', enforce: 'pre',
+ resolveId(id) {
+ if (id === 'react-i18next') return '\0test-i18n';
+ if (id.endsWith('/env-fixture.jsx')) return path.join(root, 'env-fixture.jsx');
+ },
+ load(id) {
+ const normalized = id.replaceAll('\\', '/');
+ if (id === '\0test-i18n') return `const t=(key,f)=>typeof f==='string'?f:(f&&(f.defaultValue_other||f.defaultValue))||key;export const useTranslation=()=>({t,i18n:{language:'en'}});export const Trans=({children})=>children;export const initReactI18next={type:'3rdParty',init(){}};`;
+ if (normalized.endsWith('/src/contexts/useAuth.js')) return `import {createContext} from 'react';export const AuthContext=createContext(null);const auth={user:{id:1,role:'admin'},isAdmin:true,isAuthenticated:true,hasPermission:()=>true};export const useAuth=()=>auth;`;
+ if (normalized.endsWith('/src/contexts/useWorkspace.js')) return `const ws={activeWorkspaceId:null,workspaces:[],setActiveWorkspace(){}};export const useWorkspace=()=>ws;`;
+ if (normalized.endsWith('/src/contexts/useToast.js')) return `const toast={error(m){(window.toasts=window.toasts||[]).push(m)},success(m){(window.toasts=window.toasts||[]).push('SUCCESS:'+m)},info(){},warning(){}};export const useToast=()=>toast;`;
+ if (normalized.endsWith('/src/services/api.js') || normalized.endsWith('/src/services/api/index.js')) return `const api=new Proxy({}, {get:(_,key)=>(...args)=>(window.testApi[key]?window.testApi[key](...args):Promise.resolve({}))});export {api};export default api;`;
+ if (normalized.endsWith('/env-fixture.jsx')) return fixture;
+ },
+ configureServer(vite) {
+ vite.middlewares.use('/env-check', async (_req, res) => {
+ res.setHeader('Content-Type', 'text/html');
+ res.end(await vite.transformIndexHtml('/env-check', '<div id="root"></div><script type="module" src="/env-fixture.jsx"></script>'));
+ });
+ },
+ }, react()],
+});
+const executablePath = [process.env.CHROME_PATH, chromium.executablePath(), 'C:/Program Files/Google/Chrome/Application/chrome.exe', 'C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe'].find(candidate => candidate && existsSync(candidate));
+
+let browser;
+try {
+ await server.listen();
+ browser = await chromium.launch({ ...(executablePath ? { executablePath } : {}), headless: true });
+ const page = await browser.newPage();
+ const errors = [];
+ page.on('pageerror', error => errors.push(error.message));
+ const url = `http://127.0.0.1:${server.httpServer.address().port}/env-check`;
+ await page.goto(url);
+ await page.getByRole('tab', {name:'Effective environment', exact:true}).click();
+ await page.waitForFunction(()=>window.pending.some(x=>x.service==='web'));
+ const choose = async name => {
+ await page.getByRole('combobox', {name:'Compose service'}).click();
+ await page.getByRole('option', {name, exact:true}).click();
+ };
+ await choose('worker');
+ await page.waitForFunction(()=>window.pending.some(x=>x.service==='worker'));
+ await page.evaluate(()=>window.answer('worker',{complete:true,env_vars:[{key:'WORKER_KEY',source_scope:'local',overrides:{source_scope:'workspace',group_name:'shared'},value:'DO-NOT-RENDER'}]}));
+ await page.getByText('WORKER_KEY',{exact:true}).waitFor();
+ await page.evaluate(()=>window.answer('web',{complete:true,env_vars:[{key:'STALE_WEB',source_scope:'project'}]}));
+ await page.waitForTimeout(150);
+ assert.equal(await page.getByText('STALE_WEB',{exact:true}).count(),0);
+ assert.equal(await page.getByText('DO-NOT-RENDER',{exact:true}).count(),0);
+ assert.equal(await page.getByText('Workspace / shared',{exact:true}).count(),1);
+ await page.getByRole('button',{name:'Refresh',exact:true}).click();
+ await page.waitForFunction(()=>window.pending.some(x=>x.service==='worker'));
+ assert.equal(await page.getByText('WORKER_KEY',{exact:true}).count(),0);
+ await page.evaluate(()=>window.answer('worker',{complete:false,env_vars:[{key:'LOCAL_ONLY',source_scope:'local'}]}));
+ await page.getByRole('alert').filter({hasText:'Incomplete:'}).waitFor();
+ await page.getByText('LOCAL_ONLY',{exact:true}).waitFor();
+ await page.getByRole('button',{name:'Refresh',exact:true}).click();
+ await page.waitForFunction(()=>window.pending.length>0);
+ await page.evaluate(()=>window.pending.shift().reject(Error('network')));
+ await page.getByRole('alert').filter({hasText:'Could not load'}).waitFor();
+ assert.equal(await page.getByText('LOCAL_ONLY',{exact:true}).count(),0);
+ // Failed service discovery must not silently use an unfiltered result.
+ const before = await page.evaluate(()=>window.calls.length);
+ await page.evaluate(()=>{window.discoveryError=true;});
+ await page.getByRole('button',{name:'Refresh',exact:true}).click();
+ await page.getByRole('alert').filter({hasText:'Could not load'}).waitFor();
+ assert.equal(await page.evaluate(()=>window.calls.length),before);
+ await page.getByRole('tab',{name:'Local variables',exact:true}).click();
+ await page.getByText('No environment variables',{exact:true}).waitFor();
+ assert.deepEqual(errors,[]);
+ console.log('PASS effective environment: service races, masking, overrides, incomplete/error/retry, local editor');
+
+ await page.goto(url+'?preview');
+ await page.getByText('unavailable',{exact:true}).waitFor();
+ assert.equal(await page.locator('a[href="https://unavailable.test"]').count(),0);
+ assert.equal(await page.locator('a[href="https://running.test"]').count()>0,true);
+ await page.getByRole('button',{name:'Redeploy',exact:true}).first().click();
+ await page.waitForFunction(()=>window.toasts.length>0);
+ assert.equal(await page.evaluate(()=>window.toasts.some(x=>x.includes('not deployed'))),true);
+ assert.equal(await page.evaluate(()=>window.toasts.some(x=>x.startsWith('SUCCESS:'))),false);
+ assert.deepEqual(errors,[]);
+ console.log('PASS previews: unavailable links suppressed and unsuccessful redeploy has no success toast');
+} finally {
+ await browser?.close();
+ await server.close();
+}
diff --git a/frontend/src/components/environment/EffectiveEnvironment.jsx b/frontend/src/components/environment/EffectiveEnvironment.jsx
new file mode 100644
index 00000000..e26f8a1f
--- /dev/null
+++ b/frontend/src/components/environment/EffectiveEnvironment.jsx
@@ -0,0 +1,47 @@
+import { useTranslation } from 'react-i18next';
+import DataTable from '../ds/DataTable';
+import DataTableFooter from '../ds/DataTableFooter';
+import ListToolbar from '../ds/ListToolbar';
+import { Button } from '../ui/button';
+import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '../ui/select';
+import { useEffectiveEnvironment } from './useEffectiveEnvironment';
+
+export default function EffectiveEnvironment({ appId }) {
+ const { t } = useTranslation();
+ const { services, service, selectService, data, loading, error, refresh } = useEffectiveEnvironment(appId);
+ const scopes = {
+ local: t('effectiveEnv.local', 'Local variables'),
+ workspace: t('effectiveEnv.workspace', 'Workspace'),
+ project: t('effectiveEnv.project', 'Project'),
+ environment: t('effectiveEnv.environment', 'Environment'),
+ resource: t('effectiveEnv.resource', 'Attached group'),
+ direct: t('effectiveEnv.resource', 'Attached group'),
+ };
+ const source = row => [scopes[row.source_scope] || row.source_scope, row.group_name].filter(Boolean).join(' / ');
+ const rows = data?.env_vars || [];
+ const columns = [
+ { key: 'key', header: t('effectiveEnv.key', 'Key'), sortable: true, render: row => <code>{row.key}</code> },
+ { key: 'source_scope', header: t('effectiveEnv.source', 'Winning source'), render: source },
+ { key: 'overrides', header: t('effectiveEnv.overrides', 'Overrides inherited source'), render: row => row.overrides ? source(row.overrides) : '—' },
+ { key: 'target_service', header: t('effectiveEnv.target', 'Target service'), render: row => row.target_service || t('effectiveEnv.allServices', 'All services') },
+ { key: 'is_reference', header: t('effectiveEnv.value', 'Value'), render: row => row.is_reference ? t('effectiveEnv.reference', 'Reference · resolved at deployment') : t('effectiveEnv.hidden', 'Hidden') },
+ ];
+ return <div className="env-vars-container">
+ <p className="hint">{t('effectiveEnv.explanation', 'Managed variables for the next deployment or restart, not a live container inspection. Image and Compose-file variables are not included. Values are hidden, including references and interpolated secrets.')}</p>
+ <ListToolbar tools={<Button variant="outline" onClick={refresh} disabled={loading}>{t('effectiveEnv.refresh', 'Refresh')}</Button>}>
+ {services.length > 0 ? <Select value={service || ''} onValueChange={selectService}>
+ <SelectTrigger aria-label={t('effectiveEnv.service', 'Compose service')}><SelectValue /></SelectTrigger>
+ <SelectContent>{services.map(name => <SelectItem key={name} value={name}>{name}</SelectItem>)}</SelectContent>
+ </Select> : !loading && !error && <span className="hint">{t('effectiveEnv.unfiltered', 'No Compose services discovered; showing configuration without a service filter.')}</span>}
+ </ListToolbar>
+ {loading ? <p role="status">{t('effectiveEnv.loading', 'Loading effective environment…')}</p>
+ : error ? <p role="alert" className="error-message">{t('effectiveEnv.error', 'Could not load the effective environment. Retry with Refresh.')}</p>
+ : <>
+ {data?.complete === false && <p role="alert" className="error-message">{t('effectiveEnv.incomplete', 'Incomplete: inherited variables could not be resolved. Only local configuration is shown; override information may be missing.')}</p>}
+ <DataTable columns={columns} data={rows} keyField="key"
+ emptyTitle={data?.complete === false ? t('effectiveEnv.incompleteTitle', 'Inherited configuration unavailable') : t('effectiveEnv.empty', 'No managed variables')}
+ emptyMessage={data?.complete === false ? t('effectiveEnv.incompleteEmpty', 'No local variables to show. Refresh to retry inherited configuration.') : t('effectiveEnv.emptyMessage', 'No local or inherited variables apply to this selection.')}
+ footer={<DataTableFooter shown={rows.length} total={rows.length} />} />
+ </>}
+ </div>;
+}
diff --git a/frontend/src/components/environment/EnvironmentPanel.jsx b/frontend/src/components/environment/EnvironmentPanel.jsx
new file mode 100644
index 00000000..ba782849
--- /dev/null
+++ b/frontend/src/components/environment/EnvironmentPanel.jsx
@@ -0,0 +1,19 @@
+import { useState } from 'react';
+import { useTranslation } from 'react-i18next';
+import EnvironmentVariables from '../EnvironmentVariables';
+import SegControl from '../ds/SegControl';
+import ListToolbar from '../ds/ListToolbar';
+import EffectiveEnvironment from './EffectiveEnvironment';
+
+export default function EnvironmentPanel({ appId }) {
+ const { t } = useTranslation();
+ const [view, setView] = useState('local');
+ return <>
+ <ListToolbar filters={<SegControl value={view} onChange={setView} options={[
+ { value: 'local', label: t('effectiveEnv.local', 'Local variables') },
+ { value: 'effective', label: t('effectiveEnv.title', 'Effective environment') },
+ ]} />} />
+ {view === 'local' ? <EnvironmentVariables key={appId} appId={appId} />
+ : <EffectiveEnvironment key={appId} appId={appId} />}
+ </>;
+}
diff --git a/frontend/src/components/environment/useEffectiveEnvironment.js b/frontend/src/components/environment/useEffectiveEnvironment.js
new file mode 100644
index 00000000..a8ded34c
--- /dev/null
+++ b/frontend/src/components/environment/useEffectiveEnvironment.js
@@ -0,0 +1,45 @@
+import { useEffect, useState } from 'react';
+import api from '../../services/api';
+
+// Keep discovery and resolution together: never flatten a Compose app's
+// service-specific winners into a misleading single environment.
+export function useEffectiveEnvironment(appId) {
+ const [selection, setSelection] = useState(null);
+ const [discovery, setDiscovery] = useState(null);
+ const [result, setResult] = useState(null);
+ const [revision, setRevision] = useState(0);
+ useEffect(() => {
+ let active = true;
+ setDiscovery(null);
+ api.getComposeServices(appId).then(data => {
+ if (active) setDiscovery({ appId, revision, services: data.services || [] });
+ }).catch(() => {
+ if (active) setDiscovery({ appId, revision, error: true });
+ });
+ return () => { active = false; };
+ }, [appId, revision]);
+ const current = discovery?.appId === appId && discovery?.revision === revision ? discovery : null;
+ const services = current?.services || [];
+ const service = selection?.appId === appId && services.includes(selection.service)
+ ? selection.service : services[0] || null;
+ useEffect(() => {
+ if (!current || current.error) return undefined;
+ let active = true;
+ setResult(null);
+ api.getEffectiveEnvVars(appId, service).then(data => {
+ if (active) setResult({ appId, service, revision, data });
+ }).catch(() => {
+ if (active) setResult({ appId, service, revision, error: true });
+ });
+ return () => { active = false; };
+ }, [appId, service, revision, current]);
+ const latest = current && result?.appId === appId && result?.service === service
+ && result?.revision === revision ? result : null;
+ return {
+ services, service, data: latest?.data,
+ error: Boolean(current?.error || latest?.error),
+ loading: !current || (!current.error && !latest),
+ selectService: value => setSelection({ appId, service: value }),
+ refresh: () => setRevision(value => value + 1),
+ };
+}
diff --git a/frontend/src/i18n/locales/ar.json b/frontend/src/i18n/locales/ar.json
index 5124228e..5b56511f 100644
--- a/frontend/src/i18n/locales/ar.json
+++ b/frontend/src/i18n/locales/ar.json
@@ -4422,7 +4422,6 @@
"activePreviews": "معاينات نشطة",
"couldNotLoadPrPreviews": "تعذر تحميل معاينات العلاقات العامة",
"couldNotSaveSettings": "لا يمكن حفظ الإعدادات",
- "deployAnIsolatedPreviewOfEach": "انشر معاينة معزولة لكل طلب سحب مفتوح إلى مجال مؤقت، وقم بتمزيقه عند إغلاق العلاقات العامة.",
"destroy": "تدمير",
"destroyFailed": "فشل التدمير",
"destroyPreview": "تدمير المعاينة",
diff --git a/frontend/src/i18n/locales/bn.json b/frontend/src/i18n/locales/bn.json
index 817e0f3b..d2ddb562 100644
--- a/frontend/src/i18n/locales/bn.json
+++ b/frontend/src/i18n/locales/bn.json
@@ -4422,7 +4422,6 @@
"activePreviews": "সক্রিয় পূর্বরূপ",
"couldNotLoadPrPreviews": "পিআর প্রিভিউ লোড করা যায়নি",
"couldNotSaveSettings": "সেটিংস সংরক্ষণ করা যায়নি৷",
- "deployAnIsolatedPreviewOfEach": "একটি অস্থায়ী ডোমেনে প্রতিটি খোলা পুল অনুরোধের একটি বিচ্ছিন্ন পূর্বরূপ স্থাপন করুন এবং পিআর বন্ধ হয়ে গেলে এটিকে ভেঙে ফেলুন।",
"destroy": "ধ্বংস করুন",
"destroyFailed": "ধ্বংস ব্যর্থ হয়েছে",
"destroyPreview": "পূর্বরূপ ধ্বংস",
diff --git a/frontend/src/i18n/locales/de.json b/frontend/src/i18n/locales/de.json
index 064b5d65..644f8ebf 100644
--- a/frontend/src/i18n/locales/de.json
+++ b/frontend/src/i18n/locales/de.json
@@ -4422,7 +4422,6 @@
"activePreviews": "Aktive Vorschauen",
"couldNotLoadPrPreviews": "PR-Vorschauen konnten nicht geladen werden",
"couldNotSaveSettings": "Die Einstellungen konnten nicht gespeichert werden",
- "deployAnIsolatedPreviewOfEach": "Stellen Sie eine isolierte Vorschau jeder offenen Pull-Anfrage in einer temporären Domäne bereit und entfernen Sie sie, wenn der PR geschlossen wird.",
"destroy": "Zerstören",
"destroyFailed": "Die Zerstörung ist fehlgeschlagen",
"destroyPreview": "Vorschau zerstören",
diff --git a/frontend/src/i18n/locales/en.json b/frontend/src/i18n/locales/en.json
index 82f855df..bab1eaf9 100644
--- a/frontend/src/i18n/locales/en.json
+++ b/frontend/src/i18n/locales/en.json
@@ -4419,13 +4419,9 @@
"rename": "Rename"
},
"previewList": {
- "supportedProvisioners": "Preview deployment requires a supported runtime provisioner. Generic application previews are not available yet. A domain alone does not mean a preview is deployed.",
- "noRuntime": "No provisioned runtime is recorded for this preview. Its URL is unavailable.",
- "previewNotDeployed": "The preview was not deployed. Review its status below.",
"activePreviews": "Active previews",
"couldNotLoadPrPreviews": "Couldn't load PR previews.",
"couldNotSaveSettings": "Couldn't save the settings.",
- "deployAnIsolatedPreviewOfEach": "Deploy an isolated preview of each open pull request to a temporary domain, and tear it down when the PR closes.",
"destroy": "Delete",
"destroyFailed": "Couldn't delete the preview.",
"destroyPreview": "Delete preview",
@@ -4435,16 +4431,19 @@
"enabled": "Enabled",
"loadingPreviews": "Loading previews…",
"noActivePreviews": "No active previews",
+ "noRuntime": "No provisioned runtime is recorded for this preview. Its URL is unavailable.",
"openAPullRequestToSpin": "Open a pull request to spin up a preview, or sync to reconcile now.",
"placeholders": "Placeholders:",
"pr": "PR #",
"prPreviewEnvironments": "PR preview environments",
"previewForPrDestroyed": "Preview for PR #{{prnumber}} deleted",
+ "previewNotDeployed": "The preview was not deployed. Review its status below.",
"previewSettingsSaved": "Preview settings saved",
"reconciledPreviewsAgainstOpenPrs": "Reconciled previews against open PRs",
"redeploy": "Redeploy",
"redeployFailed": "Couldn't redeploy the preview.",
"redeployingPreviewForPr": "Redeploying preview for PR #{{prnumber}}",
+ "supportedProvisioners": "Preview deployment requires a supported runtime provisioner. Generic application previews are not available yet. A domain alone does not mean a preview is deployed.",
"syncFailed": "Couldn't sync previews.",
"syncWithOpenPrs": "Sync with open PRs",
"tearDownThePreviewEnvironmentFor": "Tear down the preview environment for PR #{{prnumber}}? This removes its temporary domain and resources."
@@ -8182,6 +8181,33 @@
"minutesShort": "{{count}}m"
}
},
+ "effectiveEnv": {
+ "allServices": "All services",
+ "empty": "No managed variables",
+ "emptyMessage": "No local or inherited variables apply to this selection.",
+ "environment": "Environment",
+ "error": "Could not load the effective environment. Retry with Refresh.",
+ "explanation": "Managed variables for the next deployment or restart, not a live container inspection. Image and Compose-file variables are not included. Values are hidden, including references and interpolated secrets.",
+ "hidden": "Hidden",
+ "incomplete": "Incomplete: inherited variables could not be resolved. Only local configuration is shown; override information may be missing.",
+ "incompleteEmpty": "No local variables to show. Refresh to retry inherited configuration.",
+ "incompleteTitle": "Inherited configuration unavailable",
+ "key": "Key",
+ "loading": "Loading effective environment…",
+ "local": "Local variables",
+ "overrides": "Overrides inherited source",
+ "project": "Project",
+ "reference": "Reference · resolved at deployment",
+ "refresh": "Refresh",
+ "resource": "Attached group",
+ "service": "Compose service",
+ "source": "Winning source",
+ "target": "Target service",
+ "title": "Effective environment",
+ "unfiltered": "No Compose services discovered; showing configuration without a service filter.",
+ "value": "Value",
+ "workspace": "Workspace"
+ },
"errors": {
"agent": {
"offline": "The server's agent is offline. Start the agent on that server, then try again."
diff --git a/frontend/src/i18n/locales/es.json b/frontend/src/i18n/locales/es.json
index 3eddb1fa..6c2cf92c 100644
--- a/frontend/src/i18n/locales/es.json
+++ b/frontend/src/i18n/locales/es.json
@@ -4422,7 +4422,6 @@
"activePreviews": "Vistas previas activas",
"couldNotLoadPrPreviews": "No se pudieron cargar las vistas previas de PR",
"couldNotSaveSettings": "No se pudo guardar la configuración",
- "deployAnIsolatedPreviewOfEach": "Despliega una vista previa aislada de cada pull request abierto en un dominio temporal y elimínala cuando el PR se cierre.",
"destroy": "Destruir",
"destroyFailed": "No se pudo destruir",
"destroyPreview": "Destruir vista previa",
diff --git a/frontend/src/i18n/locales/fr.json b/frontend/src/i18n/locales/fr.json
index 7ec01011..c49546e5 100644
--- a/frontend/src/i18n/locales/fr.json
+++ b/frontend/src/i18n/locales/fr.json
@@ -4422,7 +4422,6 @@
"activePreviews": "Aperçus actifs",
"couldNotLoadPrPreviews": "Impossible de charger les aperçus PR",
"couldNotSaveSettings": "Impossible d'enregistrer les paramètres",
- "deployAnIsolatedPreviewOfEach": "Déployez un aperçu isolé de chaque demande d'extraction ouverte sur un domaine temporaire et supprimez-le à la fermeture du PR.",
"destroy": "Détruire",
"destroyFailed": "La destruction a échoué",
"destroyPreview": "Détruire l'aperçu",
diff --git a/frontend/src/i18n/locales/id.json b/frontend/src/i18n/locales/id.json
index 36df785e..d4ade2a0 100644
--- a/frontend/src/i18n/locales/id.json
+++ b/frontend/src/i18n/locales/id.json
@@ -4422,7 +4422,6 @@
"activePreviews": "Pratinjau aktif",
"couldNotLoadPrPreviews": "Tidak dapat memuat pratinjau PR",
"couldNotSaveSettings": "Tidak dapat menyimpan setelan",
- "deployAnIsolatedPreviewOfEach": "Terapkan pratinjau terisolasi dari setiap permintaan penarikan terbuka ke domain sementara, dan hancurkan saat PR ditutup.",
"destroy": "Menghancurkan",
"destroyFailed": "Penghancuran gagal",
"destroyPreview": "Hancurkan pratinjau",
diff --git a/frontend/src/i18n/locales/it.json b/frontend/src/i18n/locales/it.json
index 39114f3f..63eadbd4 100644
--- a/frontend/src/i18n/locales/it.json
+++ b/frontend/src/i18n/locales/it.json
@@ -4422,7 +4422,6 @@
"activePreviews": "Anteprime attive",
"couldNotLoadPrPreviews": "Impossibile caricare le anteprime PR",
"couldNotSaveSettings": "Impossibile salvare le impostazioni",
- "deployAnIsolatedPreviewOfEach": "Distribuisci un'anteprima isolata di ogni richiesta pull aperta a un dominio temporaneo e rimuovila quando il PR si chiude.",
"destroy": "Distruggere",
"destroyFailed": "Distruzione fallita",
"destroyPreview": "Distruggi l'anteprima",
diff --git a/frontend/src/i18n/locales/ko.json b/frontend/src/i18n/locales/ko.json
index 2689af1b..4f6d0d57 100644
--- a/frontend/src/i18n/locales/ko.json
+++ b/frontend/src/i18n/locales/ko.json
@@ -4422,7 +4422,6 @@
"activePreviews": "활성 미리보기",
"couldNotLoadPrPreviews": "PR 미리보기를 로드할 수 없습니다.",
"couldNotSaveSettings": "설정을 저장할 수 없습니다.",
- "deployAnIsolatedPreviewOfEach": "열려 있는 각 풀 요청의 격리된 미리 보기를 임시 도메인에 배포하고 PR이 닫힐 때 이를 해체합니다.",
"destroy": "파괴하다",
"destroyFailed": "폐기 실패",
"destroyPreview": "미리보기 삭제",
diff --git a/frontend/src/i18n/locales/pl.json b/frontend/src/i18n/locales/pl.json
index 0ae63d31..4421ee9a 100644
--- a/frontend/src/i18n/locales/pl.json
+++ b/frontend/src/i18n/locales/pl.json
@@ -4422,7 +4422,6 @@
"activePreviews": "Aktywne podglądy",
"couldNotLoadPrPreviews": "Nie można wczytać podglądów PR",
"couldNotSaveSettings": "Nie udało się zapisać ustawień",
- "deployAnIsolatedPreviewOfEach": "Wdróż izolowany podgląd każdego otwartego żądania ściągnięcia w domenie tymczasowej i zniszcz go po zamknięciu PR.",
"destroy": "Zniszczyć",
"destroyFailed": "Zniszczenie nie powiodło się",
"destroyPreview": "Zniszcz podgląd",
diff --git a/frontend/src/i18n/locales/pt.json b/frontend/src/i18n/locales/pt.json
index 722b7e81..be3f4777 100644
--- a/frontend/src/i18n/locales/pt.json
+++ b/frontend/src/i18n/locales/pt.json
@@ -4422,7 +4422,6 @@
"activePreviews": "Visualizações ativas",
"couldNotLoadPrPreviews": "Não foi possível carregar as visualizações de PR",
"couldNotSaveSettings": "Não foi possível salvar as configurações",
- "deployAnIsolatedPreviewOfEach": "Implante uma visualização isolada de cada solicitação pull aberta em um domínio temporário e desative-a quando o PR for fechado.",
"destroy": "Destruir",
"destroyFailed": "Falha na destruição",
"destroyPreview": "Destruir visualização",
diff --git a/frontend/src/i18n/locales/ru.json b/frontend/src/i18n/locales/ru.json
index 2b7f26bb..360cad82 100644
--- a/frontend/src/i18n/locales/ru.json
+++ b/frontend/src/i18n/locales/ru.json
@@ -4422,7 +4422,6 @@
"activePreviews": "Активные превью",
"couldNotLoadPrPreviews": "Не удалось загрузить предварительный просмотр PR.",
"couldNotSaveSettings": "Не удалось сохранить настройки",
- "deployAnIsolatedPreviewOfEach": "Разверните изолированную предварительную версию каждого открытого запроса на включение во временный домен и отключите ее при закрытии PR.",
"destroy": "Удалить",
"destroyFailed": "Уничтожить не удалось",
"destroyPreview": "Уничтожить предварительный просмотр",
diff --git a/frontend/src/i18n/locales/th.json b/frontend/src/i18n/locales/th.json
index ea69ebf5..91b55e42 100644
--- a/frontend/src/i18n/locales/th.json
+++ b/frontend/src/i18n/locales/th.json
@@ -4422,7 +4422,6 @@
"activePreviews": "การแสดงตัวอย่างที่ใช้งานอยู่",
"couldNotLoadPrPreviews": "ไม่สามารถโหลดตัวอย่าง PR",
"couldNotSaveSettings": "ไม่สามารถบันทึกการตั้งค่าได้",
- "deployAnIsolatedPreviewOfEach": "ปรับใช้การแสดงตัวอย่างแบบแยกของแต่ละคำขอดึงแบบเปิดไปยังโดเมนชั่วคราว และรื้อถอนเมื่อ PR ปิด",
"destroy": "ทำลาย",
"destroyFailed": "การทำลายล้างล้มเหลว",
"destroyPreview": "ทำลายการแสดงตัวอย่าง",
diff --git a/frontend/src/i18n/locales/tr.json b/frontend/src/i18n/locales/tr.json
index efb29013..197949be 100644
--- a/frontend/src/i18n/locales/tr.json
+++ b/frontend/src/i18n/locales/tr.json
@@ -4422,7 +4422,6 @@
"activePreviews": "Etkin önizlemeler",
"couldNotLoadPrPreviews": "PR önizlemeleri yüklenemedi",
"couldNotSaveSettings": "Ayarlar kaydedilemedi",
- "deployAnIsolatedPreviewOfEach": "Her açık çekme isteğinin yalıtılmış bir ön izlemesini geçici bir etki alanına dağıtın ve PR kapatıldığında onu yırtın.",
"destroy": "Tahrip etmek",
"destroyFailed": "Yok etme başarısız oldu",
"destroyPreview": "Önizlemeyi yok et",
diff --git a/frontend/src/i18n/locales/vi.json b/frontend/src/i18n/locales/vi.json
index 78d5cc40..bc676b9e 100644
--- a/frontend/src/i18n/locales/vi.json
+++ b/frontend/src/i18n/locales/vi.json
@@ -4422,7 +4422,6 @@
"activePreviews": "Xem trước đang hoạt động",
"couldNotLoadPrPreviews": "Không thể tải bản xem trước PR",
"couldNotSaveSettings": "Không thể lưu cài đặt",
- "deployAnIsolatedPreviewOfEach": "Triển khai bản xem trước riêng biệt của từng yêu cầu kéo mở tới một miền tạm thời và chia nhỏ nó khi PR đóng.",
"destroy": "Hủy hoại",
"destroyFailed": "Phá hủy thất bại",
"destroyPreview": "Phá hủy bản xem trước",
diff --git a/frontend/src/i18n/locales/zh-Hans.json b/frontend/src/i18n/locales/zh-Hans.json
index 3226ac89..d31e4aa9 100644
--- a/frontend/src/i18n/locales/zh-Hans.json
+++ b/frontend/src/i18n/locales/zh-Hans.json
@@ -4422,7 +4422,6 @@
"activePreviews": "活动预览",
"couldNotLoadPrPreviews": "无法加载 PR 预览",
"couldNotSaveSettings": "无法保存设置",
- "deployAnIsolatedPreviewOfEach": "将每个开放拉取请求的独立预览部署到临时域,并在 PR 关闭时将其拆除。",
"destroy": "销毁",
"destroyFailed": "销毁失败",
"destroyPreview": "销毁预览",
diff --git a/frontend/src/i18n/locales/zh-Hant.json b/frontend/src/i18n/locales/zh-Hant.json
index b51ec35f..8185d16d 100644
--- a/frontend/src/i18n/locales/zh-Hant.json
+++ b/frontend/src/i18n/locales/zh-Hant.json
@@ -4422,7 +4422,6 @@
"activePreviews": "活動預覽",
"couldNotLoadPrPreviews": "無法載入 PR 預覽",
"couldNotSaveSettings": "無法儲存設定",
- "deployAnIsolatedPreviewOfEach": "為每個開啟的 Pull Request 在暫時網域部署獨立的預覽環境,並在 PR 關閉時移除。",
"destroy": "銷毀",
"destroyFailed": "銷毀失敗",
"destroyPreview": "銷毀預覽",
diff --git a/frontend/src/pages/ServiceDetail.jsx b/frontend/src/pages/ServiceDetail.jsx
index 00b72012..e8157832 100644
--- a/frontend/src/pages/ServiceDetail.jsx
+++ b/frontend/src/pages/ServiceDetail.jsx
@@ -7,7 +7,7 @@ import { useConfirm } from '../hooks/useConfirm';
import { useService } from '../hooks/useService';
import useTabParam from '../hooks/useTabParam';
import { getTabsForType } from '../utils/serviceTypes';
-import EnvironmentVariables from '../components/EnvironmentVariables';
+import EnvironmentVariables from '../components/environment/EnvironmentPanel';
import EventsTab from '../components/service-detail/EventsTab';
import LogsTab from '../components/service-detail/LogsTab';
import ShellTab from '../components/service-detail/ShellTab';
diff --git a/frontend/src/services/api/apps.js b/frontend/src/services/api/apps.js
index 9b78e786..d5282fa9 100644
--- a/frontend/src/services/api/apps.js
+++ b/frontend/src/services/api/apps.js
@@ -218,6 +218,12 @@ export async function regeneratePrivateUrl(appId) {
}
// Environment Variables endpoints
+export async function getEffectiveEnvVars(appId, service = null) {
+ const params = new URLSearchParams({ view: 'effective' });
+ if (service) params.set('service', service);
+ return this.request(`/apps/${appId}/env?${params}`);
+}
+
export async function getEnvVars(appId, maskSecrets = false) {
const params = maskSecrets ? '?mask=true' : '';
return this.request(`/apps/${appId}/env${params}`);