Campaign Form, re-used over time for different campaigns (for example BugHunter, Fenix, Proton)
Перейти к файлу
dependabot[bot] 09aef06f9a
Bump express from 4.18.2 to 4.19.2 (#15)
Bumps [express](https://github.com/expressjs/express) from 4.18.2 to 4.19.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.18.2...4.19.2)

---
updated-dependencies:
- dependency-name: express
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-29 12:50:42 +01:00
lib Adjust to Firefox Nightly 2022 campaign 2022-08-17 22:27:41 +02:00
public Adjust to next campaign 2023-02-08 21:48:53 +01:00
routes Generalize naming to be able to reuse for future campaigns without a lot of renaming 2021-07-31 22:42:56 +00:00
views Adjust campaign title 2023-02-27 19:27:58 +01:00
.gitignore Better handle non-image uploads by adding a link to the original attachment (fixes #6) 2021-09-20 17:56:21 +02:00
CODE_OF_CONDUCT.md Initial commit 2021-03-21 18:34:13 +01:00
Dockerfile Initial commit 2021-03-21 18:34:13 +01:00
LICENSE Initial commit 2021-03-21 18:34:13 +01:00
README.md Better handle non-image uploads by adding a link to the original attachment (fixes #6) 2021-09-20 17:56:21 +02:00
app.js Initial commit 2021-03-21 18:34:13 +01:00
field_config.json Adjust for Firefox Translations campaign 2022-05-16 21:39:21 +02:00
index.js Generalize naming to be able to reuse for future campaigns without a lot of renaming 2021-07-31 22:42:56 +00:00
package-lock.json Bump express from 4.18.2 to 4.19.2 (#15) 2024-03-29 12:50:42 +01:00
package.json Bump express from 4.18.2 to 4.19.2 (#15) 2024-03-29 12:50:42 +01:00

README.md

Mozilla Campaign Form

This is a basic campaign form to submit issues to a GitHub repository. This has previously been used in campaigns such as Firefox Foxfooding and FxA testing. These campaigns previously lived in separate repos, upcoming campaigns will be handled in this repository as they come up.

Note that this form is basic and might not support everything you need. Several parts could be abstracted, however these campaigns are mostly short-lived and code gets adjusted as needed. PRs are welcome though!

Setting up the server

Requirements

  • Make sure you have Node.js installed
  • Create a repository to hold the submitted issues
  • Create a "triage" label for issues in that repository
  • Create the necessary labels in the GitHub repo according to lib/githubBackend.js
  • Create a personal access token for your GitHub user

Starting

Then you can start the server with the following command. Make sure to replace the placeholders with your data.

$ git clone <URL>
$ cd campaign-form
$ npm ci
$ GITHUB_TOKEN=<yourGitHubToken> OWNER=<yourGitHubUsername> REPO=<yourGitHubRepoForIssues> SESSION_SECRET=someSECRET BASE_URL=http://localhost:4000/ AWS_ACCESS_KEY_ID="<yourAWSAccessKeyID" AWS_SECRET_ACCESS_KEY="<yourAWSAccessKey>" AWS_S3_BUCKET_NAME="<yourAWSS3BucketName>" npm start

Note: you can leave off the AWS configuration, however attachments won't be uploaded and won't be shown in the resulting GitHub issue.

Now you can access the website for it at localhost:4000.

Environment variables

The following environment variables are needed. Note that you will need to set these up in Heroku as well!

Variable Description Example
AWS_ACCESS_KEY_ID AWS Access Key ID to upload attachments ...
AWS_SECRET_ACCESS_KEY AWS Access Key Secret to upload attachments ...
AWS_S3_BUCKET_NAME AWS S3 Bucket name to upload attachments to campaign-form-uploads
BASE_URL URL of the form https://foxfooding-form.mozilla.community/
GITHUB_TOKEN Token for the GitHub user to post issues ...
OWNER GitHub username / organization hosting the reporting repo mozilla
REPO GitHub repository name to host the issues campaign-form
SESSION_SECRET Random string used as session secret foobarbaz....

Changes needed for new campaigns

Coding

  • Check the fields_config.json file and adjust if needed
  • Adjust lib/formHandling.js to work together with the defined fields
  • Adjust views/index.pug to reflect correct strings and fields (if a previous campaign got stopped, you might need to revert previous changes to get back the form fields and then adjust them)
  • Adjust logo in public/ and its alt text in views/index.pug
  • Adjust title in views/layout.pug
  • Check lib/githubBackend.js to adjust possible version / OS GitHub labels and create them in the GitHub issues repo
  • Adjust public/client.js if any fields need pre-filling (such as UA)
  • Adjust header background color in public/style.css if needed

Operation / Admin

  • Add mozilla-campaign-form-bot GitHub user as collaborator to issues repository