diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 1c9509c9..00000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -name: Bug report -about: You might have found a bug and decide to report it -title: '' -labels: 'bug :bug:' -assignees: '' ---- - -## Context & versions - - -## Steps to reproduce - - -## Actual behavior - - -## Expected behavior - \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 00000000..5eb15fdc --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,68 @@ +name: πŸ› Bug report +description: You found a bug! +title: 'πŸ› ' +labels: ["πŸ› Bug"] +projects: ["IntersectMBO/24", "IntersectMBO/34"] +body: + - type: markdown + attributes: + value: | + ## 🌟 **Thank you for contributing to Constitutional Committee Portal!** + - type: markdown + attributes: + value: | + Before submitting a new issue please check the [existing issues](https://github.com/IntersectMBO/cc-portal/issues) to avoid duplication. + + - type: dropdown + id: domain + attributes: + label: Domain + description: Which CC Portal instance were you connected to? + options: + - constitution.gov.tools + - sancho.constitution.gov.tools + - other + validations: + required: true + + - type: textarea + id: context + attributes: + label: Context + description: Please give the context to what you were trying to achieve + placeholder: | + I was trying to see the latest CC member updates... + validations: + required: true + + - type: textarea + id: reproduce + attributes: + label: Steps to reproduce + description: Explain the steps to reproduce + placeholder: | + 1. Navigate to view constitution + 2. Scroll to appendix + 3. ... + validations: + required: true + + - type: textarea + id: actual-behavior + attributes: + label: Actual behavior + description: A description of the erroneous outcome + placeholder: | + A error came up on the screen stating... + validations: + required: true + + - type: textarea + id: expected-behavior + attributes: + label: Expected behavior + description: A description of what you expect to happen instead + placeholder: | + The constitution appendix is legible and accessible... + validations: + required: true \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 51874e6e..d4800fce 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,13 +1,13 @@ blank_issues_enabled: true contact_links: - name: Contributing guidelines - url: https://github.com/IntersectMBO/xxxx/blob/master/CONTRIBUTING.md + url: https://github.com/IntersectMBO/cc-portal/blob/master/CONTRIBUTING.md about: Some rules & processes we honor. - name: Feature ideas - url: https://github.com/IntersectMBO/xxxx/discussions/categories/ideas + url: https://github.com/IntersectMBO/cc-portal/discussions/categories/ideas about: Maybe someone else had the same or a similar idea already? - name: All issues - url: https://github.com/IntersectMBO/xxxx/issues + url: https://github.com/IntersectMBO/cc-portal/issues about: Check whether your issue is not already covered here. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_idea.yml b/.github/ISSUE_TEMPLATE/feature_idea.yml index c5542fa5..1d84b8be 100644 --- a/.github/ISSUE_TEMPLATE/feature_idea.yml +++ b/.github/ISSUE_TEMPLATE/feature_idea.yml @@ -1,44 +1,73 @@ -name: Feature idea -description: Idea or request for some feature on the xxxx roadmap -labels: [':thought_balloon: idea'] +name: πŸ’‘ Feature idea +description: Idea or request for some feature on the CC Portal roadmap +title: "πŸ’‘ " +labels: ["πŸ’‘ Feature idea"] +projects: ["IntersectMBO/24", "IntersectMBO/34"] body: - type: markdown attributes: - value: value: | - **Thank you for contributing to our project!** :green_heart: + ## 🌟 **Thank you for contributing to Constitutional Committee Portal!** + - type: markdown + attributes: + value: | + Before submitting a new issue consider [starting a new discussion](https://github.com/IntersectMBO/cc-portal/discussions/new?category=ideas). - Instead of opening this issue, consider [starting a new idea discussion](https://github.com/IntersectMBO/xxxx/discussions/new?category=ideas). - That way, we can discuss & refine your idea together, before we adopt it as a feature into the roadmap. + - type: dropdown + id: design-needed + attributes: + label: Is there new design needed? + description: Will this feature require new or edit to existing frontend designs? + options: + - 'Yes' + - 'No' + - Not sure + validations: + required: true - type: textarea - id: why + id: what attributes: - label: Why - description: Why do we need or want this feature + label: What? + description: What is this feature? placeholder: | - Give context and describe the problem, challenge or opportunity you see + For example describe a new API endpoint, a change in wording, + a new configuration option, ... validations: required: true - type: textarea - id: what + id: why attributes: - label: What - description: What is this feature roughly about + label: Why? + description: Why do we need or want this feature? placeholder: | - For example describe a new API endpoint, a change in messaging formats, - a new configuration option, ... + Give context and describe the problem the idea solves validations: required: true - type: textarea id: how attributes: - label: How - description: How could we realize this feature + label: How? + description: How can we realize this feature? placeholder: | Which technical solutions, libraries or systems should be used, which components need to change, steps how to implement this, ... validations: - required: true \ No newline at end of file + required: true + + - type: markdown + attributes: + value: | + --- + + - type: textarea + id: user-story + attributes: + label: (Optional) User Story with acceptance criteria + description: See examples [here](https://github.com/IntersectMBO/cardano-test-plans/blob/main/userStoryInventoryChangHF.md#2g-delegate-to-self-for-registered-dreps). + placeholder: | + As a [ada holder | DRep | Direct voter], I want [some goal] so that [some reason]. + validations: + required: false \ No newline at end of file diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 283f57ae..ce0073e2 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -4,8 +4,8 @@ ## Checklist -- [related issue](https://github.com/IntersectMBO/xxxx/issues/) +- [related issue](https://github.com/IntersectMBO/cc-portal/issues/) - [ ] My changes generate no new warnings -- [ ] My code follows the [style guidelines](https://github.com/IntersectMBO/xxxx/tree/main/docs/style-guides) of this project +- [ ] My code follows the [style guidelines](https://github.com/IntersectMBO/cc-portal/tree/main/docs/style-guides) of this project - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added tests that prove my fix is effective or that my feature works diff --git a/.github/workflows/label-feature-idea.yml b/.github/workflows/label-feature-idea.yml new file mode 100644 index 00000000..a46751e5 --- /dev/null +++ b/.github/workflows/label-feature-idea.yml @@ -0,0 +1,61 @@ +name: Add labels to πŸ’‘ Feature idea issues + +on: + issues: + types: [opened, edited] + +permissions: + issues: write + contents: read + +jobs: + apply-labels: + runs-on: ubuntu-latest + steps: + - name: Check if issue is a "πŸ’‘ Feature idea" + id: check_is_feature_idea + run: | + echo "## Checking if issue is a 'Feature idea'..." + if [[ "${{ github.event.issue.title }}" == "πŸ’‘ "* ]]; then + echo "is_feature_idea=true" >> $GITHUB_ENV + else + echo "is_feature_idea=false" >> $GITHUB_ENV + fi + + - name: Apply "🎨 Design Needed" label if design needed is "Yes" + if: ${{ env.is_feature_idea == 'true' }} + uses: actions/github-script@v6 + with: + script: | + const issueBody = context.payload.issue.body; + + // Match the "Yes" selection under the "### Is there new design needed?" header + const designNeededMatch = issueBody.match(/### Is there new design needed\?\s*\n\s*Yes\s*\n/); + + if (designNeededMatch) { + await github.rest.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: ["🎨 Design Needed"], + }); + } + + - name: Apply "User Story Needed" label if user story not provided + if: ${{ env.is_feature_idea == 'true' }} + uses: actions/github-script@v6 + with: + script: | + const issueBody = context.payload.issue.body; + + const userStoryPattern = /### \(Optional\) User Story with acceptance criteria\s*\n\s*_No response_/; + const userStoryMissing = userStoryPattern.test(issueBody); + + if (userStoryMissing) { + await github.rest.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: ["User Story Needed"], + }); + } \ No newline at end of file diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 3edf6a9d..90e27cd4 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -5,6 +5,7 @@ on: branches: - develop - staging + - beta - master permissions: diff --git a/CHANGELOG.md b/CHANGELOG.md index c02a8b13..cd4abd54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# xxxx Changelog +# Constitutional Committee Portal Changelog All notable changes to this project will be documented in this file. @@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 As a minor extension, we also keep a semantic version for the `UNRELEASED` changes. -## [tag-xxxx](https://github.com/IntersectMBO/xxxx/releases/tag/xxxx) 2024-xx-xx +## [tag-xxxx](https://github.com/IntersectMBO/cc-portal/releases/tag/xxxx) 2024-xx-xx ### Added - diff --git a/CODE-OF-CONDUCT.md b/CODE-OF-CONDUCT.md index 279206db..7be7b84a 100644 --- a/CODE-OF-CONDUCT.md +++ b/CODE-OF-CONDUCT.md @@ -60,7 +60,7 @@ representative at an online or offline event. Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at -[XXXX@intersectmbo.org](XXXX@intersectmbo.org). +[oso@intersectmbo.org](oso@intersectmbo.org). All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the diff --git a/CODEOWNERS b/CODEOWNERS index dee7e04c..1108c039 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1,4 +1,4 @@ -# xxxx Project Codeowners +# Constitutional Committee Project Codeowners # These owners will be the default owners for everything in the repository. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 96ff3232..4534399f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,14 +1,21 @@ -# Contributing to the `xxxx` project +# Contributing to the `CC Portal` project -Thanks for considering contributing and helping us on creating xxxx! 😎 +⚠️ This is a work in progress document, more instruction on how-to contribute to come! + +Contributing todo: + +- [ ] Refactor to reflect reality +- [ ] Make more friendly to open source contributors + +Thanks for considering contributing and helping us on creating CC Portal! 😎 The best way to contribute right now is to try things out and provide feedback, but we also accept contributions to the documentation and the obviously to the code itself. -This document contains guidelines to help you get started and how to make sure your contribution gets accepted, making you our newest xxxx contributor! +This document contains guidelines to help you get started and how to make sure your contribution gets accepted, making you our newest CC Portal contributor! ## Table of Contents -- [Contributing to the `xxxx` project](#contributing-to-the-xxxx-project) +- [Contributing to the `CC Portal` project](#contributing-to-the-cc-portal-project) - [Table of Contents](#table-of-contents) - [Code of Conduct](#code-of-conduct) - [Ask for Help](#ask-for-help) @@ -30,12 +37,6 @@ This document contains guidelines to help you get started and how to make sure y - [React](#react) - [CSS in Javascript](#css-in-javascript) - [CSS / SASS](#css--sass) - - [Haskell](#haskell) - - [Development Processes](#development-processes) - - [Developer workflow](#developer-workflow) - - [QA Workflow](#qa-workflow) - - [PO Workflow](#po-workflow) - - [Tech Lead Workflow](#tech-lead-workflow) ## Code of Conduct @@ -77,11 +78,11 @@ Please complete the following steps in advance to help us fix any potential bug We use GitHub issues to track bugs and errors. If you run into an issue with the project: -- Open an [Issue](https://github.com/IntersectMBO/xxxx/issues/new). +- Open an [Issue](https://github.com/IntersectMBO/cc-portal/issues/new). (Since we can't be sure at this point whether it is a bug or not, we ask you not to talk about a bug yet and not to label the issue.) - Explain the behavior you would expect and the actual behavior. - Please provide as much context as possible. - Describe the *reproduction steps* that someone else can follow to recreate the issue on their own. + Describe the _reproduction steps_ that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case. - Provide the information you collected in the previous section. @@ -108,6 +109,7 @@ TODO Thank you for contributing your changes by opening a pull requests! To get something merged we usually require: + - Follow the Pull Request template - Description of the changes - if your commit messages are great, this is less important - Quality of changes is ensured - through new or updated automated tests @@ -124,6 +126,7 @@ Please reuse the branch naming for the pull request naming. - Using the related issue number after the prefix is required. Examples: + - `feat/123-added-ability-for-dreps-to-change-drep-id` - `fix/312-fixed-drep-ids-being-reversed` - `chore/567-bumped-cardano-node-version-to-9` @@ -131,7 +134,7 @@ Examples: ### Commit Messages -Please make informative commit messages! +Please make informative commit messages! It makes it much easier to work out why things are the way they are when you’re debugging things later. A commit message is communication, so as usual, put yourself in the position of the reader: what does a reviewer, or someone reading the commit message later need to do their job? @@ -142,6 +145,7 @@ Also, include any relevant meta-information, such as issue numbers. If a commit completely addresses a issue, you can put that in the headline if you want, but it’s fine to just put it in the body. Here are seven rules for great git commit messages: + 1. Separate subject from body with a blank line 2. Limit the subject line to 50 characters (soft limit) 3. Capitalize the subject line @@ -165,6 +169,7 @@ Try to keep branches up-to-date with main (not strict requirement though). Once merged to main, please delete the branch. **Tip:** Use Github's merge button in PRs to merge with commit. +This strategy helps us operate on the commits you've delivered: it's easier to [cherry-pick a merge commit](https://git-scm.com/docs/git-cherry-pick#Documentation/git-cherry-pick.txt--mltparent-numbergt) than a series of commits, and it's also easier to [revert changes using a merge commit](https://git-scm.com/docs/git-revert#Documentation/git-revert.txt--mparent-number) instead of a series of reverts. If a branch is outdated, use the rebase button in PRs to rebase feature branches (NOT update via merge). #### Rationale @@ -172,7 +177,7 @@ If a branch is outdated, use the rebase button in PRs to rebase feature branches Keeping branches ahead of main not only make the git history a lot nicer to process, it also makes conflict resolutions easier. Merging main into a branch repeatedly is a good recipe to introduce invalid conflict resolutions and loose track of the actual changes brought by a the branch. -### Versioning +### Versioning Not all releases are declared stable. Releases that aren't stable will be released as pre-releases and will append a -pre tag indicating it is not ready for running on production networks. @@ -180,6 +185,7 @@ Releases that aren't stable will be released as pre-releases and will append a - ### Changelog During development, on every PR; + - Make sure `CHANGELOG.md` is kept up-to-date with high-level, technical, but user-focused list of changes according to [keepachangelog](https://keepachangelog.com/en/1.0.0/). - Bump `UNRELEASED` version in `CHANGELOG.md` according to [semver](https://semver.org/). @@ -196,44 +202,3 @@ Please see [CSS in Javascript Style Guide](./docs/style-guides/css-in-js/). #### CSS / SASS Please see [CSS / SASS Style Guide](./docs/style-guides/css-sass/). - -#### Haskell - -TODO - -## Development Processes - -### Developer workflow - - - -- Choose ticket/issue to work on from the project, move ticket from `todo` to `in progress`. -- Create [well named](#branch-naming) branch from `develop` add changes, then make a pull request back to the `develop` branch. -- If the changes are not ready for review then feel free to create a draft PR, and link this to the ticket/issue. -- Developers should review each other's pull requests, and should be requested via [CODEOWNERS](./CODEOWNERS). -- Unit tests are run on each pull request to `develop`. -- Once tests pass and peer review is done the branch can be merged into `develop` by author and then deployed to the dev environment (manually for now). -- The ticket status can then be moved ticket to `in QA` making sure that the PR/branch has been added to the ticket/issue as a comment. - -### QA Workflow - -- Choose ticket from `in QA`. -- Merge in the ticket's changes from `develop` branch into `test` branch. -- Deploy to test environment (manually for now). -- The QA tests the deployed test environment against the ticket. -- If QA agrees that the code is good, they can make a PR from `test` branch to `staging` branch where end-to-end and performance tests are run. -- If tests pass, then QA or tech lead can merge and deploy to staging environment (manually for now). -- Moving ticket to `staging` status this ready for PO check. - -### PO Workflow - -- Choose ticket from `staging` status. -- Compare the deployment on staging environment to the contents of the ticket. -- If the deployment has been satisfied via the staging environment, PO comments on the ticket to be included in next release. - -### Tech Lead Workflow - -- Bundle the staging status tickets together into a new tag. -- Merge `staging` branch into the `main` branch. -- Deploy tagged build to `beta` environment. -- Move tickets from staging status to done status. diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..b9e73469 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright Β© 2018-2021 IOHK + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md index 2d029723..5c951578 100644 --- a/README.md +++ b/README.md @@ -2,16 +2,16 @@ Welcome to the official repository for the Constitution Committee Portal. -The primary purpose of the solution is to host the Cardano Constitution and allow anyone to get familiar with it and follow the evolution over time. It also serves as the single point of truth for the Cardano Community members to see how Constitutional Committee members voted on a specific Governance Action, with the inclusion of their rationale. For members of the Constitutional Committee, it serves as a portal to add reasoning to their votes and prepare it as an off-chain resource to be attached to on-chain governance actions. +The primary purpose of this solution is to host the Cardano Constitution and allow anyone to get familiar with it and follow its evolution over time. It also serves as the single point of truth for the Cardano Community members to see how Constitutional Committee members voted on a specific Governance Action, with the inclusion of their rationale. For members of the Constitutional Committee, it serves as a portal to add reasoning to their votes and prepare it as an off-chain resource to be attached to on-chain governance actions. -## Table of content: +## Navigation - [Introduction](#introduction) - [Prerequisites](#prerequisites) - [Tech stack](#tech-stack) - [Getting started](#getting-started) - [Usage](#usage) -- [Environment Variables](#environment-variables) +- [Environment Variables](#environment-variables) - [API Documentation](#api-documentation) - [License](#license) @@ -93,7 +93,7 @@ Before you begin setting up the application, you'll need to clone the repository ``` Edit the .env file to reflect your local settings. Env variables description can be found [below](#environment-variables). - Run this command within folders: `frontend`, `worker-service`, `ipfs-service` to configure environment variables for all these services. Edit every .env file to reflect your local settings. - Important: for `worker-service` environment variables ensure the right credentials for connection to DB-SYNC Database + Important: for `worker-service` environment variables ensure the right credentials for connection to DB-SYNC Database 4. **Docker Setup:** @@ -120,22 +120,18 @@ Before you begin setting up the application, you'll need to clone the repository ``` 6. **Create Super Admin** - + A Super Admin should be created manually. To do that, run the following SQL queries on the Backend PostgreSQL database: - 1. Create super admin user with valid email address - ``` INSERT INTO users (email, status, role_id) VALUES ('your@email.com', 'active', (SELECT r.id FROM roles r WHERE r.code='super_admin')); ``` - 2. Add permissions to super admin - ``` INSERT INTO user_permissions(user_id, permission_id) SELECT users.id, permissions.id FROM permissions - INNER join users on users.email + INNER join users on users.email IN ('your@email.com') WHERE code IN ('manage_admins', 'manage_cc_members', 'add_constitution_version'); ``` @@ -143,9 +139,8 @@ Before you begin setting up the application, you'll need to clone the repository ## Usage If the installation process passes successfully, the CC Portal is ready to use. - -- Frontend should be available on the URL: `http://localhost:3000`. -- Backend shoul be available on the URL: `http://localhost:1337`. + - Frontend should be available on the URL: `http://localhost:3000`. + - Backend shoul be available on the URL: `http://localhost:1337`. ## Environment Variables @@ -176,6 +171,7 @@ Below is a description of the environment variables used in the `.env` file: - `REDIS_HOST`: Hostname for Redis. Example `cache`. - `REDIS_PORT`: Port number for Redis. Example `6379`. - `REDIS_PASSWORD`: Password for Redis. Example `password`. + - `REDIS_TLS`: TLS connection is enabled/disabled. Example `false`. - `AWS_ACCESS_KEY_ID`: AWS SES access key id. - `AWS_SECRET_ACCESS_KEY`: AWS SES secret access key. - `AWS_REGION`: AWS SES region. @@ -187,6 +183,7 @@ Below is a description of the environment variables used in the `.env` file: - `MINIO_SECRET_KEY`: Secret key for Minio. - `MINIO_USE_SSL`: Dedines whether Minio use SSL. Example `true`, `false`. - `MINIO_BUCKET`: Bucket name for Minio. + - `S3_BASE_URL`: URL of the AWS S3 service. Example: `https://s3.us-east-1.amazonaws.com`. - `IPFS_SERVICE_URL`: URL of the IPFS service.Example `http://localhost:3001`. - `FE_LOGIN_CALLBACK_URL`: Frontend login callback URL. Example `http://localhost:3000/en/verify/login`. - `FE_REGISTER_CALLBACK_URL`: Frontend register callback URL. Example `http://localhost:3000/en/verify/register`. @@ -199,6 +196,15 @@ Below is a description of the environment variables used in the `.env` file: - `IPFS_PUBLIC_URL`: The base of public IPFS URL. - `IPNS_PUBLIC_URL`: The base of public IPNS URL. - `IPNS_CONSTITUTION_KEY_NAME`: Key name used to generate IPNS peer ID. Example `some-random-string`. + - `REDIS_HOST`: Hostname for Redis. Example `cache`. + - `REDIS_PORT`: Port number for Redis. Example `6379`. + - `REDIS_PASSWORD`: Password for Redis. Example `password`. + - `REDIS_TLS`: TLS connection is enabled/disabled. Example `false`. + - `DHT_QUEUE_ATTEMPTS`: Count of attempts. Example `10`. + - `DHT_QUEUE_BACKOFF_TYPE`: Backoff type (exponential, fixed). Example `exponential`. + - `DHT_QUEUE_BACKOFF_DELAY`: Backoff delay in milliseconds. Example `1000`. + - `MAX_PEERS`: Limit of peers stored in the peer store. Example `5000`. + - `PRUNE_PEER_STORE_INTERVAL`: Frequency of the job that reduces the total number of peers limited to MAX_PEERS. Example `0 0 */12 * * *`. 4. **Worker service** @@ -216,10 +222,13 @@ Below is a description of the environment variables used in the `.env` file: - `REDIS_HOST`: Hostname for Redis. Example `cache`. - `REDIS_PORT`: Port number for Redis. Example `6379`. - `REDIS_PASSWORD`: Password for Redis. Example `password`. + - `REDIS_TLS`: TLS connection is enabled/disabled. Example `false`. - `HOT_ADDRESSES_PER_PAGE`: Password for the DB-Sync PostgreSQL database user. Example: `10`. - `GOV_ACTION_PROPOSALS_PER_PAGE`: Password for the DB-Sync PostgreSQL database user. Example: `10`. - `VOTES_JOB_FREQUENCY`: Frequency of the job that retrieves votes. Example: `*/30 * * * * *`. - `GOV_ACTION_PROPOSALS_JOB_FREQUENCY`: Frequency of the job that retrieves Governance Action Proposals. Example: `0 * * * * *`. + - `EPOCH_DURATION`: Epoch duration in seconds. Example: `86400`. + - `GAP_DURATION_IN_EPOCH_COUNT`: Govenrnance action proposal duration expressed in number of epochs. Example: `6`. ## API Documentation diff --git a/SECURITY.md b/SECURITY.md index d7856a7f..2e7800b1 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,7 +2,7 @@ ## Reporting a Vulnerability -Please report (suspected) security vulnerabilities to [XXXX@intersectmbo.org](XXXX@intersectmbo.org). +Please report (suspected) security vulnerabilities to [security@intersectmbo.org](security@intersectmbo.org). You will receive a response from us within 48 hours. If the issue is confirmed, we will release a patch as soon as possible. diff --git a/SUPPORT.md b/SUPPORT.md index 2722f187..ad9d7e34 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -1,8 +1,8 @@ # Ask for help -Should you have any questions or need some help in getting set up, you can use these communication channels to reach the xxxx team and get answers in a way where others can benefit from it as well: +Should you have any questions or need some help in getting set up, you can use these communication channels to reach the CC portal team and get answers in a way where others can benefit from it as well: -- Github [Discussions](https://github.com/IntersectMBO/xxxx) +- Github [Discussions](https://github.com/IntersectMBO/cc-portal/discussions) # Reporting a Vulnerability diff --git a/docker-compose.yaml b/docker-compose.yaml index ac915b4b..7b57a974 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -114,7 +114,6 @@ services: container_name: proxy ports: - "80:80" - - "443:443" networks: - cc