This repository has been archived by the owner on Sep 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
2 changed files
with
169 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
BioCompute Editor | ||
================= | ||
|
||
The BioCompute Editor is a web application that can be used to create and edit BioCompute objects based on BioCompute schema described in the BCO specification document. This editor uses <a href="https://github.com/jdorn/json-editor">JSON Editor</a> developed by Jeremy Dorn. | ||
|
||
|
||
Software requirement | ||
==================== | ||
* Any linux operating system | ||
* MongoDB Community or Enterprise version | ||
|
||
|
||
### MongoDB Installation Example | ||
If you do not have MongoDB installed on your server, here is an example of [MongoDB installation instruction steps](mongodb_installation.md) steps for CentOs server. | ||
|
||
|
||
### Downloading BioCompute Editor | ||
Use git clone to clone the bco_editor repository | ||
|
||
``` | ||
git clone https://github.com/biocompute-objects/bco_editor.git | ||
``` | ||
|
||
### BioCompute Editor Setup | ||
Assuming you have followed [MongoDB installation instructions steps](mongodb_installation.md), edit the config.json file under cgi-bin/conf/ subdirectory to customize it to your server. In the example given below, the name of the mongodb database is "bcodb_1_tst", and requires an authenticated mongodb user who has a "readWrite" role to write to it. In the example config file given below, the mongodb username and password are "bcodbadmin" and "pass123!" respectively. | ||
|
||
|
||
``` | ||
"dbinfo":{ | ||
"mongodbname":"bcodb_1_tst" | ||
,"mongodbuser":"bcodbadmin" | ||
,"mongodbpassword":"bcodbpass" | ||
,"sessionlife":3600 | ||
,"collections":{ | ||
"bco":"c_bco" | ||
,"counters":"c_counters" | ||
,"users":"c_users" | ||
} | ||
} | ||
,"pathinfo":{ | ||
"htmlroot":"http://example.com/bco_editor/" | ||
,"htmlpath":"/myrepositories/bco_editor/html/" | ||
} | ||
``` | ||
|
||
As for html and cgi-bin directories, the easiest way (assuming your apache is set to allow following symbolic links) is to make symbolic links from your server html and cgi-bin roots. | ||
|
||
``` | ||
$ sudo ln -s /myrepositories/bco_editor/cgi-bin /var/www/cgi-bin/bco_editor | ||
$ sudo ln -s /myrepositories/bco_editor/html /var/www/html/bco_editor | ||
``` | ||
|
||
Or you can copy the folders physically. | ||
|
||
``` | ||
$ sudo cp -r /myrepositories/bco_editor/cgi-bin /var/www/cgi-bin/bco_editor | ||
$ sudo cp -r /myrepositories/bco_editor/html /var/www/html/bco_editor | ||
``` | ||
|
||
You also need to make sure that apache has write access to /var/www/html/bco_editor/log/. | ||
|
||
``` | ||
$ sudo chown -R apache:apache /var/www/html/bco_editor/log/ | ||
``` | ||
|
||
Finally, you need to make sure the htmlRoot and cgiRoot javascript variables in bco_editor/html/index.html are assigned right values | ||
|
||
``` | ||
<script> | ||
var htmlRoot = '/bco_editor/'; | ||
var cgiRoot = '/cgi-bin/bco_editor/'; | ||
</script> | ||
``` | ||
|
||
### Admin Utility | ||
The script admin_util under cgi-bin/ subdirectory is used to manage the BioCompute Editor portal. Given below are commands (issued from the cgi-bin subdirectory) that can be used to perform various tasks. | ||
|
||
``` | ||
Listing registered users | ||
$ python admin_util -a list_users | ||
Registration is public but users cannot login before they are activated using this admin_util tool (read below on how to activate pending registerations). | ||
Adding new user | ||
$ python admin_util -a upsert_user -e jim.jones@gmail.com -f James -l Jones -p pass123 -s 1 | ||
Activating or updating user | ||
$ python admin_util -a upsert_user -e jim.jones@gmail.com -s 1 | ||
Removing user | ||
$ python admin_util -a delete_user -e jim.jones@gmail.com | ||
Listing BioCompute objects | ||
$ python admin_util -a list_bco | ||
Deleting BioCompute object | ||
$ python admin_util -a delete_bco -o 2 | ||
``` | ||
|
||
|
||
|
||
### Other Links | ||
BioCompute Partnership: http://biocomputeobject.org | ||
|
||
GitHub repository for BioCompute Objects: | ||
https://github.com/biocompute-objects/bco_editor | ||
|
||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
|
||
### MongoDB Installation Example | ||
|
||
If you do not have MongoDB installed on your server, here is an example installation steps for CentOs server (taken from | ||
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-red-hat/) | ||
|
||
``` | ||
1) Create a /etc/yum.repos.d/mongodb-org-4.0.repo file so that you can install MongoDB directly using yum: | ||
[mongodb-org-4.0] | ||
name=MongoDB Repository | ||
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/x86_64/ | ||
gpgcheck=1 | ||
enabled=1 | ||
gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc | ||
2) sudo yum install -y mongodb-org | ||
3) Start mongod | ||
$ sudo service mongod start | ||
4) Start MongoDB without authentication | ||
$ mongo | ||
5) Create the user administrator | ||
> use admin | ||
> db.createUser({ | ||
user: "superadmin", | ||
pwd: "superpass", | ||
roles: ["userAdminAnyDatabase", "dbAdminAnyDatabase","readWriteAnyDatabase"] | ||
}) | ||
Then disconnect from the mongo shell (Ctrl+D). | ||
6. Disconnect from mongo shell and enable authentication in mongod configuration file and change "disabled" to "enabled" | ||
$ sudo vi /etc/mongod.conf | ||
#security: | ||
# authorization: "disabled" | ||
7) Restart mongod | ||
$ sudo service mongod restart | ||
From now on, all clients connecting to this server must authenticate themselves as a valid users, and they will be only able to perform actions as determined by their assigned roles. | ||
8) Connect and authenticate as the user administrator, and create additional users | ||
$ mongo | ||
> use admin | ||
> db.auth("superadmin", "superpass") | ||
1 | ||
> use bcodb_1_tst | ||
> db.createUser({user: "bcodbadmin", pwd: "bcodbpass", roles: [ { role: "readWrite", db: "bcodb_1_tst" } ]}) | ||
``` |