1 | # adminMongo
|
2 |
|
3 | adminMongo is a Web based user interface (GUI) to handle all your MongoDB connections/databases needs. adminMongo is fully responsive and should work on a range of devices.
|
4 |
|
5 | > adminMongo connection information (including username/password) is stored unencrypted in a config file, it is not recommended to run this application on a production or public facing server without proper security considerations.
|
6 |
|
7 | ## Installation
|
8 |
|
9 | 1. Clone Repository: `git clone https://github.com/mrvautin/adminMongo.git && cd adminMongo`
|
10 | 2. Install dependencies: `npm install`
|
11 | 3. Start application: `npm start`
|
12 | 4. Visit [http://127.0.0.1:1234](http://127.0.0.1:1234) in your browser
|
13 |
|
14 | ## Deploy on Heroku
|
15 | [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)
|
16 |
|
17 | ### Features
|
18 |
|
19 | * Manage from a connection level for easy access to multiple databases
|
20 | * Create/Delete databases
|
21 | * Create/Delete/Edit collection
|
22 | * Create/Delete/Edit documents
|
23 | * Create/Delete indexes
|
24 | * Query documents
|
25 | * Collection statistics
|
26 | * Export collections in JSON format
|
27 |
|
28 |
|
29 | ### Current limitations
|
30 |
|
31 | * Documents need to have an "_id" value which is a string, integer, or MongoDB ObjectId. Documents using Composite ID indexing is currently not supported.
|
32 | * Connection strings with multiple hosts for replica sets are currently not supported.
|
33 |
|
34 | ### Configuration
|
35 |
|
36 | adminMongo will listen on host: `localhost` and port: `1234` by default.
|
37 | This can be overwritten by adding a config file in `/config/app.json`. The config file can also override the default 5 docs per page.
|
38 | The config file options are:
|
39 | ```
|
40 | {
|
41 | "app": {
|
42 | "host": "10.0.0.1",
|
43 | "port": 4321,
|
44 | "docs_per_page": 15,
|
45 | "password": "secureadminpassword",
|
46 | "locale": "de",
|
47 | "context": "dbApp"
|
48 | }
|
49 | }
|
50 | ```
|
51 |
|
52 | **Note: Any changes to the config file requires a restart of the application**
|
53 |
|
54 | ### Setting a context path
|
55 |
|
56 | Setting a `context` of "dbApp" is like changing the base URL of the app and will mean the app will listen on `http://10.0.0.1:4321/dbApp`. Ommiting a context will mean the application will listen on
|
57 | root. Eg: `http://10.0.0.1:4321`. This setting can be useful when running `adminMongo` behind Nginx etc.
|
58 |
|
59 | An example Nginx server block. Note the `location /dbApp {` and `proxy_pass http://10.0.0.1:4321/dbApp;` lines match
|
60 | the `context` set in the `/config/app.json` file.
|
61 |
|
62 | ```
|
63 | server {
|
64 | listen 80;
|
65 |
|
66 | server_name mydomain.com www.mydomain.com;
|
67 |
|
68 | location /dbApp {
|
69 | proxy_pass http://10.0.0.1:4321/dbApp;
|
70 | proxy_http_version 1.1;
|
71 | proxy_set_header Upgrade $http_upgrade;
|
72 | proxy_set_header Connection 'upgrade';
|
73 | proxy_set_header Host $host;
|
74 | proxy_cache_bypass $http_upgrade;
|
75 | }
|
76 | }
|
77 | ```
|
78 |
|
79 | ### Language locale
|
80 |
|
81 | **Looking for people to translate into other languages. If you can help, grab the `/locale/en.js` file, translate to your language and submit a pull request.**
|
82 |
|
83 | The locale is automatically set to the detected locale of Nodejs. If there is not a translation, `adminMongo` will default to English. To override the detected locale
|
84 | a setting can be added to the `app.json` file. See Configuration section for a "German" example.
|
85 |
|
86 | ### Authentication
|
87 |
|
88 | By default `adminMongo` is not password protected. You can add password authentication by adding a `password` value to the `/config/app.json` file
|
89 | (See the Configuration section). Once added you will need to restart `adminMongo` and all routes will be protected until the correct password is added. You
|
90 | will then be authenticated for the life of the session (60 mins by default) or if the "Logout" link is clicked.
|
91 |
|
92 | ## Usage
|
93 |
|
94 | ### Create a connection
|
95 |
|
96 | After visiting [http://127.0.0.1:1234](http://127.0.0.1:1234) you will be presented with a connection screen. You need to give your connection a unique name as a reference when using adminMongo and a MongoDB formatted connection string. The format of a MongoDB connection string can form: `mongodb://<user>:<password>@127.0.0.1:<port>/<db>` where specifying to the `<db>` level is optional. For more information on MongoDB connection strings, see the [official MongoDB documentation](http://docs.mongodb.org/manual/reference/connection-string/).
|
97 |
|
98 | Note: The connection can be either local or remote hosted on VPS or MongoDB service such as MongoLab.
|
99 |
|
100 | ![adminMongo connections screen](https://raw.githubusercontent.com/mrvautin/mrvautin.github.io/master/images/adminMongo/adminMongo_connections.png "adminMongo connections screen")
|
101 | *The Connection setup screen*
|
102 |
|
103 | ### Connection/Database admin
|
104 |
|
105 | After opening your newly created connection, you are able to see all database objects associated with your connection. Here you can create/delete collections, create/delete users and see various stats for your database.
|
106 |
|
107 | ![adminMongo database screen](https://raw.githubusercontent.com/mrvautin/mrvautin.github.io/master/images/adminMongo/adminMongo_dbview.png "adminMongo database screen")
|
108 | *The connections/database screen*
|
109 |
|
110 | ### Collections
|
111 |
|
112 | After selecting your collection from the "Database Objects" menu, you will be presented with the collections screen. Here you can see documents in pagination form, create new documents, search documents, delete, edit documents and view/add indexes to your collection.
|
113 |
|
114 | ![adminMongo collections screen](https://raw.githubusercontent.com/mrvautin/mrvautin.github.io/master/images/adminMongo/adminMongo_collectionview.png "adminMongo collections screen")
|
115 | *The collections screen*
|
116 |
|
117 | ### Searching documents
|
118 |
|
119 | You can search documents using the `Search documents` button on the collections screen. You will need to enter the key (field name) and value. Eg: key = "_id" and value = "569ff81e0077663d78a114ce".
|
120 |
|
121 | > You can clear your search by clicking the `Reset` button on the collections screen.
|
122 |
|
123 | ![adminMongo search documents](https://raw.githubusercontent.com/mrvautin/mrvautin.github.io/master/images/adminMongo/adminMongo_searchdocuments.png "adminMongo search documents")
|
124 | *The collections screen*
|
125 |
|
126 | ### Documents
|
127 |
|
128 | Adding and editing documents is done using a JSON syntax highlighting control.
|
129 |
|
130 | ![adminMongo documents](https://raw.githubusercontent.com/mrvautin/mrvautin.github.io/master/images/adminMongo/adminMongo_docedit.png "adminMongo documents")
|
131 | *Editing a document*
|
132 |
|
133 | ### Indexes
|
134 |
|
135 | Indexes can be added from the collection screen. Please see the [official MongoDB documentation](https://docs.mongodb.org/manual/indexes/) on adding indexes.
|
136 |
|
137 | ![adminMongo documents](https://raw.githubusercontent.com/mrvautin/mrvautin.github.io/master/images/adminMongo/adminMongo_manageindexes.png "adminMongo indexes")
|
138 | *Viewing/Adding indexes*
|
139 |
|
140 | ## Contributing
|
141 |
|
142 | 1. Fork it!
|
143 | 2. Create your feature branch: `git checkout -b my-new-feature`
|
144 | 3. Commit your changes: `git commit -am 'Add some feature'`
|
145 | 4. Push to the branch: `git push origin my-new-feature`
|
146 | 5. Submit a pull request :D
|
147 |
|
148 | ## Future plans
|
149 |
|
150 | Please make any suggestions.
|
151 |
|
152 | ## License
|
153 |
|
154 | [The MIT License](https://github.com/mrvautin/adminMongo/tree/master/LICENSE)
|