Skip to content
This repository was archived by the owner on Sep 21, 2022. It is now read-only.

Commit 5c42656

Browse files
committed
Add README
Add README
1 parent 50794c7 commit 5c42656

2 files changed

Lines changed: 169 additions & 0 deletions

File tree

README.md

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
BioCompute Editor
2+
=================
3+
4+
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.
5+
6+
7+
Software requirement
8+
====================
9+
* Any linux operating system
10+
* MongoDB Community or Enterprise version
11+
12+
13+
### MongoDB Installation Example
14+
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.
15+
16+
17+
### Downloading BioCompute Editor
18+
Use git clone to clone the bco_editor repository
19+
20+
```
21+
git clone https://github.com/biocompute-objects/bco_editor.git
22+
23+
```
24+
25+
### BioCompute Editor Setup
26+
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.
27+
28+
29+
```
30+
"dbinfo":{
31+
"mongodbname":"bcodb_1_tst"
32+
,"mongodbuser":"bcodbadmin"
33+
,"mongodbpassword":"bcodbpass"
34+
,"sessionlife":3600
35+
,"collections":{
36+
"bco":"c_bco"
37+
,"counters":"c_counters"
38+
,"users":"c_users"
39+
}
40+
}
41+
,"pathinfo":{
42+
"htmlroot":"http://example.com/bco_editor/"
43+
,"htmlpath":"/myrepositories/bco_editor/html/"
44+
}
45+
46+
```
47+
48+
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.
49+
50+
```
51+
$ sudo ln -s /myrepositories/bco_editor/cgi-bin /var/www/cgi-bin/bco_editor
52+
$ sudo ln -s /myrepositories/bco_editor/html /var/www/html/bco_editor
53+
```
54+
55+
Or you can copy the folders physically.
56+
57+
```
58+
$ sudo cp -r /myrepositories/bco_editor/cgi-bin /var/www/cgi-bin/bco_editor
59+
$ sudo cp -r /myrepositories/bco_editor/html /var/www/html/bco_editor
60+
```
61+
62+
You also need to make sure that apache has write access to /var/www/html/bco_editor/log/.
63+
64+
```
65+
$ sudo chown -R apache:apache /var/www/html/bco_editor/log/
66+
```
67+
68+
Finally, you need to make sure the htmlRoot and cgiRoot javascript variables in bco_editor/html/index.html are assigned right values
69+
70+
```
71+
<script>
72+
var htmlRoot = '/bco_editor/';
73+
var cgiRoot = '/cgi-bin/bco_editor/';
74+
</script>
75+
```
76+
77+
### Admin Utility
78+
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.
79+
80+
```
81+
Listing registered users
82+
$ python admin_util -a list_users
83+
84+
Registration is public but users cannot login before they are activated using this admin_util tool (read below on how to activate pending registerations).
85+
86+
Adding new user
87+
$ python admin_util -a upsert_user -e jim.jones@gmail.com -f James -l Jones -p pass123 -s 1
88+
89+
Activating or updating user
90+
$ python admin_util -a upsert_user -e jim.jones@gmail.com -s 1
91+
92+
Removing user
93+
$ python admin_util -a delete_user -e jim.jones@gmail.com
94+
95+
Listing BioCompute objects
96+
$ python admin_util -a list_bco
97+
98+
Deleting BioCompute object
99+
$ python admin_util -a delete_bco -o 2
100+
101+
```
102+
103+
104+
105+
### Other Links
106+
BioCompute Partnership: http://biocomputeobject.org
107+
108+
GitHub repository for BioCompute Objects:
109+
https://github.com/biocompute-objects/bco_editor
110+
111+
112+

mongodb_installation.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
2+
### MongoDB Installation Example
3+
4+
If you do not have MongoDB installed on your server, here is an example installation steps for CentOs server (taken from
5+
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-red-hat/)
6+
7+
```
8+
9+
1) Create a /etc/yum.repos.d/mongodb-org-4.0.repo file so that you can install MongoDB directly using yum:
10+
11+
[mongodb-org-4.0]
12+
name=MongoDB Repository
13+
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/x86_64/
14+
gpgcheck=1
15+
enabled=1
16+
gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc
17+
18+
2) sudo yum install -y mongodb-org
19+
20+
3) Start mongod
21+
$ sudo service mongod start
22+
23+
4) Start MongoDB without authentication
24+
$ mongo
25+
26+
5) Create the user administrator
27+
> use admin
28+
> db.createUser({
29+
user: "superadmin",
30+
pwd: "superpass",
31+
roles: ["userAdminAnyDatabase", "dbAdminAnyDatabase","readWriteAnyDatabase"]
32+
})
33+
34+
Then disconnect from the mongo shell (Ctrl+D).
35+
36+
6. Disconnect from mongo shell and enable authentication in mongod configuration file and change "disabled" to "enabled"
37+
$ sudo vi /etc/mongod.conf
38+
39+
#security:
40+
# authorization: "disabled"
41+
42+
7) Restart mongod
43+
$ sudo service mongod restart
44+
45+
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.
46+
47+
48+
8) Connect and authenticate as the user administrator, and create additional users
49+
50+
$ mongo
51+
> use admin
52+
> db.auth("superadmin", "superpass")
53+
1
54+
> use bcodb_1_tst
55+
> db.createUser({user: "bcodbadmin", pwd: "bcodbpass", roles: [ { role: "readWrite", db: "bcodb_1_tst" } ]})
56+
57+
```

0 commit comments

Comments
 (0)