Skip to content

octoprint.schema.config.server#

CommandsConfig #

Bases: BaseModel

localPipCommand: Optional[str] = None class-attribute instance-attribute #

pip command associated with OctoPrint, used for installing plugins and updates, if unset (default) the command will be autodetected based on the current python executable - unless you have a really special setup this is the right way to do it and there should be no need to ever touch this setting.

serverRestartCommand: Optional[str] = None class-attribute instance-attribute #

Command to restart OctoPrint.

systemRestartCommand: Optional[str] = None class-attribute instance-attribute #

Command to restart the system OctoPrint is running on.

systemShutdownCommand: Optional[str] = None class-attribute instance-attribute #

Command to shut down the system OctoPrint is running on.

CookiesConfig #

Bases: BaseModel

samesite: SameSiteEnum = SameSiteEnum.lax class-attribute instance-attribute #

SameSite setting to use on the cookies. Possible values are None, Lax and Strict. Defaults to Lax. Be advised that if forced unset, this has security implications as many browsers now default to Lax unless you configure cookies to be set with Secure flag set, explicitly set SameSite setting here and also serve OctoPrint over https. The Lax setting is known to cause with embedding OctoPrint in frames. See also "Feature: Cookies default to SameSite=Lax", "Feature: Reject insecure SameSite=None cookies" and issue #3482.

secure: bool = False class-attribute instance-attribute #

Whether to set the Secure flag to true on cookies. Only set to true if you are running OctoPrint behind a reverse proxy taking care of SSL termination.

DiskspaceConfig #

Bases: BaseModel

critical: int = CONST_200MB class-attribute instance-attribute #

Threshold (bytes) after which to consider disk space becoming critical, defaults to 200MB.

warning: int = CONST_500MB class-attribute instance-attribute #

Threshold (bytes) after which to consider disk space becoming sparse, defaults to 500MB.

IpCheckConfig #

Bases: BaseModel

enabled: bool = True class-attribute instance-attribute #

Whether to enable the check.

trustedSubnets: List[str] = [] class-attribute instance-attribute #

Additional non-local subnets to consider trusted, in CIDR notation, e.g. 192.168.1.0/24.

OnlineCheckConfig #

Bases: BaseModel

enabled: Optional[bool] = None class-attribute instance-attribute #

Whether the online check is enabled. Ships unset, the user will be asked to make a decision as part of the setup wizard.

host: str = '1.1.1.1' class-attribute instance-attribute #

DNS host against which to check, defaults to Cloudflare's DNS.

interval: int = CONST_15MIN class-attribute instance-attribute #

Interval in which to check for online connectivity (in seconds), defaults to 15 minutes.

name: str = 'octoprint.org' class-attribute instance-attribute #

Host name for which to check name resolution, defaults to OctoPrint's main domain.

port: int = 53 class-attribute instance-attribute #

DNS port against which to check, defaults to the standard DNS port.

PluginBlacklistConfig #

Bases: BaseModel

enabled: Optional[bool] = None class-attribute instance-attribute #

Whether use of the blacklist is enabled. If unset, the user will be asked to make a decision as part of the setup wizard.

timeout: float = 3.05 class-attribute instance-attribute #

Timeout for fetching the blacklist, in seconds (default: 3.05 seconds).

ttl: int = CONST_15MIN class-attribute instance-attribute #

Time to live of the cached blacklist, in seconds (default: 15 minutes).

url: str = 'https://plugins.octoprint.org/blacklist.json' class-attribute instance-attribute #

The URL from which to fetch the blacklist.

PreemptiveCacheConfig #

Bases: BaseModel

exceptions: List[str] = [] class-attribute instance-attribute #

Which server paths to exclude from the preemptive cache, e.g. /some/path.

until: int = 7 class-attribute instance-attribute #

How many days to leave unused entries in the preemptive cache config.

ReverseProxyConfig #

Bases: BaseModel

hostFallback: Optional[str] = None class-attribute instance-attribute #

Use this option to define an optional forced host under which to run OctoPrint. This should only be needed if you want to run OctoPrint behind a reverse proxy with a different hostname than OctoPrint itself but can't configure said reverse proxy to send a host HTTP header (X-Forwarded-Host by default, see above) with forwarded requests.

hostHeader: Optional[str] = None class-attribute instance-attribute #

The request header from which to determine the host under which OctoPrint is served by the reverse proxy.

prefixFallback: Optional[str] = None class-attribute instance-attribute #

