grocy-install.sh 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #!/usr/bin/env bash
  2. # Copyright (c) 2021-2023 tteck
  3. # Author: tteck (tteckster)
  4. # License: MIT
  5. # https://github.com/tteck/Proxmox/raw/main/LICENSE
  6. source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
  7. color
  8. verb_ip6
  9. catch_errors
  10. setting_up_container
  11. network_check
  12. update_os
  13. msg_info "Installing Dependencies"
  14. $STD apt-get install -y curl
  15. $STD apt-get install -y sudo
  16. $STD apt-get install -y mc
  17. $STD apt-get install -y apache2
  18. $STD apt-get install -y unzip
  19. $STD apt-get install -y apt-transport-https
  20. $STD apt-get install -y lsb-release
  21. msg_ok "Installed Dependencies"
  22. msg_info "Installing PHP 8.1"
  23. curl -sSLo /usr/share/keyrings/deb.sury.org-php.gpg https://packages.sury.org/php/apt.gpg
  24. sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
  25. $STD apt-get update
  26. $STD apt-get install -y php8.1
  27. $STD apt-get install -y libapache2-mod-php8.1
  28. $STD apt-get install -y php8.1-sqlite3
  29. $STD apt-get install -y php8.1-gd
  30. $STD apt-get install -y php8.1-intl
  31. $STD apt-get install -y php8.1-mbstring
  32. msg_ok "Installed PHP 8.1"
  33. msg_info "Installing grocy"
  34. wget -q https://releases.grocy.info/latest
  35. $STD unzip latest -d /var/www/html
  36. chown -R www-data:www-data /var/www/html
  37. cp /var/www/html/config-dist.php /var/www/html/data/config.php
  38. chmod +x /var/www/html/update.sh
  39. cat <<EOF >/etc/apache2/sites-available/grocy.conf
  40. <VirtualHost *:80>
  41. ServerAdmin webmaster@localhost
  42. DocumentRoot /var/www/html/public
  43. ErrorLog /var/log/apache2/error.log
  44. <Directory /var/www/html/public>
  45. Options Indexes FollowSymLinks MultiViews
  46. AllowOverride All
  47. Order allow,deny
  48. allow from all
  49. </Directory>
  50. </VirtualHost>
  51. EOF
  52. $STD a2dissite 000-default.conf
  53. $STD a2ensite grocy.conf
  54. $STD a2enmod rewrite
  55. systemctl reload apache2
  56. msg_ok "Installed grocy"
  57. motd_ssh
  58. root
  59. msg_info "Cleaning up"
  60. $STD apt-get autoremove
  61. $STD apt-get autoclean
  62. rm -rf /root/latest
  63. msg_ok "Cleaned"