-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: add NC compose setup to use specific server branch (#785)
* build: add NC compose setup to use specific server branch Signed-off-by: Saw-jan <[email protected]> * docs: add SPDX header Signed-off-by: Saw-jan <[email protected]> --------- Signed-off-by: Saw-jan <[email protected]>
- Loading branch information
Showing
6 changed files
with
98 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,17 @@ | ||
#!/bin/bash | ||
# SPDX-FileCopyrightText: 2025 Jankari Tech Pvt. Ltd. | ||
# SPDX-License-Identifier: AGPL-3.0-or-later | ||
STEP_CERTS_DIR="/step/certs" | ||
|
||
if [ -d "$STEP_CERTS_DIR" ]; then | ||
rm -rf /etc/ssl/certs/Step_Root_CA.pem /usr/local/share/ca-certificates/Step_Root_CA.crt | ||
echo "[INFO] Linking root CA certificate..." | ||
cp "$STEP_CERTS_DIR"/root_ca.crt /usr/local/share/ca-certificates/Step_Root_CA.crt | ||
update-ca-certificates | ||
fi | ||
set -e | ||
|
||
chown www-data custom_apps | ||
find ./custom_apps -mindepth 1 -path ./custom_apps/integration_openproject -prune -o -exec chown www-data {} \; | ||
rm -rf /tmp/server || true | ||
# clone nextcloud server | ||
git clone -b "${SERVER_BRANCH}" --depth 1 https://github.com/nextcloud/server.git /tmp/server | ||
|
||
/entrypoint.sh apache2-foreground & | ||
(cd /tmp/server && git submodule update --init) | ||
rsync -a --chmod=755 --chown=www-data:www-data /tmp/server/ /var/www/html | ||
chown www-data: -R /var/www/html/data | ||
chown www-data: /var/www/html/.htaccess | ||
|
||
# Wait for Nextcloud | ||
while [ $(curl -s http://localhost -w %{http_code} -o /dev/null) != 302 ] && [ $(curl -s http://localhost -w %{http_code} -o /dev/null) != 200 ]; do | ||
sleep 1 | ||
done | ||
|
||
chsh -s /bin/bash www-data | ||
# install nextcloud | ||
su www-data -c "php occ maintenance:install -vvv \ | ||
--database pgsql \ | ||
--database-name $POSTGRES_DB \ | ||
--database-host $POSTGRES_HOST \ | ||
--database-user $POSTGRES_USER \ | ||
--database-pass $POSTGRES_PASSWORD \ | ||
--admin-user admin \ | ||
--admin-pass admin \ | ||
--data-dir /var/www/html/data" | ||
|
||
su www-data -c "php occ a:e integration_openproject" | ||
su www-data -c "php occ config:system:set allow_local_remote_servers --value 1" | ||
su www-data -c "php occ security:certificates:import /etc/ssl/certs/ca-certificates.crt" | ||
su www-data -c "php occ config:system:set trusted_domains 1 --value=nextcloud.local" | ||
|
||
tail -f data/nextcloud.log | ||
# run the nextcloud setup | ||
/usr/local/bin/bootstrap.sh apache2-foreground |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
/** | ||
* SPDX-FileCopyrightText: 2025 Jankari Tech Pvt. Ltd. | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
$CONFIG = [ | ||
'apps_paths' => | ||
array( | ||
0 => | ||
array( | ||
'path' => '/var/www/html/apps', | ||
'url' => '/apps', | ||
'writable' => false, | ||
), | ||
1 => | ||
array( | ||
'path' => '/var/www/html/custom_apps', | ||
'url' => '/custom_apps', | ||
'writable' => true, | ||
), | ||
), | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
# SPDX-FileCopyrightText: 2025 Jankari Tech Pvt. Ltd. | ||
# SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
set -e | ||
|
||
OCC() { | ||
# shellcheck disable=SC2068 | ||
sudo -E -u www-data php "$WEBROOT/occ" $@ | ||
} | ||
|
||
OCC a:e integration_openproject | ||
OCC security:certificates:import /etc/ssl/certs/ca-certificates.crt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
# SPDX-FileCopyrightText: 2025 Jankari Tech Pvt. Ltd. | ||
# SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
set -e | ||
|
||
echo "-----------------------------------------------------------" | ||
echo "[INFO] Installing CA certificates..." | ||
echo "-----------------------------------------------------------" | ||
|
||
STEP_CERTS_DIR="/step/certs" | ||
|
||
if [ -d "$STEP_CERTS_DIR" ]; then | ||
rm -rf /etc/ssl/certs/Step_Root_CA.pem /usr/local/share/ca-certificates/Step_Root_CA.crt | ||
echo "[INFO] Linking root CA certificate..." | ||
cp "$STEP_CERTS_DIR"/root_ca.crt /usr/local/share/ca-certificates/Step_Root_CA.crt | ||
update-ca-certificates | ||
fi | ||
|
||
# fix custom_apps permissions | ||
chown www-data custom_apps | ||
find ./custom_apps -mindepth 1 -path ./custom_apps/integration_openproject -prune -o -exec chown www-data {} \; |