fix: adicionar opção de segurança para compatibilidade
deu pau pra rodar no vdm
This commit is contained in:
+18
-10
@@ -75,8 +75,8 @@ func RunWireguardDockerContainer(envFilePath string, cv ConfigValues) error {
|
|||||||
return fmt.Errorf("erro ao resolver caminho absoluto: %w", err)
|
return fmt.Errorf("erro ao resolver caminho absoluto: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd := exec.Command(
|
args := []string{
|
||||||
"docker", "run", "-it", "-d",
|
"run", "-it", "-d",
|
||||||
"--name", containerName,
|
"--name", containerName,
|
||||||
"--network", networkName,
|
"--network", networkName,
|
||||||
"--restart", "unless-stopped",
|
"--restart", "unless-stopped",
|
||||||
@@ -85,8 +85,12 @@ func RunWireguardDockerContainer(envFilePath string, cv ConfigValues) error {
|
|||||||
"--log-opt", "max-size=5m",
|
"--log-opt", "max-size=5m",
|
||||||
"--log-opt", "max-file=1",
|
"--log-opt", "max-file=1",
|
||||||
"--env-file", absPath,
|
"--env-file", absPath,
|
||||||
wireguardImageName,
|
}
|
||||||
)
|
if cv.Server["seccomp_unconfined"] == "Sim" {
|
||||||
|
args = append(args, "--security-opt", "seccomp=unconfined")
|
||||||
|
}
|
||||||
|
args = append(args, wireguardImageName)
|
||||||
|
cmd := exec.Command("docker", args...)
|
||||||
|
|
||||||
out, err := cmd.CombinedOutput()
|
out, err := cmd.CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -116,17 +120,21 @@ func RunAppClienteContainer(image, containerName, configPath, configDestinationP
|
|||||||
}
|
}
|
||||||
uidGid := fmt.Sprintf("%s:%s", currentUser.Uid, currentUser.Gid)
|
uidGid := fmt.Sprintf("%s:%s", currentUser.Uid, currentUser.Gid)
|
||||||
|
|
||||||
cmd := exec.Command(
|
args := []string{
|
||||||
"docker", "run", "-d",
|
"run", "-d",
|
||||||
"-u", uidGid,
|
"-u", uidGid,
|
||||||
"-p", fmt.Sprintf("%s:8080", cv.Server["port"]),
|
"-p", fmt.Sprintf("%s:8080", cv.Server["port"]),
|
||||||
"--name", containerName,
|
"--name", containerName,
|
||||||
"--network", "app-dono_app",
|
"--network", "app-dono_app",
|
||||||
"--restart", "unless-stopped",
|
"--restart", "unless-stopped",
|
||||||
"-v", fmt.Sprintf("%s:%s", absPath, configDestinationPath), // Config mapping
|
"-v", fmt.Sprintf("%s:%s", absPath, configDestinationPath),
|
||||||
"-v", fmt.Sprintf("%s:/app/certs", cv.Cert["cert_dir_path"]), // Certs mapping
|
"-v", fmt.Sprintf("%s:/app/certs", cv.Cert["cert_dir_path"]),
|
||||||
image,
|
}
|
||||||
)
|
if cv.Server["seccomp_unconfined"] == "Sim" {
|
||||||
|
args = append(args, "--security-opt", "seccomp=unconfined")
|
||||||
|
}
|
||||||
|
args = append(args, image)
|
||||||
|
cmd := exec.Command("docker", args...)
|
||||||
|
|
||||||
out, err := cmd.CombinedOutput()
|
out, err := cmd.CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -193,6 +193,13 @@ func InitialModel() Model {
|
|||||||
Type: FieldTypeSelect,
|
Type: FieldTypeSelect,
|
||||||
Options: []string{"development", "production"},
|
Options: []string{"development", "production"},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Id: "seccomp_unconfined",
|
||||||
|
Label: "Modo Compatibilidade (máquinas antigas)",
|
||||||
|
Default: "Não",
|
||||||
|
Type: FieldTypeSelect,
|
||||||
|
Options: []string{"Não", "Sim"},
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
dbForm: NewFormStep("Banco de Dados", []FormField{
|
dbForm: NewFormStep("Banco de Dados", []FormField{
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user