commit
00ea24b5c5
@ -0,0 +1,153 @@
|
||||
#!/bin/bash
|
||||
|
||||
#Pensé pour CentOS Stream 8
|
||||
|
||||
|
||||
############################
|
||||
#VARS
|
||||
ostver="v1.16.3"
|
||||
ostdir="/var/www/osticket"
|
||||
ostpluginsrc="/usr/src/osticket/plugins"
|
||||
############################
|
||||
|
||||
cd ~
|
||||
|
||||
#install modules de base
|
||||
#dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
|
||||
dnf -y module enable php:8.0
|
||||
dnf -y in php php-mysqli php-gd php-gettext php-imap php-json php-mbstring php-xml php-apc mariadb-server mariadb nginx php-fpm git
|
||||
|
||||
|
||||
cat <<EOF >> /etc/nginx/conf.d/osticket
|
||||
# Rewrite all requests from HTTP to HTTPS
|
||||
server {
|
||||
listen 80;
|
||||
server_name tickets.noc.1nfo.services;
|
||||
rewrite ^ https://tickets.mydomain.com permanent;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443;
|
||||
server_name tickets.1nfo.services;
|
||||
ssl on;
|
||||
ssl_certificate /etc/nginx/certs/cert.pem;
|
||||
ssl_certificate_key /etc/nginx/certs/cert.key;
|
||||
|
||||
keepalive_timeout 70;
|
||||
|
||||
root /var/www/osticket;
|
||||
|
||||
set \$path_info "";
|
||||
|
||||
location ~ /include {
|
||||
deny all;
|
||||
return 403;
|
||||
}
|
||||
|
||||
if (\$request_uri ~ "^/api(/[^\?]+)") {
|
||||
set \$path_info \$1;
|
||||
}
|
||||
|
||||
location ~ ^/api/(?:tickets|tasks).*$ {
|
||||
try_files \$uri \$uri/ /api/http.php?\$query_string;
|
||||
}
|
||||
|
||||
if (\$request_uri ~ "^/scp/.*\.php(/[^\?]+)") {
|
||||
set \$path_info \$1;
|
||||
}
|
||||
|
||||
if (\$request_uri ~ "^/.*\.php(/[^\?]+)") {
|
||||
set \$path_info \$1;
|
||||
}
|
||||
|
||||
location ~ ^/scp/ajax.php/.*$ {
|
||||
try_files \$uri \$uri/ /scp/ajax.php?\$query_string;
|
||||
}
|
||||
|
||||
location ~ ^/ajax.php/.*$ {
|
||||
try_files \$uri \$uri/ /ajax.php?\$query_string;
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files \$uri \$uri/ index.php;
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
try_files \$uri = 404;
|
||||
fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
fastcgi_param PATH_INFO \$path_info;
|
||||
fastcgi_pass 127.0.0.1:8888;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EOF
|
||||
|
||||
|
||||
systemctl enable --now mariadb
|
||||
systemctl enable --now nginx
|
||||
systemctl enable --now php-fpm
|
||||
|
||||
#copie de la source
|
||||
git clone https://github.com/osTicket/osTicket.git
|
||||
cd osTicket
|
||||
git checkout $ostver
|
||||
git pull
|
||||
|
||||
#setup / deploiement
|
||||
mkdir -p $ostdir
|
||||
chown -R nginx:nginx $ostdir
|
||||
chmod -R a+rX $ostdir
|
||||
chmod -R u+rw $ostdir
|
||||
|
||||
php manage.php deploy --setup $ostdir
|
||||
cd ..
|
||||
|
||||
# Setup Official Plugins
|
||||
git clone -b develop https://github.com/osTicket/osTicket-plugins $ostpluginsrc
|
||||
cd $ostpluginsrc
|
||||
php make.php hydrate
|
||||
for plugin in $(find * -maxdepth 0 -type d ! -path doc ! -path lib); do cp -r ${plugin} $ostdir/include/plugins; done;
|
||||
cp -R $ostpluginsrc/*.phar $ostdir/include/plugins/
|
||||
cd ~
|
||||
# Add Community Plugins
|
||||
## Archiver
|
||||
git clone https://github.com/clonemeagain/osticket-plugin-archiver $ostdir/include/plugins/archiver && \
|
||||
## Attachment Preview
|
||||
git clone https://github.com/clonemeagain/attachment_preview $ostdir/include/plugins/attachment-preview && \
|
||||
## Auto Closer
|
||||
git clone https://github.com/clonemeagain/plugin-autocloser $ostdir/include/plugins/auto-closer && \
|
||||
## Fetch Note
|
||||
git clone https://github.com/bkonetzny/osticket-fetch-note $ostdir/include/plugins/fetch-note && \
|
||||
## Field Radio Buttons
|
||||
git clone https://github.com/Micke1101/OSTicket-plugin-field-radiobuttons $ostdir/include/plugins/field-radiobuttons && \
|
||||
## Mentioner
|
||||
git clone https://github.com/clonemeagain/osticket-plugin-mentioner $ostdir/include/plugins/mentioner && \
|
||||
## Multi LDAP Auth
|
||||
git clone https://github.com/philbertphotos/osticket-multildap-auth $ostdir/include/plugins/multi-ldap && \
|
||||
mv $ostdir/include/plugins/multi-ldap/multi-ldap/* $ostdir/include/plugins/multi-ldap/ && \
|
||||
rm -rf $ostdir/include/plugins/multi-ldap/multi-ldap && \
|
||||
## Prevent Autoscroll
|
||||
git clone https://github.com/clonemeagain/osticket-plugin-preventautoscroll $ostdir/include/plugins/prevent-autoscroll && \
|
||||
## Rewriter
|
||||
git clone https://github.com/clonemeagain/plugin-fwd-rewriter $ostdir/include/plugins/rewriter && \
|
||||
## Slack
|
||||
git clone https://github.com/clonemeagain/osticket-slack $ostdir/include/plugins/slack && \
|
||||
## Teams (Microsoft)
|
||||
git clone https://github.com/ipavlovi/osTicket-Microsoft-Teams-plugin $ostdir/include/plugins/teams && \
|
||||
\
|
||||
### Log Miscellany Installation
|
||||
touch /var/log/msmtp.log && \
|
||||
chown nginx:nginx /var/log/msmtp.log && \
|
||||
|
||||
|
||||
|
||||
|
||||
##update
|
||||
#git pull
|
||||
#php manage.php deploy -v $ostdir
|
||||
|
||||
|
||||
##upgrade nouvelle version
|
||||
#futur!
|
||||
Loading…
Reference in new issue