Giter Club home page Giter Club logo

dazzle's Introduction

# 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".

dazzle's People

Contributors

cebe avatar chris-r avatar eriknelson avatar finkregh avatar hbons avatar michaeleino avatar peterverraedt avatar psctheone avatar tino-wittig avatar tuxmartin avatar vlenhart avatar vsviridov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dazzle's Issues

(duplicate) Dazzle create gives read/execute to others on Ubuntu 12.04 server

...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.

dazzle readme needs to be updated

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!

setup failes, if the name of the user and/or group is not 7 chars long

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`

sparkleshare server does not work on debian wheezy

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.

errors on setup with centos 6.3

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?

Is there a reason `dazzle link` requires root?

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?

setup assumes an init.d based sysmanager instead of systemd?

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".

Freeing disk space in repo

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?

Enable multiple accounts for "shared" projects

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.

Add optionnal config or command line option to name a DNS name

... 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")

Dazzle assumes that authorized SSH keys are stored in ~/.ssh/authorized_keys

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.

No default DAZZLE_USER

Nice defaults

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.

Restarting ssh considered harmful

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...

Unable to find Client ID

Hello

I've installed SparkleShare and I've completed the set up.
After I enter "link dazzle" I am prompted for my client id.
Which should be found in my status icon menu.

I don't see it anywhere.

screenshot from 2017-05-25 12 50 40

Is there an alternative way to access it? Or can I somehow get a new one?

dazzy setup error 114 ssh

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

create crypo does not work

You might want coment this line in the help until it does something :)
"create-encrypted PROJECT_NAME creates an encrypted SparkleShare project"

setup is broken if DAZZLE_HOME already exists

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".

setup can produce multiple unhandled errors, and it still reports success

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".

Uninstall

It would be nice if there was an un-install script.

erreur if i want install new project in dazzle

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

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.