mirror of
https://github.com/YunoHost/yunorunner.git
synced 2024-09-03 20:05:52 +02:00
[enh] allow to specify a custom port on which yunorunner will listen
This commit is contained in:
parent
380c7ce501
commit
6aa293b3cd
2 changed files with 9 additions and 3 deletions
|
@ -63,6 +63,12 @@ Current behavior:
|
||||||
* for arm : launch job as `$app_id ($app_list_name) (~ARM~)`
|
* 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)`
|
* 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
|
##### SSL
|
||||||
|
|
||||||
If you need this server to be front (without nginx in front of it) you can start it like that:
|
If you need this server to be front (without nginx in front of it) you can start it like that:
|
||||||
|
|
6
run.py
6
run.py
|
@ -717,7 +717,7 @@ async def index(request):
|
||||||
|
|
||||||
|
|
||||||
@argh.arg('-t', '--type', choices=['stable', 'arm', 'testing-unstable', 'dev'], default="stable")
|
@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):
|
if not os.path.exists(path_to_analyseCI):
|
||||||
print(f"Error: analyseCI script doesn't exist at '{path_to_analyseCI}'")
|
print(f"Error: analyseCI script doesn't exist at '{path_to_analyseCI}'")
|
||||||
sys.exit(1)
|
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())
|
app.add_task(jobs_dispatcher())
|
||||||
|
|
||||||
if not ssl:
|
if not ssl:
|
||||||
app.run('localhost', port=4242, debug=True)
|
app.run('localhost', port=port, debug=True)
|
||||||
else:
|
else:
|
||||||
import ssl
|
import ssl
|
||||||
context = ssl.create_default_context(purpose=ssl.Purpose.CLIENT_AUTH)
|
context = ssl.create_default_context(purpose=ssl.Purpose.CLIENT_AUTH)
|
||||||
context.load_cert_chain(certfile_path, keyfile=keyfile_path)
|
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__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Add table
Reference in a new issue