Add Deploy to Heroku button (#63)

* Add package.json and app.json

* Add yarn engine

* Remove extra build command

* Force install dev deps

* Add deploy button and update readme
This commit is contained in:
Alan Friedman 2019-05-12 13:14:10 -04:00 committed by GitHub
parent d546697172
commit 6fae5e8efa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 108 additions and 0 deletions

47
app.json Normal file
View File

@ -0,0 +1,47 @@
{
"name": "Darkwire",
"description": "End-to-end encrypted web chat",
"keywords": [
"cryptography",
"chat",
"privacy"
],
"website": "https://darkwire.io",
"repository": "https://github.com/darkwire/darkwire.io",
"env": {
"MAILGUN_API_KEY": {
"description": "Mailgun API Key (only required for abuse reporting)",
"required": false
},
"ABUSE_TO_EMAIL_ADDRESS": {
"description": "Where to send abuse reports (only required for abuse reporting)",
"required": false
},
"MAILGUN_DOMAIN": {
"description": "Mailgun domain (only required for abuse reporting)",
"required": false
},
"ABUSE_FROM_EMAIL_ADDRESS": {
"description": "From address on abuse emails (only required for abuse reporting)",
"required": false
},
"API_HOST": {
"description": "Example: 'api.your-darkwire-api.com'",
"required": false
},
"API_PROTOCOL": {
"description": "Example: 'https'",
"required": false,
"value": "https"
},
"API_PORT": {
"description": "Example: 443",
"required": false,
"value": "443"
}
},
"image": "heroku/nodejs",
"addons": [
"heroku-redis"
]
}

17
build.sh Executable file
View File

@ -0,0 +1,17 @@
echo "building client..."
rm -rf client
git clone https://github.com/darkwire/darkwire-client.git client
cd client
yarn --production=false
REACT_APP_API_HOST=$API_HOST \
REACT_APP_API_PROTOCOL=$API_PROTOCOL \
REACT_APP_API_PORT=$API_PORT \
yarn react-scripts build
cd ../
echo "building server..."
rm -rf server
git clone https://github.com/darkwire/darkwire-server.git server
cd server
yarn --production=false
yarn build

23
package.json Normal file
View File

@ -0,0 +1,23 @@
{
"name": "darkwire.io",
"version": "2.0.0",
"description": "encrypted web chat",
"main": "index.js",
"repository": "https://github.com/darkwire/darkwire.io.git",
"engines": {
"yarn": "1.x"
},
"contributors": [
{
"name": "Daniel Seripap"
},
{
"name": "Alan Friedman"
}
],
"license": "MIT",
"scripts": {
"build": "./build.sh",
"start": "cd server && CLIENT_DIST_DIRECTORY='../client/build' yarn start"
}
}

View File

@ -4,6 +4,8 @@
Simple encrypted web chat. Powered by [socket.io](http://socket.io), the [web cryptography API](https://developer.mozilla.org/en-US/docs/Web/API/Window/crypto). This project is an example of how client side encryption works and how you can integrate it as a chat service. Simple encrypted web chat. Powered by [socket.io](http://socket.io), the [web cryptography API](https://developer.mozilla.org/en-US/docs/Web/API/Window/crypto). This project is an example of how client side encryption works and how you can integrate it as a chat service.
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)
### Darkwire Server ### Darkwire Server
Darkwire server is a Node.js application that requires redis. Darkwire server is a Node.js application that requires redis.
@ -35,6 +37,25 @@ environment:
- API_PORT=3000 - API_PORT=3000
``` ```
### Production
#### Build
This command will pull server and client repos down and create production builds of each.
```
$ yarn
$ yarn build
```
#### Start server
This will start a production server.
```
$ yarn start
```
### Contributing to Darkwire ### Contributing to Darkwire
Run `setup-dev.sh` to automatically clone server/client files and install dependencies, or clone the client and server repositories. Run `setup-dev.sh` to automatically clone server/client files and install dependencies, or clone the client and server repositories.