mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
This makes the installation a bit more secure by ensuring a user does not accidentally expose a way for unauthorized users to add new ssh keys to the system. Additionally, this removes the extra HOSTNAME file to make the initial install process easier (that file was not modifiable by any dokku commands. Closes #2247
36 lines
716 B
Bash
Executable File
36 lines
716 B
Bash
Executable File
#!/bin/bash
|
|
set -eo pipefail
|
|
[[ $TRACE ]] && set -x
|
|
|
|
if [[ -e /usr/share/debconf/confmodule ]]; then
|
|
# shellcheck disable=SC1091
|
|
. /usr/share/debconf/confmodule
|
|
fi
|
|
|
|
case "$1" in
|
|
install)
|
|
db_get "dokku/skip_key_file"
|
|
if [ -z "${DEBCONF_RECONFIGURE}" ] && [ "$RET" != "true" ]; then
|
|
db_get "dokku/key_file"
|
|
if [ ! -f "$RET" ]; then
|
|
echo "Error: keyfile '$RET' not found." >&2
|
|
echo " To deploy, you will need to generate a keypair and add with 'dokku ssh-keys:add'." >&2
|
|
db_reset "dokku/key_file"
|
|
fi
|
|
fi
|
|
;;
|
|
|
|
upgrade) ;;
|
|
|
|
\
|
|
abort-upgrade) ;;
|
|
|
|
\
|
|
*)
|
|
echo "preinst called with unknown argument \`$1'" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
exit 0
|