-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: prepare service for self host option (#230)
- Loading branch information
Showing
45 changed files
with
775 additions
and
347 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
NODE_ENV=development | ||
APP_DOMAIN=localhost:4000 | ||
HTTP_SCHEMA=http | ||
ROOT_DOMAIN=localhost:4000 | ||
MONGO_URL=mongodb://localhost:51651 | ||
MONGO_DB_NAME=dev | ||
MONGO_DB_USER=dev-user | ||
MONGO_DB_PASSWORD=password | ||
ROOT_DOMAIN=localhost | ||
SECRET_SESSION_KEY=74925e5027a05d9e31082271747a92b11a3b6988fc303bbb2aae330bef92b3a7 | ||
SHOULD_SERVE_WEBSITE=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,55 @@ | ||
# BundleMon service | ||
|
||
### Environment variables | ||
|
||
| Name | Description | Default | | ||
| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | --------------------- | | ||
| MONGO_URL | MongoDB connection URL | `-` | | ||
| MONGO_DB_NAME | MongoDB database name | `-` | | ||
| MONGO_DB_USER | MongoDB username | `-` | | ||
| MONGO_DB_PASSWORD | MongoDB password | `-` | | ||
| HTTP_SCHEMA | HTTP schema (`http` or `https`) | `https` | | ||
| PORT | Port number for the service | `8080` | | ||
| ROOT_DOMAIN | Root domain for the service | `bundlemon.dev` | | ||
| APP_DOMAIN | Application domain, defaults to ROOT_DOMAIN | same as `ROOT_DOMAIN` | | ||
| SHOULD_SERVE_WEBSITE | Flag to determine if the website should be served | `true` | | ||
| SECRET_SESSION_KEY | This key will be used for securely signing session cookies.<br />Auto generated each time the service starts, Prefer to set a key. | Auto generated | | ||
| MAX_SESSION_AGE_SECONDS | Maximum session age in seconds | `21600` (6 hours) | | ||
| MAX_BODY_SIZE_BYTES | Max body size in bytes | `1048576` (1 MB) | | ||
|
||
<details> | ||
<summary>Generate secret session key</summary> | ||
|
||
```sh | ||
yarn install | ||
|
||
# prints the secret key | ||
node apps/service/scripts/generateSecretKey.js | ||
``` | ||
|
||
</details> | ||
|
||
### GitHub integration (optional) | ||
|
||
If you want your self hosted BundleMon service to interact with GitHub, you will need to create GitHub App. | ||
|
||
#### Create GitHub App | ||
|
||
1. [Go to register new GitHub App](https://github.com/settings/apps/new) | ||
1. Choose name | ||
1. Setup Repository permissions | ||
- Metadata - Read | ||
- Pull requests - Read & write | ||
- Checks - Read & write | ||
- Commit statuses - Read & write | ||
1. Create App | ||
1. Generate private key, Replace private key new lines with `\n` | ||
|
||
#### GitHub App environment variables | ||
|
||
| Name | Description | | ||
| ------------------------ | ------------------------ | | ||
| GITHUB_APP_ID | GitHub App ID | | ||
| GITHUB_APP_PRIVATE_KEY | GitHub App private key | | ||
| GITHUB_APP_CLIENT_ID | GitHub App client ID | | ||
| GITHUB_APP_CLIENT_SECRET | GitHub App client secret | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.