summaryrefslogtreecommitdiffstats
path: root/.devcontainer/setup.sh
diff options
context:
space:
mode:
authorRobin Windey <ro.windey@gmail.com>2023-03-11 12:18:21 +0000
committerGitHub <noreply@github.com>2023-03-31 13:53:03 +0000
commit16c14c059d03069f7e19e100b60c550e8ac54a38 (patch)
treeda7019badd7e19b25c312488e9fa22eb30e3ca8b /.devcontainer/setup.sh
parent81df7d636e06d1cf5b4aa6ee8e7be8d8fe73c3c9 (diff)
downloadnextcloud-server-16c14c059d03069f7e19e100b60c550e8ac54a38.tar.gz
nextcloud-server-16c14c059d03069f7e19e100b60c550e8ac54a38.zip
Minor improvements for devcontainer
* Autostart apache2 * Apply occ installation on start * Autostart Xdebug on request * Add DevContainer Xdebug profile Signed-off-by: GitHub <noreply@github.com>
Diffstat (limited to '.devcontainer/setup.sh')
-rwxr-xr-x.devcontainer/setup.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/.devcontainer/setup.sh b/.devcontainer/setup.sh
index 9d2e3d73f98..e3595123b84 100755
--- a/.devcontainer/setup.sh
+++ b/.devcontainer/setup.sh
@@ -6,3 +6,25 @@ git submodule update --init
# Codespace config
cp .devcontainer/codespace.config.php config/codespace.config.php
+
+# Set git safe.directory
+git config --global --add safe.directory /var/www/html
+
+# Onetime installation setup
+if [ ! -f "data/.devcontainer-install-complete" ]; then
+ echo "Running NC installation"
+ sudo -u www-data php occ maintenance:install \
+ --verbose \
+ --database=pgsql \
+ --database-name=postgres \
+ --database-host=127.0.0.1 \
+ --database-port=5432 \
+ --database-user=postgres \
+ --database-pass=postgres \
+ --admin-user admin \
+ --admin-pass admin && \
+ touch "data/.devcontainer-install-complete"
+fi
+
+# Clear caches and stuff ...
+service apache2 restart