@@ -148,20 +148,18 @@ mkdir -p "${TEMP_DIRECTORY}"
148
148
chown -R "${NGINX_USER}":"${NGINX_GROUP}" "${TEMP_DIRECTORY}"
149
149
150
150
### Database Check
151
- case "$DB_TYPE" in
152
- "mysql" | "mariadb" | "MYSQL" | "MARIADB" )
151
+ case "${ DB_TYPE,,} " in
152
+ "mysql" | "mariadb" )
153
153
DB_PORT=${DB_PORT:-3306}
154
-
155
154
sanity_db mariadb
156
155
db_ready mariadb
157
-
158
156
install_options="--database=mysql --database-host=${DB_HOST} --database-name=${DB_NAME} --database-user=${DB_USER} --database-pass=${DB_PASS} --database-table-space=${DB_PREFIX} --database-port=${DB_PORT}"
159
157
;;
160
- " sqlite" | "SQLITE" | "sqlite3" | "SQLITE3" )
158
+ sqlite* )
161
159
DB_TYPE="sqlite3"
162
160
install_options="--database-name $SQLITE_DATABASE"
163
161
;;
164
- " postgres" | "postgresql" | "POSTGRES" | "POSTGRESQL" )
162
+ postgres* )
165
163
DB_PORT=${DB_PORT:-5432}
166
164
sanity_db
167
165
db_ready postgres
@@ -173,17 +171,11 @@ case "$DB_TYPE" in
173
171
;;
174
172
esac
175
173
176
- ### Sudo Hack for entering inside the container
177
- echo "alias occ='sudo -u ${NGINX_USER} php ${NGINX_WEBROOT}/occ'" > /root/.bashrc
178
-
179
- mkdir -p "${NGINX_WEBROOT}"
180
- chown -R "${NGINX_USER}":"${NGINX_GROUP}" "${NGINX_WEBROOT}"
181
-
182
174
installed_version="0.0.0~unknown"
183
-
175
+ mkdir -p "${NGINX_WEBROOT}"
184
176
rsync -a --delete --exclude /config/ --exclude /data/ --exclude /custom-apps/ --exclude /themes/ /assets/nextcloud/ "${NGINX_WEBROOT}"/
185
177
mkdir -p "${NGINX_WEBROOT}"/data "${NGINX_WEBROOT}"/config "${NGINX_WEBROOT}"/themes "${NGINX_WEBROOT}"/custom-apps
186
- chown -R nginx "${NGINX_WEBROOT}"
178
+ chown -R "${NGINX_USER}":"${NGINX_GROUP}" "${NGINX_WEBROOT}"
187
179
188
180
for dir in config themes; do
189
181
if directory_empty "${NGINX_WEBROOT}"/"$dir"; then
@@ -209,7 +201,7 @@ if version_greater "$installed_version" "${NEXTCLOUD_VERSION}"; then
209
201
exit 1
210
202
fi
211
203
212
- if [ "$ENABLE_AUTO_UPGRADE" = "TRUE" ] ; then
204
+ if var_true "${ ENABLE_AUTO_UPGRADE}" ; then
213
205
if version_greater "${NEXTCLOUD_VERSION}" "$installed_version"; then
214
206
if [ "$installed_version" != "0.0.0~unknown" ]; then
215
207
silent sudo -u "${NGINX_USER}" php "${NGINX_WEBROOT}"/occ app:list > /tmp/list_before
0 commit comments