mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-04 22:39:46 +00:00
permit IP for cifs backups (#2342)
* permit IP for cifs backups * allow ip instead of hostname (#2347) --------- Co-authored-by: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com> Co-authored-by: Aiden McClelland <me@drbonez.dev>
This commit is contained in:
@@ -16,6 +16,9 @@ use crate::util::Invoke;
|
|||||||
use crate::Error;
|
use crate::Error;
|
||||||
|
|
||||||
async fn resolve_hostname(hostname: &str) -> Result<IpAddr, Error> {
|
async fn resolve_hostname(hostname: &str) -> Result<IpAddr, Error> {
|
||||||
|
if let Ok(addr) = hostname.parse() {
|
||||||
|
return Ok(addr);
|
||||||
|
}
|
||||||
#[cfg(feature = "avahi")]
|
#[cfg(feature = "avahi")]
|
||||||
if hostname.ends_with(".local") {
|
if hostname.ends_with(".local") {
|
||||||
return Ok(IpAddr::V4(crate::net::mdns::resolve_mdns(hostname).await?));
|
return Ok(IpAddr::V4(crate::net::mdns::resolve_mdns(hostname).await?));
|
||||||
|
|||||||
@@ -277,12 +277,10 @@ export class BackupDrivesStatusComponent {
|
|||||||
const CifsSpec: ConfigSpec = {
|
const CifsSpec: ConfigSpec = {
|
||||||
hostname: {
|
hostname: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
name: 'Hostname',
|
name: 'Hostname/IP',
|
||||||
description:
|
description:
|
||||||
'The hostname of your target device on the Local Area Network.',
|
'The hostname or IP address of the target device on your Local Area Network.',
|
||||||
placeholder: `e.g. 'My Computer' OR 'my-computer.local'`,
|
placeholder: `e.g. 'MyComputer.local' OR '192.168.1.4'`,
|
||||||
pattern: '^[a-zA-Z0-9._-]+( [a-zA-Z0-9]+)*$',
|
|
||||||
'pattern-description': `Must be a valid hostname. e.g. 'My Computer' OR 'my-computer.local'`,
|
|
||||||
nullable: false,
|
nullable: false,
|
||||||
masked: false,
|
masked: false,
|
||||||
copyable: false,
|
copyable: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user