Commit 8e2cf8cd authored by Egor Kremnev's avatar Egor Kremnev

fix scripts

parent 3689996c
...@@ -27,9 +27,7 @@ mkdir -p ${BACKUP_DIR} ...@@ -27,9 +27,7 @@ mkdir -p ${BACKUP_DIR}
BACKUP_DATE=$(date +"%Y_%m_%d__%H_%M") BACKUP_DATE=$(date +"%Y_%m_%d__%H_%M")
BACKUP_DIR_PATH=${BACKUP_DIR}/${PROJECT_ROOT}_backup_${BACKUP_DATE}_v${VERSION} BACKUP_DIR_PATH=${BACKUP_DIR}/${PROJECT_ROOT}_backup_${BACKUP_DATE}_v${VERSION}
DB_PATH=${PROJECT_ROOT}/database/database.${INSTANCE_NAME}.sqlite # sudo mysqldump -u [user] -p [database_name] > [filename].sql
STASH_DB_DIR=/tmp/db/
STASH_DB_PATH=${STASH_DB_DIR}database.${INSTANCE_NAME}.sqlite
info() { info() {
echo -e "\e[33m[Info] \e[33m$1 \e[39m $(for i in {12..21} ; do echo -en "\e[33;1;${i}m.\e[0m" ; done ; echo)" echo -e "\e[33m[Info] \e[33m$1 \e[39m $(for i in {12..21} ; do echo -en "\e[33;1;${i}m.\e[0m" ; done ; echo)"
...@@ -86,6 +84,25 @@ info "# Database folder permission" ...@@ -86,6 +84,25 @@ info "# Database folder permission"
chmod -R 775 database chmod -R 775 database
chown -R $(whoami) database chown -R $(whoami) database
env
sed -i '' 's/^#DB_HOST=/DB_HOST=/g' ".env"
sed -i '' 's/^\(DB_HOST=\).*/\1'$([ -n "$DB_HOST_ENV" ] && echo "$DB_HOST_ENV" || echo "$DB_HOST")'/' ".env"
sed -i '' 's/^#DB_PORT=/DB_PORT=/g' ".env"
sed -i '' 's/^\(DB_PORT=\).*/\1'$([ -n "$DB_PORT_ENV" ] && echo "$DB_PORT_ENV" || echo "$DB_PORT")'/' ".env"
sed -i '' 's/^#DB_DATABASE=/DB_DATABASE=/g' ".env"
sed -i '' 's/^\(DB_DATABASE=\).*/\1'$([ -n "$DB_DATABASE_ENV" ] && echo "$DB_DATABASE_ENV" || echo "$DB_DATABASE")'/' ".env"
sed -i '' 's/^#DB_USERNAME=/DB_USERNAME=/g' ".env"
sed -i '' 's/^\(DB_USERNAME=\).*/\1'$([ -n "$DB_USERNAME_ENV" ] && echo "$DB_USERNAME_ENV" || echo "$DB_USERNAME")'/' ".env"
sed -i '' 's/^#DB_PASSWORD=/DB_PASSWORD=/g' ".env"
sed -i '' 's/^\(DB_PASSWORD=\).*/\1'$([ -n "$DB_PASSWORD_ENV" ] && echo "$DB_PASSWORD_ENV" || echo "$DB_PASSWORD")'/' ".env"
php artisan migrate --seed # Выполним посев
info "# Restart nginx server" info "# Restart nginx server"
service nginx restart service nginx restart
......
server { server {
listen 80; listen 80;
server_name 104.248.29.4; server_name 104.248.29.4; # Здесь адрес вашего сервера
root /home/demo/application/public; root /home/demo/application/public;
add_header X-Frame-Options "SAMEORIGIN"; add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff"; add_header X-Content-Type-Options "nosniff";
index index.php; index index.html index.htm index.php;
charset utf-8; charset utf-8;
...@@ -20,7 +21,8 @@ server { ...@@ -20,7 +21,8 @@ server {
error_page 404 /index.php; error_page 404 /index.php;
location ~ \.php$ { location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php8.0-fpm.sock; fastcgi_pass unix:/var/run/php/php8.1-fpm.sock; # Указываем актуальную для вашего сервера версию php
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params; include fastcgi_params;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment