Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
d3c7c18809 | |||
bf65b56f81 | |||
fe2b275779 | |||
a3add44c29 | |||
7d38b27c05 | |||
c1de357149 | |||
10516d232f | |||
e0dc1222ed | |||
4b7406b60a | |||
7d1df01a3e | |||
1f7515a0ed | |||
a4539fae1d | |||
ef06d24202 | |||
50325b1f3a |
70
README.md
70
README.md
@ -2,6 +2,74 @@
|
|||||||
|
|
||||||
Das Schließsystem läuft auf einem RaspberryPi mit der Erweiterungsplatine "PiFaceDigitalIO".
|
Das Schließsystem läuft auf einem RaspberryPi mit der Erweiterungsplatine "PiFaceDigitalIO".
|
||||||
|
|
||||||
|
##Software##
|
||||||
|
|
||||||
|
###Installation###
|
||||||
|
<code>apt-get install python-pifacedigitalio </code>
|
||||||
|
|
||||||
|
Um das Paket zu installieren muss die */etc/apt/sources.list* angepasst werden.
|
||||||
|
|
||||||
|
<code>deb http://archive.raspbian.org/raspbian wheezy main contrib non-free rpi</code>
|
||||||
|
|
||||||
|
<code>deb-src http://archive.raspbian.org/raspbian wheezy main contrib non-free rpi</code>
|
||||||
|
|
||||||
|
Wer apt-get benutzt, kann den Raspbian Pubkey zum keyring hinzufügen.
|
||||||
|
|
||||||
|
<code>wget http://archive.raspbian.org/raspbian.public.key -O - | sudo apt-key add -</code>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
###Dateiliste###
|
||||||
|
Der Deamon besteht aus folgenden Dateien.
|
||||||
|
|
||||||
|
* foodoor
|
||||||
|
* foodoord
|
||||||
|
* foodoord.conf
|
||||||
|
* foodoord_initd
|
||||||
|
* foodoor-ssh-wrapper
|
||||||
|
* foodoor-update-keydb
|
||||||
|
|
||||||
|
##Schüssel
|
||||||
|
|
||||||
|
###Schlüsselupdate
|
||||||
|
<pre><code>foodoor-update-keydb
|
||||||
|
</code></pre>
|
||||||
|
Aktualisiert die die Schlüssel auf der Tür und baut die *Authorized_Keys* für die User *open* und *close*. Keys die nicht dem OpenSSH-Format mit 4096 bit entsprechen, werden ignoriert. Wenn das Script von Hand aufgerufen wird, werden die betroffenen Keys angezeigt. Über einen Cronjob werden die Keys alle **5 Min aktualisiert**.
|
||||||
|
|
||||||
|
###Schlüsselformate###
|
||||||
|
Der foodoord akzeptiert nur Pub-Keys im *OpenSSH2-Format*. Keys lassen sich unter anderem mit OpenSSH oder PuTTygen erzeugen.
|
||||||
|
|
||||||
|
###OpenSSH####
|
||||||
|
|
||||||
|
####Keys generieren####
|
||||||
|
* Mit <code>ssh-keygen -b 4096 </code> lassen sich Keys generieren.
|
||||||
|
* <code>ssh-add $Pfad_zum_Key</code> fügt den Key dem ssh-Agent hinzu. Die Option <code>ssh-add -l</code> zeigt geladene Keys an.
|
||||||
|
* <code>ssh-kegen -l -f $Pfad_zum_Key </code> gibt den Fingerprint und andere Informationen zurück.
|
||||||
|
|
||||||
|
####Keys konvertieren(PuTTy>OpenSSH):####
|
||||||
|
* <code>ssh-keygen -i $Pfad_zum_Key > $Pfad_neuer_Pfad.pub</code> liest ssh2-kompatible Keys(RFC 4716) ein und speichert diese im OpenSSH-Format.
|
||||||
|
|
||||||
|
###PuTTy###
|
||||||
|
Da die Tür nur Keys im OpenSSH-Format verträgt, dürfen auch mit Putty nur OpenSSH-Keys genutzt werden.
|
||||||
|
|
||||||
|
###Keys generieren (OpenSSH-Format mit PuttyGen):###
|
||||||
|
1. PuTTYgen öffnen
|
||||||
|
2. Unten "Number of Bits in a generated Key:" 4096 eintippen
|
||||||
|
3. "Generate" klicken um Key zu generieren
|
||||||
|
4. Nach dem generieren oben im Menu "Conversions" > "Export OpenSSH-Key"
|
||||||
|
5. Speichern
|
||||||
|
|
||||||
|
Es ist zu beachten, dass Putty den PrivateKey im Putty-Format benötigt! Das heißt, falls der generierte Key vor dem Export nicht gespeichert wurde, muss der private Key noch konvertiert werden, siehe nächster Punkt!
|
||||||
|
|
||||||
|
###Keys konvertieren(OpenSSH>PuTTy):###
|
||||||
|
1. PuTTYgen öffnen
|
||||||
|
2. "Load" drücken
|
||||||
|
3. OpenSSH-Key auswählen
|
||||||
|
4. "Save Private-Key" drücken
|
||||||
|
5. Speichern
|
||||||
|
|
||||||
|
##Hardware
|
||||||
|
|
||||||
### Input:
|
### Input:
|
||||||
* ssh-login
|
* ssh-login
|
||||||
* Klingel
|
* Klingel
|
||||||
@ -10,4 +78,4 @@ Das Schließsystem läuft auf einem RaspberryPi mit der Erweiterungsplatine "PiF
|
|||||||
### Output:
|
### Output:
|
||||||
* Status LEDs
|
* Status LEDs
|
||||||
* Summer
|
* Summer
|
||||||
* Keymatic
|
* Keymatic
|
||||||
|
11
debian/changelog
vendored
Normal file
11
debian/changelog
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
foodoord (2-1~foobar1) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
-- Hauro <hauro@chaospott.de> Fri, 17 Jul 2015 20:10:27 +0200
|
||||||
|
|
||||||
|
foodoord (1-1~foobar1) unstable; urgency=low
|
||||||
|
|
||||||
|
* Initial release.
|
||||||
|
|
||||||
|
-- gammlaa <gammlaa@chaospott.de> Sat, 04 Apr 2015 16:19:46 +0100
|
1
debian/compat
vendored
Normal file
1
debian/compat
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
9
|
15
debian/control
vendored
Normal file
15
debian/control
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
Source: foodoord
|
||||||
|
Section: net
|
||||||
|
Priority: optional
|
||||||
|
Maintainer: gammlaa <gammlaa@chaospott.de>
|
||||||
|
Build-Depends: debhelper (>= 9), dh-python, python
|
||||||
|
Standards-Version: 3.9.6
|
||||||
|
Homepage: https://github.com/c3e/foodoord
|
||||||
|
|
||||||
|
Package: foodoord
|
||||||
|
Architecture: all
|
||||||
|
X-Python-Version: any
|
||||||
|
Depends: ${misc:Depends}, adduser, python-pifacedigitalio
|
||||||
|
Description: Türschließsystem des foobar e.V.
|
||||||
|
Simsalabim!
|
||||||
|
|
38
debian/copyright
vendored
Normal file
38
debian/copyright
vendored
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||||
|
Upstream-Name: foodoord
|
||||||
|
Source: <url://example.com>
|
||||||
|
|
||||||
|
Files: *
|
||||||
|
Copyright: <years> <put author's name and email here>
|
||||||
|
<years> <likewise for another author>
|
||||||
|
License: <special license>
|
||||||
|
<Put the license of the package here indented by 1 space>
|
||||||
|
<This follows the format of Description: lines in control file>
|
||||||
|
.
|
||||||
|
<Including paragraphs>
|
||||||
|
|
||||||
|
# If you want to use GPL v2 or later for the /debian/* files use
|
||||||
|
# the following clauses, or change it to suit. Delete these two lines
|
||||||
|
Files: debian/*
|
||||||
|
Copyright: 2014 gammlaa <gammlaa@chaospott.de>
|
||||||
|
License: GPL-2+
|
||||||
|
This package 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 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
.
|
||||||
|
This package 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 program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
.
|
||||||
|
On Debian systems, the complete text of the GNU General
|
||||||
|
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
|
||||||
|
|
||||||
|
# Please also look if there are files or directories which have a
|
||||||
|
# different copyright/license attached and list them here.
|
||||||
|
# Please avoid to pick license terms that are more restrictive than the
|
||||||
|
# packaged work, as it may make Debian's contributions unacceptable upstream.
|
1
debian/foodoord.cron.d
vendored
Normal file
1
debian/foodoord.cron.d
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
*/5 * * * * root [ -x /usr/sbin/foodoor-update-keydb ] && /usr/sbin/foodoor-update-keydb >/dev/null 2>&1
|
5
debian/foodoord.install
vendored
Normal file
5
debian/foodoord.install
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
foodoord.conf etc
|
||||||
|
foodoor usr/sbin
|
||||||
|
foodoord usr/sbin
|
||||||
|
foodoor-ssh-wrapper usr/sbin
|
||||||
|
foodoor-update-keydb usr/sbin
|
38
debian/foodoord.preinst
vendored
Normal file
38
debian/foodoord.preinst
vendored
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# preinst script for foodoord
|
||||||
|
#
|
||||||
|
# see: dh_installdeb(1)
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# summary of how this script can be called:
|
||||||
|
# * <new-preinst> `install'
|
||||||
|
# * <new-preinst> `install' <old-version>
|
||||||
|
# * <new-preinst> `upgrade' <old-version>
|
||||||
|
# * <old-preinst> `abort-upgrade' <new-version>
|
||||||
|
# for details, see http://www.debian.org/doc/debian-policy/ or
|
||||||
|
# the debian-policy package
|
||||||
|
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
install|upgrade)
|
||||||
|
addgroup --system foodoor
|
||||||
|
adduser --system --ingroup foodoor --home /var/lib/foodoor/open --disabled-password --disabled-login open
|
||||||
|
adduser --system --ingroup foodoor --home /var/lib/foodoor/close --disabled-password --disabled-login close
|
||||||
|
;;
|
||||||
|
|
||||||
|
abort-upgrade)
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
echo "preinst called with unknown argument \`$1'" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# dh_installdeb will replace this with shell code automatically
|
||||||
|
# generated by other debhelper scripts.
|
||||||
|
|
||||||
|
#DEBHELPER#
|
||||||
|
|
||||||
|
exit 0
|
12
debian/rules
vendored
Executable file
12
debian/rules
vendored
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
#!/usr/bin/make -f
|
||||||
|
# See debhelper(7) (uncomment to enable)
|
||||||
|
# output every command that modifies files on the build system.
|
||||||
|
#DH_VERBOSE = 1
|
||||||
|
|
||||||
|
%:
|
||||||
|
dh $@ --with=python2
|
||||||
|
|
||||||
|
override_dh_installinit:
|
||||||
|
mkdir debian/foodoord/etc/init.d
|
||||||
|
cp foodoord_initd debian/foodoord/etc/init.d/foodoord
|
||||||
|
dh_installinit --onlyscripts
|
1
debian/source/format
vendored
Normal file
1
debian/source/format
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
3.0 (quilt)
|
@ -24,13 +24,14 @@ do
|
|||||||
do
|
do
|
||||||
valid_key=$(ssh-keygen -l -f ${keyfile})
|
valid_key=$(ssh-keygen -l -f ${keyfile})
|
||||||
if [ "$?" -eq "0" ]; then
|
if [ "$?" -eq "0" ]; then
|
||||||
if [ $(echo "${valid_key}" | cut -d" " -f1) -ne "4096" ]; then
|
if [ $(echo "${valid_key}" | cut -d" " -f1) -lt "4096" ]; then
|
||||||
echo "Key size of key ${keyfile} not equal to 4096. Not adding it to key database." >&2
|
echo "Size of key ${keyfile} is less than 4096. Not adding it to key database." >&2
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
printf "command=\"/usr/sbin/foodoor ${action}\",no-port-forwarding,no-X11-forwarding,no-agent-forwarding " >> ${outfile}
|
printf "command=\"/usr/sbin/foodoor ${action}\",no-port-forwarding,no-X11-forwarding,no-agent-forwarding " >> ${outfile}
|
||||||
cat "${keyfile}" >> ${outfile}
|
cat "${keyfile}" >> ${outfile}
|
||||||
|
echo >> ${outfile}
|
||||||
done
|
done
|
||||||
install -d -o ${action} -g nogroup -m 0700 /var/lib/foodoor/${action}/.ssh
|
install -d -o ${action} -g nogroup -m 0700 /var/lib/foodoor/${action}/.ssh
|
||||||
install -b -S .last -o ${action} -g nogroup -m 0600 ${outfile} /var/lib/foodoor/${action}/.ssh/authorized_keys
|
install -b -S .last -o ${action} -g nogroup -m 0600 ${outfile} /var/lib/foodoor/${action}/.ssh/authorized_keys
|
||||||
|
Reference in New Issue
Block a user