install 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #!/bin/bash
  2. source _common.sh
  3. source /usr/share/yunohost/helpers
  4. secret=$(ynh_string_random --length=24)
  5. timezone=$(timedatectl show --value --property=Timezone)
  6. #=================================================
  7. # INSTALL DEPENDENCIES
  8. #=================================================
  9. ynh_script_progression "Installing dependencies..."
  10. ynh_nodejs_install
  11. #=================================================
  12. # DOWNLOAD, CHECK AND UNPACK SOURCE
  13. #=================================================
  14. ynh_script_progression "Setting up source files..."
  15. ynh_setup_source --dest_dir="$install_dir"
  16. #=================================================
  17. # APP INITIAL CONFIGURATION
  18. #=================================================
  19. ynh_script_progression "Adding $app's configuration files..."
  20. ynh_config_add_nginx
  21. ynh_config_add_systemd
  22. yunohost service add $app --description="Customizable browser's home page" --log="/var/log/$app/$app.log"
  23. #=================================================
  24. # ADD A CONFIGURATION
  25. #=================================================
  26. ynh_script_progression "Adding $app's configuration..."
  27. ynh_config_add --template=".env" --destination="$install_dir/.env"
  28. #=================================================
  29. # INSTALL HOMARR
  30. #=================================================
  31. ynh_script_progression "Building the app..."
  32. pushd $install_dir
  33. ynh_hide_warnings ynh_exec_as_app yarn install
  34. ynh_hide_warnings ynh_exec_as_app NODE_ENV=production yarn build
  35. ynh_hide_warnings ynh_exec_as_app yarn db:migrate
  36. popd
  37. #=================================================
  38. # START SYSTEMD SERVICE
  39. #=================================================
  40. ynh_script_progression "Starting $app's systemd service..."
  41. ynh_systemctl --service=$app --action="start"
  42. #=================================================
  43. # END OF SCRIPT
  44. #=================================================
  45. ynh_script_progression "Installation of $app completed"