A stream of assets from peers across the Mozilla Network
Перейти к файлу
Mavis Ou 7a4f9030a8
Revert "Added nonce & implemented GTM and CSP changes (#1661)" (#1668)
This reverts commit 81b7d8c3aa.
2022-12-06 09:55:16 -08:00
.github Create ci.yml 2021-01-11 14:16:37 -08:00
assets Footer: added copy for CC license (#1431) 2020-10-16 13:56:20 -07:00
components updated to use data layer + only fire when checkbox is checked (#1657) 2022-08-11 11:54:29 -07:00
config make things runnable again (#1648) 2022-03-24 15:22:35 -07:00
js Revert "Added nonce & implemented GTM and CSP changes (#1661)" (#1668) 2022-12-06 09:55:16 -08:00
pages GA improvements with respect to DNT setting & install GTM (#1505) 2021-01-18 14:14:17 -08:00
scss error message on Add page (#1437) 2020-10-16 14:52:14 -07:00
.eslintrc.json Make ESLint raise errors instead of warnings (#1147) 2019-08-28 09:13:17 -07:00
.gitignore Dependency updates (#961) 2018-06-19 11:05:41 -07:00
.mergify.yml Add recaptcha (#1637) 2022-01-27 09:32:36 -08:00
.stylelintrc Prettier for stylelint (#1149) 2019-09-03 14:58:54 -07:00
.stylelintrc-colors.js Bump stylelint from 13.6.1 to 13.8.0 (#1466) 2021-01-13 15:34:01 -08:00
.travis.yml Node v14.4.x (#1337) 2020-06-30 10:06:03 -07:00
CODE_OF_CONDUCT.md add code of conduct (#1016) 2019-02-22 11:23:41 -05:00
PULL_REQUEST_TEMPLATE.md Update PULL_REQUEST_TEMPLATE.md (#1363) 2020-07-04 10:21:39 -07:00
Procfile Related to #305 - forgot to update Procfile in the previous commit 2017-01-11 13:45:45 -08:00
README.md make things runnable again (#1648) 2022-03-24 15:22:35 -07:00
app.json update docs, reviewapp admin script and app.json (#1229) 2020-01-22 10:49:25 +01:00
app.jsx use @babel/polyfill to fix a bunch of IE issues (#1252) 2020-03-02 10:30:37 -08:00
appveyor.yml Node v14.4.x (#1337) 2020-06-30 10:06:03 -07:00
contribute.json Bumped up Pulse's Observatory score (#876) 2017-12-06 15:13:20 -08:00
main.jsx GA improvements with respect to DNT setting & install GTM (#1505) 2021-01-18 14:14:17 -08:00
manifest.json Update manifest (#823) 2017-10-25 08:47:51 -04:00
package-lock.json sass instead of node-sass (#1556) 2021-03-23 09:44:25 -07:00
package.json added node version to package.json (#1662) 2022-12-01 14:39:31 -08:00
server.js Revert "Added nonce & implemented GTM and CSP changes (#1661)" (#1668) 2022-12-06 09:55:16 -08:00
webpack.client.common.js Bump prettier from 1.19.1 to 2.0.5 (#1297) 2020-06-02 17:29:58 -07:00
webpack.client.dev.js Bump prettier from 1.19.1 to 2.0.5 (#1297) 2020-06-02 17:29:58 -07:00
webpack.client.prod.js Bump prettier from 1.19.1 to 2.0.5 (#1297) 2020-06-02 17:29:58 -07:00
webpack.server.common.js Bump prettier from 1.19.1 to 2.0.5 (#1297) 2020-06-02 17:29:58 -07:00
webpack.server.dev.js Bump prettier from 1.19.1 to 2.0.5 (#1297) 2020-06-02 17:29:58 -07:00
webpack.server.prod.js Bump prettier from 1.19.1 to 2.0.5 (#1297) 2020-06-02 17:29:58 -07:00

README.md

Mozilla Pulse

Travis Build Status AppVeyor Build Status

Pulse is a platform that helps the Mozilla Network capture and broadcast its projects and activities. mozillapulse.org

Around the globe, teachers, engineers, activists, and others collaborate to protect and extend the internet as a public resource. They create amazing apps, art, tools, games, and campaigns. Their impact is tremendous, but decentralized and difficult to track, even within the network.

Pulse reveals the network's footprint, it fosters collaboration and amplifies the big wins.

Contribute

We love contributors, but the team maintaining this project is small and not structured to significantly support new and inexperienced contributors. If there's an unassigned issue that catches your eye, feel free to open a PR for it, but keep in mind our support will be limited. We usually don't have the capacity to walk you through the process of spinning up the project, opening a PR or describing what the solution to the issue could be.

Development

Requirements

  • node
  • npm

Setup

$> git clone https://github.com/mozilla/network-pulse.git
$> cd network-pulse
$> npm install
$> npm start

Environments

If you would like to override default environment variables... create a .env file on the root directory and set your env vars there. See environment variables section for details.

There are two files that you can expressly copy depending on your use:

  1. default.env has all the environment variables needed to run the pulse site without running a local pulse API instance.
  2. default.localhost.env has all the environment variables needed to run the pulse site in a way that it uses a locally running pulse API instance.

If you need (2), make sure to follow the instructions in the network pulse api README.md that explain how to set up Google Authentication.

Key scripts to run

npm start

This starts server in development mode. See environment variables section for PORT number.

npm test

This starts a few test scripts. Don't forget to run this command and fix errors (if any) before you git push your changes.

Fixing linting errors

If npm test yields linting errors, you can run npm run fix to have the style linters try to automatically fix any linting issues. This should almost always be enough to fix any linting errors.

npm optimize

This starts a few image optimization scripts.

Environment variables

Name Description
PORT Default: process.env.PORT(falls back to 3000 if process.env.PORT cannot be found)

The port number you are running the server on.
PULSE_API_HOST Default: https://pulse-api.mofostaging.net

Host of the Pulse API URL.
PULSE_API Default: https://pulse-api.mofostaging.net/api/pulse

URL to Pulse API. e.g., http://test.example.com:8000/api/pulse.
To set up a local instance of Pulse API, follow instructions on Pulse API README doc.
PULSE_LOGIN_URL Default: https://pulse-api.mofostaging.net/accounts/login/

URL to use to login to Pulse. This needs to be a Pulse API login url.
PULSE_LOGOUT_URL Default: https://pulse-api.mofostaging.net/accounts/logout/

URL to use to logout of Pulse. This needs to be a Pulse API logout url.
USE_RECAPTCHA Default: true

Whether or not to have recaptcha securing the sign up/sign in action.
RECAPTCHA_KEY Default: empty string

The recaptcha site key to use, when recaptcha is enabled.
PROJECT_BATCH_SIZE Default: 24

Number of projects you want to display as a batch. Make sure this number is divisible by 2 AND 3 so rows display evenly for different screen sizes.
PROFILE_BATCH_SIZE Default: 10

Number of profiles you want to display as a batch.
LEARN_MORE_LINK Default: https://www.mozillapulse.org/entry/120

Link to learn more about what Pulse project is about.
NODE_ENV Default: development

When this is set to production, it enables production specific express settings and middleware
APP_HOST Default: localhost

The domain which this app should serve. It's only used when NODE_ENV is set to production
HEROKU_APP_NAME Default: ""

The name of the review app (generated by Heroku).
GITHUB_TOKEN Default: ""

GitHub token used by the review app slack webhook.
SLACK_WEBHOOK Default: ""

Webhook of the Slack channel where the bot is posting.

Deployment

Staging

URL: https://network-pulse-staging.herokuapp.com/

Updates to master branch automatically triggers staging deployment.

Production

URL: https://mozillapulse.org

Deployment is done using the Heroku pipeline. Simply click "Promote To Production".

Review Apps

Review App for PRs

Opening a PR will automatically create a Review App in the network-pulse pipeline. A slack bot posts credentials and links to Review Apps in to the mofo-ra-pulse Slack channel.

Note: This only work for Mo-Fo staff: you will need to manually open a Review App on Heroku for PRs opened by external contributors.

Review App for branches

You can manually create a review app for any branch pushed to this repo. It's useful if you want to test your code on Heroku without opening a PR yet.

To create one:

  • log into Heroku.
  • Go to the network-pulse pipeline.
  • Click on + New app and select the branch you want to use.

The review app slack bot will post a message in the mofo-ra-pulse with links and credentials as soon as the review app is ready.

Environment variables:

  • GITHUB_TOKEN: GITHUB API authentication.
  • SLACK_WEBHOOK_RA: Webhook to mofo-ra-pulse.
  • STAGING_SERVER: Boolean, set this to True on the staging server.

Non-secret envs can be added to the app.json file. Secrets must be set on Heroku in the Review Apps (pipelines' settings tab).