mirror of https://github.com/gophish/gophish
Added config file integration, updated some styles
parent
f32989b4c5
commit
a3518032be
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"url" : "localhost:3333",
|
"url" : "localhost:3333",
|
||||||
"smtp" : {
|
"smtp" : {
|
||||||
"server" : "smtp.example.com",
|
"host" : "smtp.example.com",
|
||||||
"port" : 25,
|
"port" : 25,
|
||||||
"user" : "username",
|
"user" : "username",
|
||||||
"pass" : "password"
|
"pass" : "password"
|
||||||
|
|
32
gophish.go
32
gophish.go
|
@ -26,10 +26,36 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
import (
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
type SMTPServer struct {
|
||||||
http.Handle("/", createRouter())
|
Server string `json:"host"`
|
||||||
http.ListenAndServe("localhost:3333", nil)
|
Port int `json:"port"`
|
||||||
|
User string `json:"user"`
|
||||||
|
Password string `json:"password"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Config struct {
|
||||||
|
URL string `json:"url"`
|
||||||
|
SMTP SMTPServer `json:"smtp"`
|
||||||
|
}
|
||||||
|
|
||||||
|
var config Config
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
// Get the config file
|
||||||
|
config_file, e := ioutil.ReadFile("./config.json")
|
||||||
|
if e != nil {
|
||||||
|
fmt.Printf("File error: %v\n", e)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
json.Unmarshal(config_file, &config)
|
||||||
|
fmt.Printf("Gophish server started at http://%s\n", config.URL)
|
||||||
|
http.Handle("/", createRouter())
|
||||||
|
http.ListenAndServe(config.URL, nil)
|
||||||
}
|
}
|
|
@ -61,3 +61,7 @@ footer > p {
|
||||||
color:#444444;
|
color:#444444;
|
||||||
font-family: 'Open Sans', sans-serif;
|
font-family: 'Open Sans', sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.header {
|
||||||
|
margin-top:10px;
|
||||||
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
{{define "content"}} {{template "nav"}}
|
{{define "content"}} {{template "nav"}}
|
||||||
<div class="jumbotron">
|
<div class="jumbotron">
|
||||||
<div class="container" style="text-align:center;">
|
<div class="container" style="text-align:center;">
|
||||||
<h1>
|
<h1 class="header">
|
||||||
Dashboard
|
Dashboard
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue