fix: remote verification
This commit is contained in:
parent
a49171f8cc
commit
9ab5e13e8f
@ -222,7 +222,7 @@ export async function verifyRemoteDockerEngine(request: FastifyRequest<OnlyId>,
|
|||||||
if (!coolifyNetwork) {
|
if (!coolifyNetwork) {
|
||||||
await asyncExecShell(`DOCKER_HOST=${host} docker network create --attachable coolify-infra`);
|
await asyncExecShell(`DOCKER_HOST=${host} docker network create --attachable coolify-infra`);
|
||||||
}
|
}
|
||||||
|
if (isCoolifyProxyUsed) await startTraefikProxy(id);
|
||||||
await prisma.destinationDocker.update({ where: { id }, data: { remoteVerified: true } })
|
await prisma.destinationDocker.update({ where: { id }, data: { remoteVerified: true } })
|
||||||
return reply.code(201).send()
|
return reply.code(201).send()
|
||||||
|
|
||||||
@ -235,7 +235,7 @@ export async function getDestinationStatus(request: FastifyRequest<OnlyId>) {
|
|||||||
try {
|
try {
|
||||||
const { id } = request.params
|
const { id } = request.params
|
||||||
const destination = await prisma.destinationDocker.findUnique({ where: { id } })
|
const destination = await prisma.destinationDocker.findUnique({ where: { id } })
|
||||||
const isRunning = await checkContainer({ dockerId: destination.id, container: 'coolify-proxy' })
|
const isRunning = await checkContainer({ dockerId: destination.id, container: 'coolify-proxy', remove: true })
|
||||||
return {
|
return {
|
||||||
isRunning
|
isRunning
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ const root: FastifyPluginAsync = async (fastify): Promise<void> => {
|
|||||||
|
|
||||||
fastify.post('/:id/configuration/sshKey', async (request) => await assignSSHKey(request));
|
fastify.post('/:id/configuration/sshKey', async (request) => await assignSSHKey(request));
|
||||||
|
|
||||||
fastify.post('/:id/verify', async (request, reply) => await verifyRemoteDockerEngine(request, reply));
|
fastify.post<OnlyId>('/:id/verify', async (request, reply) => await verifyRemoteDockerEngine(request, reply));
|
||||||
};
|
};
|
||||||
|
|
||||||
export default root;
|
export default root;
|
||||||
|
@ -38,8 +38,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
loading.proxy = true;
|
|
||||||
if (destination.remoteEngine && destination.remoteVerified) {
|
if (destination.remoteEngine && destination.remoteVerified) {
|
||||||
|
loading.proxy = true;
|
||||||
const { isRunning } = await get(`/destinations/${id}/status`);
|
const { isRunning } = await get(`/destinations/${id}/status`);
|
||||||
if (isRunning === false && destination.isCoolifyProxyUsed === true) {
|
if (isRunning === false && destination.isCoolifyProxyUsed === true) {
|
||||||
destination.isCoolifyProxyUsed = !destination.isCoolifyProxyUsed;
|
destination.isCoolifyProxyUsed = !destination.isCoolifyProxyUsed;
|
||||||
@ -69,6 +69,7 @@
|
|||||||
loading.proxy = false;
|
loading.proxy = false;
|
||||||
});
|
});
|
||||||
async function changeProxySetting() {
|
async function changeProxySetting() {
|
||||||
|
if (!destination.remoteVerified) return
|
||||||
loading.proxy = true;
|
loading.proxy = true;
|
||||||
if (!cannotDisable) {
|
if (!cannotDisable) {
|
||||||
const isProxyActivated = destination.isCoolifyProxyUsed;
|
const isProxyActivated = destination.isCoolifyProxyUsed;
|
||||||
@ -262,7 +263,7 @@
|
|||||||
<div class="grid grid-cols-2 items-center px-10">
|
<div class="grid grid-cols-2 items-center px-10">
|
||||||
<Setting
|
<Setting
|
||||||
id="changeProxySetting"
|
id="changeProxySetting"
|
||||||
disabled={cannotDisable}
|
disabled={cannotDisable || !destination.remoteVerified}
|
||||||
loading={loading.proxy}
|
loading={loading.proxy}
|
||||||
bind:setting={destination.isCoolifyProxyUsed}
|
bind:setting={destination.isCoolifyProxyUsed}
|
||||||
on:click={changeProxySetting}
|
on:click={changeProxySetting}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user