| 94 | |
| 95 | |
| 96 | def configure_apps_script(cfg: dict) -> dict: |
| 97 | print() |
| 98 | print(bold("Google Apps Script setup")) |
| 99 | print(dim(" 1. Open https://script.google.com -> New project")) |
| 100 | print(dim(" 2. Paste apps_script/Code.gs from this repo into the editor")) |
| 101 | print(dim(" 3. Set AUTH_KEY in Code.gs to the password below")) |
| 102 | print(dim(" 4. Deploy -> New deployment -> Web app")) |
| 103 | print(dim(" Execute as: Me | Who has access: Anyone")) |
| 104 | print(dim(" 5. Copy the Deployment ID and paste it here")) |
| 105 | print() |
| 106 | |
| 107 | ids_raw = prompt( |
| 108 | "Deployment ID(s) - comma-separated for load balancing", |
| 109 | default=None, |
| 110 | ) |
| 111 | ids = [x.strip() for x in ids_raw.split(",") if x.strip()] |
| 112 | if len(ids) == 1: |
| 113 | cfg["script_id"] = ids[0] |
| 114 | cfg.pop("script_ids", None) |
| 115 | else: |
| 116 | cfg["script_ids"] = ids |
| 117 | cfg.pop("script_id", None) |
| 118 | return cfg |
| 119 | |
| 120 | |
| 121 | def configure_network(cfg: dict) -> dict: |