mirror of
https://github.com/bettercap/bettercap
synced 2025-08-20 05:23:19 -07:00
Merge pull request #1218 from kkrypt0nn/master
Some checks failed
Build and Push Docker Images / docker (push) Has been cancelled
Linux tests / build (1.24.x, ubuntu-latest) (push) Has been cancelled
macOS tests / build (1.24.x, macos-latest) (push) Has been cancelled
Windows tests / build (1.24.x, windows-latest) (push) Has been cancelled
Some checks failed
Build and Push Docker Images / docker (push) Has been cancelled
Linux tests / build (1.24.x, ubuntu-latest) (push) Has been cancelled
macOS tests / build (1.24.x, macos-latest) (push) Has been cancelled
Windows tests / build (1.24.x, windows-latest) (push) Has been cancelled
feat: Add default username and password for API
This commit is contained in:
commit
453c417e92
3 changed files with 10 additions and 10 deletions
|
@ -90,12 +90,12 @@ func NewRestAPI(s *session.Session) *RestAPI {
|
|||
"Value of the Access-Control-Allow-Origin header of the API server."))
|
||||
|
||||
mod.AddParam(session.NewStringParameter("api.rest.username",
|
||||
"",
|
||||
"user",
|
||||
"",
|
||||
"API authentication username."))
|
||||
|
||||
mod.AddParam(session.NewStringParameter("api.rest.password",
|
||||
"",
|
||||
"pass",
|
||||
"",
|
||||
"API authentication password."))
|
||||
|
||||
|
|
|
@ -31,20 +31,20 @@ func NewHttpServer(s *session.Session) *HttpServer {
|
|||
mod.AddParam(session.NewStringParameter("http.server.address",
|
||||
session.ParamIfaceAddress,
|
||||
session.IPv4Validator,
|
||||
"Address to bind the http server to."))
|
||||
"Address to bind the HTTP server to."))
|
||||
|
||||
mod.AddParam(session.NewIntParameter("http.server.port",
|
||||
"80",
|
||||
"Port to bind the http server to."))
|
||||
"Port to bind the HTTP server to."))
|
||||
|
||||
mod.AddHandler(session.NewModuleHandler("http.server on", "",
|
||||
"Start httpd server.",
|
||||
"Start HTTP server.",
|
||||
func(args []string) error {
|
||||
return mod.Start()
|
||||
}))
|
||||
|
||||
mod.AddHandler(session.NewModuleHandler("http.server off", "",
|
||||
"Stop httpd server.",
|
||||
"Stop HTTP server.",
|
||||
func(args []string) error {
|
||||
return mod.Stop()
|
||||
}))
|
||||
|
|
|
@ -35,11 +35,11 @@ func NewHttpsServer(s *session.Session) *HttpsServer {
|
|||
mod.AddParam(session.NewStringParameter("https.server.address",
|
||||
session.ParamIfaceAddress,
|
||||
session.IPv4Validator,
|
||||
"Address to bind the http server to."))
|
||||
"Address to bind the HTTPS server to."))
|
||||
|
||||
mod.AddParam(session.NewIntParameter("https.server.port",
|
||||
"443",
|
||||
"Port to bind the http server to."))
|
||||
"Port to bind the HTTPS server to."))
|
||||
|
||||
mod.AddParam(session.NewStringParameter("https.server.certificate",
|
||||
"~/.bettercap-httpd.cert.pem",
|
||||
|
@ -54,13 +54,13 @@ func NewHttpsServer(s *session.Session) *HttpsServer {
|
|||
tls.CertConfigToModule("https.server", &mod.SessionModule, tls.DefaultLegitConfig)
|
||||
|
||||
mod.AddHandler(session.NewModuleHandler("https.server on", "",
|
||||
"Start https server.",
|
||||
"Start HTTPS server.",
|
||||
func(args []string) error {
|
||||
return mod.Start()
|
||||
}))
|
||||
|
||||
mod.AddHandler(session.NewModuleHandler("https.server off", "",
|
||||
"Stop https server.",
|
||||
"Stop HTTPS server.",
|
||||
func(args []string) error {
|
||||
return mod.Stop()
|
||||
}))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue