mirror of
https://github.com/mgerb/mywebsite
synced 2026-01-12 02:42:48 +00:00
updated bunch of file paths and changed the way posts are loaded
This commit is contained in:
131
node_modules/mongo-express/README.md
generated
vendored
131
node_modules/mongo-express/README.md
generated
vendored
@@ -20,11 +20,11 @@ Current features:
|
||||
* View/add/rename/delete collections
|
||||
* View/add/update/delete documents
|
||||
* Use BSON data types in documents
|
||||
* Ability to specify the default key to be shown in the docs list.
|
||||
|
||||
Planned features:
|
||||
|
||||
* Support for replica set connections
|
||||
* Web-based command-line interface
|
||||
* Site authentication
|
||||
* REST interface
|
||||
|
||||
@@ -45,12 +45,14 @@ interface can be used for executing malicious javascript on a server**.
|
||||
Screenshots
|
||||
-----------
|
||||
|
||||
<img src="http://i.imgur.com/DOi3b.png" title="Viewing documents in a collection" />
|
||||
<img src="http://imgur.com/6Ggxe1J.png" title="Viewing documents in a collection" />
|
||||
<img src="http://imgur.com/ojSu5Nn.png" title="Viewing server status" />
|
||||
<img src="http://imgur.com/OA0idFS.png" title="Viewing database" />
|
||||
|
||||
Click here for more screenshots:
|
||||
[http://imgur.com/a/OTZHe](http://imgur.com/a/OTZHe)
|
||||
[https://imgur.com/gallery/etfhv/](https://imgur.com/gallery/etfhv/)
|
||||
|
||||
These screenshots are from version 0.11.0.
|
||||
These screenshots are from version 0.29.1.
|
||||
|
||||
|
||||
Usage
|
||||
@@ -64,10 +66,28 @@ Or if you want to install a global copy:
|
||||
|
||||
npm install -g mongo-express
|
||||
|
||||
By default `config.default.js` is used where the default authentication is admin:pass
|
||||
|
||||
**To configure:**
|
||||
|
||||
Copy `YOUR_PATH/node_modules/mongo-express/config.default.js` into a new file called `YOUR_PATH/node_modules/mongo-express/config.js`.
|
||||
|
||||
*Note:* Populate the defaultKeyNames field with your database names, collection names and the key name to be displayed by default in the documents list of collections page.
|
||||
|
||||
For example :
|
||||
```
|
||||
defaultKeyNames:{
|
||||
"world_db":{ //Database 1 Name
|
||||
"continent":"cont_name", // collection:feild
|
||||
"country":"country_name",
|
||||
"city":"name"
|
||||
},
|
||||
... // Database 2
|
||||
... // Database 3
|
||||
}
|
||||
```
|
||||
If no key name is specified for a collection, it defaults to '_id'.
|
||||
|
||||
*Note:* YOUR_PATH will depend on your current OS user and system configuration. You can see it in the output text shown after executing npm install.
|
||||
|
||||
Fill in your MongoDB connection details and any other options you want to change in `config.js`.
|
||||
@@ -76,83 +96,64 @@ Fill in your MongoDB connection details and any other options you want to change
|
||||
|
||||
cd YOUR_PATH/node_modules/mongo-express/ && node app.js
|
||||
|
||||
If you installed it globally, you can immediately start mongo-express like this:
|
||||
|
||||
mongo-express -u user -p password -d database
|
||||
|
||||
Or if you want to use it as an administrator:
|
||||
|
||||
mongo-express -u superuser -p password
|
||||
|
||||
For help on configuration options:
|
||||
|
||||
mongo-express -h
|
||||
|
||||
**To mount as Express 4 middleware (see `node_modules/mongo-express/app.js`):**
|
||||
|
||||
var
|
||||
express = require('express')
|
||||
, http = require('http')
|
||||
;
|
||||
var mongo_express = require('mongo-express/middleware')
|
||||
var mongo_express_config = require('./mongo_express_config')
|
||||
|
||||
var
|
||||
config = require('./config')
|
||||
, middleware = require('./middleware')
|
||||
;
|
||||
app.use('/mongo_express', mongo_express(mongo_express_config))
|
||||
|
||||
**To run in a Docker container:**
|
||||
|
||||
var app = express();
|
||||
app.use('/your-mountpath', middleware(config));
|
||||
app.listen(config.site.port, function() {
|
||||
console.log("Mongo Express server listening on port " + (config.site.port || 80));
|
||||
});
|
||||
|
||||
**To run as a Docker container:**
|
||||
|
||||
First, build the container from the project directorty:
|
||||
First, build an image from the project directory:
|
||||
|
||||
docker build -t mongo-express .
|
||||
|
||||
If you have a running [MongoDB container](https://registry.hub.docker.com/_/mongo/):
|
||||
Then run the image. Make sure you have a running [MongoDB container](https://registry.hub.docker.com/_/mongo/) and specify it's name in the `--link` argument.
|
||||
|
||||
docker run -d -p 8081:8081 --link mongodb:mongodb mongo-express
|
||||
docker run -it --rm --link YOUR_MONGODB_CONTAINER:mongo mongo-express
|
||||
|
||||
You can use the following [environment variables](https://docs.docker.com/reference/run/#env-environment-variables):
|
||||
You can use the following [environment variables](https://docs.docker.com/reference/run/#env-environment-variables) to modify the container's configuration:
|
||||
|
||||
- Variable name: `ME_CONFIG_MONGODB_SERVER`
|
||||
- Description: MongoDB host name or IP address.
|
||||
- Default value: `localhost`
|
||||
Name | Default | Description
|
||||
----------------------------------|-----------------|------------
|
||||
`ME_CONFIG_MONGODB_SERVER` |`mongo` or `localhost`| MongoDB host name or IP address. The default is `localhost` in the config file and `mongo` in the docker image.
|
||||
`ME_CONFIG_MONGODB_PORT` | `27017` | MongoDB port.
|
||||
`ME_CONFIG_MONGODB_ADMINUSERNAME` | ` ` | Administrator username.
|
||||
`ME_CONFIG_MONGODB_ADMINPASSWORD` | ` ` | Administrator password.
|
||||
`ME_CONFIG_SITE_COOKIESECRET` | `cookiesecret` | String used by [cookie-parser middleware](https://www.npmjs.com/package/cookie-parser) to sign cookies.
|
||||
`ME_CONFIG_SITE_SESSIONSECRET` | `sessionsecret` | String used to sign the session ID cookie by [express-session middleware](https://www.npmjs.com/package/express-session).
|
||||
`ME_CONFIG_BASICAUTH_USERNAME` | `admin` | mongo-express login name. Sending an empty string will disable basic authentication.
|
||||
`ME_CONFIG_BASICAUTH_PASSWORD` | `pass` | mongo-express login password.
|
||||
`ME_CONFIG_REQUEST_SIZE` | `100kb` | Used to configure maximum mongo update payload size. CRUD operations above this size will fail due to restrictions in [body-parser](https://www.npmjs.com/package/body-parser).
|
||||
`ME_CONFIG_OPTIONS_EDITORTHEME` | `rubyblue` | Web editor color theme, [more here](http://codemirror.net/demo/theme.html).
|
||||
|
||||
**Example:**
|
||||
|
||||
- Variable name: `ME_CONFIG_MONGODB_PORT`
|
||||
- Description: MongoDB port.
|
||||
- Default value: `27017`
|
||||
docker run -it --rm \
|
||||
--name mongo-express \
|
||||
--link web_db_1:mongo \
|
||||
-e ME_CONFIG_OPTIONS_EDITORTHEME="ambiance" \
|
||||
-e ME_CONFIG_BASICAUTH_USERNAME="" \
|
||||
mongo-express
|
||||
|
||||
- Variable name: `ME_CONFIG_MONGODB_ADMINUSERNAME`
|
||||
- Description: Administrator username.
|
||||
- Default value: ``
|
||||
|
||||
- Variable name: `ME_CONFIG_MONGODB_ADMINPASSWORD`
|
||||
- Description: Administrator password.
|
||||
- Default value: ``
|
||||
|
||||
- Variable name: `ME_CONFIG_SITE_COOKIESECRET`
|
||||
- Description: String used by [cookie-parser middleware](https://www.npmjs.com/package/cookie-parser) to sign cookies.
|
||||
- Default value: `cookiesecret`
|
||||
|
||||
|
||||
- Variable name: `ME_CONFIG_SITE_SESSIONSECRET`
|
||||
- Description: String used to sign the session ID cookie by [express-session middleware](https://www.npmjs.com/package/express-session).
|
||||
- Default value: `sessionsecret`
|
||||
|
||||
|
||||
- Variable name: `ME_CONFIG_BASICAUTH_USERNAME`
|
||||
- Description: mongo-express login name. Sending an empty string will disable basic authentication.
|
||||
- Default value: `admin`
|
||||
|
||||
|
||||
- Variable name: `ME_CONFIG_BASICAUTH_PASSWORD`
|
||||
- Description: mongo-express login password.
|
||||
- Default value `pass`
|
||||
|
||||
- Variable name: `ME_CONFIG_OPTIONS_EDITORTHEME`
|
||||
- Description: Web editor color theme.
|
||||
- Default value: `rubyblue`
|
||||
|
||||
-
|
||||
This example links to a container name typical of `docker-compose`, changes the editor's color theme, and disables basic authentication.
|
||||
|
||||
**To use:**
|
||||
|
||||
Visit `http://localhost:8081` or whatever URL/port you entered into your
|
||||
config (if running standalone) or whatever `config.site.baseUrl` (if mounting
|
||||
as a middleware).
|
||||
The default port exposed from the container is 8081, so visit `http://localhost:8081` or whatever URL/port you entered into your config (if running standalone) or whatever `config.site.baseUrl` (if mounting as a middleware).
|
||||
|
||||
|
||||
BSON Data Types
|
||||
|
||||
Reference in New Issue
Block a user