Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
docker
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
Nextcloud
docker
Commits
35b8ebf9
Commit
35b8ebf9
authored
3 years ago
by
John Molakvoæ
Committed by
John Molakvoæ
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Allow simultaneous initialization of common html volume
Signed-off-by:
John Molakvoæ
<
skjnldsv@protonmail.com
>
parent
e76b7cab
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
docker-entrypoint.sh
+95
-73
95 additions, 73 deletions
docker-entrypoint.sh
upgrade.exclude
+1
-0
1 addition, 0 deletions
upgrade.exclude
with
96 additions
and
73 deletions
docker-entrypoint.sh
+
95
−
73
View file @
35b8ebf9
...
...
@@ -101,6 +101,24 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
else
rsync_options
=
"-rlD"
fi
# If another process is syncing the html folder, wait for
# it to be done, then escape initalization
lock
=
/var/www/html/nextcloud-init-sync.lock
count
=
0
if
[
-f
"
$lock
"
]
;
then
until
[
!
-f
"
$lock
"
]
do
count
=
$((
count+1
))
wait
=
$((
count
*
10
))
echo
"Another process is initializing Nextcloud. Waiting
$wait
seconds..."
sleep
$wait
done
echo
"The other process is done, assuming complete initialization"
else
# Prevent multiple images syncing simultaneously
touch
$lock
rsync
$rsync_options
--delete
--exclude-from
=
/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
for
dir
in
config data custom_apps themes
;
do
...
...
@@ -109,9 +127,8 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi
done
rsync
$rsync_options
--include
'/version.php'
--exclude
'/*'
/usr/src/nextcloud/ /var/www/html/
echo
"Initializing finished"
#i
nstall
# I
nstall
if
[
"
$installed_version
"
=
"0.0.0.0"
]
;
then
echo
"New nextcloud instance"
...
...
@@ -152,21 +169,21 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi
if
[
"
$install
"
=
true
]
;
then
echo
"
s
tarting nextcloud installation"
echo
"
S
tarting nextcloud installation"
max_retries
=
10
try
=
0
until
run_as
"php /var/www/html/occ maintenance:install
$install_options
"
||
[
"
$try
"
-gt
"
$max_retries
"
]
do
echo
"
r
etrying install..."
echo
"
R
etrying install..."
try
=
$((
try+1
))
sleep
10s
done
if
[
"
$try
"
-gt
"
$max_retries
"
]
;
then
echo
"
i
nstalling of nextcloud failed!"
echo
"
I
nstalling of nextcloud failed!"
exit
1
fi
if
[
-n
"
${
NEXTCLOUD_TRUSTED_DOMAINS
+x
}
"
]
;
then
echo
"
s
etting trusted domains…"
echo
"
S
etting trusted domains…"
NC_TRUSTED_DOMAIN_IDX
=
1
for
DOMAIN
in
$NEXTCLOUD_TRUSTED_DOMAINS
;
do
DOMAIN
=
$(
echo
"
$DOMAIN
"
|
sed
-e
's/^[[:space:]]*//'
-e
's/[[:space:]]*$//'
)
...
...
@@ -175,10 +192,10 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
done
fi
else
echo
"
running
web-based installer on first connect!"
echo
"
Please run the
web-based installer on first connect!"
fi
fi
#u
pgrade
# U
pgrade
else
run_as
'php /var/www/html/occ upgrade'
...
...
@@ -188,6 +205,11 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
rm
-f
/tmp/list_before /tmp/list_after
fi
# Initialization done, reset lock
rm
$lock
echo
"Initializing finished"
fi
fi
fi
...
...
This diff is collapsed.
Click to expand it.
upgrade.exclude
+
1
−
0
View file @
35b8ebf9
...
...
@@ -3,3 +3,4 @@
/custom_apps/
/themes/
/version.php
/nextcloud-init-sync.lock
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment