iptime-cli 0.1.0__tar.gz → 0.1.1__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: iptime-cli
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: Unofficial command line and Python library for ipTIME routers with the new admin UI (firmware 16.x): clients, DHCP reservations, port forwarding, Wi-Fi, WAN, remote admin. Standard library only.
5
5
  Author: El Fenomeno
6
6
  License-Expression: MIT
@@ -71,7 +71,7 @@ Settings are read in this order: command-line flag, environment variable, config
71
71
  | Admin user | `--user` | `IPTIME_USER` | `user` | `admin` |
72
72
  | Admin password | — | `IPTIME_PASSWORD` | `password` | asked on the terminal |
73
73
 
74
- The config file is `~/.config/iptime-cli/config` (or `--config FILE`, or `IPTIME_CONFIG`):
74
+ The config file is `~/.config/iptime-cli/config` on macOS and Linux, `%APPDATA%\iptime-cli\config` on Windows (or `--config FILE`, or `IPTIME_CONFIG`):
75
75
 
76
76
  ```ini
77
77
  host = 192.168.0.1
@@ -79,7 +79,7 @@ user = admin
79
79
  password = change-me
80
80
  ```
81
81
 
82
- Keep it private: `chmod 600 ~/.config/iptime-cli/config`. The tool warns on stderr when a file with a password is readable by others. A file of `IPTIME_ADMIN_URL=`, `IPTIME_ADMIN_USER=`, `IPTIME_ADMIN_PASSWORD=` lines (or `IPTIME_HOST=` ...) works too. `--host` accepts `192.168.0.1`, `192.168.0.1:8080` or a full URL.
82
+ Keep it private: `chmod 600 ~/.config/iptime-cli/config`. The tool warns on stderr when a file with a password is readable by others (macOS and Linux; on Windows your user profile's permissions protect it). A file of `IPTIME_ADMIN_URL=`, `IPTIME_ADMIN_USER=`, `IPTIME_ADMIN_PASSWORD=` lines (or `IPTIME_HOST=` ...) works too. `--host` accepts `192.168.0.1`, `192.168.0.1:8080` or a full URL.
83
83
 
84
84
  > **Logging in may end an open browser admin session.** The router allows few simultaneous admin sessions. The CLI logs out when it finishes.
85
85
 
@@ -342,8 +342,8 @@ Exit codes: `0` ok, `1` error (router, login, API), `2` bad usage or bad params
342
342
  | Read commands (`info`, `clients`, `wan`, `wifi`, `dhcp list`, `port list`, `remote-admin`, `firmware check`, `call`) and `firmware upgrade --dry-run` | run against that router |
343
343
  | Write commands (`port add/rm`, `dhcp reserve/unreserve`, `remote-admin on/off`, `reboot`, `firmware upgrade`) | **only against the bundled fake router**, never against a real one by this package. The request bodies follow what the admin page sends. An earlier hand-written script sent the same port-forward and DHCP-reservation bodies to a real router and they worked; `remote-admin off`, `remote-admin on`, `reboot` and the two firmware-upgrade calls and their status stages were read from the admin bundle and never reached real hardware |
344
344
  | Login failures | one wrong login against real hardware: the router answered `{"error": {"code": -31996, "message": "Config error"}}`. Captcha and lockout messages were not observed; those paths are only exercised by the fake router, so their wording is a guess |
345
- | OS | macOS, Python 3.12 |
346
- | Not tested | Linux and Windows, other models, other 16.x builds, https admin, old admin UI (refused with an error), Wi-Fi 7 / mesh models |
345
+ | OS | macOS (Python 3.12) against the real router; Windows 11 (Python 3.10) and Ubuntu 24.04 (Python 3.12) against the bundled fake router, installed from PyPI |
346
+ | Not tested | Windows and Linux against a real router, other models, other 16.x builds, https admin, old admin UI (refused with an error), Wi-Fi 7 / mesh models |
347
347
 
348
348
  Other models may differ: on the tested model `system/temperature`, `wireless/mlo/info`, `port/role`, `power/status` and `fan/running` are absent.
349
349
 
@@ -48,7 +48,7 @@ Settings are read in this order: command-line flag, environment variable, config
48
48
  | Admin user | `--user` | `IPTIME_USER` | `user` | `admin` |
49
49
  | Admin password | — | `IPTIME_PASSWORD` | `password` | asked on the terminal |
50
50
 
51
- The config file is `~/.config/iptime-cli/config` (or `--config FILE`, or `IPTIME_CONFIG`):
51
+ The config file is `~/.config/iptime-cli/config` on macOS and Linux, `%APPDATA%\iptime-cli\config` on Windows (or `--config FILE`, or `IPTIME_CONFIG`):
52
52
 
53
53
  ```ini
54
54
  host = 192.168.0.1
@@ -56,7 +56,7 @@ user = admin
56
56
  password = change-me
57
57
  ```
58
58
 
59
- Keep it private: `chmod 600 ~/.config/iptime-cli/config`. The tool warns on stderr when a file with a password is readable by others. A file of `IPTIME_ADMIN_URL=`, `IPTIME_ADMIN_USER=`, `IPTIME_ADMIN_PASSWORD=` lines (or `IPTIME_HOST=` ...) works too. `--host` accepts `192.168.0.1`, `192.168.0.1:8080` or a full URL.
59
+ Keep it private: `chmod 600 ~/.config/iptime-cli/config`. The tool warns on stderr when a file with a password is readable by others (macOS and Linux; on Windows your user profile's permissions protect it). A file of `IPTIME_ADMIN_URL=`, `IPTIME_ADMIN_USER=`, `IPTIME_ADMIN_PASSWORD=` lines (or `IPTIME_HOST=` ...) works too. `--host` accepts `192.168.0.1`, `192.168.0.1:8080` or a full URL.
60
60
 
61
61
  > **Logging in may end an open browser admin session.** The router allows few simultaneous admin sessions. The CLI logs out when it finishes.
62
62
 
@@ -319,8 +319,8 @@ Exit codes: `0` ok, `1` error (router, login, API), `2` bad usage or bad params
319
319
  | Read commands (`info`, `clients`, `wan`, `wifi`, `dhcp list`, `port list`, `remote-admin`, `firmware check`, `call`) and `firmware upgrade --dry-run` | run against that router |
320
320
  | Write commands (`port add/rm`, `dhcp reserve/unreserve`, `remote-admin on/off`, `reboot`, `firmware upgrade`) | **only against the bundled fake router**, never against a real one by this package. The request bodies follow what the admin page sends. An earlier hand-written script sent the same port-forward and DHCP-reservation bodies to a real router and they worked; `remote-admin off`, `remote-admin on`, `reboot` and the two firmware-upgrade calls and their status stages were read from the admin bundle and never reached real hardware |
321
321
  | Login failures | one wrong login against real hardware: the router answered `{"error": {"code": -31996, "message": "Config error"}}`. Captcha and lockout messages were not observed; those paths are only exercised by the fake router, so their wording is a guess |
322
- | OS | macOS, Python 3.12 |
323
- | Not tested | Linux and Windows, other models, other 16.x builds, https admin, old admin UI (refused with an error), Wi-Fi 7 / mesh models |
322
+ | OS | macOS (Python 3.12) against the real router; Windows 11 (Python 3.10) and Ubuntu 24.04 (Python 3.12) against the bundled fake router, installed from PyPI |
323
+ | Not tested | Windows and Linux against a real router, other models, other 16.x builds, https admin, old admin UI (refused with an error), Wi-Fi 7 / mesh models |
324
324
 
325
325
  Other models may differ: on the tested model `system/temperature`, `wireless/mlo/info`, `port/role`, `power/status` and `fan/running` are absent.
326
326
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "iptime-cli"
7
- version = "0.1.0"
7
+ version = "0.1.1"
8
8
  description = "Unofficial command line and Python library for ipTIME routers with the new admin UI (firmware 16.x): clients, DHCP reservations, port forwarding, Wi-Fi, WAN, remote admin. Standard library only."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -2,6 +2,6 @@
2
2
  from .client import (ApiError, CaptchaError, ConnectError, IptimeError, Lease, LockoutError,
3
3
  LoginError, OldUiError, PortForward, Reservation, Router, Station, UpgradeError)
4
4
 
5
- __version__ = "0.1.0"
5
+ __version__ = "0.1.1"
6
6
  __all__ = ["Router", "Station", "Lease", "Reservation", "PortForward", "IptimeError", "ApiError",
7
7
  "LoginError", "CaptchaError", "LockoutError", "OldUiError", "ConnectError", "UpgradeError"]
@@ -30,8 +30,12 @@ class Settings:
30
30
 
31
31
 
32
32
  def default_config_path() -> str:
33
- base = os.environ.get("XDG_CONFIG_HOME") or os.path.expanduser("~/.config")
34
- return os.path.join(base, "iptime-cli", "config")
33
+ """~/.config/iptime-cli/config (XDG); on Windows %APPDATA%\\iptime-cli\\config unless XDG_CONFIG_HOME is set."""
34
+ base = os.environ.get("XDG_CONFIG_HOME")
35
+ if not base and os.name == "nt" and os.environ.get("APPDATA"):
36
+ base = os.environ["APPDATA"]
37
+ base = base or os.path.join(os.path.expanduser("~"), ".config")
38
+ return os.path.normpath(os.path.join(base, "iptime-cli", "config"))
35
39
 
36
40
 
37
41
  def read_file(path: str, warn=True) -> dict:
@@ -49,7 +53,8 @@ def read_file(path: str, warn=True) -> dict:
49
53
  for name, aliases in _KEYS.items():
50
54
  if key in aliases:
51
55
  out[name] = value
52
- if warn and out.get("password"):
56
+ # POSIX mode bits mean nothing on Windows (every file reports 0666); the user profile ACL protects it there.
57
+ if warn and out.get("password") and os.name != "nt":
53
58
  mode = stat.S_IMODE(os.stat(path).st_mode)
54
59
  if mode & 0o077:
55
60
  print(f"warning: {path} holds a password but is readable by others "
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: iptime-cli
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: Unofficial command line and Python library for ipTIME routers with the new admin UI (firmware 16.x): clients, DHCP reservations, port forwarding, Wi-Fi, WAN, remote admin. Standard library only.
5
5
  Author: El Fenomeno
6
6
  License-Expression: MIT
@@ -71,7 +71,7 @@ Settings are read in this order: command-line flag, environment variable, config
71
71
  | Admin user | `--user` | `IPTIME_USER` | `user` | `admin` |
72
72
  | Admin password | — | `IPTIME_PASSWORD` | `password` | asked on the terminal |
73
73
 
74
- The config file is `~/.config/iptime-cli/config` (or `--config FILE`, or `IPTIME_CONFIG`):
74
+ The config file is `~/.config/iptime-cli/config` on macOS and Linux, `%APPDATA%\iptime-cli\config` on Windows (or `--config FILE`, or `IPTIME_CONFIG`):
75
75
 
76
76
  ```ini
77
77
  host = 192.168.0.1
@@ -79,7 +79,7 @@ user = admin
79
79
  password = change-me
80
80
  ```
81
81
 
82
- Keep it private: `chmod 600 ~/.config/iptime-cli/config`. The tool warns on stderr when a file with a password is readable by others. A file of `IPTIME_ADMIN_URL=`, `IPTIME_ADMIN_USER=`, `IPTIME_ADMIN_PASSWORD=` lines (or `IPTIME_HOST=` ...) works too. `--host` accepts `192.168.0.1`, `192.168.0.1:8080` or a full URL.
82
+ Keep it private: `chmod 600 ~/.config/iptime-cli/config`. The tool warns on stderr when a file with a password is readable by others (macOS and Linux; on Windows your user profile's permissions protect it). A file of `IPTIME_ADMIN_URL=`, `IPTIME_ADMIN_USER=`, `IPTIME_ADMIN_PASSWORD=` lines (or `IPTIME_HOST=` ...) works too. `--host` accepts `192.168.0.1`, `192.168.0.1:8080` or a full URL.
83
83
 
84
84
  > **Logging in may end an open browser admin session.** The router allows few simultaneous admin sessions. The CLI logs out when it finishes.
85
85
 
@@ -342,8 +342,8 @@ Exit codes: `0` ok, `1` error (router, login, API), `2` bad usage or bad params
342
342
  | Read commands (`info`, `clients`, `wan`, `wifi`, `dhcp list`, `port list`, `remote-admin`, `firmware check`, `call`) and `firmware upgrade --dry-run` | run against that router |
343
343
  | Write commands (`port add/rm`, `dhcp reserve/unreserve`, `remote-admin on/off`, `reboot`, `firmware upgrade`) | **only against the bundled fake router**, never against a real one by this package. The request bodies follow what the admin page sends. An earlier hand-written script sent the same port-forward and DHCP-reservation bodies to a real router and they worked; `remote-admin off`, `remote-admin on`, `reboot` and the two firmware-upgrade calls and their status stages were read from the admin bundle and never reached real hardware |
344
344
  | Login failures | one wrong login against real hardware: the router answered `{"error": {"code": -31996, "message": "Config error"}}`. Captcha and lockout messages were not observed; those paths are only exercised by the fake router, so their wording is a guess |
345
- | OS | macOS, Python 3.12 |
346
- | Not tested | Linux and Windows, other models, other 16.x builds, https admin, old admin UI (refused with an error), Wi-Fi 7 / mesh models |
345
+ | OS | macOS (Python 3.12) against the real router; Windows 11 (Python 3.10) and Ubuntu 24.04 (Python 3.12) against the bundled fake router, installed from PyPI |
346
+ | Not tested | Windows and Linux against a real router, other models, other 16.x builds, https admin, old admin UI (refused with an error), Wi-Fi 7 / mesh models |
347
347
 
348
348
  Other models may differ: on the tested model `system/temperature`, `wireless/mlo/info`, `port/role`, `power/status` and `fan/running` are absent.
349
349
 
File without changes
File without changes