ZeroNet Proxy¶
The darc.proxy.zeronet module contains the auxiliary functions
around managing and processing the ZeroNet proxy.
-
darc.proxy.zeronet._zeronet_bootstrap()[source]¶ ZeroNet bootstrap.
The bootstrap arguments are defined as
_ZERONET_ARGS.- Raises
subprocess.CalledProcessError – If the return code of
_ZERONET_PROCis non-zero.
-
darc.proxy.zeronet.zeronet_bootstrap()[source]¶ Bootstrap wrapper for ZeroNet.
The function will bootstrap the ZeroNet proxy. It will retry for
ZERONET_RETRYtimes in case of failure.Also, it will NOT re-bootstrap the proxy as is guaranteed by
_ZERONET_BS_FLAG.- Warns
ZeroNetBootstrapFailed – If failed to bootstrap ZeroNet proxy.
- Raises
UnsupportedPlatform – If the system is not supported, i.e. not macOS or Linux.
The following constants are configuration through environment variables:
-
darc.proxy.zeronet.ZERONET_RETRY: int¶ Retry times for ZeroNet bootstrap when failure.
- Default
3- Environ
-
darc.proxy.zeronet.BS_WAIT: float¶ Time after which the attempt to start ZeroNet is aborted.
- Default
90- Environ
ZERONET_WAIT
Note
If not provided, there will be NO timeouts.
-
darc.proxy.zeronet.ZERONET_PATH: str¶ Path to the ZeroNet project.
- Default
/usr/local/src/zeronet- Environ
-
darc.proxy.zeronet.ZERONET_ARGS: List[str]¶ ZeroNet bootstrap arguments for
run.sh start.If provided, it should be parsed as command line arguments (c.f.
shlex.split()).- Default
''- Environ
Note
The command will be run as
DARC_USER, if current user (c.f.getpass.getuser()) is root.
The following constants are defined for internal usage:
-
darc.proxy.zeronet._MNG_ZERONET: bool¶ If manage ZeroNet proxy through
darc.- Default
- Environ
DARC_ZERONET
-
darc.proxy.zeronet._ZERONET_PROC: subprocess.Popen¶ ZeroNet proxy process running in the background.