124 lines
4.1 KiB
Plaintext
124 lines
4.1 KiB
Plaintext
# ====================
|
|
# - Install via debian packagesystem
|
|
# ====================
|
|
|
|
# - Install dependencies
|
|
# -
|
|
apt-get install ruby-dev gnupg2 libgpgme-dev libsqlite3-dev libssl-dev build-essential
|
|
apt-get install haveged
|
|
|
|
# - Install schleuder 3 from stretch-backports
|
|
# -
|
|
apt-get install -t stretch-backports schleuder
|
|
|
|
# - You will get the following output
|
|
# -
|
|
# - Type 'J'
|
|
# -
|
|
Paketlisten werden gelesen... Fertig
|
|
Abhängigkeitsbaum wird aufgebaut.
|
|
Statusinformationen werden eingelesen.... Fertig
|
|
The following additional packages will be installed:
|
|
fonts-lato libgpgme11 libruby2.3 libyaml-0-2 rake ruby ruby-activemodel ruby-activerecord ruby-activesupport
|
|
ruby-arel ruby-atomic ruby-backports ruby-blankslate ruby-builder ruby-daemons ruby-did-you-mean ruby-eventmachine
|
|
ruby-gpgme ruby-i18n ruby-json ruby-mail ruby-mail-gpg ruby-mime-types ruby-minitest ruby-multi-json ruby-net-telnet
|
|
ruby-oj ruby-power-assert ruby-rack ruby-rack-protection ruby-rack-test ruby-sinatra ruby-sinatra-contrib
|
|
ruby-sqlite3 ruby-test-unit ruby-thor ruby-thread-safe ruby-tilt ruby-tzinfo ruby2.3 rubygems-integration
|
|
schleuder-cli sqlite3 thin
|
|
Vorgeschlagene Pakete:
|
|
gpgsm ri ruby-dev ruby-builder-doc bundler sqlite3-doc
|
|
Die folgenden NEUEN Pakete werden installiert:
|
|
fonts-lato libgpgme11 libruby2.3 libyaml-0-2 rake ruby ruby-activemodel ruby-activerecord ruby-activesupport
|
|
ruby-arel ruby-atomic ruby-backports ruby-blankslate ruby-builder ruby-daemons ruby-did-you-mean ruby-eventmachine
|
|
ruby-gpgme ruby-i18n ruby-json ruby-mail ruby-mail-gpg ruby-mime-types ruby-minitest ruby-multi-json ruby-net-telnet
|
|
ruby-oj ruby-power-assert ruby-rack ruby-rack-protection ruby-rack-test ruby-sinatra ruby-sinatra-contrib
|
|
ruby-sqlite3 ruby-test-unit ruby-thor ruby-thread-safe ruby-tilt ruby-tzinfo ruby2.3 rubygems-integration schleuder
|
|
schleuder-cli sqlite3 thin
|
|
0 aktualisiert, 45 neu installiert, 0 zu entfernen und 47 nicht aktualisiert.
|
|
Es müssen 9.420 kB an Archiven heruntergeladen werden.
|
|
Nach dieser Operation werden 42,1 MB Plattenplatz zusätzlich benutzt.
|
|
Möchten Sie fortfahren? [J/n]
|
|
|
|
|
|
|
|
# ---
|
|
# - Enable user schleuder for managing lists
|
|
# ---
|
|
|
|
backup_date="$(date +%Y-%m-%d-%H%M)"
|
|
schleuder_config="/etc/schleuder/schleuder.yml"
|
|
user_schleuder_config="/var/lib/schleuder/.schleuder-cli/schleuder-cli.yml"
|
|
|
|
# - Create API Key for user schleuder
|
|
# -
|
|
api_key="$(schleuder new_api_key)"
|
|
|
|
# - Add the generated API Key to the list of valid api keys at
|
|
# - configuration file $schleuder_config
|
|
# -
|
|
if ! grep -q "$api_key" 2> /dev/null $schleuder_config ; then
|
|
perl -i.$backup_date -n -p \
|
|
-e "s/(^(\s*)valid_api_keys:.*)/\1\n\2 - ${api_key}/" \
|
|
$schleuder_config
|
|
fi
|
|
|
|
|
|
# - Add generated API Key to schleuder's configuration file
|
|
# - '${user_schleuder_config}'
|
|
# -
|
|
|
|
# - If no configuration file present, create a new default one.
|
|
# -
|
|
have_dot_schleuder_cli_yml=true
|
|
if [[ ! -d "~schleuder/.schleuder-cli" ]] ; then
|
|
have_dot_schleuder_cli_yml=false
|
|
elif [[ ! -f "~schleuder/.schleuder-cli/schleuder-cli.yml" ]] ; then
|
|
|
|
# - If the directory is present, no default configuration file (see below)
|
|
# - will be written
|
|
# -
|
|
mv "~schleuder/.schleuder-cli" "~schleuder/.schleuder-cli.${backup_date}"
|
|
|
|
have_dot_schleuder_cli_yml=false
|
|
fi
|
|
|
|
if ! $have_dot_schleuder_cli_yml ; then
|
|
|
|
# Creates a default configuration file '${user_schleuder_config}'
|
|
#
|
|
su - schleuder -s /bin/bash -c "/usr//bin/schleuder-cli lists list > /dev/null 2>&1"
|
|
|
|
fi
|
|
|
|
# - Now, add the API Key..
|
|
# -
|
|
perl -i.$backup_date -n -p \
|
|
-e "s/^(\s*api_key:).*/\1 ${api_key}/" \
|
|
${user_schleuder_config}
|
|
|
|
|
|
# - Get tls fingerprint of configured certificate
|
|
# -
|
|
cert_fingerprint="$(schleuder cert fingerprint | awk '{print$4}')"
|
|
|
|
# - Add the fingerprint to schleuder users private configuration file
|
|
# -
|
|
if ! grep -q "$cert_fingerprint" 2> /dev/null ${user_schleuder_config} ; then
|
|
perl -i.$backup_date -n -p \
|
|
-e "s/^(\s*tls_fingerprint:).*/\1 ${cert_fingerprint}/" \
|
|
${user_schleuder_config}
|
|
fi
|
|
|
|
|
|
# - Restart 'schleuder-api-daemon'
|
|
# -
|
|
systemctl restart schleuder-api-daemon
|
|
|
|
|
|
|
|
# ---
|
|
# - Add Postfix support
|
|
# ---
|
|
|
|
|