@@ -15,12 +15,13 @@ update_os
1515
1616msg_info " Installing Dependencies"
1717$STD apt-get install -y \
18- composer \
1918 git \
20- nginx \
21- php8.2-{bcmath,common,ctype,ldap,curl,fileinfo,fpm,gd,iconv,intl,mbstring,mysql,soap,xml,xsl,zip,cli}
19+ nginx
2220msg_ok " Installed Dependencies"
2321
22+ PHP_VERSION=" 8.3" PHP_MODULE=" common,ctype,ldap,fileinfo,iconv,mysql,soap,xsl" PHP_FPM=" YES" setup_php
23+ setup_composer
24+ fetch_and_deploy_gh_release " snipe-it" " snipe/snipe-it" " tarball"
2425setup_mariadb
2526
2627msg_info " Setting up database"
@@ -38,12 +39,7 @@ $STD mariadb -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUS
3839} >> ~/snipeit.creds
3940msg_ok " Set up database"
4041
41- msg_info " Installing Snipe-IT"
42- temp_file=$( mktemp)
43- RELEASE=$( curl -fsSL https://api.github.com/repos/snipe/snipe-it/releases/latest | grep " tag_name" | awk ' {print substr($2, 3, length($2)-4) }' )
44- curl -fsSL " https://github.com/snipe/snipe-it/archive/refs/tags/v${RELEASE} .tar.gz" -o " $temp_file "
45- tar zxf $temp_file
46- mv snipe-it-${RELEASE} /opt/snipe-it
42+ msg_info " Configuring Snipe-IT"
4743cd /opt/snipe-it
4844cp .env.example .env
4945IPADDRESS=$( hostname -I | awk ' {print $1}' )
@@ -56,11 +52,9 @@ sed -i -e "s|^APP_URL=.*|APP_URL=http://$IPADDRESS|" \
5652chown -R www-data: /opt/snipe-it
5753chmod -R 755 /opt/snipe-it
5854export COMPOSER_ALLOW_SUPERUSER=1
59- # $STD composer update --no-plugins --no-scripts
6055$STD composer install --no-dev --optimize-autoloader --no-interaction
6156$STD php artisan key:generate --force
62- echo " ${RELEASE} " > " /opt/${APPLICATION} _version.txt"
63- msg_ok " Installed SnipeIT"
57+ msg_ok " Configured SnipeIT"
6458
6559msg_info " Creating Service"
6660cat << EOF >/etc/nginx/conf.d/snipeit.conf
@@ -84,15 +78,13 @@ server {
8478 }
8579}
8680EOF
87-
8881systemctl reload nginx
89- msg_ok " Configured Service"
82+ msg_ok " Created Service"
9083
9184motd_ssh
9285customize
9386
9487msg_info " Cleaning up"
95- rm -f $temp_file
9688$STD apt-get -y autoremove
9789$STD apt-get -y autoclean
9890msg_ok " Cleaned"
0 commit comments