nextcloud/.devcontainer/setup.sh
Andy Scherzinger cc1686dba9
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-31 10:38:47 +02:00

34 lines
957 B
Bash
Executable File

#!/bin/bash
#
# SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
#
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../" >/dev/null 2>&1 && pwd )"
cd $DIR/
git submodule update --init
# Codespace config
cp .devcontainer/codespace.config.php config/codespace.config.php
# VSCode debugger profile
mkdir -p .vscode && cp .devcontainer/launch.json .vscode/launch.json
# Onetime installation setup
if [[ ! $(sudo -u ${APACHE_RUN_USER} php occ status) =~ installed:[[:space:]]*true ]]; then
echo "Running NC installation"
sudo -u ${APACHE_RUN_USER} 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
fi
sudo service apache2 restart