diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d1e76c..31ebda6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ All notable changes to this project will be documented in this file. - fixed hide error object of type QProcess on WorkProcess class #93 - fixed settings dhcp for allow to change dhcp configuration - fixed error when execute from github actions +- fixed set restport by default 1337 ## [Released] diff --git a/config/app/config.ini b/config/app/config.ini index ed13903..8420a51 100644 --- a/config/app/config.ini +++ b/config/app/config.ini @@ -131,4 +131,5 @@ PASSWORD_SCHEMES=['pbkdf2_sha512', 'md5_crypt'] EXTENSIONS="blueprints.restapi:init_app", "ext.database:init_app", "ext.auth:init_app" USERNAME=wp3admin PASSWORD=admin -public_id="" \ No newline at end of file +public_id="" +port=1337 \ No newline at end of file diff --git a/wifipumpkin3/__main__.py b/wifipumpkin3/__main__.py index d0f05c3..cf008d6 100644 --- a/wifipumpkin3/__main__.py +++ b/wifipumpkin3/__main__.py @@ -53,6 +53,7 @@ def parser_args_func(parse_args, config): config.set_one("ap_mode", "restapi", True) config.set("rest_api_settings", "PASSWORD", parse_args.password) config.set("rest_api_settings", "USERNAME", parse_args.username) + config.set("rest_api_settings", "port", parse_args.restport) server_restapi = RestControllerAPI("wp3API", config) thead = threading.Thread(target=server_restapi.run) thead.setDaemon(True) diff --git a/wifipumpkin3/core/servers/rest/application.py b/wifipumpkin3/core/servers/rest/application.py index 8f286b9..4240fad 100644 --- a/wifipumpkin3/core/servers/rest/application.py +++ b/wifipumpkin3/core/servers/rest/application.py @@ -23,8 +23,9 @@ class RestControllerAPI(object): def __init__(self, name, config): self.conf = config self.app = Flask(name) + self.port_rest = self.conf.get("rest_api_settings", "port") configuration.init_app(self.app, self.conf) configuration.load_extensions(self.app) def run(self): - self.app.run(debug=False) + self.app.run(debug=False, port=self.port_rest)