Giter Site home page Giter Site logo

rtestard / campaign-form Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mozilla/campaign-form

0.0 0.0 0.0 714 KB

Campaign Form, re-used over time for different campaigns (for example BugHunter, Fenix, Proton)

License: Other

JavaScript 59.02% CSS 15.75% Dockerfile 0.53% Pug 24.69%

campaign-form's Introduction

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

campaign-form's People

Contributors

michaelkohler avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.