Merge branch 'master' into issue-363
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
# Copy this file to .env, remove this comment and change the keys
|
||||
#
|
||||
# Please use `openssl rand -hex 32` to create SEQUELIZE_SECRET
|
||||
|
||||
DATABASE_URL=postgres://user:pass@example.com:5432/atlas
|
||||
DATABASE_URL_TEST=postgres://user:pass@example.com:5432/atlas-test
|
||||
|
||||
19
LICENSE
Normal file
19
LICENSE
Normal file
@@ -0,0 +1,19 @@
|
||||
Copyright (c) 2017 Atlas (https://www.beautifulatlas.com/) and individual contributors.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the Atlas nor the names of its contributors may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
18
README.md
18
README.md
@@ -2,12 +2,23 @@
|
||||
|
||||

|
||||
|
||||
Atlas is a modern wiki for your team built using React and Node.js. [https://www.beautifulatlas.com/](https://www.beautifulatlas.com/)
|
||||
|
||||
## Installation
|
||||
|
||||
Atlas requires following dependencies to work:
|
||||
|
||||
- Postgres >=9.5
|
||||
- Redis
|
||||
- S3 bucket configured to support CORS uploads
|
||||
- Slack developer application
|
||||
|
||||
To install and run the application:
|
||||
|
||||
1. Install dependencies with `yarn`
|
||||
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. Run DB migrations `yarn sequelize -- db:migrate`
|
||||
1. Run DB migrations `yarn sequelize db:migrate`
|
||||
1. Start the development server `yarn start`
|
||||
|
||||
|
||||
@@ -25,3 +36,8 @@ Or to run migrations on test database:
|
||||
```
|
||||
yarn sequelize db:migrate --env test
|
||||
```
|
||||
|
||||
|
||||
## License
|
||||
|
||||
Atlas is [BSD licensed](/blob/master/LICENSE).
|
||||
|
||||
@@ -18,7 +18,7 @@ router.post('user.s3Upload', auth(), async ctx => {
|
||||
ctx.assertPresent(size, 'size is required');
|
||||
|
||||
const s3Key = uuid.v4();
|
||||
const key = `${s3Key}/${filename}`;
|
||||
const key = `uploads/${ctx.state.user.id}/${s3Key}/${filename}`;
|
||||
const policy = makePolicy();
|
||||
|
||||
ctx.body = {
|
||||
@@ -36,7 +36,7 @@ router.post('user.s3Upload', auth(), async ctx => {
|
||||
},
|
||||
asset: {
|
||||
contentType: kind,
|
||||
url: `${process.env.AWS_S3_UPLOAD_BUCKET_URL}${s3Key}/${filename}`,
|
||||
url: `${process.env.AWS_S3_UPLOAD_BUCKET_URL}${key}`,
|
||||
name: filename,
|
||||
size,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user