Skip to content

Make Decidim fully configurable via ENV vars#8725

Merged
andreslucena merged 55 commits intodecidim:developfrom
Platoniq:feat/complete-env-vars
Feb 3, 2022
Merged

Make Decidim fully configurable via ENV vars#8725
andreslucena merged 55 commits intodecidim:developfrom
Platoniq:feat/complete-env-vars

Conversation

@microstudi
Copy link
Copy Markdown
Contributor

@microstudi microstudi commented Jan 18, 2022

🎩 What? Why?

This PR will improve the way the default application is created via the decidim generator.
The goal is to set a full-featured application ready to run and configurable, at least with the default adaptations (such as the map provider), entirely via ENV variables.

This changes will make the default Decidim application fully compliant with the 12 Factor principles and will facilitate the later introduction of better scripts or containers fully prepared to easily deploy Decidim with minimal customization.

Notes
Marked with ⛔ are configuration options that require additional code efforts to make it work (such as create a service class). We will NOT set up env vars for these options at the moment. In the future, if some default providers are added we might add these as env vars options as well.

Changes:

  • Omniauth defaults & tests
  • Complete default secrets.yml defaults with env vars
  • Full SMTP config
  • Default documentation
  • Application Name
  • Application mailer sender
  • Force SSL
  • Rails Log level
  • Rails Logger adapter ⛔
  • Rails storage (local || S3 compat) ⛔ (will be handled in a different approach through a generator option)
  • Queue adapter (delayed_job || sidekiq) ⛔ (will be handled in a different approach through a generator option)
  • Queue name prefix
  • Assets host
  • Content processors ⛔
  • Currency unit
  • Html header snippets
  • newsletter tracker
  • IP /system access list
  • throttling requests, period and (maybe) password to disabled it (for testing)
  • Unconfirmed access
  • Base upload path
  • cors enabled
  • image uploader quality
  • max reports before hidding
  • Data portability expiration time
  • Available locales
  • Default locale
  • Maps (Here Maps || OpenStreetMaps) - Maybe Geocoding (although default is to be linked to maps)
  • Etherpad
  • SMS gateway service class ⛔
  • Timestamp service class ⛔
  • PDF signature class ⛔
  • csv col separation
  • amendments visibility options ⛔
  • machine translation service class (with automatic enabling translations) ⛔
  • machine translation delay ⛔
  • consent cookie name
  • user roles ⛔
  • Attachment file size
  • avatar file size
  • expire session time
  • enable remember me
  • session timeout interval
  • follow http x forwarded
  • password blacklist
  • cache key separator
  • conversation length
  • open redirects
  • reference generator ⛔
  • Documentation

Current ENVS:

OMNIAUTH_FACEBOOK_APP_ID (if defined enables login button)
OMNIAUTH_FACEBOOK_APP_SECRET
OMNIAUTH_TWITTER_API_KEY (if defined enables login button)
OMNIAUTH_TWITTER_API_SECRET
OMNIAUTH_GOOGLE_CLIENT_ID (if defined enables login button)
OMNIAUTH_GOOGLE_CLIENT_SECRET
MAPS_PROVIDER
MAPS_API_KEY
MAPS_DYNAMIC_PROVIDER
MAPS_STATIC_PROVIDER
MAPS_STATIC_API_KEY
MAPS_DYNAMIC_API_KEY
MAPS_DYNAMIC_URL
MAPS_STATIC_URL
MAPS_ATTRIBUTION
MAPS_EXTRA_VARS
MAPS_GEOCODING_HOST
ETHERPAD_SERVER
ETHERPAD_API_KEY
ETHERPAD_API_VERSION (defaults to 1.2.1)
SECRET_KEY_BASE
SMTP_USERNAME
SMTP_PASSWORD
SMTP_ADDRESS
SMTP_DOMAIN
SMTP_PORT (default: 587)
SMTP_STARTTLS_AUTO (default: auto)
SMTP_AUTHENTICATION
BULLETIN_BOARD_SERVER
BULLETIN_BOARD_PUBLIC_KEY
BULLETIN_BOARD_API_KEY
AUTHORITY_NAME
AUTHORITY_PRIVATE_KEY
ELECTIONS_SCHEME_NAME (default: electionguard)
ELECTIONS_NUMBER_OF_TRUSTEES
ELECTIONS_QUORUM
DECIDIM_APPLICATION_NAME (default My Application Name')
DECIDIM_MAILER_SENDER (default: change-me@example.org)
DECIDIM_AVAILABLE_LOCALES (default: en,ca,es)
DECIDIM_DEFAULT_LOCALE (default: en)
DECIDIM_FORCE_SSL (default auto)
DECIDIM_ENABLE_HTML_HEADER_SNIPPETS
DECIDIM_CURRENCY_UNIT (default )
DECIDIM_IMAGE_UPLOADER_QUALITY (default 80)
DECIDIM_MAX_REPORTS_BEFORE_HIDING (default 3)
DECIDIM_TRACK_NEWSLETTER_LINKS (default true)
DECIDIM_DATA_PORTABILITY_EXPIRY_TIME (default 7)
DECIDIM_THROTTLING_MAX_REQUESTS (default 100)
DECIDIM_THROTTLING_PERIOD (default 1)
DECIDIM_UNCONFIRMED_ACCESS_FOR (default 2)
DECIDIM_SYSTEM_ACCESSLIST_IPS
DECIDIM_BASE_UPLOADS_PATH
DECIDIM_DEFAULT_CSV_COL_SEP (default ;)
DECIDIM_CORS_ENABLED (default false)
DECIDIM_MAXIMUM_ATTACHMENT_SIZE (default 10)
DECIDIM_MAXIMUM_AVATAR_SIZE (default 5)
DECIDIM_CONSENT_COOKIE_NAME (default decidim-cc)
DECIDIM_EXPIRE_SESSION_AFTER (default 30)
DECIDIM_ENABLE_REMEMBER_ME (default true)
DECIDIM_SESSION_TIMEOUT_INTERVAL (default 10)
DECIDIM_FOLLOW_HTTP_X_FORWARDED_HOST (default false)
DECIDIM_MAXIMUM_CONVERSATION_MESSAGE_LENGTH (default 1000)
DECIDIM_PASSWORD_BLACKLIST
DECIDIM_ALLOW_OPEN_REDIRECTS (default false)
RAILS_LOG_LEVEL
RAILS_ASSET_HOST
VAPID_PUBLIC_KEY
VAPID_PRIVATE_KEY

📌 Related Issues

Link your PR to an issue

  • Related to #?
  • Fixes #?

Testing

Describe the best way to test or validate your PR.

📋 Checklist

🚨 Please review the guidelines for contributing to this repository.

  • CONSIDER adding a unit test if your PR resolves an issue.
  • ✔️ DO check open PR's to avoid duplicates.
  • ✔️ DO keep pull requests small so they can be easily reviewed.
  • ✔️ DO build locally before pushing.
  • ✔️ DO make sure tests pass.
  • ✔️ DO make sure any new changes are documented in docs/.
  • ✔️ DO add and modify seeds if necessary.
  • ✔️ DO add CHANGELOG upgrade notes if required.
  • ✔️ DO add to GraphQL API if there are new public fields.
  • ✔️ DO add link to MetaDecidim if it's a new feature.
  • AVOID breaking the continuous integration build.
  • AVOID making significant changes to the overall architecture.

📷 Screenshots

Please add screenshots of the changes you're proposing
Description

♥️ Thank you!

@microstudi
Copy link
Copy Markdown
Contributor Author

@andreslucena tests passing, should I remove the references to platoniq? or anything else we should discuss on this?

@microstudi
Copy link
Copy Markdown
Contributor Author

@andreslucena this is ready. 2 failed tests in the generator as expected (needs to be merged to pass)

Copy link
Copy Markdown
Member

@andreslucena andreslucena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏽

@andreslucena andreslucena merged commit 40953c9 into decidim:develop Feb 3, 2022
eliegaboriau pushed a commit to eliegaboriau/decidim that referenced this pull request Feb 21, 2022
Co-authored-by: Andrés Pereira de Lucena <andreslucena@users.noreply.github.com>
@alecslupu alecslupu added this to the 0.27.0 milestone Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: generators type: change PRs that implement a change for an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants