Merge pull request #54 from YunoHost/rework-end-of-installation

Remove postinstall and instead print a text explaining what to do and pointing to the documentation
This commit is contained in:
Alexandre Aubin 2018-12-18 16:16:22 +01:00 committed by GitHub
commit 35925a5a6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -122,10 +122,9 @@ function main()
reboot reboot
fi fi
step post_install || die "Post-installation failed"
info "Installation logs are available in $YUNOHOST_LOG" info "Installation logs are available in $YUNOHOST_LOG"
success "YunoHost installation completed !" success "YunoHost installation completed !"
conclusion
exit 0 exit 0
} }
@ -428,51 +427,35 @@ function fix_locales() {
export LC_ALL export LC_ALL
} }
function post_install() { function conclusion() {
# No postinstall in auto mode # Get first local IP and global IP
[[ "$AUTOMODE" == "1" ]] && return 0 local local_ip=$(hostname --all-ip-address | awk '{print $1}')
local global_ip=$(curl https://ip.yunohost.org 2>/dev/null)
# Remove whiptail and dialog remains... # Will ignore local ip if it's already the global IP (e.g. for some VPS)
clear [[ "$local_ip" != "$global_ip" ]] || local_ip=""
local text=" # Formatting
Yunohost packages have been installed successfully! [[ -z "$local_ip" ]] || local_ip=$(echo -e "\n - https://$local_ip/ (local IP, if self-hosting at home)")
[[ -z "$global_ip" ]] || global_ip=$(echo -e "\n - https://$global_ip/ (global IP, if you're on a VPS)")
You can now proceed with Yunohost post-installation. cat << EOF
This is where you will be asked for : ===============================================================================
- the main DNS domain name of your server You should now proceed with Yunohost post-installation. This is where you will
- the administration password be asked for :
- the main domain of your server ;
- the administration password.
You can also perform this step later on your own : You can perform this step :
- either from a shell, by running 'yunohost tools postinstall' - from the command line, by running 'yunohost tools postinstall' as root
as root - or from your web browser, by accessing : ${local_ip}${global_ip}
- either from your web browser, by accessing https://yunohost.local
Please refer to https://yunohost.org/#/postinstall If this is your first time with YunoHost, it is strongly recommended to take
for additionnal information. time to read the administator documentation and in particular the sections
'Finalizing your setup' and 'Getting to know YunoHost'. It is available at
Do you want to proceed with YunoHost post-installation now? the following URL : https://yunohost.org/admindoc
" ===============================================================================
whiptail --title "Post-installation" --yesno "$text" 25 78 \ EOF
|| return 0
/usr/bin/yunohost tools postinstall
local POSTINSTALL_EXIT_CODE="$?"
while [[ "$POSTINSTALL_EXIT_CODE" != "0" ]] ;
do
local text_retry="
Yunohost post-installation has failed.
Do you want to try again now?
"
whiptail --title "Post-installation" --yesno "$text_retry" 12 78 --defaultno \
|| return $POSTINSTALL_EXIT_CODE
/usr/bin/yunohost tools postinstall
POSTINSTALL_EXIT_CODE="$?"
done
return 0
} }
############################################################################### ###############################################################################