vortex-cli 8.4.2__tar.gz → 8.5.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/PKG-INFO +24 -3
  2. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/README.md +23 -2
  3. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/pyproject.toml +1 -1
  4. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/cli.py +2 -1
  5. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/commands/servers.py +10 -1
  6. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/commands/watch.py +1 -0
  7. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/models.py +10 -3
  8. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/server_options.py +10 -1
  9. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/webdesign.py +38 -9
  10. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/workspace.py +56 -2
  11. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex_cli.egg-info/PKG-INFO +24 -3
  12. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/LICENSE +0 -0
  13. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/setup.cfg +0 -0
  14. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/__init__.py +0 -0
  15. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/__main__.py +0 -0
  16. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/colour.py +0 -0
  17. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/commands/__init__.py +0 -0
  18. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/commands/agenda.py +0 -0
  19. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/commands/app.py +0 -0
  20. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/commands/clean.py +0 -0
  21. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/commands/clone.py +0 -0
  22. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/commands/code.py +0 -0
  23. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/commands/compile.py +0 -0
  24. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/commands/db.py +0 -0
  25. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/commands/diff.py +0 -0
  26. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/commands/docs.py +0 -0
  27. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/commands/execute.py +0 -0
  28. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/commands/fetch.py +0 -0
  29. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/commands/file.py +0 -0
  30. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/commands/info.py +0 -0
  31. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/commands/keyword.py +0 -0
  32. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/commands/libs.py +0 -0
  33. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/commands/log.py +0 -0
  34. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/commands/object_.py +0 -0
  35. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/commands/pull.py +0 -0
  36. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/commands/search.py +0 -0
  37. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/commands/stats.py +0 -0
  38. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/commands/use.py +0 -0
  39. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/commands/weblog.py +0 -0
  40. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/constants.py +0 -0
  41. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/docs/Blackbook v2.md +0 -0
  42. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/docs/Blackbook.pdf +0 -0
  43. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/docs/index.html +0 -0
  44. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/docs/marked.min.js +0 -0
  45. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/git.py +0 -0
  46. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/lib/puakma-6.0.40.jar +0 -0
  47. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/libs.py +0 -0
  48. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/logging.py +0 -0
  49. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/main.py +0 -0
  50. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/output.py +0 -0
  51. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/registry.py +0 -0
  52. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/schedule.py +0 -0
  53. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/session_store.py +0 -0
  54. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/soap.py +0 -0
  55. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/spinner.py +0 -0
  56. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/sync.py +0 -0
  57. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex/util.py +0 -0
  58. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex_cli.egg-info/SOURCES.txt +0 -0
  59. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex_cli.egg-info/dependency_links.txt +0 -0
  60. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex_cli.egg-info/entry_points.txt +0 -0
  61. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex_cli.egg-info/requires.txt +0 -0
  62. {vortex_cli-8.4.2 → vortex_cli-8.5.0}/vortex_cli.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vortex_cli
3
- Version: 8.4.2
3
+ Version: 8.5.0
4
4
  Summary: Vortex CLI
5
5
  Author-email: Jordan Amos <jordan.amos@gmail.com>
6
6
  License: MIT License
@@ -87,14 +87,15 @@ While it is possible to use without it, this software has been purposefully desi
87
87
 
88
88
  ```
89
89
  [DEFAULT] ; This section is optional and only useful if you have multiple definitions
90
- port = 80 ; Options provided under DEFAULT will be applied to all definitions if not provided
90
+ scheme = https ; Options provided under DEFAULT will be applied to all definitions if not provided
91
91
  soap_path = system/SOAPDesigner.pma
92
92
  default = server1 ; Useful when you have multiple definitions
93
93
 
94
94
 
95
95
  [server1] ; This can be called whatever you want and can be referenced using the '--server' flag
96
96
  host = example.com
97
- port = 8080 ; we can overwrite the DEFAULT value
97
+ scheme = http ; Optional - https (the default) or http, for a server that only speaks plain HTTP. We can overwrite the DEFAULT value
98
+ port = 8080 ; Optional - unset = the scheme's port: 443 for https, 80 for http
98
99
  username = myuser ; Optional - Prompted at runtime if not provided
99
100
  password = mypassword ; Optional - Prompted at runtime if not provided
100
101
  ; Optional
@@ -106,6 +107,26 @@ While it is possible to use without it, this software has been purposefully desi
106
107
  java_environment_name = JavaSE-17 ; Java Execution Environment name https://docs.osgi.org/reference/eenames.html
107
108
  ```
