$ show 45Drives/cockpit-file-sharing
This repository is a Cockpit web UI plugin for managing file sharing services on Linux servers, developed by 45Drives. It provides a single-page application with separate tabs for Samba (CIFS), NFS, iSCSI (using SCST driver, both single-server and clustered with Pacemaker), and S3 object storage (supporting MinIO, RustFS, Ceph RGW, and Garage backends). The architecture is a Vue 3 + TypeScript frontend that communicates with the server by executing shell commands, parsing configuration files (e.g., /etc/exports, smb.conf), and interacting with backend-specific CLIs (mc, radosgw-admin, garage) and S3-compatible APIs. Key entry points include App.vue for top-level routing, and per-tab main components (SambaTabMain, NFSTabMain, ISCSITabMain, S3ManagementMain). Data flows are user-driven: configuration changes are applied via system commands and written to configuration files, with systemd service management for start/stop/status. The codebase demonstrates reasonable engineering practices with error handling using neverthrow, but has some legacy code in file-sharing-old/ and significant coupling in the iSCSI cluster driver. It is actively maintained with frequent releases and many open issues.
The LLM identified 4 files worth highlighting for reuse:
A Vue component that provides start/stop, enable/disable, and status polling for any systemd unit. It uses a reactive composable (useSystemdUnit) and displays service name, status, and action buttons. This component is self-contained and could be extracted into a shared UI library for any Cockpit plugin needing systemd service management.
A pure TypeScript module that parses and unparses NFS /etc/exports format. It supports escaped paths, comments, multiple options per export, and produces a structured array of export entries. This is a standalone utility with no dependencies on the rest of the codebase and can be reused in any project needing to manipulate NFS exports programmatically.
A registry that maps backend kind strings (e.g., 'minio', 'ceph', 'garage', 'rustfs') to their respective bucket backend implementations. It provides a clean plugin-style interface (getBucketBackend(kind)) and isolates backend-specific logic behind a common abstraction. This pattern is reusable for any multi-backend system where implementations need to be swapped or extended.
A Vue 3 composable that wraps a systemd unit with reactive state (active, enabled, loading). It provides methods for start, stop, enable, disable, and manages polling for status updates. It is isolated and only depends on @45drives/cockpit-helpers for spawning commands. This composable can be reused in any Cockpit plugin requiring systemd unit management.