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: read-only iam

Andras Bacsaiee40120496ec
diff --git a/apps/ui/src/lib/store.ts b/apps/ui/src/lib/store.ts
index 493896c70e..52bf6eb4ca 100644
--- a/apps/ui/src/lib/store.ts
+++ b/apps/ui/src/lib/store.ts
@@ -58,11 +58,10 @@ export const appSession: Writable<AppSession> = writable({
});
export const disabledButton: Writable<boolean> = writable(false);
export const isDeploymentEnabled: Writable<boolean> = writable(false);
-export function checkIfDeploymentEnabledApplications(isAdmin: boolean, application: any) {
+export function checkIfDeploymentEnabledApplications(application: any) {
return !!(
- isAdmin &&
(application.buildPack === 'compose') ||
- (application.fqdn || application.settings.isBot) &&
+ (application.fqdn || application.settings?.isBot) &&
((application.gitSource &&
application.repository &&
application.buildPack) || application.simpleDockerfile) &&
@@ -70,9 +69,8 @@ export function checkIfDeploymentEnabledApplications(isAdmin: boolean, applicati
);
}
-export function checkIfDeploymentEnabledServices(isAdmin: boolean, service: any) {
+export function checkIfDeploymentEnabledServices( service: any) {
return (
- isAdmin &&
service.fqdn &&
service.destinationDocker &&
service.version &&
diff --git a/apps/ui/src/routes/applications/[id]/__layout.svelte b/apps/ui/src/routes/applications/[id]/__layout.svelte
index f9e8ff1ffb..502861a936 100644
--- a/apps/ui/src/routes/applications/[id]/__layout.svelte
+++ b/apps/ui/src/routes/applications/[id]/__layout.svelte
@@ -83,7 +83,7 @@
let forceDelete = false;
let stopping = false;
const { id } = $page.params;
- $isDeploymentEnabled = checkIfDeploymentEnabledApplications($appSession.isAdmin, application);
+ $isDeploymentEnabled = checkIfDeploymentEnabledApplications(application);
async function deleteApplication(name: string, force: boolean) {
const sure = confirm($t('application.confirm_to_delete', { name }));
@@ -292,7 +292,6 @@
<a
href={$isDeploymentEnabled ? `/applications/${id}/logs` : null}
class="btn btn-sm text-sm gap-2"
- sveltekit:prefetch
>
<svg
xmlns="http://www.w3.org/2000/svg"
@@ -363,7 +362,7 @@
<button
on:click={restartApplication}
type="submit"
- disabled={!$isDeploymentEnabled}
+ disabled={!$isDeploymentEnabled || !$appSession.isAdmin}
class="btn btn-sm gap-2"
>
<svg
@@ -383,7 +382,7 @@
</button>
{/if}
<button
- disabled={!$isDeploymentEnabled}
+ disabled={!$isDeploymentEnabled || !$appSession.isAdmin}
class="btn btn-sm gap-2"
on:click={() => handleDeploySubmit(true)}
>
@@ -409,7 +408,7 @@
<button
on:click={stopApplication}
type="submit"
- disabled={!$isDeploymentEnabled}
+ disabled={!$isDeploymentEnabled || !$appSession.isAdmin}
class="btn btn-sm gap-2"
>
<svg
@@ -432,7 +431,7 @@
<button
on:click={stopApplication}
type="submit"
- disabled={!$isDeploymentEnabled}
+ disabled={!$isDeploymentEnabled || !$appSession.isAdmin}
class="btn btn-sm gap-2"
>
<svg
@@ -453,7 +452,7 @@
{/if}
<button
class="btn btn-sm gap-2"
- disabled={!$isDeploymentEnabled}
+ disabled={!$isDeploymentEnabled || !$appSession.isAdmin}
on:click={() => handleDeploySubmit(true)}
>
{#if $status.application.overallStatus !== 'degraded'}
diff --git a/apps/ui/src/routes/applications/[id]/features.svelte b/apps/ui/src/routes/applications/[id]/features.svelte
index 604abb6b3d..a505b68cf0 100644
--- a/apps/ui/src/routes/applications/[id]/features.svelte
+++ b/apps/ui/src/routes/applications/[id]/features.svelte
@@ -103,7 +103,7 @@
}
return errorNotification(error);
} finally {
- $isDeploymentEnabled = checkIfDeploymentEnabledApplications($appSession.isAdmin, application);
+ $isDeploymentEnabled = checkIfDeploymentEnabledApplications(application);
}
}
</script>
diff --git a/apps/ui/src/routes/applications/[id]/index.svelte b/apps/ui/src/routes/applications/[id]/index.svelte
index b842c0af80..44b7d68eab 100644
--- a/apps/ui/src/routes/applications/[id]/index.svelte
+++ b/apps/ui/src/routes/applications/[id]/index.svelte
@@ -58,7 +58,7 @@
$status.application.overallStatus === 'degraded' ||
$status.application.overallStatus === 'healthy' ||
$status.application.initialLoading;
- $isDeploymentEnabled = checkIfDeploymentEnabledApplications($appSession.isAdmin, application);
+ $isDeploymentEnabled = checkIfDeploymentEnabledApplications(application);
let statues: any = {};
let loading = {
save: false,
@@ -235,7 +235,7 @@
}
return errorNotification(error);
} finally {
- $isDeploymentEnabled = checkIfDeploymentEnabledApplications($appSession.isAdmin, application);
+ $isDeploymentEnabled = checkIfDeploymentEnabledApplications(application);
}
}
async function handleSubmit(toast: boolean = true) {
@@ -269,7 +269,7 @@
}
await saveForm(id, application, baseDatabaseBranch, dockerComposeConfiguration);
setLocation(application, settings);
- $isDeploymentEnabled = checkIfDeploymentEnabledApplications($appSession.isAdmin, application);
+ $isDeploymentEnabled = checkIfDeploymentEnabledApplications(application);
forceSave = false;
if (toast) {
diff --git a/apps/ui/src/routes/applications/[id]/storages.svelte b/apps/ui/src/routes/applications/[id]/storages.svelte
index 136b0e9df5..d67d84a32f 100644
--- a/apps/ui/src/routes/applications/[id]/storages.svelte
+++ b/apps/ui/src/routes/applications/[id]/storages.svelte
@@ -96,7 +96,6 @@
</div>
<Storage on:refresh={refreshStorage} isNew />
- {}
{/if}
</div>
</div>
diff --git a/apps/ui/src/routes/services/[id]/__layout.svelte b/apps/ui/src/routes/services/[id]/__layout.svelte
index 788c4dc948..d5a56937ea 100644
--- a/apps/ui/src/routes/services/[id]/__layout.svelte
+++ b/apps/ui/src/routes/services/[id]/__layout.svelte
@@ -76,10 +76,9 @@
import { dev } from '$app/env';
const { id } = $page.params;
- $isDeploymentEnabled = checkIfDeploymentEnabledServices($appSession.isAdmin, service);
+ $isDeploymentEnabled = checkIfDeploymentEnabledServices(service);
let statusInterval: any;
-
async function deleteService() {
const sure = confirm($t('application.confirm_to_delete', { name: service.name }));
@@ -291,7 +290,7 @@
</button>
{:else if $status.service.overallStatus === 'healthy'}
<button
- disabled={!$isDeploymentEnabled}
+ disabled={!$isDeploymentEnabled || !$appSession.isAdmin}
class="btn btn-sm gap-2"
on:click={() => restartService()}
>
@@ -317,7 +316,7 @@
<button
on:click={() => stopService(false)}
type="submit"
- disabled={!$isDeploymentEnabled}
+ disabled={!$isDeploymentEnabled || !$appSession.isAdmin}
class="btn btn-sm gap-2"
>
<svg
@@ -338,10 +337,10 @@
</button>
{:else if $status.service.overallStatus === 'degraded'}
<button
- on:click={stopService}
+ on:click={() => stopService()}
type="submit"
- disabled={!$isDeploymentEnabled}
- class="btn btn-sm gap-2"
+ disabled={!$isDeploymentEnabled || !$appSession.isAdmin}
+ class="btn btn-sm gap-2"
>
<svg
xmlns="http://www.w3.org/2000/svg"
@@ -362,7 +361,7 @@
{#if $status.service.overallStatus === 'degraded'}
<button
class="btn btn-sm gap-2"
- disabled={!$isDeploymentEnabled}
+ disabled={!$isDeploymentEnabled || !$appSession.isAdmin}
on:click={() => restartService()}
>
<svg
@@ -386,7 +385,7 @@
{:else if $status.service.overallStatus === 'stopped'}
<button
class="btn btn-sm gap-2"
- disabled={!$isDeploymentEnabled}
+ disabled={!$isDeploymentEnabled || !$appSession.isAdmin}
on:click={() => startService()}
>
<svg
diff --git a/apps/ui/src/routes/services/[id]/index.svelte b/apps/ui/src/routes/services/[id]/index.svelte
index 4b82bfb7d0..e77771bd39 100644
--- a/apps/ui/src/routes/services/[id]/index.svelte
+++ b/apps/ui/src/routes/services/[id]/index.svelte
@@ -110,7 +110,7 @@
if (formData) service = await saveForm(formData, service);
setLocation(service);
forceSave = false;
- $isDeploymentEnabled = checkIfDeploymentEnabledServices($appSession.isAdmin, service);
+ $isDeploymentEnabled = checkIfDeploymentEnabledServices(service);
return addToast({
message: 'Configuration saved.',
type: 'success'