108
109
 
110
+ ## Upgrading to 8.5
111
+
112
+ - **HTTPS is the default.** A new per-server option `scheme` (`https`, the default, or
113
+ `http`) picks how vortex talks to the server, and an unset `port` now follows it: 443 for
114
+ https, 80 for http (`port` is no longer required). An explicit `port` is always honoured.
115
+ - **Action needed for plain-HTTP servers:** add `scheme = http` to each one. A config that
116
+ only says `port = 80` (often under `[DEFAULT]`) would now mean https on port 80, which
117
+ cannot work, so vortex refuses it with the fix: *"server 'x' uses https (the default since
118
+ 8.5) on port 80 (from [DEFAULT]) ... add 'scheme = http' to [x]; for HTTPS remove 'port'
119
+ ... or set 'port = 443'"*. For an HTTPS server, drop `port = 80` from `[DEFAULT]` (or
120
+ override it with `port = 443`).
121
+ - **A redirect to https says so.** A server that redirects plain HTTP to HTTPS (e.g. behind
122
+ Cloudflare) used to be reported as *"answered ... with a page instead of JSON - the
123
+ credentials were not accepted"*. It now reads *"HTTP 301 from <url>: the server redirects
124
+ to https (...) - set 'scheme = https' (port 443, or remove 'port') for '<server>' in
125
+ servers.ini"*. A real 401/403 still gives the credentials hint.
126
+ - `app list --open-urls` / `--open-dev-urls` and `clone --open-urls` open `https://` links.
127
+ - `vortex server list` shows each server's scheme; `vortex server get` shows the port an unset
128
+ `port` resolves to (`https default` / `http default`).
129
+
109
130
  ## Upgrading to 8.4
110
131
 
111
132
  - **`vortex stats` shows the server's disk space** after the statistics: each mounted local
@@ -43,14 +43,15 @@ While it is possible to use without it, this software has been purposefully desi
43
43
 
44
44
  ```
45
45
  [DEFAULT] ; This section is optional and only useful if you have multiple definitions
46
- port = 80 ; Options provided under DEFAULT will be applied to all definitions if not provided
46
+ scheme = https ; Options provided under DEFAULT will be applied to all definitions if not provided
47
47
  soap_path = system/SOAPDesigner.pma
48
48
  default = server1 ; Useful when you have multiple definitions
49
49
 
50
50
 
51
51
  [server1] ; This can be called whatever you want and can be referenced using the '--server' flag
52
52
  host = example.com
53
- port = 8080 ; we can overwrite the DEFAULT value
53
+ scheme = http ; Optional - https (the default) or http, for a server that only speaks plain HTTP. We can overwrite the DEFAULT value
54
+ port = 8080 ; Optional - unset = the scheme's port: 443 for https, 80 for http
54
55
  username = myuser ; Optional - Prompted at runtime if not provided
55
56
  password = mypassword ; Optional - Prompted at runtime if not provided
56
57
  ; Optional
@@ -62,6 +63,26 @@ While it is possible to use without it, this software has been purposefully desi
62
63
  java_environment_name = JavaSE-17 ; Java Execution Environment name https://docs.osgi.org/reference/eenames.html
63
64
  ```
64
65
 
66
+ ## Upgrading to 8.5
67
+
68
+ - **HTTPS is the default.** A new per-server option `scheme` (`https`, the default, or
69
+ `http`) picks how vortex talks to the server, and an unset `port` now follows it: 443 for
70
+ https, 80 for http (`port` is no longer required). An explicit `port` is always honoured.
71
+ - **Action needed for plain-HTTP servers:** add `scheme = http` to each one. A config that
72
+ only says `port = 80` (often under `[DEFAULT]`) would now mean https on port 80, which
73
+ cannot work, so vortex refuses it with the fix: *"server 'x' uses https (the default since
74
+ 8.5) on port 80 (from [DEFAULT]) ... add 'scheme = http' to [x]; for HTTPS remove 'port'
75
+ ... or set 'port = 443'"*. For an HTTPS server, drop `port = 80` from `[DEFAULT]` (or
76
+ override it with `port = 443`).
77
+ - **A redirect to https says so.** A server that redirects plain HTTP to HTTPS (e.g. behind
78
+ Cloudflare) used to be reported as *"answered ... with a page instead of JSON - the
79
+ credentials were not accepted"*. It now reads *"HTTP 301 from <url>: the server redirects
80
+ to https (...) - set 'scheme = https' (port 443, or remove 'port') for '<server>' in
81
+ servers.ini"*. A real 401/403 still gives the credentials hint.
82
+ - `app list --open-urls` / `--open-dev-urls` and `clone --open-urls` open `https://` links.
83
+ - `vortex server list` shows each server's scheme; `vortex server get` shows the port an unset
84
+ `port` resolves to (`https default` / `http default`).
85
+
65
86
  ## Upgrading to 8.4
