diff --git a/app/pipeline/convert/build_step.go b/app/pipeline/convert/build_step.go index 7063d1b..4bfad3f 100644 --- a/app/pipeline/convert/build_step.go +++ b/app/pipeline/convert/build_step.go @@ -44,7 +44,9 @@ func buildCommandNew( if len(buildVars) > 0 { var args []string for k, v := range buildVars { - args = append(args, fmt.Sprintf("%s=%s", k, v)) + // Escape single quotes in value and wrap value in single quotes + escapedValue := strings.ReplaceAll(v, `'`, `'\''`) + args = append(args, fmt.Sprintf(`%s='%s'`, k, escapedValue)) } addSecret(pCtx, step, "CLOUDNESS_BUILD_ARGS", strings.Join(args, " ")) } diff --git a/app/pipeline/convert/templates/static/4-httproute.yaml b/app/pipeline/convert/templates/static/4-httproute.yaml index 5070ee6..ad61085 100644 --- a/app/pipeline/convert/templates/static/4-httproute.yaml +++ b/app/pipeline/convert/templates/static/4-httproute.yaml @@ -34,6 +34,10 @@ spec: type: PathPrefix value: / + timeouts: + request: 300s + backendRequest: 300s + backendRefs: - name: {{ $.PrivateDomain }} namespace: {{ $.Namespace }} diff --git a/app/services/manager/kube/ingress.go b/app/services/manager/kube/ingress.go index 7cbd113..7bf5a73 100644 --- a/app/services/manager/kube/ingress.go +++ b/app/services/manager/kube/ingress.go @@ -37,6 +37,11 @@ func (m *K8sManager) AddHttpRoute(ctx context.Context, server *types.Server, nam WithMatches(v1.HTTPRouteMatch().WithPath(v1.HTTPPathMatch().WithType(gatewayv1.PathMatchPathPrefix).WithValue("/"))). WithBackendRefs( v1.HTTPBackendRef().WithName(gatewayv1.ObjectName(service)).WithNamespace(gatewayv1.Namespace(namespace)).WithPort(gatewayv1.PortNumber(port)), + ). + WithTimeouts( + v1.HTTPRouteTimeouts(). + WithRequest(gatewayv1.Duration("300s")). + WithBackendRequest(gatewayv1.Duration("300s")), ), ), ) diff --git a/templates/6-matomo.json b/templates/6-matomo.json new file mode 100644 index 0000000..f51d5a2 --- /dev/null +++ b/templates/6-matomo.json @@ -0,0 +1,117 @@ +{ + "icon": "https://raw.githubusercontent.com/cloudness-io/icons/refs/heads/main/matomo.svg", + "name": "Matomo Analytics", + "readme": "Matomo is a powerful open-source web analytics platform that gives you 100% data ownership and user privacy protection.", + "tags": [ + "analytics", + "monitoring" + ], + "services": [ + { + "icon": "https://raw.githubusercontent.com/cloudness-io/icons/refs/heads/main/matomo.svg", + "name": "Matomo", + "build": { + "source": { + "registry": { + "image": "matomo:latest" + } + } + }, + "deploy": { + "startCommand": "sh -c 'if ! id -u www-data > /dev/null 2>&1; then addgroup -g 82 www-data && adduser -u 82 -D -S -G www-data www-data; fi && /entrypoint.sh apache2-foreground'" + }, + "networking": { + "containerPorts": [ + 80 + ], + "serviceDomain": { + "port": 80, + "path": "/" + } + }, + "volumes": [ + { + "name": "matomo-data", + "mountPath": "/var/www/html" + } + ], + "variables": [ + { + "key": "MATOMO_DATABASE_HOST", + "value": "${{matomo-db.CLOUDNESS_PRIVATE_DOMAIN}}", + "type": "run" + }, + { + "key": "MATOMO_DATABASE_ADAPTER", + "value": "mysql", + "type": "run" + }, + { + "key": "MATOMO_DATABASE_TABLES_PREFIX", + "value": "matomo_", + "type": "run" + }, + { + "key": "MATOMO_DATABASE_USERNAME", + "value": "${{matomo-db.MYSQL_USER}}", + "type": "run" + }, + { + "key": "MATOMO_DATABASE_PASSWORD", + "value": "${{matomo-db.MYSQL_PASSWORD}}", + "type": "run" + }, + { + "key": "MATOMO_DATABASE_DBNAME", + "value": "${{matomo-db.MYSQL_DATABASE}}", + "type": "run" + } + ] + }, + { + "icon": "https://raw.githubusercontent.com/cloudness-io/icons/refs/heads/main/mysql.svg", + "name": "matomo-db", + "build": { + "source": { + "registry": { + "image": "mysql:latest" + } + } + }, + "deploy": {}, + "networking": { + "containerPorts": [ + 3306 + ] + }, + "volumes": [ + { + "name": "db-data", + "mountPath": "/var/lib/mysql" + } + ], + "variables": [ + { + "key": "MYSQL_ROOT_PASSWORD", + "value": "${{secret(32)}}", + "type": "run" + }, + { + "key": "MYSQL_DATABASE", + "value": "matomo", + "type": "run" + }, + { + "key": "MYSQL_USER", + "value": "matomo", + "type": "run" + }, + { + "key": "MYSQL_PASSWORD", + "value": "${{secret(32)}}", + "type": "run" + } + ] + } + ] +} \ No newline at end of file