45drives / cockpit-file-sharing Goto Github PK
View Code? Open in Web Editor NEWA Cockpit plugin to easily manage samba and NFS file sharing.
License: GNU General Public License v3.0
A Cockpit plugin to easily manage samba and NFS file sharing.
License: GNU General Public License v3.0
This tool relies on parsing the output of getent passwd
in order to get a user list for adding to shares, however this does not work in many cases when the system is a domain member. For example, the default behavior of SSSD is to not populate the full contents of the user list via getpwent()
calls, due to the extreme performance impact that loading so many users can cause.
It would be better if this Cockpit application instead (or additionally) provided a text-entry for the usernames that would just validate that getent passwd <username>
(or getpwnam('username')
) returns a valid entry before accepting it.
no internet no work..........................
To minimize attack footprint within my NAS as normal users but without shell, as nologin users (example of such user below).
pikachu:x:1009:1002:,,,:/home/pikachu:/usr/sbin/nologin
When looking into your code
-> cockpit-file-sharing/file-sharing/samba-manager/samba-manager.js
-> function add_user_options()
you define nologin users as system users and filter them out. According my limited understanding this is not correct approach. Instead of using 'nologin' as criteria, please consider other means .e.g. do filtering based on UID ranges as system users are typically having UID <1000. You may look into Linux Standard Base (LSB) reserved ranges, implementations in different Linux distros as your reference for UID ranges for system users.
Hi,
there are no generic artifacts in 3.2.5 release and when I try to build I get the following error:
cockpit-file-sharing-3.2.5]$ make
Building file-sharing
npm --prefix file-sharing install
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@45drives%2fcockpit-css - Not found
npm ERR! 404
npm ERR! 404 '@45drives/cockpit-css@^0.1.12' is not in this registry.
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/ishtanzar/.npm/_logs/2022-08-22T17_07_49_305Z-debug-0.log
make: *** [Makefile:80: file-sharing/dist/index.html] Error 1```
Regards,
Describe the bug
Icon font is not loading on the page
To Reproduce
Steps to reproduce the behavior:
cockpit
and cockpit-file-sharing
on Fedora 36Expected behavior
The font should load
Screenshots
See above
Console Output
downloadable font: download failed (font-family: "FontAwesome" style:normal weight:400 stretch:100 src index:0): status=2147746065 source: https://server1.hmpg.dev/cockpit/$5e3a684201e1c869874b8329cc82bcace4898145a8ec126c6209130165e28f21/base1/fonts/fontawesome.woff?v=4.2.0
GET https://server1.hmpg.dev/cockpit/$5e3a684201e1c869874b8329cc82bcace4898145a8ec126c6209130165e28f21/base1/fonts/fontawesome.woff?v=4.2.0 net::ERR_ABORTED 404
file-sharing-patternfly.css:1
Desktop (please complete the following information):
The problem is the same on Fedora37 beta and cockpit 276
Version of cockpit-file-sharing
: 2.4.5 on both Fedora 36 and 37 beta
Describe the bug
The RPM package for cockpit-file-sharing
installs cockpit-ws
as a dependency, which conflicts with the Podman-based deployment, as described in https://github.com/cockpit-project/cockpit-container
To Reproduce
Steps to reproduce the behavior:
(On a Fedora IoT {36,37} terminal)
rpm-ostree install cockpit-file-sharing
podman container runlabel --name cockpit-ws RUN quay.io/cockpit/ws
Note: this error occurs with the cockpit-file-sharing
version shipped with both Fedora IoT 36 and 37, as well as with the RPM package available in this repository (see details below)
Additional context
The issue described above happens with both cockpit-file-sharing
version 2.4.5-2
(from the Fedora IoT 36 and 37 official repositories), and with version 3.2.9-2
available here.
Why does cockpit-file-sharing
enforce cockpit-ws
as a dependency?
From what I saw from all other Cockpit applications, none of them has cockpit-ws
as a hard dependency (I spent a good amount of time trying to understand which application was breaking my ability to run Cockpit with Podman using the official container when I first encounter this issue ;)
Thanks!
I'm not sure where to get support for this, so I hope it's okay here. On a Debian 11 Proxmox 7 server, when I go to add a new NFS share and click on Add, nothing happens. Where can I look to try and diagnose the problem?
I'm trying to make a home share for every user using variable substitutions, so basically using the path /home/$u
Which normally on smb would make the path be dynamic based on the logged user.
However this is not working here, the file sharing plugin instead actually created the /home/$u
directory.
Is there any workaround for this?
`root@5005U-Linux:~# testparm
Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
Weak crypto is allowed
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
[global]
log file = /var/log/samba/log.%m
logging = file
map to guest = Bad User
max log size = 1000
obey pam restrictions = Yes
pam password change = Yes
panic action = /usr/share/samba/panic-action %d
passwd chat = Enter\snew\s\spassword:* %n\n Retype\snew\s\spassword:* %n\n password\supdated\ssuccessfully .
passwd program = /usr/bin/passwd %u
registry shares = Yes
server role = standalone server
unix password sync = Yes
usershare allow guests = Yes
idmap config * : backend = tdb
[文件]
path = /mnt/文件
read only = No
valid users = @ilove ilove
`
I saw the setup file and it seems to use EL8 like CentOS 8 when using Fedora any version.
Error infos:
- nothing provides /usr/libexec/platform-python needed by cockpit-file-sharing-1.0.0-1.el8.noarch
- nothing provides /usr/libexec/platform-python needed by cockpit-file-sharing-2.1.0-1.el8.noarch
- nothing provides /usr/libexec/platform-python needed by cockpit-file-sharing-2.2.0-1.el8.noarch
- nothing provides /usr/libexec/platform-python needed by cockpit-file-sharing-2.2.1-1.el8.noarch
- nothing provides /usr/libexec/platform-python needed by cockpit-file-sharing-2.3.0-1.el8.noarch
- nothing provides /usr/libexec/platform-python needed by cockpit-file-sharing-2.3.1-1.el8.noarch
- nothing provides /usr/libexec/platform-python needed by cockpit-file-sharing-2.4.0-3.el8.noarch
- nothing provides /usr/libexec/platform-python needed by cockpit-file-sharing-2.4.1-1.el8.noarch
- nothing provides /usr/libexec/platform-python needed by cockpit-file-sharing-2.4.1-2.el8.noarch
dnf search nfs-kernel-server
nothing found.
dnf install python3
package python3-3.9.7-1.fc34.x86_64 has already installed.
rpm -qa|grep nfs
sssd-nfs-idmap-2.5.2-2.fc34.x86_64
libnfsidmap-2.5.4-2.rc3.fc34.x86_64
nfs-utils-2.5.4-2.rc3.fc34.x86_64
libnfs-4.0.0-4.fc34.x86_64
qemu-block-nfs-5.2.0-8.fc34.x86_64
Describe the request
Currently when selecting the Windows ACLs option on a samba share it adds the following values:
map acl inherit = yes
acl_xattr:ignore system acls = yes
vfs objects = acl_xattr
Which is perfect, however with these options it is designed for solely Windows clients, not a mixed Windows/Linux/Possibly MacOS? clients due to the way it applies the ACLs
If we're to apply the following values:
map acl inherit = yes
vfs objects = acl_xattr
The Windows ACLs are able to be processed by both Windows and non-Windows clients, and is technically how we were setting up the shares prior to the typo within acl_xattr: ignore system acls = yes
being fixed.
(Prior when the share would actually list the options as:
map acl inherit = yes
acl_xattr:ignore system acl = yes
vfs objects = acl_xattr
It would actually ignore the middle value as it seems samba stops checking for error handling and just makes the value null if there is an option with a : that has a junk value after it, for example read only:garbage = yes
gets parsed correctly by testparm but does not actually change anything on samba, so we were essentially configuring it as if there were only the map acl inherit = yes
, and vfs objects = acl_xattr
options previously)
Both configurations are completely valid, and have their own use-cases, they're just 2 different ways to setup the same thing both with their own reasons to use.
TL;DR --
Would it be possible to leave the current Windows ACLs option as-is, and add a second option which only adds the following to the share and call it something like "Windows ACLs with Linux support" or something?
map acl inherit = yes
vfs objects = acl_xattr
Let me know if you need any more info
Automatically modify or have an option to specify Linux folder permissions & ownership at share creation so that you do not need to do it manually in Navigator or Linux terminal.
Currentily following the instructions for "Ubuntu" does not work on 22.04.
Is there any plans to support this?
Hello,
Not sure if this is the correct place for this.
I installed cockpit-file-sharing on my newly genned Ubuntu server running Ubuntu 20.04.2 LTS.
the samba file sharing is overlaid with the spinning 45Drives spinning logo and an error shows up "Can't load /etc/samba/smb.conf - run testparm to debug it"
smb.conf does exist and I can edit it as sudo
testparm runs as sudo and has no issues or errors and samba works fine.
My user login to cockpit does have sudo privs and other items in cockpit do get elevated correctly.
perms on smb.conf
-rw-r--r-- 1 root root 9273 Jun 22 16:07 /etc/samba/smb.conf
I am not sure how to proceed.
Installed Ubuntu server on a Proxmox server as a VM, was able to get cockpit and filesharing installed with little issue. I'm now stuck on getting Samba to function properly. When I go to File Sharing > Samba I see this:
So, I go onto the Ubuntu server so I can edit that file and apparently it's a sample:
Could really use some assistance, googling "smb.conf is a sample," hasn't returned helpful results.
Thanks in advance,
-Nick
I want to translate it to simplified Chinese, can you help me?
I am running Cockpit 252-1 with file-sharing 2.4.4-1 on Ubuntu Server 21.10 and when I try to add an NFS share it spits this error at me.
Error occured when adding export: /usr/share/cockpit/file-sharing/nfs-manager/scripts/nfs_add.py exited with code 1
This looks like a cool project! I'd like to try it out but my smb.conf file is located at /usr/local/etc/ksmbd/smb.conf
. The syntax is mostly the same as with regular samba. Could this tool be modified to allow custom config file location?
Can a repo be provided for fedora, especially a package that doesnt depend on: /usr/libexec/platform-python
Current behavior when creating a samba share where the path is sub directory of cephfs mount does not show correct quota when mapped in windows.
Also to set a quota need to go to ceph dashboard, it would be nice to do from "Add Share" screen directly to avoid clicks.
Hi, Is it possible to provide a package for Ubuntu Server LTS 22.04 ?
Pls do consider.
Thanks,
MCZen
p.s. - Is there a Ubuntu PPA that has this package ?
I've ran into the issue a few times now where someone wants to create a new SMB share using the module but it only works if you are logged into root and most times you don't want everyone knowing the root password and in some instances, there is no root password for security reasons
it would be great if any user could log in, elevate themselves as an admin (like they already can) and then just allow them to make shares.
i believe the issue now is that for clusters there needs to be passwordless ssh between systems and that user needs to be able to make systems services
currently, there is no way around this besides making shares in the cli which defeats the purpose of this module
The project apparently attempts to handle the different package managers of various distributions by providing a single script that detects the distribution and perhaps other site details, and performs the desired administrative changes. However, this approach makes the applied changes opaque to the administrator. Many administrators prefer to know what configuration would be changed. Mostly, it would be easy to follow a few steps appropriate for a particular distribution, to configure the local package manager. Please consider providing such steps in the documentation, for use as an alternative to running a script on the system.
After the newest File-sharing update that added Ceph Quotes for SMB shares, the quota is set on creation but when you edit the share and change the quota it does not update.
Changing the quota and saving it does not display the new set quota in "df" or show in the ceph dashboard or on the client systems that had the share mapped.
Manually updating the quota in the ceph dashboard did reflect the new set quota but file-sharing was not able to push the newly updated quota to ceph
First I would like to thank all the contributors to this project for the great tool that has been shared with the community.
Second ....
Using a fresh headless install of Alma Linux 8.4 with samba installed and running...
Followed install instructions below...
"
$ curl -o /etc/yum.repos.d/45drives.repo http://images.45drives.com/repo/centos/45drives-centos.repo
$ dnf clean all && dnf makecache
$ dnf install cockpit-file-sharing
"
Result was a nicely working Cockpit Samba config tool that is a great addition to Samba command line configuration tools.
I especially like the Samba user configure tool included.
But....Now cockpit reports the following error message under "Software Updates "
"cannot update repo '45drives_stable': repomd.xml GPG signature verification error: Bad GPG signature"
Is this a security signature that is now out of date, missing or in error? If so how do I correct this error.
Any suggestions will be greatly appreciated.
Thanks
Just what the title says.
I'd like to be able to manually edit the share definitions at some point, or simply backing them up.
Thanks!
When using a remote host to ssh bridge into a cockpit host with this plugin installed, both the Samba and the NFS tabs show Samba is not installed. Please install...
and Failed to load NFS services. Is NFS installed or enabled?
respectively.
When starting cockpit on the host itself and using it directly, everything works as expected.
I tested this with:
Hi! I'm working on packaging this officially for Fedora. In general, we try to de-bundle things where we can. I noticed that there's a rather large file-sharing-patternfly.css.gz
included that appears to be minimized css from several sources. This seems unusual compared to the other cockpit modules I've looked at... can this be simplified?
Thanks for the plugin! I installed it after configuring Samba through smb.conf
with the shares I needed. Those shares aren't showing up on Cockpit. Do I have to remove the share and recreate it through the GUI before it's visible?
A warning message is displayed indicating that the path to a samba share does not exist when it does:
[root@rockygw1 ~]# stat /mnt/cephfs/samba
File: /mnt/cephfs/samba
Size: 2 Blocks: 0 IO Block: 65536 directory
Device: 62h/98d Inode: 1099511627777 Links: 4
Access: (0775/drwxrwxr-x) Uid: (202303/ boss) Gid: (200512/domain admins)
Context: unconfined_u:object_r:cephfs_t:s0
Access: 2022-06-27 14:25:44.333645216 -0300
Modify: 2022-06-27 14:29:55.285938146 -0300
Change: 2022-06-27 14:31:34.394801044 -0300
Birth: 2022-06-27 14:25:44.333645216 -0300
[root@rockygw1 ~]# echo $?
0
This may stem from checkIfExists()
in SambaShareEditor.vue being called before tmpShare.path
is assigned its proper value.
It seems to have a default value of "", or whatever value that props.share.path has initially (object is assigned in tmpShareInit()
).
` watch(() => props.share, () => {
tmpShareInit();
}, { lazy: false });
tmpShareInit() is also called in onMounted():
onMounted(() => tmpShareInit());
And again in a cancel function:
const cancel = () => {
tmpShareInit();
emit('hide');
}
This seems to be a race condition so it isn't consistently reproduced, have to refresh the browser a couple of times to reliably reproduce.
After creating a share in file sharing if you attempt to delete or remove the share it does not. you can see a wheel spinning in the background of the tab after pressing delete but nothing happens
this has been tested on Ubuntu 20.04 and Rocky8.4. the workaround, for now, is to use "net conf delshare share" and then manually deleting the directory in navigator or the terminal
User names in SMB shares have extra commas after upgrade to cockpit-file-sharing 3.2.3. This will take down the service for people using the usernames that have commas inserted (don't ask me how I know...).
To Reproduce
Open File Sharing in Cockpit (after upgrade to newest file sharing)
and check users on the file shares. If you have multiple users and groups you will see commas after some of them.
e.g. user1,
user2,
user3
Expected behavior
Usernames should be converted from the old format without commas e.g.:
user1
user2
Same for groups.
Screenshots
I already fixed it by removing the user names and adding them again so I cannot send a screenshot.
Desktop (please complete the following information):
Smartphone (please complete the following information):
I tried to use your Rocky Linux repo, but the xml file is not reachable.
45Drives Stable Packages 275 B/s | 196 B 00:00
Errors during downloading metadata for repository '45drives_stable':
- Status code: 404 for http://images.45drives.com/repo/centos/el34/stable/repodata/repomd.xml (IP: 204.235.208.90)
Error: Failed to download metadata for repo '45drives_stable': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
Ignoring repositories: 45drives_stable
I installed cockpit from Ubuntu source and added your repo
to manage my Samba (which works marvellously)
but in your repo you're more than just your add-ons, you also have cockpit-*
which under Ubuntu focal, at least break few packages
Applying updates failed
The following packages have unmet dependencies:
cockpit-system: Breaks: cockpit-dashboard but 215-1 is to be installed
cockpit-dashboard: Depends: cockpit-ws (< 215-1.1~) but 237.2-1focal is to be installed
cockpit-bridge: Breaks: cockpit-dashboard (< 233) but 215-1 is to be installed
apt-cache policy cockpit
cockpit:
Installed: 215-1
Candidate: 237.2-1focal
Version table:
252-1~ubuntu20.04.1 100
100 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 Packages
237.2-1focal 500
500 http://images.45drives.com/repo/debian focal/main amd64 Packages
*** 215-1 500
500 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages
100 /var/lib/dpkg/status
I was thinking of pinning your repo with a lower priority, but apparently my pinning simply won't want to work, which any will only fix the issue for myself.
cat /etc/apt/preferences.d/cockpit
Package: cockpit-*
Pin: origin "images.45drives.com"
Pin-Priority: 400
You come with a solution which could be removing those file from your repo or a better one if you know it.
You tell me
How to get vertical scrolling working on samba tab? If you have a lot of shares you are not able to scroll down ... doesn't work on Win10 with Edge, Firefox and even Chrome ...
It would be nice to be able to use these plugins for fedora, seeing as centos/rocky does not have btrfs support (yet). Given that fedora is upstream of centos, hopefully that wouldn't involve a large degree of work.
Attempting to add the repository and install cockpit-file-sharing
gets dependency errors upon installation.
Also tried installing the dependencies manually then installing the rpm directly, no go:
Building from source seems to be working fine so far.
Describe the bug
I follow the generic installation instrucctions. When I execute make install, I get this error:
mac@minipc:~/cockpit-file-sharing_3.2.5_generic$ sudo make install
Installing file-sharing
Creating install directory
mkdir -p /usr/share/cockpit/file-sharing
Copying files
Done installing file-sharing
cp -af system_files/* /
cp: cannot stat 'system_files/*': No such file or directory
make: [Makefile:124: system-files-install] Error 1 (ignored)
To Reproduce
Just follow the generic installation instructions on a ubuntu 22.04 server.
Expected behavior
The installations finishes without error.
Describe the bug
Trying to connect from MacOS gives me the error: The server may not exist or is unavailable at this time...
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Successful connection.
Screenshots
Desktop (please complete the following information):
Additional context
Used to work well before the most recent changes in the cockpit modules. Connecting with "Connect to server..." allows me to enter the username and password but always rejects it (shaking login window).
After installation, the existing shares in my SMB.conf file aren't loaded in the web panel.
Recreating the same info in the web panel doesnt show any message and the new shares arent stored in smb.conf either.
I have recreated the same shares in the webpanel and removed them from my smb.conf, so for me the issue is resolved.
For people with many shares, this might be an issue
On servers joined to an active directory, it would be great for larger organizations if shares could be created by a domain admin user. As of right now, it appears it can only be done with root user and an admin would need to distribute root user credentials to anyone who would like to make a share in File Sharing tab.
sudo commands will change the user in the terminal - but the user on Houston/cockpit remains the same if we click on "Limited Access" and enter the password.
When I open File Shares, it defaults to the NFS tab and pops an error that I haven't setup NFS. Because this server lives in a Mac/windows network, I am only exposing SMB shares and haven't set up NFS for a reason.
It would be nice to have a configuration option to disable the NFS tab, or just change the default tab to SMB.
Hi @joshuaboud 👋
Describe the bug
'@45drives/cockpit-css@^0.1.12' seems to not be available at npmjs.org
To Reproduce
Steps to reproduce the behavior:
make
commandExpected behavior
The library is pulled to begin the build
for ubuntu 21.10 there is no release yet....
Describe the bug
I can use Samba section but NFS section is not working at all.
The project is amazing. This extension for managing NAS options from cockpit is great.
Desktop (please complete the following information):
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.