hbons / dazzle Goto Github PK
View Code? Open in Web Editor NEWA script to easily set up a SparkleShare host
A script to easily set up a SparkleShare host
# Dazzle, SparkleShare host setup script An easier and less error prone way to set up a SparkleShare host. Created to work on Debian and Red Hat based systems. ## Usage Usage (as root): # Get Dazzle curl https://raw.githubusercontent.com/hbons/Dazzle/master/dazzle.sh \ --output /usr/local/bin/dazzle # Initial Dazzle setup chmod +x /usr/local/bin/dazzle dazzle setup # Link a SparkleShare client dazzle link # Create a new project dazzle create PROJECT_NAME ## Configuration You can control almost all configuration options via environment variables: export DAZZLE_USER=dazzle export DAZZLE_HOME=/var/lib/stuff sudo dazzle setup Available options are the following: * DAZZLE_USER: the Dazzle user. Defaults to "storage". * DAZZLE_GROUP: the Dazzle group. Defaults to "storage". * DAZZLE_HOME: the directory used to store projects. Defaults to "/home/storage".
In line 47 and 53 is a check to verify the user and the group, but it fails, if you use another username, which has more than 7 chars, you can use this cut command:
line 47
STORAGE=`grep "^$DAZZLE_USER:" /etc/passwd | cut --delimiter=: --fields=1`
line 53
STORAGE=`grep "^$DAZZLE_USER:" /etc/group | cut --delimiter=: --fields=1`
Mac .dmg files tend to be compressed so it makes sense to add them to the attributes file with -delta
DAZZLE_USER="${DAZZLE_USER:-$MYUSER}"
DAZZLE_GROUP="${DAZZLE_GROUP:-$DAZZLE_USER}"
DAZZLE_HOME="${DAZZLE_HOME:-/home/$DAZZLE_USER}"
There's no DAZZLE_USER defined before, so it creates user "" and /home/.ssh.
... and skip getting the public IP address from ifconfig.me/ip
Thanks for this script, it works really nicely and is easily readable. Quite reassuring for a script running as root.
Maybe dazzle.sh should stay simple and have "advanced" script with options next to it for "particular" situations (cf next issues "suggestions")
Currently the script cannot be used on Solaris derived operating systems due to missing os awareness.
It would be nice if there was an un-install script.
when i try to install dazzy its show
sudo dazzle setup 1/4 | Installing the Git package... -> The Git package has already been installed (version 1.9.1). 2/4 | Creating account "storage"... -> Account already exists. 3/4 | Configuring account "storage"... -> mkdir --parents /home/storage/.ssh -> touch /home/storage/.ssh/authorized_keys -> chmod 700 /home/storage/.ssh -> chmod 600 /home/storage/.ssh/authorized_keys 4/4 | Reloading the SSH config... -> /etc/init.d/ssh reload **/usr/local/bin/dazzle: line 114: /etc/init.d/ssh: No such file or directory**
show error as above there is error at Line 114
and may error bcs there is no ssh its sshd
so how can i solve it
best regards
https://github.com/hbons/Dazzle/blob/master/dazzle.sh#L155
TAR is not compressed.
Tar is now commonly used to collect many files into one larger file for distribution or archiving.
I'm using Dazzle to configure a SparkleShare host on a RPi that has an NFS mount with root squashed. I setup Dazzle with a home directory of /home/sparkle/
, sync its files to a sparkle
owned directory in the NFS mount and then bind mount that back over the spark home so that my sparkleshare is NFS backed (so it get's the benefit of all my NAS features).
However, since root is squashed, dazzle link
fails with this configuration. Root can't write the ssh-key to the authorized keys. The script also bombs out if I try to run it as sparkle
, who actually owns the files. I had to manually edit the authorized_keys
file and add my client ID, and this worked.
So it doesn't appear that root is required for dazzle link
. Is it possible to remove that requirement, and possibly remove it from any other dazzle command that claims to require it but does not?
Maybe I'm missing something, but it looks like the only difference between dazzle create
and dazzle create-encrypted
is how they name the repo…
ಠ_ಠ
You might want coment this line in the help until it does something :)
"create-encrypted PROJECT_NAME creates an encrypted SparkleShare project"
Simple solution: rename README to README.md or README.markdown
dazzle setup
which: no git in (/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
1/4 | Installing the Git package...
-> yum --assumeyes install git
Error: Nothing to do
2/4 | Creating account "storage"...
which: no git-shell in (/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
-> useradd storage --create-home --home /home/storage --system --shell --password "*" --user-group
useradd: invalid shell '--password'
anu idea what this is caused by?
hi i get this erreur if i want make new project.
(i used redhat os in virtual machine)
[root@localhost ~]# dazzle create PROJECT_NAME
which: no git in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
Creating project "PROJECT_NAME"...
-> init --bare /var/lib/stuff/PROJECT_NAME
init: invalid option: --bare
Try `init --help' for more information.
-> config --file /var/lib/stuff/PROJECT_NAME/config receive.denyNonFastForwards true
/usr/bin/dazzle: line 168: config: command not found
/usr/bin/dazzle: line 175: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 179: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 175: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 179: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 175: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 179: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 175: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 179: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 175: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 179: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 175: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 179: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 175: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 179: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 175: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 179: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 175: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 179: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 175: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 179: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 175: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 179: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 175: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 179: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 175: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 179: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 175: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 179: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 175: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 179: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 175: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 179: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 175: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 179: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 175: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 179: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 175: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 179: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 175: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 179: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 175: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 179: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 175: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 179: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 175: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 179: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 175: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 179: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 175: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 179: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 175: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 179: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 175: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 179: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 175: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 179: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 175: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 179: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 175: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
/usr/bin/dazzle: line 179: /var/lib/stuff/PROJECT_NAME/info/attributes: No such file or directory
-> chown --recursive dazzle:dazzle /var/lib/stuff
chown: invalid user: dazzle:dazzle' -> chmod --recursive o-rwx /var/lib/stuff/PROJECT_NAME chmod: cannot access
/var/lib/stuff/PROJECT_NAME': No such file or directory
If the target disk on the sparkleshare server created with dazzle runs out of disk space, what is the recommended way to prune the git repo history?
Installing the server on Wheezy does work but if you try to connect you get an error like (auth.log):
Nov 18 13:26:13 fb04-kuczera-lin sshd[18384]: Connection closed by xxx.xxx.xxx.xxx [preauth]
Nov 18 13:26:14 fb04-kuczera-lin sshd[18626]: Connection closed by xxx.xxx.xxx.xxx [preauth]
These are the only error-messages i could find.
I have a particular config with SSH where the host listens on port 22 but I use another port on the public frontend (multiple SSH, SSH listenning on port 443 for it to work on public wifis, avoiding script kiddies, etc.)
In the past I mistakenly used to restart ssh while still being connected via ssh. Of course this immediately killed my active console connection and sometimes even left me alone without being able to contact my server at all when sshd did not came up properly again.
Time passed and now - as a seasoned Unix user - I am aware that most ssh init scripts provide a reload
command that avoids the aforementioned nastiness. It keeps active ssh connections alive and only applies the configuration changes to new connections.
I'd argue that it would be a good choice to do that by default in dazzle.sh as well...
My SSH daemon is listening on ports 22 and 443. The output I receive from dazzle create Project
is
Address: [email protected]:22
443
Remote Path: /home/storage/Project
When setting up a "shared" project, I want to avoid add the ssh key of the other person to /home/storage/.ssh/authorized_keys because that would give them access to all my git repos.
Maybe having the an option to override the "storage" parameter. This way one can separate the access to the git repos. In that case, if the storage account exists maybe it would be user friendly to copy the existing key from there (main user of SparkleShare).
Again maybe this "advanced" version could be a different script to keep the "simple" version human readable.
...and probably other servers, but I didn't test any. I was able to use my own user (not storage) to add a hosted project and download a complete (but read-only) copy of a project without using the storage user or adding the key to "authorized_keys".
I'm submitting a simple patch, but I'm far from a Linux permissions expert.
I didn't apply the change to the entire DAZZLE_HOME directory (like the user/group ownership currently are). That could cause creating a new project to break existing projects if they are counting on the current behaviour for some reason. I just removed read/write/execute for others on the new project directory.
This worked for me, I was no longer able to successfully add and download the files to a project without properly adding the lkey and connecting as storage.
It might also be a good idea to change the umask for the storage user and ssh connections, but I don't know if that varies between distributions. The Ubuntu .profile has a comment "for ssh logins, install and configure the libpam-umask package", but that sounds like it might be Debian/Ubuntu specific.
OS: Fedora 32 for Raspberry Pi:
This one is a little odd because most major distributions at this point are systemd based and should use systemctl sshd reload
.
[root@<host> sparkleshare]# DAZZLE_USER=sparkle DAZZLE_GROUP=sparkle DAZZLE_HOME=/nfsmnt/sync ./dazzle.sh setup
1/4 | Installing the Git package...
-> The Git package has already been installed (version 2.26.2).
2/4 | Creating account "sparkle"...
-> Account already exists.
-> mkdir --parents /nfsmnt/sync
mkdir: cannot create directory ‘/nfsmnt’: File exists
3/4 | Configuring account "sparkle"...
-> mkdir --parents /nfsmnt/sync/.ssh
mkdir: cannot create directory ‘/nfsmnt’: File exists
-> touch /nfsmnt/sync/.ssh/authorized_keys
touch: cannot touch '/nfsmnt/sync/.ssh/authorized_keys': No such file or directory
-> chmod 700 /nfsmnt/sync/.ssh
chmod: cannot access '/nfsmnt/sync/.ssh': No such file or directory
-> chmod 600 /nfsmnt/sync/.ssh/authorized_keys
chmod: cannot access '/nfsmnt/sync/.ssh/authorized_keys': No such file or directory
4/4 | Reloading the SSH config...
-> /etc/init.d/ssh reload
./dazzle.sh: line 116: /etc/init.d/ssh: No such file or directory
Setup complete!
To create a new project, run "dazzle create PROJECT_NAME".
Installing dazzle as the readme says using "dazzle setup" will not properly do the setup as the user "" is used. After adding -u storage and deleting /home/.ssh I thought I was ok. However, a faulty entry in sshd_config also prevented ssh from starting at boot, locking me out. You definitely need to fix something (the readme or the defaults not being used) as this is potentially dangerous!
I'm trying to store my data on an NFS mount, so I pre-created /nfsmnt/sync
, expecting to be able to point DAZZLE_HOME
at this directory to use it as my main data directory.
OS: Fedora 32 for Raspberry Pi
Here's the output with my specific paths edited for privacy (there's also an error that I guess is the result of the script assuming something other than systemd? Out of scope for this issue so I will file separately):
[root@<host> sparkleshare]# DAZZLE_USER=sparkle DAZZLE_GROUP=sparkle DAZZLE_HOME=/nfsmnt/sync ./dazzle.sh setup
1/4 | Installing the Git package...
-> The Git package has already been installed (version 2.26.2).
2/4 | Creating account "sparkle"...
-> Account already exists.
-> mkdir --parents /nfsmnt/sync
mkdir: cannot create directory ‘/nfsmnt’: File exists
3/4 | Configuring account "sparkle"...
-> mkdir --parents /nfsmnt/sync/.ssh
mkdir: cannot create directory ‘/nfsmnt’: File exists
-> touch /nfsmnt/sync/.ssh/authorized_keys
touch: cannot touch '/nfsmnt/sync/.ssh/authorized_keys': No such file or directory
-> chmod 700 /nfsmnt/sync/.ssh
chmod: cannot access '/nfsmnt/sync/.ssh': No such file or directory
-> chmod 600 /nfsmnt/sync/.ssh/authorized_keys
chmod: cannot access '/nfsmnt/sync/.ssh/authorized_keys': No such file or directory
4/4 | Reloading the SSH config...
-> /etc/init.d/ssh reload
./dazzle.sh: line 116: /etc/init.d/ssh: No such file or directory
Setup complete!
To create a new project, run "dazzle create PROJECT_NAME".
In my sshd_config I have
AuthorizedKeysFile /etc/ssh/user-keys/%u
so the user storage's authorized keys are stored in /etc/ssh/user-keys/storage
(writable only by root) and /home/storage/.ssh/authorized_keys
is disregarded. This is probably really uncommon and not at all a dealbreaker for me but I thought you should be aware of it and perhaps fix it on a rainy day.
OS: Fedora 32 for Raspberry Pi
Here are the relevant logs, I've filed issues that caused the underlying problems, but as you can see, many separate things went wrong, and setup is happily reporting success at the end. There doesn't appear to be much error handling, if any.
[root@<host> sparkleshare]# DAZZLE_USER=sparkle DAZZLE_GROUP=sparkle DAZZLE_HOME=/nfsmnt/sync ./dazzle.sh setup
1/4 | Installing the Git package...
-> The Git package has already been installed (version 2.26.2).
2/4 | Creating account "sparkle"...
-> Account already exists.
-> mkdir --parents /nfsmnt/sync
mkdir: cannot create directory ‘/nfsmnt’: File exists
3/4 | Configuring account "sparkle"...
-> mkdir --parents /nfsmnt/sync/.ssh
mkdir: cannot create directory ‘/nfsmnt’: File exists
-> touch /nfsmnt/sync/.ssh/authorized_keys
touch: cannot touch '/nfsmnt/sync/.ssh/authorized_keys': No such file or directory
-> chmod 700 /nfsmnt/sync/.ssh
chmod: cannot access '/nfsmnt/sync/.ssh': No such file or directory
-> chmod 600 /nfsmnt/sync/.ssh/authorized_keys
chmod: cannot access '/nfsmnt/sync/.ssh/authorized_keys': No such file or directory
4/4 | Reloading the SSH config...
-> /etc/init.d/ssh reload
./dazzle.sh: line 116: /etc/init.d/ssh: No such file or directory
Setup complete!
To create a new project, run "dazzle create PROJECT_NAME".
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.