octoprint.cli.server#
daemon_options = bulk_options([click.option('--pid', type=click.Path(), default='/tmp/octoprint.pid', callback=set_ctx_obj_option, help='Pidfile to use for daemonizing.')])
module-attribute
#
Decorator to add the options for the daemon subcommand: --pid
.
server_options = bulk_options([click.option('--host', type=click.STRING, callback=set_ctx_obj_option, help='Specify the host address on which to bind the server.'), click.option('--port', type=click.INT, callback=set_ctx_obj_option, help='Specify the port on which to bind the server.'), click.option('-4', '--ipv4', 'v4', is_flag=True, callback=set_ctx_obj_option, help="Bind to IPv4 addresses only. Implies '--host 0.0.0.0'. Silently ignored if -6 is present."), click.option('-6', '--ipv6', 'v6', is_flag=True, callback=set_ctx_obj_option, help='Bind to IPv6 addresses only. Disables dual stack when binding to any v6 addresses. Silently ignored if -4 is present.'), click.option('--logging', type=click.Path(), callback=set_ctx_obj_option, help='Specify the config file to use for configuring logging.'), click.option('--iknowwhatimdoing', 'allow_root', is_flag=True, callback=set_ctx_obj_option, help='Allow OctoPrint to run as user root.'), click.option('--debug', is_flag=True, callback=set_ctx_obj_option, help='Enable debug mode.'), click.option('--ignore-blacklist', 'ignore_blacklist', is_flag=True, callback=set_ctx_obj_option, help='Disable processing of the plugin blacklist.')])
module-attribute
#
Decorator to add the options shared among the server commands: --host
, --port
, -4
, -6
--logging
, --iknowwhatimdoing
and --debug
.
daemon_command(ctx, command, **kwargs)
#
Starts, stops or restarts in daemon mode.
Please note that daemon mode is not supported under Windows and MacOSX right now.
enable_safemode(ctx, **kwargs)
#
Sets the safe mode flag for the next start.
run_server(basedir, configfile, host, port, v6_only, debug, allow_root, logging_config, verbosity, safe_mode, ignore_blacklist, octoprint_daemon = None, overlays = None, disable_color = False)
#
Initializes the environment and starts up the server.
serve_command(ctx, **kwargs)
#
Starts the OctoPrint server.