{"record":{"id":"5fcb5d0e14f59a5a","repo":"kgretzky/evilginx2","slug":"phishlet-s-is-a-template-you-have-to-create","errorCode":null,"errorMessage":"phishlet '%s' is a template - you have to 'create' child phishlet from it, with predefined parameters, before you can enable it.","messagePattern":"phishlet '(.+?)' is a template - you have to 'create' child phishlet from it, with predefined parameters, before you can enable it\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/config.go","lineNumber":404,"sourceCode":"\t\t\tif c.PhishletConfig(l.Phishlet).Enabled {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}\n\nfunc (c *Config) SetSiteEnabled(site string) error {\n\tpl, err := c.GetPhishlet(site)\n\tif err != nil {\n\t\tlog.Error(\"%v\", err)\n\t\treturn err\n\t}\n\tif c.PhishletConfig(site).Hostname == \"\" {\n\t\treturn fmt.Errorf(\"enabling phishlet '%s' requires its hostname to be set up\", site)\n\t}\n\tif pl.isTemplate {\n\t\treturn fmt.Errorf(\"phishlet '%s' is a template - you have to 'create' child phishlet from it, with predefined parameters, before you can enable it.\", site)\n\t}\n\tc.PhishletConfig(site).Enabled = true\n\tc.refreshActiveHostnames()\n\tc.VerifyPhishlets()\n\tlog.Info(\"enabled phishlet '%s'\", site)\n\n\tc.SavePhishlets()\n\treturn nil\n}\n\nfunc (c *Config) SetSiteDisabled(site string) error {\n\tif _, err := c.GetPhishlet(site); err != nil {\n\t\tlog.Error(\"%v\", err)\n\t\treturn err\n\t}\n\tc.PhishletConfig(site).Enabled = false\n\tc.refreshActiveHostnames()\n\tlog.Info(\"disabled phishlet '%s'\", site)","sourceCodeStart":386,"sourceCodeEnd":422,"githubUrl":"https://github.com/kgretzky/evilginx2/blob/4c0988a1d9db4d172a185e979a38bfd0efdb5830/core/config.go#L386-L422","documentation":"SetSiteEnabled throws this when the target phishlet is marked isTemplate. Template phishlets are blueprints; they cannot be enabled directly because they lack concrete parameters. Users must 'create' a child phishlet from the template with the required parameters, then enable the child.","triggerScenarios":"Running 'phishlets enable <template-name>' (handlePhishlets → SetSiteEnabled) on a phishlet loaded as a template, or on a parent phishlet instead of a child created from it.","commonSituations":"New users confusing template phishlets with enable-ready ones; enabling the parent name after creating a differently-named child; automation referencing the template name from a config file.","solutions":["Create a child phishlet from the template: phishlets create <child> <template> <param>... , then enable the child","Enable the child phishlet's name, not the template/parent name","List phishlets to identify which entries are templates before enabling","Update scripts/config to reference the created child phishlet name"],"exampleFix":"// console\n// before\nphishlets enable oauth-template\n// after\nphishlets create oauth-live oauth-template hostname oauth.example.com\nphishlets enable oauth-live","handlingStrategy":"try-catch","validationCode":"// before SetSiteEnabled, ensure the phishlet is not a template\npl, err := c.GetPhishlet(site)\nif err != nil { return err }\nif pl.IsTemplate() { return fmt.Errorf(\"%s is a template; create a child phishlet first\", site) }\nc.SetSiteEnabled(site, true)","typeGuard":"func isTemplatePhishlet(c *Config, site string) bool {\n    pl, err := c.GetPhishlet(site)\n    return err != nil || pl.IsTemplate()\n}","tryCatchPattern":"if err := c.SetSiteEnabled(site, true); err != nil {\n    if strings.Contains(err.Error(), \"is a template\") {\n        log.Printf(\"create a child from %s with 'phishlets create <child> %s ...', then enable the child\", site, site)\n    }\n    return err\n}","preventionTips":["Never enable phishlets loaded from the templates directory directly","Create a concrete child with required params, then enable the child name","Document template vs child phishlet names for your team/scripts","List phishlets and filter out templates in automation before enabling"],"tags":["configuration","phishlet","template"],"backgroundTag":"phishlet-is-template","analyzedSha":"4c0988a1d9db4d172a185e979a38bfd0efdb5830","analyzedAt":"2026-09-05T19:23:07.238Z","contentChangedAt":"2026-09-05T19:23:07.238Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}