Merge pull request #355 from coollabsio/next

v2.4.10
This commit is contained in:
Andras Bacsai 2022-04-17 20:37:56 +02:00 committed by GitHub
commit 9481beb61f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 8 deletions

View File

@ -1,7 +1,7 @@
{
"name": "coolify",
"description": "An open-source & self-hostable Heroku / Netlify alternative.",
"version": "2.4.9",
"version": "2.4.10",
"license": "AGPL-3.0",
"scripts": {
"dev": "docker-compose -f docker-compose-dev.yaml up -d && cross-env NODE_ENV=development & svelte-kit dev",

View File

@ -62,10 +62,11 @@
<div class="grid grid-cols-2 items-center px-10">
<label for="extraConfig">Extra Config</label>
<textarea
bind:value={service.wordpress.extraConfig}
disabled={isRunning}
readonly={isRunning}
class:resize-none={isRunning}
rows={isRunning ? 1 : 5}
rows="5"
name="extraConfig"
id="extraConfig"
placeholder={!isRunning
@ -74,8 +75,8 @@
define('WP_ALLOW_MULTISITE', true);
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);`
: 'N/A'}>{service.wordpress.extraConfig}</textarea
>
: 'N/A'}
/>
</div>
<div class="grid grid-cols-2 items-center px-10">
<Setting

View File

@ -113,7 +113,7 @@ export const post: RequestHandler = async (event) => {
services: {
[`${id}-ftp`]: {
image: `atmoz/sftp:alpine`,
command: `'${ftpUser}:${password.replace('\n', '').replace(/\$/g, '$$$')}:e:1001'`,
command: `'${ftpUser}:${password.replace('\n', '').replace(/\$/g, '$$$')}:e:33'`,
extra_hosts: ['host.docker.internal:host-gateway'],
container_name: `${id}-ftp`,
volumes,

View File

@ -12,21 +12,44 @@ export const post: RequestHandler = async (event) => {
try {
const service = await db.getService({ id, teamId });
const { destinationDockerId, destinationDocker, fqdn } = service;
const {
destinationDockerId,
destinationDocker,
fqdn,
wordpress: { ftpEnabled }
} = service;
if (destinationDockerId) {
const engine = destinationDocker.engine;
try {
let found = await checkContainer(engine, id);
const found = await checkContainer(engine, id);
if (found) {
await removeDestinationDocker({ id, engine });
}
found = await checkContainer(engine, `${id}-mysql`);
} catch (error) {
console.error(error);
}
try {
const found = await checkContainer(engine, `${id}-mysql`);
if (found) {
await removeDestinationDocker({ id: `${id}-mysql`, engine });
}
} catch (error) {
console.error(error);
}
try {
if (ftpEnabled) {
const found = await checkContainer(engine, `${id}-ftp`);
if (found) {
await removeDestinationDocker({ id: `${id}-ftp`, engine });
}
await db.prisma.wordpress.update({
where: { serviceId: id },
data: { ftpEnabled: false }
});
}
} catch (error) {
console.error(error);
}
}
return {