Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
A
aphp1_classwork80
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Egor Kremnev
aphp1_classwork80
Commits
8e2cf8cd
Commit
8e2cf8cd
authored
Aug 22, 2023
by
Egor Kremnev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix scripts
parent
3689996c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
6 deletions
+25
-6
apply-update.sh
scripts/apply-update.sh
+20
-3
default.conf
scripts/nginx/default.conf
+5
-3
No files found.
scripts/apply-update.sh
View file @
8e2cf8cd
...
@@ -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
...
...
scripts/nginx/default.conf
View file @
8e2cf8cd
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
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment