1
0
Fork 0
mirror of https://github.com/SunRed/haste-server.git synced 2024-11-23 17:50:19 +01:00

Updated config documentation, changed env vars

Removed HASTE_ prefix as it would not work on evironments like Heroku, relevant comment: https://github.com/zneix/haste-server/pull/7#issuecomment-695790378
This commit is contained in:
zneix 2020-09-20 16:39:49 +02:00
parent 58c37bf677
commit 45b4ce87a8
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 911916E0523B22F6
4 changed files with 14 additions and 11 deletions

View file

@ -53,18 +53,21 @@ npm install
## Edit configuration ## Edit configuration
There is an [example configuration file](../example.config.json) available for you to copy: Haste can already work "out-of-the-box" with no config changes - useful for environments like Heroku or Dokku.
You can use `HOST` and `PORT` environment variables for host and port specification to override config values.
However, there is an [example configuration file](../example.config.js) available for you to copy:
```bash ```bash
cp example.config.json config.json cp example.config.js config.js
``` ```
By default storage system stores haste documents as hashed files in `./data` directory. By default storage system stores haste documents as hashed files in `./data` directory.
Rest of provided defaults are enough to run the server, however, example config contains comments about what each value does and you can adjust the options to your likings. Rest of provided defaults are enough to run the server, however, example config contains comments about what each value does and you can adjust the options to your likings.
[Guide for all supported storage systems.](./storage.md). [Guide for all supported storage systems](./storage.md).
[Guide for all supported key generators.](./generators.md). [Guide for all supported key generators](./generators.md).
## Run the server ## Run the server

8
package-lock.json generated
View file

@ -1,6 +1,6 @@
{ {
"name": "haste", "name": "haste",
"version": "0.2.3", "version": "0.2.4",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@ -713,9 +713,9 @@
"dev": true "dev": true
}, },
"bl": { "bl": {
"version": "4.0.2", "version": "4.0.3",
"resolved": "https://registry.npmjs.org/bl/-/bl-4.0.2.tgz", "resolved": "https://registry.npmjs.org/bl/-/bl-4.0.3.tgz",
"integrity": "sha512-j4OH8f6Qg2bGuWfRiltT2HYGx0e1QcBTrK9KAHNMwMZdQnDZFk0ZSYIpADjYCB3U12nicC5tVJwSIhwOWjb4RQ==", "integrity": "sha512-fs4G6/Hu4/EE+F75J8DuN/0IpQqNjAdC7aEQv7Qt8MHGUH7Ckv2MwTEEeN9QehD0pfIDkMI1bkHYkKy7xHyKIg==",
"requires": { "requires": {
"buffer": "^5.5.0", "buffer": "^5.5.0",
"inherits": "^2.0.4", "inherits": "^2.0.4",

View file

@ -1,6 +1,6 @@
{ {
"name": "haste", "name": "haste",
"version": "0.2.3", "version": "0.2.4",
"description": "Private Pastebin Server - continued by zneix", "description": "Private Pastebin Server - continued by zneix",
"keywords": [ "keywords": [
"paste", "paste",

View file

@ -22,8 +22,8 @@ const utils = new HasteUtils();
//load config and set some defaults //load config and set some defaults
const config = require('./config'); const config = require('./config');
config.host = process.env.HASTE_HOST || config.host || '127.0.0.1'; config.host = process.env.HOST || config.host || '127.0.0.1';
config.port = process.env.HASTE_PORT || config.port || 7777; config.port = process.env.PORT || config.port || 7777;
//set up logger //set up logger
winston.add(new winston.transports.Console({ winston.add(new winston.transports.Console({