You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
2.4 KiB

  1. # -*- mode: shell-script -*-
  2. GOGOCARTO_CODE="$SERVICE_CONFIGSTORE/opt/apps/gogocarto"
  3. GOGOCARTO_RELEASE=3.1.3-2-gf3c10f1
  4. GOGOCARTO_URL=https://docker.0k.io/downloads/gogocarto-"${GOGOCARTO_RELEASE}".tar.bz2
  5. gogocarto:init() {
  6. mkdir -p "${GOGOCARTO_CODE}" &&
  7. cd "${GOGOCARTO_CODE}" &&
  8. curl "$GOGOCARTO_URL" | tar xjv
  9. }
  10. gogocarto:config() {
  11. APP_ENV=$(options-get app-env 2>/dev/null) || true
  12. APP_ENV=${APP_ENV:-prod}
  13. cat <<EOF > "${GOGOCARTO_CODE}"/.env
  14. ###> symfony/framework-bundle ###
  15. APP_ENV=$APP_ENV
  16. APP_SECRET=82ec369b81caab5446ddfc3b5edb4d00
  17. CSRF_PROTECTION=$(
  18. [ "$APP_ENV" == "prod" ] &&
  19. echo "true" ||
  20. echo "false") ## active csrf protection on production servers
  21. #TRUSTED_PROXIES=127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
  22. #TRUSTED_HOSTS='^localhost|example\.com$'
  23. ###< symfony/framework-bundle ###
  24. ###> vich upload ###
  25. IMAGES_MAX_FILESIZE=8M # for public images upload
  26. IMAGE_RESIZE_WIDTH=1000 # in pixel
  27. FILES_MAX_FILESIZE=1M # for other public file upload
  28. ###> vich upload ###
  29. USE_AS_SAAS=false
  30. CONTACT_EMAIL=contact@localhost.fr
  31. INSTANCE_NAME=GoGoCarto
  32. ###> symfony/swiftmailer-bundle ###
  33. # For Gmail as a transport, use: "gmail://username:password@localhost"
  34. # For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode="
  35. # Delivery is disabled by default via "null://localhost"
  36. MAILER_URL=gmail://test.gogocarto:creerdescartesagogo@localhost
  37. FROM_EMAIL=test.gogocarto@gmail.com
  38. ###< symfony/swiftmailer-bundle ###
  39. ###> hwi/oauth-bundle ###
  40. OAUTH_COMMUNS_ID=disabled
  41. OAUTH_COMMUNS_SECRET=disabled
  42. OAUTH_GOOGLE_ID=disabled
  43. OAUTH_GOOGLE_SECRET=disabled
  44. OAUTH_FACEBOOK_ID=disabled
  45. OAUTH_FACEBOOK_SECRET=disabled
  46. ###< hwi/oauth-bundle ###
  47. ###> sentry/sentry-symfony ###
  48. # Log errors nicely with sentry. Create your account on sentry.io and provide the DSN here
  49. # exple: SENTRY_DSN=https://6145d1aac36c429781fc1b0f79b0da48@sentry.io/1402018
  50. SENTRY_DSN=
  51. ###< sentry/sentry-symfony ###
  52. EOF
  53. }
  54. symphony() {
  55. export COMPOSE_IGNORE_ORPHANS=true
  56. ## We don't want post deploy that is doing the final http initialization.
  57. compose --debug -q --no-init --no-post-deploy \
  58. --without-relation="$SERVICE_NAME":web-proxy \
  59. run \
  60. "${symphony_docker_run_opts[@]}" \
  61. -T --rm -w /opt/apps/gogocarto \
  62. --entrypoint php \
  63. -u www-data "$SERVICE_NAME" bin/console "$@" | cat
  64. return "${PIPESTATUS[0]}"
  65. }