Use this option to define an optional URL prefix (with a leading /, so absolute to your server's root) under which to run OctoPrint. This should only be needed if you want to run OctoPrint behind a reverse proxy under a different root endpoint than / and can't configure said reverse proxy to send a prefix HTTP header (X-Script-Name by default, see above) with forwarded requests.

prefixHeader: Optional[str] = None class-attribute instance-attribute #

The request header from which to determine the URL prefix under which OctoPrint is served by the reverse proxy.

schemeFallback: Optional[str] = None class-attribute instance-attribute #

Use this option to define an optional forced scheme (http or https) under which to run OctoPrint. This should only be needed if you want to run OctoPrint behind a reverse proxy that also does HTTPS determination but can't configure said reverse proxy to send a scheme HTTP header (X-Scheme by default, see above) with forwarded requests.

schemeHeader: Optional[str] = None class-attribute instance-attribute #

The request header from which to determine the scheme (http or https) under which a specific request to OctoPrint was made to the reverse proxy.

trustedDownstream: List[str] = [] class-attribute instance-attribute #

List of trusted downstream servers for which to ignore the IP address when trying to determine the connecting client's IP address. If you have OctoPrint behind more than one reverse proxy you should add their IPs here so that they won't be interpreted as the client's IP. One reverse proxy will be handled correctly by default.

ServerConfig #

Bases: BaseModel

allowFraming: bool = False class-attribute instance-attribute #

Whether to allow OctoPrint to be embedded in a frame or not. Note that depending on your setup you might have to set SameSite to None, Secure to true and serve OctoPrint through a reverse proxy that enables https for cookies and thus logging in to work.

allowedLoginRedirectPaths: List[str] = [] class-attribute instance-attribute #

List of paths that are allowed to be used as redirect targets for the login page, in addition to the default ones (/, /recovery/ and /plugin/appkeys/auth/)

commands: CommandsConfig = CommandsConfig() class-attribute instance-attribute #

Commands to restart/shutdown octoprint or the system it's running on.

cookies: CookiesConfig = CookiesConfig() class-attribute instance-attribute #

Settings for further configuration of the cookies that OctoPrint sets (login, remember me, ...).

diskspace: DiskspaceConfig = DiskspaceConfig() class-attribute instance-attribute #

Settings of when to display what disk space warning.

firstRun: bool = True class-attribute instance-attribute #

If this option is true, OctoPrint will show the First Run wizard and set the setting to false after that completes.

host: Optional[str] = None class-attribute instance-attribute #

Use this option to define the host to which to bind the server. If unset, OctoPrint will attempt to bind on all available interfaces, IPv4 and v6 unless either is disabled.

ignoreIncompleteStartup: bool = False class-attribute instance-attribute #

Set this to true to make OctoPrint ignore incomplete startups. Helpful for development.

ipCheck: IpCheckConfig = IpCheckConfig() class-attribute instance-attribute #

Configuration of the client IP check to warn about connections from external networks.

maxSize: int = CONST_100KB class-attribute instance-attribute #

Maximum size of requests other than file uploads in bytes, defaults to 100KB.

onlineCheck: OnlineCheckConfig = OnlineCheckConfig() class-attribute instance-attribute #

Configuration of the regular online connectivity check.

pluginBlacklist: PluginBlacklistConfig = PluginBlacklistConfig() class-attribute instance-attribute #

Configuration of the plugin blacklist.

port: int = 5000 class-attribute instance-attribute #

Use this option to define the port to which to bind the server.

preemptiveCache: PreemptiveCacheConfig = PreemptiveCacheConfig() class-attribute instance-attribute #

Configuration of the preemptive cache.

reverseProxy: ReverseProxyConfig = ReverseProxyConfig() class-attribute instance-attribute #

Settings if OctoPrint is running behind a reverse proxy (haproxy, nginx, apache, ...) that doesn't correctly set the required headers. These are necessary in order to make OctoPrint generate correct external URLs so that AJAX requests and download URLs work, and so that client IPs are read correctly.

secretKey: Optional[str] = None class-attribute instance-attribute #

Secret key for encrypting cookies and such, randomly generated on first run.

startOnceInSafeMode: bool = False class-attribute instance-attribute #

If this option is true, OctoPrint will enable safe mode on the next server start and reset the setting to false

uploads: UploadsConfig = UploadsConfig() class-attribute instance-attribute #

Settings for file uploads to OctoPrint, such as maximum allowed file size and header suffixes to use for streaming uploads. OctoPrint does some nifty things internally in order to allow streaming of large file uploads to the application rather than just storing them in memory. For that it needs to do some rewriting of the incoming upload HTTP requests, storing the uploaded file to a temporary location on disk and then sending an internal request to the application containing the original filename and the location of the temporary file.

UploadsConfig #

Bases: BaseModel

maxSize: int = CONST_1GB class-attribute instance-attribute #

Maximum size of uploaded files in bytes, defaults to 1GB.

nameSuffix: str = 'name' class-attribute instance-attribute #

Suffix used for storing the filename in the file upload headers when streaming uploads.

pathSuffix: str = 'path' class-attribute instance-attribute #

Suffix used for storing the path to the temporary file in the file upload headers when streaming uploads.