installAndConfigureServer.sh 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. OC_PASS=123456acb php occ user:add --password-from-env user1
  32. OC_PASS=123456acb php occ user:add --password-from-env disabledUser
  33. php occ user:disable disabledUser
  34. if [ "$NEXTCLOUD_SERVER_DOMAIN" != "" ]; then
  35. # Default first trusted domain is "localhost"; replace it with given domain.
  36. php occ config:system:set trusted_domains 0 --value="$NEXTCLOUD_SERVER_DOMAIN"
  37. fi