commit
0dd32b5319
@ -161,7 +161,7 @@ export async function startTraefikTCPProxy(
|
|||||||
image: 'traefik:v2.6',
|
image: 'traefik:v2.6',
|
||||||
command: [
|
command: [
|
||||||
`--entrypoints.tcp.address=:${publicPort}`,
|
`--entrypoints.tcp.address=:${publicPort}`,
|
||||||
`--providers.http.endpoint=${otherTraefikEndpoint}?id=${id}&privatePort=${privatePort}&publicPort=${publicPort}&type=tcp`,
|
`--providers.http.endpoint=${otherTraefikEndpoint}?id=${id}&privatePort=${privatePort}&publicPort=${publicPort}&type=tcp&address=${dependentId}`,
|
||||||
'--providers.http.pollTimeout=2s',
|
'--providers.http.pollTimeout=2s',
|
||||||
'--log.level=error'
|
'--log.level=error'
|
||||||
],
|
],
|
||||||
|
@ -49,7 +49,7 @@ export default async function ({
|
|||||||
applicationId
|
applicationId
|
||||||
});
|
});
|
||||||
await asyncExecShell(
|
await asyncExecShell(
|
||||||
`git clone -q -b ${branch} https://x-access-token:${token}@${url}/${repository}.git ${workdir}/ && cd ${workdir} && git submodule update --init --recursive && git lfs pull && cd .. `
|
`GIT_SSH_COMMAND='ssh -o StrictHostKeyChecking=no' git clone -q -b ${branch} https://x-access-token:${token}@${url}/${repository}.git ${workdir}/ && cd ${workdir} && git submodule update --init --recursive && git lfs pull && cd .. `
|
||||||
);
|
);
|
||||||
const { stdout: commit } = await asyncExecShell(`cd ${workdir}/ && git rev-parse HEAD`);
|
const { stdout: commit } = await asyncExecShell(`cd ${workdir}/ && git rev-parse HEAD`);
|
||||||
return commit.replace('\n', '');
|
return commit.replace('\n', '');
|
||||||
|
@ -31,7 +31,7 @@ export default async function ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
await asyncExecShell(
|
await asyncExecShell(
|
||||||
`git clone -q -b ${branch} git@${url}:${repository}.git --config core.sshCommand="ssh -q -i ${repodir}id.rsa -o StrictHostKeyChecking=no" ${workdir}/ && cd ${workdir}/ && git submodule update --init --recursive && git lfs pull && cd .. `
|
`GIT_SSH_COMMAND='ssh -o StrictHostKeyChecking=no' git clone -q -b ${branch} git@${url}:${repository}.git --config core.sshCommand="ssh -q -i ${repodir}id.rsa -o StrictHostKeyChecking=no" ${workdir}/ && cd ${workdir}/ && git submodule update --init --recursive && git lfs pull && cd .. `
|
||||||
);
|
);
|
||||||
const { stdout: commit } = await asyncExecShell(`cd ${workdir}/ && git rev-parse HEAD`);
|
const { stdout: commit } = await asyncExecShell(`cd ${workdir}/ && git rev-parse HEAD`);
|
||||||
return commit.replace('\n', '');
|
return commit.replace('\n', '');
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
try {
|
try {
|
||||||
await post(`/services/${id}/check.json`, {
|
await post(`/services/${id}/check.json`, {
|
||||||
fqdn: service.fqdn,
|
fqdn: service.fqdn,
|
||||||
otherFqdns: [service.minio.apiFqdn],
|
otherFqdns: service.minio?.apiFqdn ? [service.minio?.apiFqdn] : [],
|
||||||
exposePort: service.exposePort
|
exposePort: service.exposePort
|
||||||
});
|
});
|
||||||
await post(`/services/${id}/${service.type}.json`, { ...service });
|
await post(`/services/${id}/${service.type}.json`, { ...service });
|
||||||
|
@ -13,7 +13,7 @@ export const post: RequestHandler = async (event) => {
|
|||||||
let { fqdn, exposePort, otherFqdns } = await event.request.json();
|
let { fqdn, exposePort, otherFqdns } = await event.request.json();
|
||||||
|
|
||||||
if (fqdn) fqdn = fqdn.toLowerCase();
|
if (fqdn) fqdn = fqdn.toLowerCase();
|
||||||
if (otherFqdns) otherFqdns = otherFqdns.map((fqdn) => fqdn.toLowerCase());
|
if (otherFqdns && otherFqdns.length > 0) otherFqdns = otherFqdns.map((f) => f.toLowerCase());
|
||||||
if (exposePort) exposePort = Number(exposePort);
|
if (exposePort) exposePort = Number(exposePort);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -25,7 +25,7 @@ export const post: RequestHandler = async (event) => {
|
|||||||
})
|
})
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (otherFqdns) {
|
if (otherFqdns && otherFqdns.length > 0) {
|
||||||
for (const ofqdn of otherFqdns) {
|
for (const ofqdn of otherFqdns) {
|
||||||
const domain = getDomain(ofqdn);
|
const domain = getDomain(ofqdn);
|
||||||
const nakedDomain = domain.replace('www.', '');
|
const nakedDomain = domain.replace('www.', '');
|
||||||
|
@ -9,6 +9,7 @@ export const get: RequestHandler = async (event) => {
|
|||||||
const privatePort = event.url.searchParams.get('privatePort');
|
const privatePort = event.url.searchParams.get('privatePort');
|
||||||
const publicPort = event.url.searchParams.get('publicPort');
|
const publicPort = event.url.searchParams.get('publicPort');
|
||||||
const type = event.url.searchParams.get('type');
|
const type = event.url.searchParams.get('type');
|
||||||
|
const address = event.url.searchParams.get('address') || id;
|
||||||
let traefik = {};
|
let traefik = {};
|
||||||
if (publicPort && type && privatePort) {
|
if (publicPort && type && privatePort) {
|
||||||
if (type === 'tcp') {
|
if (type === 'tcp') {
|
||||||
@ -24,7 +25,7 @@ export const get: RequestHandler = async (event) => {
|
|||||||
services: {
|
services: {
|
||||||
[id]: {
|
[id]: {
|
||||||
loadbalancer: {
|
loadbalancer: {
|
||||||
servers: [{ address: `${id}:${privatePort}` }]
|
servers: [{ address: `${address}:${privatePort}` }]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user