
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Module for handling mounting and unmounting fileshares on different operating systems
[!IMPORTANT]
This project is under development. All source code and features on the main branch are for the purpose of testing or evaluation and not production ready.
Module for handling mounting fileshares on OS
You can create mounter objects in two ways:
from mfd_connect import LocalConnection, RPyCConnection
from mfd_mount import Mount, ESXiMount, PosixMount, WindowsMount, FreeBSDMount
mounter_generic = Mount(connection=LocalConnection()) # will automatically instantiate proper subclass
mounter_windows = WindowsMount(connection=LocalConnection())
mounter_windows.mount_nfs(mount_point="Z:", share_path="10.10.10.10:/shared")
mounter_windows.is_mounted(mount_point="Z:")
mounter_posix = PosixMount(connection=LocalConnection())
mounter_posix.mount_nfs(mount_point="/mnt/shared", share_path="10.10.10.10:/shared")
mounter_posix.mount_cifs(mount_point="/mnt/shared", share_path="//10.10.10.10/shared", username='user', password='pass')
mounter_posix.mount_tmpfs(mount_point="/mnt/shared", share_path="//10.10.10.10/shared", params='-o param')
mounter_posix.mount_hugetlbfs(mount_point="/mnt/shared", share_path="//10.10.10.10/shared", params='-o param')
mounter_posix.is_mounted(mount_point="/mnt/shared")
# or
with mounter_posix.mount_nfs(mount_point="/mnt/shared", share_path="10.10.10.10:/shared"):
mounter_posix.is_mounted(mount_point="/mnt/shared") # will automatically unmount share afterwards
with mounter_posix.mount_cifs(mount_point="/mnt/shared", share_path="//10.10.10.10/shared", username='user', password='pass'):
mounter_posix.is_mounted(mount_point="/mnt/shared") # will automatically unmount share afterwards
with mounter_posix.mount_tmpfs(mount_point="/mnt/shared", share_path="//10.10.10.10/shared", params='-o param'):
mounter_posix.is_mounted(mount_point="/mnt/shared") # will automatically unmount share afterwards
with mounter_posix.mount_hugetlbfs(mount_point="/mnt/shared", share_path="//10.10.10.10/shared", params='-o param'):
mounter_posix.is_mounted(mount_point="/mnt/shared") # will automatically unmount share afterwards
mounter_esxi = ESXiMount(connection=LocalConnection())
mounter_esxi.mount_nfs(mount_point="NFSVolume", share_path="10.10.10.10:/shared")
mounter_esxi.is_mounted(mount_point="NFSVolume")
mounter_posix.umount(mount_point="/mnt/shared")
mounter_freebsd = FreeBSDMount(connection=RPyCConnection(ip='11.11.11.11', port=18813))
mounter_freebsd.mount_cifs(mount_point="/mnt/shared", share_path="10.10.10.10/shared", username='user', password='pass')
# or
with mounter_freebsd.mount_cifs(mount_point="/mnt/shared", share_path="10.10.10.10/shared", username='user', password='pass'):
mounter_freebsd.is_mounted(mount_point="/mnt/shared")
Mount NFS share:
mount_nfs(self, *, mount_point: Union[Path, str],
share_path: Union[Path, str],
username: Optional[str],
password: Optional[str]
) -> None:
Mount CIFS share:
mount_cifs(self, *, mount_point: Union[Path, str],
share_path: Union[Path, str],
username: Optional[str],
password: Optional[str]
) -> None:
mount_tmpfs(self, *, mount_point: Union[Path, str],
share_path: Union[Path, str],
params: Optional[str]) -> None:
Mount HUGETLBFS share:
mount_hugetlbfs(self, *, mount_point: Union[Path, str],
share_path: Union[Path, str],
params: Optional[str]) -> None:
Check if given mountpoint is mounted:
is_mounted(self, mount_point: Union[Path, str]) -> bool:
Unmount share:
umount(self, mount_point: Union[Path, str]) -> None:
Raises UnmountException
on failure
Username
and password
are unused.
Mount_point
is name of new volume.
share_path
must be in correct format <host>/<share>
or <host>:/<share>
eg. 10.10.10.10:/to_share
or 10.10.10.10/to_share
SSHFS is not built-in system tool. It requires previous installation.
On POSIX OS'es: <package-manager> install sshfs
WINDOWS | LINUX | FreeBSD | ESXi | |
---|---|---|---|---|
CIFS | Supported :white_check_mark: | Supported :white_check_mark: | Supported :white_check_mark: | Not Supported :red_circle: |
NFS | Supported :white_check_mark: | Supported :white_check_mark: | Supported :white_check_mark: | Supported :white_check_mark: |
SSHFS | Not Supported :red_circle: | Supported :white_check_mark: | Not Supported :red_circle: | Not Supported :red_circle: |
TMPFS | Not Supported :red_circle: | Supported :white_check_mark: | Not Supported :red_circle: | Not Supported :red_circle: |
HUGELBFS | Not Supported :red_circle: | Supported :white_check_mark: | Not Supported :red_circle: | Not Supported :red_circle: |
If you encounter any bugs or have suggestions for improvements, you're welcome to contribute directly or open an issue here.
FAQs
Module for handling mounting and unmounting fileshares on different operating systems
We found that mfd-mount demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.