machineconfig 3.99__py3-none-any.whl → 4.0__py3-none-any.whl

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.

Potentially problematic release.


This version of machineconfig might be problematic. Click here for more details.

@@ -0,0 +1,6 @@
1
+ curl -sSL https://ngrok-agent.s3.amazonaws.com/ngrok.asc \
2
+ | sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null \
3
+ && echo "deb https://ngrok-agent.s3.amazonaws.com bookworm main" \
4
+ | sudo tee /etc/apt/sources.list.d/ngrok.list \
5
+ && sudo apt update \
6
+ && sudo apt install ngrok
@@ -1,6 +1,24 @@
1
1
  {
2
2
  "version": "1",
3
3
  "installers": [
4
+ {
5
+ "appName": "ngrok",
6
+ "repoURL": "CMD",
7
+ "doc": "Secure introspectable tunnels to localhost",
8
+ "fileNamePattern": {
9
+ "amd64": {
10
+ "linux": "ngrok.sh",
11
+ "windows": "winget install ngrok -s msstore",
12
+ "macos": "brew install ngrok"
13
+ },
14
+ "arm64": {
15
+ "linux": "ngrok.sh",
16
+ "windows": "winget install ngrok -s msstore",
17
+ "macos": "brew install ngrok"
18
+ }
19
+ }
20
+
21
+ },
4
22
  {
5
23
  "appName": "Visual Studio Code",
6
24
  "repoURL": "CMD",
@@ -19,12 +19,12 @@ reference:
19
19
  """
20
20
 
21
21
 
22
- def display_terminal_url(local_ip_v4: str, port: int) -> None:
22
+ def display_terminal_url(local_ip_v4: str, port: int, protocol: str = "http") -> None:
23
23
  """Display a flashy, unmissable terminal URL announcement."""
24
24
  console = Console()
25
25
 
26
26
  # Create the main message with styling
27
- url_text = Text(f"http://{local_ip_v4}:{port}", style="bold bright_cyan underline")
27
+ url_text = Text(f"{protocol}://{local_ip_v4}:{port}", style="bold bright_cyan underline")
28
28
  message = Text.assemble(
29
29
  ("🚀 ", "bright_red"),
30
30
  ("Terminal is now accessible at: ", "bright_white bold"),
@@ -64,7 +64,11 @@ def install_ttyd():
64
64
  def main(
65
65
  port: Annotated[Optional[int], typer.Option("--port", "-p", help="Port to run the terminal server on (default: 7681)")] = None,
66
66
  username: Annotated[Optional[str], typer.Option("--username", "-u", help="Username for terminal access (default: current user)")] = None,
67
- password: Annotated[Optional[str], typer.Option("--password", "-w", help="Password for terminal access (default: from ~/dotfiles/creds/passwords/quick_password)")] = None
67
+ password: Annotated[Optional[str], typer.Option("--password", "-w", help="Password for terminal access (default: from ~/dotfiles/creds/passwords/quick_password)")] = None,
68
+ ssl: Annotated[bool, typer.Option("--ssl", "-S", help="Enable SSL")] = False,
69
+ ssl_cert: Annotated[Optional[str], typer.Option("--ssl-cert", "-C", help="SSL certificate file path")] = None,
70
+ ssl_key: Annotated[Optional[str], typer.Option("--ssl-key", "-K", help="SSL key file path")] = None,
71
+ ssl_ca: Annotated[Optional[str], typer.Option("--ssl-ca", "-A", help="SSL CA file path for client certificate verification")] = None
68
72
  ) -> None:
69
73
  install_ttyd()
70
74
  if username is None:
@@ -80,17 +84,44 @@ def main(
80
84
  if port is None:
81
85
  port = 7681 # Default port for ttyd
82
86
 
87
+ # Handle SSL certificate defaults
88
+ if ssl:
89
+ if ssl_cert is None:
90
+ ssl_cert = str(Path.home().joinpath("dotfiles/creds/passwords/ssl/origin_server/cert.pem"))
91
+ if ssl_key is None:
92
+ ssl_key = str(Path.home().joinpath("dotfiles/creds/passwords/ssl/origin_server/key.pem"))
93
+
94
+ # Verify SSL files exist
95
+ cert_path = Path(ssl_cert)
96
+ key_path = Path(ssl_key)
97
+
98
+ if not cert_path.exists():
99
+ raise FileNotFoundError(f"SSL certificate file not found: {ssl_cert}")
100
+ if not key_path.exists():
101
+ raise FileNotFoundError(f"SSL key file not found: {ssl_key}")
102
+
103
+ if ssl_ca and not Path(ssl_ca).exists():
104
+ raise FileNotFoundError(f"SSL CA file not found: {ssl_ca}")
105
+
83
106
  import socket
84
107
  s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
85
108
  s.connect(('8.8.8.8',80))
86
109
  local_ip_v4 = s.getsockname()[0]
87
110
  s.close()
88
111
 
89
- # Display the flashy terminal announcement
90
- display_terminal_url(local_ip_v4, port)
112
+ # Display the flashy terminal announcement
113
+ protocol = "https" if ssl else "http"
114
+ display_terminal_url(local_ip_v4, port, protocol)
115
+
116
+ # Build ttyd command with SSL options
117
+ ssl_args = ""
118
+ if ssl:
119
+ ssl_args = f"--ssl --ssl-cert {ssl_cert} --ssl-key {ssl_key}"
120
+ if ssl_ca:
121
+ ssl_args += f" --ssl-ca {ssl_ca}"
91
122
 
92
123
  code = f"""#!/bin/bash
93
- ttyd --writable -t enableSixel=true --port {port} --credential "{username}:{password}" -t 'theme={{"background": "black"}}' bash
124
+ ttyd --writable -t enableSixel=true {ssl_args} --port {port} --credential "{username}:{password}" -t 'theme={{"background": "black"}}' bash
94
125
  """
95
126
  import subprocess
96
127
  subprocess.run(code, shell=True, check=True)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: machineconfig
3
- Version: 3.99
3
+ Version: 4.0
4
4
  Summary: Dotfiles management package
5
5
  Author-email: Alex Al-Saffar <programmer@usa.com>
6
6
  License: Apache 2.0
@@ -40,7 +40,7 @@ machineconfig/cluster/templates/run_remote.py,sha256=vCc56t8BUAUJp7tyb0PFfwy5hlm
40
40
  machineconfig/cluster/templates/utils.py,sha256=5lHgjHvodoSPBD31AwluHBBNgwimwThUsDNWGN8iH9I,1647
41
41
  machineconfig/jobs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
42
42
  machineconfig/jobs/installer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
43
- machineconfig/jobs/installer/packages_custom_dev.json,sha256=oJBj5blm8QLaMP72ZP9JE--oUiaweQSOFIAq-ySV_Wc,5646
43
+ machineconfig/jobs/installer/packages_custom_dev.json,sha256=oSOSyO7GKU4UivXrYp5h7jxPtDZZKpi4-ZeghKjwj4k,6117
44
44
  machineconfig/jobs/installer/packages_custom_essential.json,sha256=-Mgu436rbGE7JWCy-NYxxsnkxCxPxv4Gatu0wXp5XMI,775
45
45
  machineconfig/jobs/installer/packages_github_dev.json,sha256=CyadNrKml42lzPwdAlpNRyEtTS12p9dbjMrugOtvLVQ,31320
46
46
  machineconfig/jobs/installer/packages_github_essential.json,sha256=sZZczoJ_d0gC6865NRKYATOC7GQD1mKF6s07W5tsM9s,27054
@@ -65,6 +65,7 @@ machineconfig/jobs/installer/linux_scripts/docker.sh,sha256=xP219QeQ5eLwhvOHsNYq
65
65
  machineconfig/jobs/installer/linux_scripts/docker_start.sh,sha256=TiS-hWRltw66_p_Fq8gfkA_rqUIuwxoIkFZItVF6TXA,1478
66
66
  machineconfig/jobs/installer/linux_scripts/edge.sh,sha256=2JclQOi6sBTs2VQPsQWh6dPFRu1C36OyRREI0a76yJQ,1903
67
67
  machineconfig/jobs/installer/linux_scripts/nerdfont.sh,sha256=vSJQfGYVpWF2T1vz1zZuVXdeus_PWXdP7VquRQjsLwU,2351
68
+ machineconfig/jobs/installer/linux_scripts/ngrok.sh,sha256=K-t62nhnAHxhppTmqjubIJRHozkNHfBxXGbn1Oz3w-A,287
68
69
  machineconfig/jobs/installer/linux_scripts/pgsql.sh,sha256=qe_yo4dM16B8L1VYIPqyLVvI1uns2jg7if_cokuOofY,2239
69
70
  machineconfig/jobs/installer/linux_scripts/redis.sh,sha256=XNsnypuP0UQDdNnLQ1rHC8XRYeqeaM213i1aga5_Q0M,2940
70
71
  machineconfig/jobs/installer/linux_scripts/timescaledb.sh,sha256=-thz4K7Eo_4IsNTQMLsmQdyMdVhW7NAMn5S2CB3-blE,3530
@@ -174,7 +175,7 @@ machineconfig/scripts/python/repos_helper_clone.py,sha256=xW5YZEoNt3k7h9NIULhUhO
174
175
  machineconfig/scripts/python/repos_helper_record.py,sha256=YEEQORfEiLddOIIgePo5eEkyQUFruFg3kc8npMvRL-o,10927
175
176
  machineconfig/scripts/python/repos_helper_update.py,sha256=AYyKIB7eQ48yoYmFjydIhRI1lV39TBv_S4_LCa-oKuQ,11042
176
177
  machineconfig/scripts/python/scheduler.py,sha256=rKhssuxkD697EY6qaV6CSdNhxpAQLDWO4fE8GMCQ9FA,3061
177
- machineconfig/scripts/python/share_terminal.py,sha256=3d0tOjAiXbonuJprHitoUmyU4zVLnexQGdTNs1-5qq0,3455
178
+ machineconfig/scripts/python/share_terminal.py,sha256=fVE0_c70EEfTNyhVov4HNtDXjR-Kx0wn0Mz1CKYEij8,4991
178
179
  machineconfig/scripts/python/snapshot.py,sha256=aDvKeoniZaeTSNv9zWBUajaj2yagAxVdfuvO1_tgq5Y,1026
179
180
  machineconfig/scripts/python/start_slidev.py,sha256=U5ujAL7R5Gd5CzFReTsnF2SThjY91aFBg0Qz_MMl6U4,4573
180
181
  machineconfig/scripts/python/start_terminals.py,sha256=DRWbMZumhPmL0DvvsCsbRNFL5AVQn1SgaziafTio3YQ,6149
@@ -402,8 +403,8 @@ machineconfig/utils/schemas/fire_agents/fire_agents_input.py,sha256=CCs5ebomW1ac
402
403
  machineconfig/utils/schemas/installer/installer_types.py,sha256=DLagmIe0G5-xg7HZ9VrlFCDk1gIbwvX7O4gZjwq0wh0,1326
403
404
  machineconfig/utils/schemas/layouts/layout_types.py,sha256=M1ZFCz_kjRZPhxM19rIYUDR5lDDpwa09odR_ihtIFq0,1932
404
405
  machineconfig/utils/schemas/repos/repos_types.py,sha256=ECVr-3IVIo8yjmYmVXX2mnDDN1SLSwvQIhx4KDDQHBQ,405
405
- machineconfig-3.99.dist-info/METADATA,sha256=ImlRXsIaAQ9MQcpG5xYgzOi0yiWEoRsKPMj-_QfZ7Dc,7032
406
- machineconfig-3.99.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
407
- machineconfig-3.99.dist-info/entry_points.txt,sha256=c6ea0waVseT1rbfz1bw3k-eph2yVaB67x9hx64Mpvfs,1066
408
- machineconfig-3.99.dist-info/top_level.txt,sha256=porRtB8qms8fOIUJgK-tO83_FeH6Bpe12oUVC670teA,14
409
- machineconfig-3.99.dist-info/RECORD,,
406
+ machineconfig-4.0.dist-info/METADATA,sha256=SyAT0o2MjrqgbGRJ73fg2ZPQ735-X5PvW-2XCYsP9uk,7031
407
+ machineconfig-4.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
408
+ machineconfig-4.0.dist-info/entry_points.txt,sha256=c6ea0waVseT1rbfz1bw3k-eph2yVaB67x9hx64Mpvfs,1066
409
+ machineconfig-4.0.dist-info/top_level.txt,sha256=porRtB8qms8fOIUJgK-tO83_FeH6Bpe12oUVC670teA,14
410
+ machineconfig-4.0.dist-info/RECORD,,