(directory, config, cfd_args=["run"], cfd_pre_args=["tunnel"], new_process=False,
allow_input=False, capture_output=True, root=False, skip_config_flag=False, expect_success=True)
| 107 | |
| 108 | |
| 109 | def start_cloudflared(directory, config, cfd_args=["run"], cfd_pre_args=["tunnel"], new_process=False, |
| 110 | allow_input=False, capture_output=True, root=False, skip_config_flag=False, expect_success=True): |
| 111 | |
| 112 | config_path = None |
| 113 | if not skip_config_flag: |
| 114 | config_path = write_config(directory, config.full_config) |
| 115 | |
| 116 | cmd = cloudflared_cmd(config, config_path, cfd_args, cfd_pre_args, root) |
| 117 | |
| 118 | if new_process: |
| 119 | return run_cloudflared_background(cmd, allow_input, capture_output) |
| 120 | # By setting check=True, it will raise an exception if the process exits with non-zero exit code |
| 121 | return subprocess.run(cmd, check=expect_success, capture_output=capture_output) |
| 122 | |
| 123 | def cloudflared_cmd(config, config_path, cfd_args, cfd_pre_args, root): |
| 124 | cmd = [] |
searching dependent graphs…