Changements majeurs; RemiRepo PHP8.0+php-imap; Script de nettoyage(incomplet); preparation DB SQL
This commit is contained in:
1 parent
e6fd9b5da8
commit
bd174eb10f
8 files changed
+125
-32
No files matched your search
Regular → Executable
+23
-9
@@ -10,17 +10,23 @@ ostdir="/var/www/osticket"
|
|||||||
ostpluginsrc="/usr/src/osticket/plugins"
|
ostpluginsrc="/usr/src/osticket/plugins"
|
||||||
webuser="nginx"
|
webuser="nginx"
|
||||||
webgroup="nginx"
|
webgroup="nginx"
|
||||||
|
basedir=$PWD
|
||||||
############################
|
############################
|
||||||
|
|
||||||
cd ~
|
cd ~
|
||||||
|
#dnf -y in php php-intl php-zip php-mysqli php-gd php-gettext php-json php-mbstring php-xml php-pecl-apcu mariadb-server mariadb nginx php-fpm git && \
|
||||||
|
|
||||||
#install modules de base
|
|
||||||
#dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
|
dnf install http://rpms.remirepo.net/fedora/remi-release-36.rpm -y && \
|
||||||
#dnf -y module enable php:8.0 && \
|
dnf remove -y php* && \
|
||||||
dnf -y in php php-mysqli php-gd php-gettext php-json php-mbstring php-xml php-pecl-apcu mariadb-server mariadb nginx php-fpm git && \
|
dnf module list reset php -y && \
|
||||||
|
dnf module list php && \
|
||||||
|
dnf module enable php:remi-8.0 -y
|
||||||
|
\
|
||||||
|
dnf -y in php php-intl php-imap php-zip php-mysqli php-gd php-gettext php-json php-mbstring php-xml php-pecl-apcu mariadb-server mariadb nginx php-fpm git && \
|
||||||
\
|
\
|
||||||
\
|
\
|
||||||
cp nginx-conf/osticket.conf /etc/nginx/conf.d/. && \
|
cp $basedir/nginx-conf/osticket.conf /etc/nginx/conf.d/. && \
|
||||||
\
|
\
|
||||||
\
|
\
|
||||||
systemctl enable --now mariadb && \
|
systemctl enable --now mariadb && \
|
||||||
@@ -31,11 +37,11 @@ systemctl enable --now php-fpm && \
|
|||||||
git clone https://github.com/osTicket/osTicket.git && \
|
git clone https://github.com/osTicket/osTicket.git && \
|
||||||
cd osTicket && \
|
cd osTicket && \
|
||||||
git checkout $ostver && \
|
git checkout $ostver && \
|
||||||
git pull && \
|
git fetch && \
|
||||||
\
|
\
|
||||||
#setup / deploiement
|
#setup / deploiement
|
||||||
mkdir -p $ostdir && \
|
mkdir -p $ostdir && \
|
||||||
chown -R $webuser:$webgroup $ostdir && \
|
#chown -R $webuser:$webgroup $ostdir && \
|
||||||
chmod -R a+rX $ostdir && \
|
chmod -R a+rX $ostdir && \
|
||||||
chmod -R u+rw $ostdir && \
|
chmod -R u+rw $ostdir && \
|
||||||
\
|
\
|
||||||
@@ -46,7 +52,7 @@ cd .. && \
|
|||||||
git clone -b develop https://github.com/osTicket/osTicket-plugins $ostpluginsrc && \
|
git clone -b develop https://github.com/osTicket/osTicket-plugins $ostpluginsrc && \
|
||||||
cd $ostpluginsrc && \
|
cd $ostpluginsrc && \
|
||||||
php make.php hydrate && \
|
php make.php hydrate && \
|
||||||
for plugin in $(find * -maxdepth 0 -type d ! -path doc ! -path lib); do cp -r ${plugin} $ostdir/include/plugins; done; && \
|
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/ && \
|
cp -R $ostpluginsrc/*.phar $ostdir/include/plugins/ && \
|
||||||
cd ~ && \
|
cd ~ && \
|
||||||
# Add Community Plugins
|
# Add Community Plugins
|
||||||
@@ -77,7 +83,15 @@ cd ~ && \
|
|||||||
\
|
\
|
||||||
### Log Miscellany Installation
|
### Log Miscellany Installation
|
||||||
touch /var/log/msmtp.log && \
|
touch /var/log/msmtp.log && \
|
||||||
chown $webuser:$webgroup /var/log/msmtp.log
|
chown $webuser:$webgroup /var/log/msmtp.log && \
|
||||||
|
\
|
||||||
|
mv /var/www/osticket/include/ost-sampleconfig.php /var/www/osticket/include/ost-config.php && \
|
||||||
|
chmod 0666 /var/www/osticket/include/ost-config.php
|
||||||
|
chown -R $webuser:$webgroup $ostdir && \
|
||||||
|
\
|
||||||
|
echo "fin"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
##update
|
##update
|
||||||
Executable
+5
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
|
||||||
|
mysql -u root < securesetup.sql
|
||||||
|
|
||||||
Executable
+4
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -x
|
||||||
|
chmod 0644 /var/www/osticket/include/ost-config.php
|
||||||
Executable
+9
@@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
echo "Nettoyage..."
|
||||||
|
set -x
|
||||||
|
cd ~
|
||||||
|
rm -rf osTicket
|
||||||
|
rm -rf /var/www/osticket
|
||||||
|
rm -rf /usr/src/osticket
|
||||||
|
set +x
|
||||||
|
echo "Fin"
|
||||||
+25
-23
@@ -1,48 +1,50 @@
|
|||||||
|
#server {
|
||||||
|
# listen 80;
|
||||||
|
## server_name tickets.noc.1nfo.services;
|
||||||
|
# rewrite ^ https://tickets.mydomain.com permanent;
|
||||||
|
# }
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name tickets.noc.1nfo.services;
|
|
||||||
rewrite ^ https://tickets.mydomain.com permanent;
|
|
||||||
}
|
|
||||||
server {
|
|
||||||
listen 443;
|
|
||||||
server_name tickets.1nfo.services;
|
server_name tickets.1nfo.services;
|
||||||
ssl on;
|
#ssl on;
|
||||||
ssl_certificate /etc/nginx/certs/cert.pem;
|
#ssl_certificate /etc/nginx/certs/cert.pem;
|
||||||
ssl_certificate_key /etc/nginx/certs/cert.key;
|
#ssl_certificate_key /etc/nginx/certs/cert.key;
|
||||||
keepalive_timeout 70;
|
keepalive_timeout 70;
|
||||||
root /var/www/osticket;
|
root /var/www/osticket;
|
||||||
set \$path_info "";
|
index index.php index.html index.htm;
|
||||||
|
|
||||||
|
set $path_info "";
|
||||||
location ~ /include {
|
location ~ /include {
|
||||||
deny all;
|
deny all;
|
||||||
return 403;
|
return 403;
|
||||||
}
|
}
|
||||||
if (\$request_uri ~ "^/api(/[^\?]+)") {
|
if ($request_uri ~ "^/api(/[^\?]+)") {
|
||||||
set \$path_info \$1;
|
set $path_info \$1;
|
||||||
}
|
}
|
||||||
location ~ ^/api/(?:tickets|tasks).*$ {
|
location ~ ^/api/(?:tickets|tasks).*$ {
|
||||||
try_files \$uri \$uri/ /api/http.php?\$query_string;
|
try_files $uri $uri/ /api/http.php?$query_string;
|
||||||
}
|
}
|
||||||
if (\$request_uri ~ "^/scp/.*\.php(/[^\?]+)") {
|
if ($request_uri ~ "^/scp/.*\.php(/[^\?]+)") {
|
||||||
set \$path_info \$1;
|
set $path_info \$1;
|
||||||
}
|
}
|
||||||
if (\$request_uri ~ "^/.*\.php(/[^\?]+)") {
|
if ($request_uri ~ "^/.*\.php(/[^\?]+)") {
|
||||||
set \$path_info \$1;
|
set $path_info \$1;
|
||||||
}
|
}
|
||||||
location ~ ^/scp/ajax.php/.*$ {
|
location ~ ^/scp/ajax.php/.*$ {
|
||||||
try_files \$uri \$uri/ /scp/ajax.php?\$query_string;
|
try_files $uri \$uri/ /scp/ajax.php?$query_string;
|
||||||
}
|
}
|
||||||
location ~ ^/ajax.php/.*$ {
|
location ~ ^/ajax.php/.*$ {
|
||||||
try_files \$uri \$uri/ /ajax.php?\$query_string;
|
try_files $uri \$uri/ /ajax.php?$query_string;
|
||||||
}
|
}
|
||||||
location / {
|
location / {
|
||||||
try_files \$uri \$uri/ index.php;
|
try_files $uri $uri/ index.php;
|
||||||
}
|
}
|
||||||
location ~ \.php$ {
|
location ~ \.php$ {
|
||||||
try_files \$uri = 404;
|
try_files $uri = 404;
|
||||||
fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_param PATH_INFO \$path_info;
|
fastcgi_param PATH_INFO $path_info;
|
||||||
fastcgi_pass 127.0.0.1:8888;
|
fastcgi_pass unix:/run/php-fpm/www.sock;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Binary file not shown.
@@ -0,0 +1,11 @@
|
|||||||
|
ALTER USER 'root'@'localhost' IDENTIFIED BY 'msqlroot-=-';
|
||||||
|
DELETE FROM mysql.global_priv WHERE User='';
|
||||||
|
DELETE FROM mysql.global_priv WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');
|
||||||
|
DROP DATABASE IF EXISTS test;
|
||||||
|
DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%';
|
||||||
|
FLUSH PRIVILEGES;
|
||||||
|
|
||||||
|
|
||||||
|
create database osticket_db;
|
||||||
|
grant all privileges on osticket_db.* to osticket_user identified by 'OsTicketP4';
|
||||||
|
flush privileges;
|
||||||
Reference in new issue
Block a user