diff --git a/README.md b/README.md index b078032..4ee59d9 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,12 @@ Current behavior: * for arm : launch job as `$app_id ($app_list_name) (~ARM~)` * for stable : launch TWO jobs as `$app_id ($app_list_name) (testing)` and `$app_id ($app_list_name) (unstable)` +#### Changing the port + +If you need to change to port on which yunorunner is listening, you can simply uses the `--port` cli argument like that: + + ve3/bin/python ./run.py /path/to/analyseCI.sh --port 4343 + ##### SSL If you need this server to be front (without nginx in front of it) you can start it like that: diff --git a/run.py b/run.py index 8f2b3b8..941d493 100644 --- a/run.py +++ b/run.py @@ -717,7 +717,7 @@ async def index(request): @argh.arg('-t', '--type', choices=['stable', 'arm', 'testing-unstable', 'dev'], default="stable") -def main(path_to_analyseCI, ssl=False, keyfile_path="/etc/yunohost/certs/ci-apps.yunohost.org/key.pem", certfile_path="/etc/yunohost/certs/ci-apps.yunohost.org/crt.pem", type="stable", dont_minotor_apps_list=False): +def main(path_to_analyseCI, ssl=False, keyfile_path="/etc/yunohost/certs/ci-apps.yunohost.org/key.pem", certfile_path="/etc/yunohost/certs/ci-apps.yunohost.org/crt.pem", type="stable", dont_minotor_apps_list=False, port=4242): if not os.path.exists(path_to_analyseCI): print(f"Error: analyseCI script doesn't exist at '{path_to_analyseCI}'") sys.exit(1) @@ -737,13 +737,13 @@ def main(path_to_analyseCI, ssl=False, keyfile_path="/etc/yunohost/certs/ci-apps app.add_task(jobs_dispatcher()) if not ssl: - app.run('localhost', port=4242, debug=True) + app.run('localhost', port=port, debug=True) else: import ssl context = ssl.create_default_context(purpose=ssl.Purpose.CLIENT_AUTH) context.load_cert_chain(certfile_path, keyfile=keyfile_path) - app.run('0.0.0.0', port=4242, ssl=context, debug=True) + app.run('0.0.0.0', port=port, ssl=context, debug=True) if __name__ == "__main__":