66
87
 
67
88
  - **`vortex stats` shows the server's disk space** after the statistics: each mounted local
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
5
5
 
6
6
  [project]
7
7
  name = "vortex_cli"
8
- version = "8.4.2"
8
+ version = "8.5.0"
9
9
  description = "Vortex CLI"
10
10
  requires-python = ">=3.10"
11
11
  readme = { file = "README.md", content-type = "text/markdown" }
@@ -862,7 +862,8 @@ def add_server_parser(command_parser: _SubParsersAction[ArgumentParser]) -> None
862
862
  "get",
863
863
  help=(
864
864
  "Show a server's every option, its value and where it comes from "
865
- "(no request)"
865
+ "(no request). scheme defaults to https, and an unset port to the "
866
+ "scheme's (443 / 80)"
866
867
  ),
867
868
  )
868
869
  get_parser.add_argument(
@@ -22,6 +22,7 @@ from vortex.output import envelope
22
22
  from vortex.output import render_kv
23
23
  from vortex.output import render_table
24
24
  from vortex.output import report_error
25
+ from vortex.server_options import DEFAULT_PORTS
25
26
  from vortex.server_options import DEFAULT_SERVER_OPTION
26
27
  from vortex.server_options import LEGACY_OPTIONS
27
28
  from vortex.server_options import OPTIONS_BY_NAME
@@ -110,6 +111,8 @@ def server_rows(workspace: Workspace) -> list[dict[str, Any]]:
110
111
  else:
111
112
  row.update(
112
113
  {
114
+ "scheme": server.scheme,
115
+ "port": str(server.port),
113
116
  "backend": server.backend_label,
114
117
  "gateway_path": server.gateway_path,
115
118
  "webdesign_path": server.webdesign_path,
@@ -157,7 +160,8 @@ def servers(workspace: Workspace, *, json_output: bool = False) -> int:
157
160
  table.append(
158
161
  [
159
162
  row["name"] + (" *" if row["default"] else ""),
160
- f"{row['host']}:{row['port']}" if row["port"] else row["host"],
163
+ (f"{row['scheme']}://" if row.get("scheme") else "")
164
+ + (f"{row['host']}:{row['port']}" if row["port"] else row["host"]),
161
165
  backend,
162
166
  "yes" if protected is True else "no" if protected is False else "",
163
167
  row["clones"],
@@ -279,6 +283,11 @@ def show_data(workspace: Workspace, name: str | None) -> dict[str, Any]:
279
283
  if opt.secret
280
284
  else f"{opt.name}: {e}"
281
285
  )
286
+ if opt.name == "port" and source == "unset":
287
+ # an unset port follows the scheme
288
+ scheme = _value(config, name, "scheme").strip().lower() or "https"
289
+ if scheme in DEFAULT_PORTS:
290
+ source, value = f"{scheme} default", str(DEFAULT_PORTS[scheme])
282
291
  if opt.required and not value.strip():
283
292
  problems.append(f"{opt.name} is required")
284
293
  shown = ("<set>" if value else "") if opt.secret else _one_line(value)
@@ -45,6 +45,7 @@ _CLASS_EXT = ".class"
45
45
  _CONNECTION_OPTIONS = (
46
46
  "host",
47
47
  "port",
48
+ "scheme",
48
49
  "username",
49
50
  "password",
50
51
  "gateway_path",
@@ -233,10 +233,14 @@ class PuakmaServer:
233
233
  password: str | None = None,
234
234
  protected: bool = False,
235
235
  gateway_path: str | None = None,
236
+ scheme: str = "https",
236
237
  ) -> None:
237
238
  self.name = name
238
239
  self._host = host
239
240
  self._port = port
241
+ # A server that redirects http -> https answers a redirect page, not
242
+ # the gateway's JSON, so the scheme must be right up front
243
+ self.scheme = scheme
240
244
  self.soap_path = soap_path
241
245
  self.webdesign_path = webdesign_path
242
246
  # Protected servers are skipped by 'vortex watch' unless
@@ -406,7 +410,7 @@ class PuakmaServer:
406
410
  return f"{self}/{self.gateway_path}"
407
411
 
408
412
  def __str__(self) -> str:
409
- return f"http://{self.host}:{self.port}"
413
+ return f"{self.scheme}://{self.host}:{self.port}"
410
414
 
411
415
  def __enter__(self) -> PuakmaServer:
412
416
  self.ensure_credentials()
@@ -517,11 +521,14 @@ class PuakmaApplication:
517
521
  @property
518
522
  def url(self) -> str:
519
523
  base = f"{self.host}/{self.group}" if self.group else self.host
520
- return f"http://{base}/{self.name}.pma"
524
+ # Browser links: https, the default scheme. An app only knows its
525
+ # host, not its server's scheme - an http-only server redirects or
526
+ # refuses, so the user sees why
527
+ return f"https://{base}/{self.name}.pma"
521
528
 
522
529
  @property
523
530
  def web_design_url(self) -> str:
524
- base_url = f"http://{self.host}/system/webdesign.pma"
531
+ base_url = f"https://{self.host}/system/webdesign.pma"
525
532
  return f"{base_url}/DesignList?OpenPage&AppID={self.id}"
526
533
 
527
534
  @classmethod
@@ -25,7 +25,12 @@ SERVER_OPTIONS: tuple[ServerOption, ...] = (
25
25
  ServerOption(
26
26
  "host", "The server's host name, unique across servers", required=True
27
27
  ),
28
- ServerOption("port", "The HTTP port", required=True),
28
+ ServerOption("port", "The port; unset = the scheme's (443 for https, 80 for http)"),
29
+ ServerOption(
30
+ "scheme",
31
+ "https (the default) or http, for a server that only speaks plain HTTP",
32
+ default="https",
33
+ ),
29
34
  ServerOption(
30
35
  "username",
31
36
  "Else VORTEX_USERNAME_<NAME>, VORTEX_USERNAME, or a prompt",
@@ -67,6 +72,10 @@ SERVER_OPTIONS: tuple[ServerOption, ...] = (
67
72
 
68
73
  OPTIONS_BY_NAME = {o.name: o for o in SERVER_OPTIONS}
69
74
 
75
+ SCHEMES = ("https", "http")
76
+ # the port an unset 'port' means for each scheme
77
+ DEFAULT_PORTS = {"https": 443, "http": 80}
78
+
70
79
  # [DEFAULT]-only: the server 'vortex use' set
71
80
  DEFAULT_SERVER_OPTION = "default"
72
81
 
@@ -281,7 +281,30 @@ def _refusal(resp: httpx.Response, url: str) -> GatewayRefused | None:
281
281
  )
282
282
 
283
283
 
284
- def _parse(resp: httpx.Response, url: str, access_hint: str) -> Any:
284
+ def _https_redirect(
285
+ resp: httpx.Response, url: str, server_name: str | None
286
+ ) -> str | None:
287
+ """
288
+ What to say when an http:// request was redirected to https:// (a
289
+ proxy such as Cloudflare upgrading plain HTTP), else None. Without it
290
+ the redirect read as "credentials not accepted", which they never were.
291
+ """
292
+ location = resp.headers.get("location", "")
293
+ where = f"'{server_name}'" if server_name else "this server"
294
+ if not url.lower().startswith("http://"):
295
+ return None
296
+ if not location.lower().startswith("https://"):
297
+ return None
298
+ return (
299
+ f"HTTP {resp.status_code} from {url}: the server redirects to https "
300
+ f"({location}) - set 'scheme = https' (port 443, or remove 'port') "
301
+ f"for {where} in servers.ini"
302
+ )
303
+
304
+
305
+ def _parse(
306
+ resp: httpx.Response, url: str, access_hint: str, server_name: str | None = None
307
+ ) -> Any:
285
308
  """
286
309
  The JSON body of a vortex reply, the string "Success" for a DELETE,
287
310
  or an exception that says which failure mode it was. A gateway
@@ -300,7 +323,13 @@ def _parse(resp: httpx.Response, url: str, access_hint: str) -> Any:
300
323
  "route (update system/webdesign)"
301
324
  )
302
325
  raise WebDesignError(text.strip() or f"HTTP 404 from {url}", "NOT_FOUND")
303
- if resp.status_code in (401, 403) or 300 <= resp.status_code < 400:
326
+ if 300 <= resp.status_code < 400:
327
+ redirect = _https_redirect(resp, url, server_name)
328
+ if redirect is not None:
329
+ raise WebDesignUnavailable(redirect, "UNAVAILABLE")
330
+ # Puakma redirects an unauthenticated request to its login page
331
+ raise WebDesignUnavailable(access_hint, "FORBIDDEN")
332
+ if resp.status_code in (401, 403):
304
333
  raise WebDesignUnavailable(access_hint, "FORBIDDEN")
305
334
  if resp.status_code != 200:
306
335
  raise WebDesignError(f"HTTP {resp.status_code} from {url}: {text.strip()}")
@@ -384,7 +413,7 @@ class WebDesignClient:
384
413
  )
385
414
  except httpx.HTTPError as e:
386
415
  raise WebDesignUnavailable(f"request failed: {e} ({url})") from e
387
- return _parse(resp, url, self._access_hint)
416
+ return _parse(resp, url, self._access_hint, self.server.name)
388
417
 
389
418
  async def _arequest(
390
419
  self,
@@ -401,7 +430,7 @@ class WebDesignClient:
401
430
  )
402
431
  except httpx.HTTPError as e:
403
432
  raise WebDesignUnavailable(f"request failed: {e} ({url})") from e
404
- return _parse(resp, url, self._access_hint)
433
+ return _parse(resp, url, self._access_hint, self.server.name)
405
434
 
406
435
  # -- applications --------------------------------------------------
407
436
 
@@ -862,7 +891,7 @@ class GatewayClient(WebDesignClient):
862
891
  resp = self.server._client.get(url, timeout=timeout)
863
892
  except httpx.HTTPError as e:
864
893
  raise WebDesignUnavailable(f"request failed: {e} ({url})") from e
865
- reply = _as_dict(_parse(resp, url, self._access_hint))
894
+ reply = _as_dict(_parse(resp, url, self._access_hint, self.server.name))
866
895
  try:
867
896
  gateway = reply.get("gateway") or {}
868
897
  server = reply.get("server") or {}
@@ -1154,7 +1183,7 @@ class GatewayClient(WebDesignClient):
1154
1183
  if resp.status_code == 200 and resp.content.startswith(_ZIP_MAGIC):
1155
1184
  return resp.content
1156
1185
  # a refusal/login page/error text - never an archive
1157
- _parse(resp, url, self._access_hint)
1186
+ _parse(resp, url, self._access_hint, self.server.name)
1158
1187
  raise WebDesignUnavailable(
1159
1188
  f"export on '{self.server.name}' did not return an archive for "
1160
1189
  f"application [{app_id}] (HTTP {resp.status_code})"
@@ -1196,7 +1225,7 @@ class GatewayClient(WebDesignClient):
1196
1225
  )
1197
1226
  except httpx.HTTPError as e:
1198
1227
  raise WebDesignUnavailable(f"request failed: {e} ({url})") from e
1199
- return _as_dict(_parse(resp, url, self._access_hint))
1228
+ return _as_dict(_parse(resp, url, self._access_hint, self.server.name))
1200
1229
 
1201
1230
  # -- files (Admin): the filesystem below the Puakma root -----------
1202
1231
 
@@ -1249,7 +1278,7 @@ class GatewayClient(WebDesignClient):
1249
1278
  ):
1250
1279
  # a refusal, a login page or an error - never the file
1251
1280
  resp.read()
1252
- _parse(resp, url, self._access_hint)
1281
+ _parse(resp, url, self._access_hint, self.server.name)
1253
1282
  raise WebDesignUnavailable(
1254
1283
  f"'{self.server.name}' did not send the file "
1255
1284
  f"(HTTP {resp.status_code}, {content_type or 'no content type'})"
@@ -1309,7 +1338,7 @@ class GatewayClient(WebDesignClient):
1309
1338
  )
1310
1339
  except httpx.HTTPError as e:
1311
1340
  raise WebDesignUnavailable(f"request failed: {e} ({url})") from e
1312
- reply = _as_dict(_parse(resp, url, self._access_hint))
1341
+ reply = _as_dict(_parse(resp, url, self._access_hint, self.server.name))
1313
1342
  if not isinstance(reply.get("files"), list):
1314
1343
  raise WebDesignUnavailable(f"Malformed files reply from {url}")
1315
1344
  reply.pop("ok", None)
@@ -24,7 +24,9 @@ from vortex.models import DesignObjectNotFound
24
24
  from vortex.models import DesignType
25
25
  from vortex.models import PuakmaApplication
26
26
  from vortex.models import PuakmaServer
27
+ from vortex.server_options import DEFAULT_PORTS
27
28
  from vortex.server_options import OPTIONS_BY_NAME
29
+ from vortex.server_options import SCHEMES
28
30
  from vortex.server_options import ServersConfig
29
31
  from vortex.server_options import secret_interpolation_error
30
32
  from vortex.session_store import SessionStore
@@ -52,9 +54,12 @@ SAMPLE_CONFIG = """\
52
54
  # Each server's puakma.jar and shared libraries are downloaded from the
53
55
  # server itself (see 'vortex server libs') - 'lib_path' is only for extra local
54
56
  # jars to add to the classpath.
57
+ # 'scheme' is https by default; set 'scheme = http' for a server that only
58
+ # speaks plain HTTP. 'port' unset = the scheme's port (443 / 80).
55
59
  [dev]
56
60
  host =
57
- port = 80
61
+ scheme = https
62
+ port =
58
63
  username =
59
64
  password =
60
65
  soap_path = system/SOAPDesigner.pma
@@ -648,7 +653,7 @@ class Workspace:
648
653
  if cached is not None:
649
654
  return cached
650
655
  host = config.get(server_name, "host")
651
- port = config.getint(server_name, "port")
656
+ port_value = config.get(server_name, "port", fallback="").strip()
652
657
  soap_path = config.get(
653
658
  server_name, "soap_path", fallback=OPTIONS_BY_NAME["soap_path"].default
654
659
  )
@@ -665,7 +670,20 @@ class Workspace:
665
670
  "gateway_path",
666
671
  fallback=OPTIONS_BY_NAME["gateway_path"].default,
667
672
  ).strip()
673
+ scheme = (
674
+ config.get(
675
+ server_name, "scheme", fallback=OPTIONS_BY_NAME["scheme"].default
676
+ )
677
+ .strip()
678
+ .lower()
679
+ )
668
680
 
681
+ if scheme not in SCHEMES:
682
+ raise ValueError(
683
+ f"'scheme' for server '{server_name}' must be https or http, "
684
+ f"not '{scheme}'"
685
+ )
686
+ port = self._resolve_port(config, server_name, scheme, port_value)
669
687
  if not host:
670
688
  raise ValueError(f"Empty 'host' value for server '{server_name}'")
671
689
  if not soap_path:
@@ -684,6 +702,7 @@ class Workspace:
684
702
  password,
685
703
  protected,
686
704
  gateway_path or None,
705
+ scheme,
687
706
  )
688
707
  server.session_store = SessionStore(
689
708
  self.config_dir / ".sessions" / f"{server_name}.json"
@@ -693,6 +712,41 @@ class Workspace:
693
712
  except (configparser.Error, ValueError) as e:
694
713
  _error(f"Error reading server from config: {str(e)}")
695
714
 
715
+ @staticmethod
716
+ def _resolve_port(
717
+ config: configparser.ConfigParser,
718
+ server_name: str,
719
+ scheme: str,
720
+ value: str,
721
+ ) -> int:
722
+ """
723
+ The port: as set, else the scheme's own (443 / 80). https on port
724
+ 80 never works - TLS sent to a plain-HTTP port - and is what a
725
+ pre-8.5 config ('port = 80', no scheme) reads as now that https is
726
+ the default, so it is refused with the fix rather than guessed at.
727
+ """
728
+ if not value:
729
+ return DEFAULT_PORTS[scheme]
730
+ try:
731
+ port = int(value)
732
+ except ValueError:
733
+ raise ValueError(
734
+ f"'port' for server '{server_name}' must be a number, not '{value}'"
735
+ ) from None
736
+ if scheme == "https" and port == 80:
737
+ # configparser has no public "own options" view of a section
738
+ own = config._sections.get(server_name, {}) # type: ignore[attr-defined]
739
+ port_from = f"[{server_name}]" if "port" in own else "[DEFAULT]"
740
+ scheme_set = "scheme" in own or "scheme" in config.defaults()
741
+ why = "" if scheme_set else " (the default since 8.5)"
742
+ raise ValueError(
743
+ f"server '{server_name}' uses https{why} on port 80 (from "
744
+ f"{port_from}), which cannot work. For a plain-HTTP server add "
745
+ f"'scheme = http' to [{server_name}]; for HTTPS remove 'port' "
746
+ "(443 is the https default) or set 'port = 443'"
747
+ )
748
+ return port
749
+
696
750
  @staticmethod
697
751
  def app_folder_name(app: PuakmaApplication) -> str:
698
752
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vortex_cli
3
- Version: 8.4.2
3
+ Version: 8.5.0
4
4
  Summary: Vortex CLI
5
5
  Author-email: Jordan Amos <jordan.amos@gmail.com>
6
6
  License: MIT License
@@ -87,14 +87,15 @@ While it is possible to use without it, this software has been purposefully desi
87
87
 
88
88
  ```
89
89
  [DEFAULT] ; This section is optional and only useful if you have multiple definitions
90
- port = 80 ; Options provided under DEFAULT will be applied to all definitions if not provided
90
+ scheme = https ; Options provided under DEFAULT will be applied to all definitions if not provided
91
91
  soap_path = system/SOAPDesigner.pma
92
92
  default = server1 ; Useful when you have multiple definitions
93
93
 
94
94
 
95
95
  [server1] ; This can be called whatever you want and can be referenced using the '--server' flag
96
96
  host = example.com
97
- port = 8080 ; we can overwrite the DEFAULT value
97
+ scheme = http ; Optional - https (the default) or http, for a server that only speaks plain HTTP. We can overwrite the DEFAULT value
98
+ port = 8080 ; Optional - unset = the scheme's port: 443 for https, 80 for http
98
99
  username = myuser ; Optional - Prompted at runtime if not provided
99
100
  password = mypassword ; Optional - Prompted at runtime if not provided
100
101
  ; Optional
@@ -106,6 +107,26 @@ While it is possible to use without it, this software has been purposefully desi
106
107
  java_environment_name = JavaSE-17 ; Java Execution Environment name https://docs.osgi.org/reference/eenames.html
107
108
  ```
108
109
 
110
+ ## Upgrading to 8.5
111
+
112
+ - **HTTPS is the default.** A new per-server option `scheme` (`https`, the default, or
113
+ `http`) picks how vortex talks to the server, and an unset `port` now follows it: 443 for
114
+ https, 80 for http (`port` is no longer required). An explicit `port` is always honoured.
115
+ - **Action needed for plain-HTTP servers:** add `scheme = http` to each one. A config that
116
+ only says `port = 80` (often under `[DEFAULT]`) would now mean https on port 80, which
117
+ cannot work, so vortex refuses it with the fix: *"server 'x' uses https (the default since
118
+ 8.5) on port 80 (from [DEFAULT]) ... add 'scheme = http' to [x]; for HTTPS remove 'port'
119
+ ... or set 'port = 443'"*. For an HTTPS server, drop `port = 80` from `[DEFAULT]` (or
120
+ override it with `port = 443`).
121
+ - **A redirect to https says so.** A server that redirects plain HTTP to HTTPS (e.g. behind
122
+ Cloudflare) used to be reported as *"answered ... with a page instead of JSON - the
123
+ credentials were not accepted"*. It now reads *"HTTP 301 from <url>: the server redirects
124
+ to https (...) - set 'scheme = https' (port 443, or remove 'port') for '<server>' in
125
+ servers.ini"*. A real 401/403 still gives the credentials hint.
126
+ - `app list --open-urls` / `--open-dev-urls` and `clone --open-urls` open `https://` links.
127
+ - `vortex server list` shows each server's scheme; `vortex server get` shows the port an unset
128
+ `port` resolves to (`https default` / `http default`).
129
+
109
130
  ## Upgrading to 8.4
110
131
 
111
132
  - **`vortex stats` shows the server's disk space** after the statistics: each mounted local
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes