Giter Site home page Giter Site logo

tim6332001 / cockpit-file-sharing Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 45drives/cockpit-file-sharing

0.0 1.0 0.0 16.36 MB

A Cockpit plugin to easily manage samba and NFS file sharing.

License: GNU General Public License v3.0

JavaScript 63.75% Python 9.58% CSS 9.12% Makefile 1.47% HTML 16.09%

cockpit-file-sharing's Introduction

cockpit-file-sharing

A Cockpit plugin to easily manage samba and NFS file sharing.

Table of Contents

General

Features

  • Add and edit Samba shares
  • Full control of Samba Share parameters
  • Auto populate parameters with commonly used settings
  • Edit global Samba config
  • Manage Samba users and their groups
  • Add and remove groups
  • Set SeDiskOperator Privileges
  • Add and remove NFS sharing with full control of permissions and client IPs

Samba Manager Screenshot

Samba Manager Interface

NFS Manager Screenshot

NFS Manager Interface

Installation

From 45Drives Repo

Ubuntu

$ curl -sSL https://repo.45drives.com/setup | sudo bash
$ apt install cockpit-file-sharing

Rocky

$ curl -sSL https://repo.45drives.com/setup | sudo bash
$ dnf install cockpit-file-sharing

CentOS 7

$ curl -sSL https://repo.45drives.com/setup | sudo bash
$ yum install cockpit-file-sharing

From Source

Ensure dependencies are installed: cockpit, python3, samba, nfs-kernel-server.

$ git clone https://github.com/45Drives/cockpit-file-sharing.git
$ cd cockpit-file-sharing
$ make install

Samba Manager

Samba manager is used to setup samba shares in an efficient manner.

The main component to this manager is the "Share Management" card. This is used to edit and add samba shares. To add a share you simply click the "+" button.

Add Share

Add Samba Share Menu

You have full ability to customize your share the way you want it. Looking through the options in the menu, a lot are self explanatory, such as share name and description, however the rest of the options can be complicated. Down below are the options and their descriptors.

  • Path - The path to the directory on the server you would like to share
  • Windows ACLs - Checking the box adds parameters that enables access control list on the share
  • Valid Users - Users who can access the share
  • Valid Groups - Groups that can access the share
  • Guest Ok - Checking this box makes the Samba Share not require a password to access
  • Browsable - Controls whether the share is seen a list of available shares in net view

Advanced Settings

Advanced Samba Settings

Under the advanced settings tab there is an input box. You can enter any extra Samba settings you want into this box. We have implemented templates that will auto populate the input box with popular settings many users use. Down below is a description of these auto populate settings.

  • Shadow Copy - Utilizes microsoft's shadow copy service which creates backup copies or snapshots of files within the samba share
  • MacOS Share - Allows shares to be seen on MacOS
  • Audit Logs - Adds ability to record events and changes on the samba share

For any more info on settings that can be inserted into this area, please checkout the samba config documentation, https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html.

Removing Shares

Removing Samba Shares

Removing shares is as simple as clicking the "X" beside the share you would like to delete, then confirm that you want to remove the share.

Editing Global Settings

Global Samba Settings

In the global settings, you can change the description of the server as well as the amount of logs that are viewable. Much like the advanced samba settings, there is a input section to add any parameter you would like to set for all your shares on your server.

Group Management

Group Management

Adding a group is as simple as pressing the "+" button, name the group, then confirm. Removing the group is just as easy, click the "X" next to the group you would like to delete, then confirm.

User Management

User Management

Managing Samba Users in file sharing is as easy as can be. First you select the user to manage, you can then add as many groups as you want to the user and also delete groups from a user if needed!

Password

Changing the password of a samba user is possible through the "Set Samba Password" button. You can remove the password by clicking the "Remove Password" button, then confirm.

SeDiskOperatorPrivilege

Add Privilege

You can add privileges by clicking on the "+" button. You will be greeted with the menu above, you can set the group of the privilege and you can add a username and password. Remove privileges by clicking the "X" besides the privilege.

Import Shares from smb.conf

To allow Cockpit File Sharing to manage existing shares defined in smb.conf, do the following steps:

  1. Create a backup copy of smb.conf: cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
  2. Ensure that include = registry is NOT present in smb.conf: sed -i '/include = registry/d' /etc/samba/smb.conf
  3. Run net conf import /etc/samba/smb.conf
  4. Check that your shares are now in the registry with net conf list
  5. Replace contents of smb.conf: echo -e "[Global]\n\tinclude = registry" > /etc/samba/smb.conf
  6. Restart Samba: systemctl restart smb.service

NFS Manager

NFS

Adding Exports

You can add a NFS export by clicking "+" button. Within the export add menu, you have the options for export name and path. There is also a section for clients. You may add a client by clicking the "+" button. This will give you another set of Client Name, IP and Permissions. The IP is who can access the particular export and the permissions are the rules set for that IP on the export. By adding multiple clients you can have multiple IP address accessing the same export, all having different permissions.

We have set the default IP to "*". This means that anyone can have access to that export. We have set defaults of permissions to rw,sync,no_tree_subcheck. If you want to enter your own permissions, do so by separating the options by commas (See out defaults for example). Check https://linux.die.net/man/5/nfs to see a full list of available options/permissions.

Editing Exports

If you feel the need to change an export that is already added, you can click on the settings icon to the far right of the export. Clicking edit will bring you to the edit modal where you can change everything about your pre-exisitng export.

Removing an Export

If you would like to remove a whole export, click on the settings icon, then click on remove. This will permently remove the whole export. This WILL NOT however remove the path that it is attached to.

Removing a Client

If you like to a specific client from an export, go into the edit modal of the export. From the edit modal you can press the red "X" by the individual clients you would like to remove.

Export File Syntax

NFS Manger uses the file /etc/exports.d/cockpit-file-sharing.exports to add exports to the NFS-server. In order for the UI portion to work there needs to be a certain syntax to the exports file.

# Name: Name of Export
# Clients: Client 1 Name, Client 2 Name
"/path/to/export" client-1-ip(client,1,permissions) client-2-ip(client,2,permissions)

If any export does not follow this syntax, the UI will throw an error!

cockpit-file-sharing's People

Contributors

bkelly16 avatar dawsondellavalle avatar dgoo2308 avatar joshuaboud avatar muratgonul avatar sam55silver avatar tim6332001 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.