Update sample .env
Update README to reflect new process
This commit is contained in:
12
.env.sample
12
.env.sample
@ -2,11 +2,11 @@
|
|||||||
#
|
#
|
||||||
# Please use `openssl rand -hex 32` to create SECRET_KEY
|
# Please use `openssl rand -hex 32` to create SECRET_KEY
|
||||||
|
|
||||||
DATABASE_URL=postgres://user:pass@example.com:5432/outline
|
DATABASE_URL=postgres://user:pass@localhost:5432/outline
|
||||||
DATABASE_URL_TEST=postgres://user:pass@example.com:5432/outline-test
|
DATABASE_URL_TEST=postgres://user:pass@localhost:5432/outline-test
|
||||||
SECRET_KEY=F0E5AD933D7F6FD8F4DBB3E038C501C052DC0593C686D21ACB30AE205D2F634B
|
SECRET_KEY=F0E5AD933D7F6FD8F4DBB3E038C501C052DC0593C686D21ACB30AE205D2F634B
|
||||||
PORT=3000
|
PORT=3000
|
||||||
REDIS_URL=redis://localhost:6379
|
REDIS_URL=redis://redis:6379
|
||||||
SLACK_KEY=71315967491.XXXXXXXXXX
|
SLACK_KEY=71315967491.XXXXXXXXXX
|
||||||
SLACK_SECRET=d2dc414f9953226bad0a356c794XXXXX
|
SLACK_SECRET=d2dc414f9953226bad0a356c794XXXXX
|
||||||
URL=http://localhost:3000
|
URL=http://localhost:3000
|
||||||
@ -14,6 +14,12 @@ DEPLOYMENT=hosted
|
|||||||
ENABLE_UPDATES=true
|
ENABLE_UPDATES=true
|
||||||
GOOGLE_ANALYTICS_ID=
|
GOOGLE_ANALYTICS_ID=
|
||||||
|
|
||||||
|
AWS_ACCESS_KEY_ID=notcheckedindev
|
||||||
|
AWS_SECRET_ACCESS_KEY=notcheckedindev
|
||||||
|
AWS_S3_UPLOAD_BUCKET_URL=http://localhost:4569
|
||||||
|
AWS_S3_UPLOAD_BUCKET_NAME=outline-dev
|
||||||
|
AWS_S3_UPLOAD_MAX_SIZE=26214400
|
||||||
|
|
||||||
SMTP_HOST=
|
SMTP_HOST=
|
||||||
SMTP_PORT=
|
SMTP_PORT=
|
||||||
SMTP_USERNAME=
|
SMTP_USERNAME=
|
||||||
|
28
README.md
28
README.md
@ -8,37 +8,27 @@ An open, extensible, knowledge base for your team built using React and Node.js.
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
Outline requires following dependencies to work:
|
Outline requires the following dependencies:
|
||||||
|
|
||||||
- Postgres >=9.5
|
- Postgres >=9.5
|
||||||
- Redis
|
- Redis
|
||||||
- S3 bucket configured to support CORS uploads
|
|
||||||
- Slack developer application
|
- Slack developer application
|
||||||
|
|
||||||
To install and run the application:
|
In development you can quickly can an environment running using Docker by
|
||||||
|
following these steps:
|
||||||
|
|
||||||
1. Install dependencies with `yarn`
|
1. Install [Docker for Desktop](https://www.docker.com) if you don't already have it.
|
||||||
1. Register a Slack app at https://api.slack.com/apps
|
1. Register a Slack app at https://api.slack.com/apps
|
||||||
1. Copy the file `.env.sample` to `.env` and fill out the keys
|
1. Copy the file `.env.sample` to `.env` and fill out the Slack keys, everything
|
||||||
1. Run DB migrations `yarn sequelize db:migrate`
|
else should work well for development.
|
||||||
|
1. Run `make up`. This will download dependencies, build and launch a development version of Outline.
|
||||||
|
|
||||||
To run Outline in development mode with server and frontend code reloading:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
yarn dev
|
|
||||||
```
|
|
||||||
|
|
||||||
To run Outline in production mode:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
yarn start
|
|
||||||
```
|
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
### Server
|
### Server
|
||||||
|
|
||||||
To enable debugging statements, set the following env vars:
|
To enable debugging statements, add the following to your `.env` file:
|
||||||
|
|
||||||
```
|
```
|
||||||
DEBUG=sql,cache,presenters
|
DEBUG=sql,cache,presenters
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// @flow
|
// @flow
|
||||||
import crypto from 'crypto';
|
import crypto from 'crypto';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
|
import path from 'path';
|
||||||
import AWS from 'aws-sdk';
|
import AWS from 'aws-sdk';
|
||||||
import invariant from 'invariant';
|
import invariant from 'invariant';
|
||||||
import fetch from 'isomorphic-fetch';
|
import fetch from 'isomorphic-fetch';
|
||||||
@ -47,7 +48,7 @@ const uploadToS3FromUrl = async (url: string, key: string) => {
|
|||||||
invariant(AWS_S3_UPLOAD_BUCKET_NAME, 'AWS_S3_UPLOAD_BUCKET_NAME not set');
|
invariant(AWS_S3_UPLOAD_BUCKET_NAME, 'AWS_S3_UPLOAD_BUCKET_NAME not set');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// $FlowIssue dunno it's fine
|
// $FlowIssue https://github.com/facebook/flow/issues/2171
|
||||||
const res = await fetch(url);
|
const res = await fetch(url);
|
||||||
const buffer = await res.buffer();
|
const buffer = await res.buffer();
|
||||||
await s3
|
await s3
|
||||||
@ -59,7 +60,7 @@ const uploadToS3FromUrl = async (url: string, key: string) => {
|
|||||||
Body: buffer,
|
Body: buffer,
|
||||||
})
|
})
|
||||||
.promise();
|
.promise();
|
||||||
return `https://s3.amazonaws.com/${AWS_S3_UPLOAD_BUCKET_NAME}/${key}`;
|
return path.join(process.env.AWS_S3_UPLOAD_BUCKET_URL, key);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
bugsnag.notify(e);
|
bugsnag.notify(e);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user