diff --git a/.circleci/config.yml b/.circleci/config.yml index c5a6430a3..5c9b27f03 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,7 +7,7 @@ defaults: &defaults working_directory: ~/build docker: # specify the version you desire here - - image: cimg/ruby:3.0.2-node + - image: cimg/ruby:3.0.2-browsers # Specify service dependencies here if necessary # CircleCI maintains a library of pre-built images @@ -77,6 +77,18 @@ jobs: paths: - cc-test-reporter + # verify swagger specification + - run: + name: Verify swagger API specification + command: | + bundle exec rake swagger:build + if [[ `git status swagger/swagger.json --porcelain` ]] + then + echo "ERROR: The swagger.json file is not in sync with the yaml specification. Run 'rake swagger:build' and commit 'swagger/swagger.json'." + exit 1 + fi + curl -L https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.3.0/openapi-generator-cli-5.3.0.jar > ~/tmp/openapi-generator-cli-5.3.0.jar + java -jar ~/tmp/openapi-generator-cli-5.3.0.jar validate -i swagger/swagger.json # Database setup - run: yarn install --check-files - run: bundle exec rake db:create diff --git a/.codeclimate.yml b/.codeclimate.yml index 667b0f340..af0c0714f 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -40,3 +40,7 @@ exclude_patterns: - "app/javascript/dashboard/i18n/locale" - "**/*.stories.js" - "stories/" + - "app/javascript/dashboard/components/widgets/conversation/advancedFilterItems/index.js" + - "app/javascript/shared/constants/countries.js" + - "app/javascript/dashboard/components/widgets/conversation/advancedFilterItems/languages.js" + - "app/javascript/dashboard/routes/dashboard/contacts/contactFilterItems/index.js" diff --git a/.env.example b/.env.example index ef74a7c0f..36ca66be1 100644 --- a/.env.example +++ b/.env.example @@ -57,6 +57,9 @@ SMTP_AUTHENTICATION= SMTP_ENABLE_STARTTLS_AUTO=true # Can be: 'none', 'peer', 'client_once', 'fail_if_no_peer_cert', see http://api.rubyonrails.org/classes/ActionMailer/Base.html SMTP_OPENSSL_VERIFY_MODE=peer +# Comment out the following environment variables if required by your SMTP server +# SMTP_TLS= +# SMTP_SSL= # Mail Incoming # This is the domain set for the reply emails when conversation continuity is enabled diff --git a/.eslintrc.js b/.eslintrc.js index c5cbba917..77ea9be7c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -28,6 +28,9 @@ module.exports = { }], 'vue/html-self-closing': 'off', "vue/no-v-html": 'off', + 'vue/singleline-html-element-content-newline': 'warn', + 'vue/require-default-prop': 'warn', + 'vue/require-prop-types': 'warn', 'import/extensions': ['off'] }, diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 000000000..7774f34f5 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,5 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" +npm run eslint +bundle exec rubocop -a +git add diff --git a/.husky/pre-push b/.husky/pre-push new file mode 100755 index 000000000..f0e139ad8 --- /dev/null +++ b/.husky/pre-push @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +sh bin/validate_push diff --git a/.rubocop.yml b/.rubocop.yml index b1c69ec70..8f8473547 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -57,7 +57,7 @@ Metrics/BlockLength: - db/schema.rb Metrics/ModuleLength: Exclude: - - lib/woot_message_seeder.rb + - lib/seeders/message_seeder.rb Rails/ApplicationController: Exclude: - 'app/controllers/api/v1/widget/messages_controller.rb' diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..79a2f8d21 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,128 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, religion, or sexual identity +and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the + overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or + advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email + address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +hello@chatwoot.com. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series +of actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or +permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within +the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.0, available at +https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct +enforcement ladder](https://github.com/mozilla/diversity). + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see the FAQ at +https://www.contributor-covenant.org/faq. Translations are available at +https://www.contributor-covenant.org/translations. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..bfa510323 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,5 @@ +# Contributing to Chatwoot + +Thanks for taking the time to contribute! :tada::+1: + +Please refer to our [Contributing Guide](https://www.chatwoot.com/docs/contributing-guide) for detailed instructions. diff --git a/LICENSE b/LICENSE index 037ad7885..f36fc7c53 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,11 @@ -The MIT License (MIT) - Copyright (c) 2017-2021 Chatwoot Inc. +Portions of this software are licensed as follows: + +* All content that resides under the "enterprise/" directory of this repository, if that directory exists, is licensed under the license defined in "enterprise/LICENSE". +* All third party components incorporated into the Chatwoot Software are licensed under the original license provided by the owner of the applicable component. +* Content outside of the above mentioned directories or restrictions above is available under the "MIT Expat" license as defined below. + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights diff --git a/README.md b/README.md index 41f15553d..eb083bec3 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,10 @@
@@ -81,9 +84,18 @@ Deploying Chatwoot to Heroku is a breeze. It's as simple as clicking this button Follow this [link](https://www.chatwoot.com/docs/environment-variables) to understand setting the correct environment variables for the app to work with all the features. There might be breakages if you do not set the relevant environment variables. + +### DigitalOcean 1-Click Kubernetes deployment + +Chatwoot now supports 1-Click deployment to DigitalOcean as a kubernetes app. + + +
@@ -29,7 +29,7 @@