mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-23 20:28:47 +00:00
fix: use new command for registry updates
This commit is contained in:
@@ -10,15 +10,15 @@ import { IS_CLOUD } from "../constants";
|
|||||||
|
|
||||||
export type Registry = typeof registry.$inferSelect;
|
export type Registry = typeof registry.$inferSelect;
|
||||||
|
|
||||||
function shQ(s: string): string {
|
function shEscape(s: string | undefined): string {
|
||||||
if (!s) return "''";
|
if (!s) return "''";
|
||||||
return `'${s.replace(/'/g, `'\\''`)}'`;
|
return `'${s.replace(/'/g, `'\\''`)}'`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function safeDockerLoginCommand(registry: string, user: string, pass: string) {
|
function safeDockerLoginCommand(registry: string | undefined, user: string | undefined, pass: string | undefined) {
|
||||||
const escapedRegistry = shQ(registry)
|
const escapedRegistry = shEscape(registry)
|
||||||
const escapedUser = shQ(user)
|
const escapedUser = shEscape(user)
|
||||||
const escapedPassword = shQ(pass)
|
const escapedPassword = shEscape(pass)
|
||||||
return `echo ${escapedPassword} | docker login ${escapedRegistry} -u ${escapedUser} --password-stdin`;
|
return `echo ${escapedPassword} | docker login ${escapedRegistry} -u ${escapedUser} --password-stdin`;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@ export const updateRegistry = async (
|
|||||||
.returning()
|
.returning()
|
||||||
.then((res) => res[0]);
|
.then((res) => res[0]);
|
||||||
|
|
||||||
const loginCommand = `echo ${response?.password} | docker login ${response?.registryUrl} --username ${response?.username} --password-stdin`;
|
const loginCommand = safeDockerLoginCommand(response?.registryUrl, response?.username, response?.password)
|
||||||
|
|
||||||
if (
|
if (
|
||||||
IS_CLOUD &&
|
IS_CLOUD &&
|
||||||
|
|||||||
Reference in New Issue
Block a user