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: host volumes

Andras Bacsai04f7e8e77764
diff --git a/apps/api/src/lib/buildPacks/compose.ts b/apps/api/src/lib/buildPacks/compose.ts
index 4394622312..2d16c1f8d6 100644
--- a/apps/api/src/lib/buildPacks/compose.ts
+++ b/apps/api/src/lib/buildPacks/compose.ts
@@ -78,15 +78,25 @@ export default async function (data) {
if (value['volumes']?.length > 0) {
value['volumes'] = value['volumes'].map((volume) => {
let [v, path, permission] = volume.split(':');
- if (!path) {
- path = v;
- v = `${applicationId}${v.replace(/\//gi, '-').replace(/\./gi, '')}`;
+ if (
+ v.startsWith('.') ||
+ v.startsWith('..') ||
+ v.startsWith('/') ||
+ v.startsWith('~')
+ ) {
+ // Nothing to do here, host path
} else {
- v = `${applicationId}${v.replace(/\//gi, '-').replace(/\./gi, '')}`;
+ if (!path) {
+ path = v;
+ v = `${applicationId}${v.replace(/\//gi, '-').replace(/\./gi, '')}`;
+ } else {
+ v = `${applicationId}${v.replace(/\//gi, '-').replace(/\./gi, '')}`;
+ }
+ composeVolumes[v] = {
+ name: v
+ };
}
- composeVolumes[v] = {
- name: v
- };
+
return `${v}:${path}${permission ? ':' + permission : ''}`;
});
}
diff --git a/apps/api/src/lib/common.ts b/apps/api/src/lib/common.ts
index 67d8775e77..8b931653dd 100644
--- a/apps/api/src/lib/common.ts
+++ b/apps/api/src/lib/common.ts
@@ -19,7 +19,7 @@ import { saveBuildLog, saveDockerRegistryCredentials } from './buildPacks/common
import { scheduler } from './scheduler';
import type { ExecaChildProcess } from 'execa';
-export const version = '3.12.23';
+export const version = '3.12.26';
export const isDev = process.env.NODE_ENV === 'development';
export const proxyPort = process.env.COOLIFY_PROXY_PORT;
export const proxySecurePort = process.env.COOLIFY_PROXY_SECURE_PORT;
diff --git a/apps/ui/src/routes/applications/[id]/storages.svelte b/apps/ui/src/routes/applications/[id]/storages.svelte
index d67d84a32f..7f16645a24 100644
--- a/apps/ui/src/routes/applications/[id]/storages.svelte
+++ b/apps/ui/src/routes/applications/[id]/storages.svelte
@@ -36,14 +36,20 @@
if (service?.volumes) {
for (const [_, volumeName] of Object.entries(service.volumes)) {
let [volume, target] = volumeName.split(':');
- if (volume === '.') {
- volume = target;
- }
- if (!target) {
- target = volume;
- volume = `${application.id}${volume.replace(/\//gi, '-').replace(/\./gi, '')}`;
+ if (
+ volume.startsWith('.') ||
+ volume.startsWith('..') ||
+ volume.startsWith('/') ||
+ volume.startsWith('~')
+ ) {
+ // Nothing to do here, host path
} else {
- volume = `${application.id}${volume.replace(/\//gi, '-').replace(/\./gi, '')}`;
+ if (!target) {
+ target = volume;
+ volume = `${application.id}${volume.replace(/\//gi, '-').replace(/\./gi, '')}`;
+ } else {
+ volume = `${application.id}${volume.replace(/\//gi, '-').replace(/\./gi, '')}`;
+ }
}
predefinedVolumes.push({ id: volume, path: target, predefined: true });
}
@@ -88,14 +94,14 @@
{/key}
{/each}
{#if $appSession.isAdmin}
- <div class:pt-10={predefinedVolumes.length > 0}>
- Add New Volume <Explainer
- position="dropdown-bottom"
- explanation={$t('application.storage.persistent_storage_explainer')}
- />
- </div>
-
- <Storage on:refresh={refreshStorage} isNew />
+ <div class:pt-10={predefinedVolumes.length > 0}>
+ Add New Volume <Explainer
+ position="dropdown-bottom"
+ explanation={$t('application.storage.persistent_storage_explainer')}
+ />
+ </div>
+
+ <Storage on:refresh={refreshStorage} isNew />
{/if}
</div>
</div>
diff --git a/package.json b/package.json
index 4da878fce0..e518e9dda3 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "coolify",
"description": "An open-source & self-hostable Heroku / Netlify alternative.",
- "version": "3.12.23",
+ "version": "3.12.26",
"license": "Apache-2.0",
"repository": "github:coollabsio/coolify",
"scripts": {