commit 4974dcd3abf64d26f39385e3a93eec7eab0553a2
parent 08248302ac5103b9632c1ebfcd5bf01f246656f4
Author: parazyd <parazyd@dyne.org>
Date: Mon, 16 May 2016 19:40:26 +0200
make way for bitcoin wallet
Diffstat:
3 files changed, 49 insertions(+), 44 deletions(-)
diff --git a/conf/README b/conf/README
@@ -1,27 +0,0 @@
-Here's some more info on the features
-
-# WebDAV
-To generate a WebDAV login entry by yourself, issue the following command:
-
-####################
-`echo -n "yourUsername:WebDAV:" \
- && echo -n "yourUsername:WebDAV:yourDavPassword" \
- | md5sum \
- | awk '{print $1}'`
-####################
-
-Add it to the 'davpasswd' file which is located in
-/etc/apache2/DAV/davpasswd on your coffin box. Or add it now here,
-before installation.
-
-The file 'webdav.skel' located in this directory is an example entry
-for the WebDAV of your tomb. Insert correct info in it, and copy it to
-your USB's .coffin directory and name it 'webdav.conf'. You have to do
-this every time for each new tomb you create.
-Remember to set the ':webdav' feature in your hook ;)
-
-# SSHFS
-In order to get SSH access with your new username, copy your SSH
-pubkey to your USB's .coffin directory and name it 'tombName.pub'
-You only have to do this once-per-username, not for every tomb.
-Remember to set the ':sshfs' feature in your hook ;)
diff --git a/conf/webdav.skel b/conf/webdav.skel
@@ -1,13 +0,0 @@
-# Add this above the last two lines in
-# /etc/apache2/sites-enabled/coffindav.conf
-
-alias /yourTombName /media/yourTombName
-<Directory "/media/yourTombName">
- Dav On
- AllowOverride none
- Options Indexes FollowSymlinks
- AuthType Digest
- AuthName WebDAV
- AuthUserFile /etc/apache2/DAV/davpasswd
- Require user yourUsername
-</Directory>
diff --git a/helpers/makehook b/helpers/makehook
@@ -1,8 +1,22 @@
#!/usr/bin/env bash
#
-# Helper script to generate hooks for coffin.
+# Copyright (c) 2016 Dyne.org Foundation
+# coffin is written and maintained by parazyd <parazyd@dyne.org>
#
-# ~ parazyd
+# This file is part of coffin
+#
+# This source code is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This software is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this source code. If not, see <http://www.gnu.org/licenses/>.
hooks="hook"
davfile="davpasswd"
@@ -38,7 +52,7 @@ genhook() {
hookentry="create:${undertaker}:${tombname}:${tombsize}:webdav"
echo $hookentry >> $hooks
gendav
- echo $daventry >> $davfile
+ echo ${daventry} >> ${davfile}
;;
delete)
hookentry="delete:${undertaker}:${tombname}"
@@ -46,11 +60,15 @@ genhook() {
echo "WARNING: This delete hook will not work, as you do not
have the keyfile used for it with you."
}
- echo $hookentry >> $hooks
+ echo ${hookentry} >> ${hooks}
;;
backup)
echo "backup"
;;
+ wallet)
+ hookentry="create:${undertaker}:${tombname}:${tombsize}:wallet"
+ echo ${hookentry} >> ${hooks}
+ ;;
*)
echo "how did you even get here?"
;;
@@ -140,6 +158,32 @@ happenz() {
# TODO: make pattern recognition, sed or awk
;;
+ 5)
+ echo -e "\n"
+ echo "Creating a Bitcoin wallet..."
+
+ read -p "Please input the username you wish to use: " undertaker
+ re='^[A-Za-z0-9]+$'
+ [[ $undertaker =~ $re ]] || {
+ echo "ERROR: Invalid characters in username."
+ exec $0
+ }
+
+ read -p "Please input the name you wish to use for your tomb: " tombname
+ [[ $tombname =~ $re ]] || {
+ echo "ERROR: Invalid characters in tomb name."
+ exec $0
+ }
+
+ tombsize=20 # NOTE: could possibly be less
+
+ read -r -p "Please input the password you will use to access your tomb: " davpass
+
+ genhook wallet
+ [[ $? = 0 ]] && {
+ successmsg
+ }
+ ;;
*)
echo -e "\n"
echo "No valid option. Exiting..."
@@ -161,6 +205,7 @@ main() {
2) Delete an existing tomb on the coffin
3) Backup a tomb from the coffin
4) Toggle your tomb's open/close state
+5) Configure and create a Bitcoin wallet
#########################################################