installAndConfigureServer.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/bash
  2. # @copyright Copyright (c) 2017, Daniel Calviño Sánchez (danxuliu@gmail.com)
  3. #
  4. # @license GNU AGPL version 3 or any later version
  5. #
  6. # This program is free software: you can redistribute it and/or modify
  7. # it under the terms of the GNU Affero General Public License as
  8. # published by the Free Software Foundation, either version 3 of the
  9. # License, or (at your option) any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU Affero General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU Affero General Public License
  17. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. # Helper script to install and configure the Nextcloud server as expected by the
  19. # acceptance tests.
  20. #
  21. # This script is not meant to be called manually; it is called when needed by
  22. # the acceptance tests launchers.
  23. set -o errexit
  24. NEXTCLOUD_SERVER_DOMAIN=""
  25. if [ "$1" = "--nextcloud-server-domain" ]; then
  26. NEXTCLOUD_SERVER_DOMAIN=$2
  27. shift 2
  28. fi
  29. php occ maintenance:install --admin-pass=admin
  30. OC_PASS=123456acb php occ user:add --password-from-env user0
  31. if [ "$NEXTCLOUD_SERVER_DOMAIN" != "" ]; then
  32. # Default first trusted domain is "localhost"; replace it with given domain.
  33. php occ config:system:set trusted_domains 0 --value="$NEXTCLOUD_SERVER_DOMAIN"
  34. fi