setup.sh 957 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/bash
  2. #
  3. # SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
  4. # SPDX-License-Identifier: AGPL-3.0-or-later
  5. #
  6. DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../" >/dev/null 2>&1 && pwd )"
  7. cd $DIR/
  8. git submodule update --init
  9. # Codespace config
  10. cp .devcontainer/codespace.config.php config/codespace.config.php
  11. # VSCode debugger profile
  12. mkdir -p .vscode && cp .devcontainer/launch.json .vscode/launch.json
  13. # Onetime installation setup
  14. if [[ ! $(sudo -u ${APACHE_RUN_USER} php occ status) =~ installed:[[:space:]]*true ]]; then
  15. echo "Running NC installation"
  16. sudo -u ${APACHE_RUN_USER} php occ maintenance:install \
  17. --verbose \
  18. --database=pgsql \
  19. --database-name=postgres \
  20. --database-host=127.0.0.1 \
  21. --database-port=5432 \
  22. --database-user=postgres \
  23. --database-pass=postgres \
  24. --admin-user admin \
  25. --admin-pass admin
  26. fi
  27. sudo service apache2 restart