Skip to content

Commit 6132345

Browse files
committed
Add config options for dashboard IP and port. Fixes #87
You can now launch the dashboard like this: `MRQ_DASHBOARD_PORT=8080 MRQ_DASHBOARD_IP=127.0.0.1 make dashboard`
1 parent 82eaf0c commit 6132345

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

mrq/config.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,20 @@ def add_parser_args(parser, config_type):
223223
action="store",
224224
help='Default queue for dashboard actions.')
225225

226+
parser.add_argument(
227+
'--dashboard_port',
228+
default=5555,
229+
action="store",
230+
type=int,
231+
help='Use this port for mrq-dashboard. 5555 by default.')
232+
233+
parser.add_argument(
234+
'--dashboard_ip',
235+
default="0.0.0.0",
236+
action="store",
237+
type=str,
238+
help='Bind the dashboard to this IP. Default is "0.0.0.0", use "127.0.0.1" to restrict access.')
239+
226240
# Worker-specific args
227241

228242
elif config_type == "worker":

mrq/dashboard/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ def api_logs():
324324

325325
def main():
326326
app.debug = True
327-
run_simple('0.0.0.0', int(os.environ.get("PORT", 5555)), app)
327+
run_simple(cfg["dashboard_ip"], int(cfg["dashboard_port"]), app)
328328

329329

330330
if __name__ == '__main__':

0 commit comments

Comments
 (0)