@@ -250,26 +250,40 @@ def provision_status(self) -> str:
250250 """
251251 return self .info .provision_status
252252
253+ @property
254+ def hostname (self ) -> str :
255+ """
256+ The hostname of the Pi
257+ """
258+ return f"{ self .name } .hostedpi.com"
259+
253260 @property
254261 def ipv4_ssh_hostname (self ) -> str :
255262 """
256- The hostname to use when connecting to the Pi over IPv4
263+ The hostname to use when connecting to the Pi over SSH using IPv4
264+ """
265+ return f"ssh.{ self .hostname } "
266+
267+ @property
268+ def ipv6_ssh_hostname (self ) -> str :
269+ """
270+ The hostname to use when connecting to the Pi over SSH using IPv6
257271 """
258- return f"ssh. { self .name } .hostedpi.com"
272+ return self .hostname
259273
260274 @property
261275 def ipv4_ssh_command (self ) -> str :
262276 """
263- The SSH command required to connect to the Pi over IPv4
277+ The SSH command required to connect to the Pi over SSH using IPv4
264278 """
265279 return f"ssh -p { self .ipv4_ssh_port } root@{ self .ipv4_ssh_hostname } "
266280
267281 @property
268282 def ipv6_ssh_command (self ) -> str :
269283 """
270- The SSH command required to connect to the Pi over IPv6
284+ The SSH command required to connect to the Pi over SSH using IPv6
271285 """
272- return f"ssh root@[ { self .ipv6_address } ] "
286+ return f"ssh root@{ self .ipv6_ssh_hostname } "
273287
274288 @property
275289 def ipv4_ssh_config (self ) -> str :
@@ -280,7 +294,7 @@ def ipv4_ssh_config(self) -> str:
280294 return f"""Host { self .name }
281295 user root
282296 port { self .ipv4_ssh_port }
283- hostname ssh. { self .name } .hostedpi.com
297+ hostname { self .ipv4_ssh_hostname }
284298 """ .strip ()
285299
286300 @property
@@ -291,7 +305,7 @@ def ipv6_ssh_config(self) -> str:
291305 """
292306 return f"""Host { self .name }
293307 user root
294- hostname { self .ipv6_address }
308+ hostname { self .ipv6_ssh_hostname }
295309 """ .strip ()
296310
297311 @property
@@ -302,7 +316,7 @@ def url(self) -> str:
302316 .. note::
303317 Note that a web server must be installed on the Pi for the URL to be resolvable.
304318 """
305- return f"http://www.{ self .name } .hostedpi.com "
319+ return f"http://www.{ self .hostname } "
306320
307321 @property
308322 def url_ssl (self ) -> str :
@@ -315,7 +329,7 @@ def url_ssl(self) -> str:
315329
316330 See https://letsencrypt.org/
317331 """
318- return f"https://www.{ self .name } .hostedpi.com "
332+ return f"https://www.{ self .hostname } "
319333
320334 @property
321335 def ssh_keys (self ) -> set [str ]:
0 commit comments