{"record":{"id":"bcf0cd49e8a0f2f5","repo":"kgretzky/evilginx2","slug":"enabling-phishlet-s-requires-its-hostname-to-be","errorCode":null,"errorMessage":"enabling phishlet '%s' requires its hostname to be set up","messagePattern":"enabling phishlet '(.+?)' requires its hostname to be set up","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/config.go","lineNumber":401,"sourceCode":"func (c *Config) IsLureHostnameValid(hostname string) bool {\n\tfor _, l := range c.lures {\n\t\tif l.Hostname == hostname {\n\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}","sourceCodeStart":383,"sourceCodeEnd":419,"githubUrl":"https://github.com/kgretzky/evilginx2/blob/4c0988a1d9db4d172a185e979a38bfd0efdb5830/core/config.go#L383-L419","documentation":"SetSiteEnabled refuses to enable a phishlet whose hostname has not been configured. Enabling requires a live hostname so active hostnames and certificate provisioning can be set up; enabling a hostname-less phishlet would create an unusable, unroutable lure. It returns the error to the caller (handlePhishlets in the admin console) after logging.","triggerScenarios":"Running 'phishlets enable <name>' (handlePhishlets → SetSiteEnabled) on a phishlet where 'phishlets hostname <name> <host>' was never executed, so PhishletConfig(site).Hostname == \"\"; also applies to child phishlets created without a hostname parameter.","commonSituations":"Fresh install where users enable a phishlet straight after loading it; automation scripts that enable phishlets but skip the hostname step; creating a child phishlet without passing the hostname custom parameter.","solutions":["Set the hostname first: phishlets hostname <phishlet> <your-domain>, then enable it","For child phishlets, create them with the hostname custom parameter included","Verify with 'phishlets get-hosts <phishlet>' that hostnames are set before enabling","Fix automation to always set hostname before calling SetSiteEnabled"],"exampleFix":"// console\n// before\nphishlets enable linkedin\n// after\nphishlets hostname linkedin ln.example.com\nphishlets enable linkedin","handlingStrategy":"validation","validationCode":"// before SetSiteEnabled\nif cfg := c.PhishletConfig(site); cfg == nil || cfg.Hostname == \"\" {\n    return fmt.Errorf(\"set hostname for %s first: phishlets hostname %s <domain>\", site, site)\n}\nc.SetSiteEnabled(site, true)","typeGuard":null,"tryCatchPattern":"if err := c.SetSiteEnabled(site, true); err != nil {\n    if strings.Contains(err.Error(), \"requires its hostname to be set up\") {\n        log.Printf(\"run 'phishlets hostname %s <domain>' first\", site)\n    }\n    return err\n}","preventionTips":["Always run 'phishlets hostname <name> <domain>' immediately after loading a phishlet","In automation, assert hostname is non-empty before enabling","Verify with 'phishlets get-hosts <name>' before enable","Include hostname as a required parameter when creating child phishlets"],"tags":["configuration","phishlet","hostname"],"backgroundTag":"phishlet-hostname-missing","analyzedSha":"4c0988a1d9db4d172a185e979a38bfd0efdb5830","analyzedAt":"2026-09-05T19:23:07.238Z","contentChangedAt":"2026-09-05T19:23:07.238Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}