diff --git a/src/services.cpp b/src/services.cpp index 7a216eb..db87207 100644 --- a/src/services.cpp +++ b/src/services.cpp @@ -182,7 +182,15 @@ bool create_service(const std::string &server_name, const std::string &template_ } return false; } - + + // check template is all good. + if (!gTemplateManager().test_template(tinfo.local_template_path())) + { + if (!silent) + std::cerr << "Error: Template '" << template_name << "' is not valid" << std::endl; + return false; + } + // create the service directory fs::create_directory(service_dir); diff --git a/templates/caddy/example/.template_info.env b/templates/caddy/config/.template_info.env similarity index 100% rename from templates/caddy/example/.template_info.env rename to templates/caddy/config/.template_info.env diff --git a/templates/caddy/example/Caddyfile b/templates/caddy/config/Caddyfile similarity index 100% rename from templates/caddy/example/Caddyfile rename to templates/caddy/config/Caddyfile diff --git a/templates/caddy/example/service.env b/templates/caddy/config/service.env similarity index 100% rename from templates/caddy/example/service.env rename to templates/caddy/config/service.env diff --git a/templates/caddy/example/static/index.html b/templates/caddy/config/static/index.html similarity index 100% rename from templates/caddy/example/static/index.html rename to templates/caddy/config/static/index.html diff --git a/templates/dropshell-agent/example/.template_info.env b/templates/dropshell-agent/config/.template_info.env similarity index 100% rename from templates/dropshell-agent/example/.template_info.env rename to templates/dropshell-agent/config/.template_info.env diff --git a/templates/dropshell-agent/example/service.env b/templates/dropshell-agent/config/service.env similarity index 100% rename from templates/dropshell-agent/example/service.env rename to templates/dropshell-agent/config/service.env diff --git a/templates/example-nginx/example/.template_info.env b/templates/example-nginx/config/.template_info.env similarity index 100% rename from templates/example-nginx/example/.template_info.env rename to templates/example-nginx/config/.template_info.env diff --git a/templates/example-nginx/example/service.env b/templates/example-nginx/config/service.env similarity index 100% rename from templates/example-nginx/example/service.env rename to templates/example-nginx/config/service.env diff --git a/templates/simple-object-storage/example/.template_info.env b/templates/simple-object-storage/config/.template_info.env similarity index 100% rename from templates/simple-object-storage/example/.template_info.env rename to templates/simple-object-storage/config/.template_info.env diff --git a/templates/simple-object-storage/example/service.env b/templates/simple-object-storage/config/service.env similarity index 100% rename from templates/simple-object-storage/example/service.env rename to templates/simple-object-storage/config/service.env diff --git a/templates/simple-object-storage/example/sos_config.json b/templates/simple-object-storage/config/sos_config.json similarity index 100% rename from templates/simple-object-storage/example/sos_config.json rename to templates/simple-object-storage/config/sos_config.json diff --git a/templates/squashkiwi/example/.template_info.env b/templates/squashkiwi/config/.template_info.env similarity index 100% rename from templates/squashkiwi/example/.template_info.env rename to templates/squashkiwi/config/.template_info.env diff --git a/templates/squashkiwi/example/service.env b/templates/squashkiwi/config/service.env similarity index 100% rename from templates/squashkiwi/example/service.env rename to templates/squashkiwi/config/service.env diff --git a/templates/watchtower/example/.template_info.env b/templates/watchtower/config/.template_info.env similarity index 100% rename from templates/watchtower/example/.template_info.env rename to templates/watchtower/config/.template_info.env diff --git a/templates/watchtower/example/config.json b/templates/watchtower/config/config.json similarity index 100% rename from templates/watchtower/example/config.json rename to templates/watchtower/config/config.json diff --git a/templates/watchtower/example/service.env b/templates/watchtower/config/service.env similarity index 100% rename from templates/watchtower/example/service.env rename to templates/watchtower/config/service.env