|
1 | 1 | # How To Install |
2 | | -[Download most resent release from here.][Download] |
3 | | - |
4 | | -# HTML5 based new super fancy version |
5 | | -## Web app |
6 | | -Just extract in a HTML5 compatible webserver public directory. Or just use the [GitHub hosted version](https://foxusa.github.io/OpenNote/OpenNote/). |
7 | | - |
8 | | -## CouchDB Install |
9 | | -If you want sync your notes with a server, you will need to install CouchDB. |
10 | | -[CouchDB Download page](http://couchdb.apache.org/) |
11 | | - |
12 | | -You will need to enable CORS in CouchDB |
13 | | -The easiest way to do this is to use `add-cors-to-couchdb` |
14 | | -```shell |
15 | | -npm install -g add-cors-to-couchdb |
16 | | -add-cors-to-couchdb |
| 2 | +Put the following text in a `docker-compose.yml`. Make sure to set all the items marked `#TODO`. Also make sure this file is in a secure place. Your credentials are stored in it. |
17 | 3 | ``` |
| 4 | +version: "2" |
| 5 | +services: |
| 6 | + opennote: |
| 7 | + image: foxusa/opennote |
| 8 | + ports: |
| 9 | + - "8080:80" |
| 10 | + couchdb: |
| 11 | + image: couchdb |
| 12 | + ports: |
| 13 | + - "5984:5984" |
| 14 | + - "6984:6984" |
| 15 | + environment: |
| 16 | + COUCHDB_USER: user #TODO set this |
| 17 | + COUCHDB_PASSWORD: password #TODO set this |
| 18 | +
|
| 19 | + minio: |
| 20 | + image: minio/minio |
| 21 | + volumes: |
| 22 | + - "/tmp/data:/data" #TODO set this |
| 23 | + ports: |
| 24 | + - "9000:9000" |
| 25 | + environment: |
| 26 | + MINIO_ACCESS_KEY: tests #TODO set this |
| 27 | + MINIO_SECRET_KEY: testssdfasdf #TODO set this |
| 28 | + command: server /data |
18 | 29 |
|
19 | | -Run the commands below substituting `http://127.0.0.1:5984/` with the url of your server |
20 | | -```shell |
21 | | -# Create DB |
22 | | -curl -X PUT http://127.0.0.1:5984/opennote |
23 | | - |
24 | | -# Set permissions on opennote database |
25 | | -curl -X PUT http://localhost:5984/opennote/_security \ |
26 | | - -u admin:password \ |
27 | | - -H "Content-Type: application/json" \ |
28 | | - -d '{"admins": { "names": ["admin"], "roles": [] }, "members": { "names": ["admin"], "roles": [] } }' |
29 | | - |
30 | | -# SSL |
31 | | -curl -X PUT http://localhost:5984/_config/daemons/httpsd \ |
32 | | - -u admin:password \ |
33 | | - -H "Content-Type: application/json" \ |
34 | | - -d '"{couch_httpd, start_link, [https]}"' |
35 | | - |
36 | | -mkdir /etc/couchdb/cert |
37 | | -openssl genrsa > /etc/couchdb/cert/privkey.pem |
38 | | -openssl req -new -x509 -key /etc/couchdb/cert/privkey.pem -out /etc/couchdb/cert/mycert.pem -days 1095 |
39 | | - |
40 | | -curl -X PUT http://127.0.0.1:5984/_config/ssl/cert_file \ |
41 | | - -u admin:password \ |
42 | | - -H "Content-Type: application/json" \ |
43 | | - -d '"/etc/couchdb/cert/mycert.pem"' |
44 | | - |
45 | | -curl -X PUT http://127.0.0.1:5984/_config/ssl/key_file \ |
46 | | - -u admin:password \ |
47 | | - -H "Content-Type: application/json" \ |
48 | | - -d '"/etc/couchdb/cert/privkey.pem"' |
49 | | - |
50 | | -# Default SSL port 6984 |
51 | | -``` |
52 | | - |
53 | | -Now in `/OpenNote/#/settings/database/` put the following connection string in the `Replication url` field `https://admin:[email protected]:6984/opennote` |
54 | | - |
55 | | -### Automatic(Wizard Based Install) |
56 | | -To run the installer open |
57 | | -`<install path>/Service/install.php` |
58 | | - |
59 | | -Make sure you delete `install.php` and `Config.template`. |
60 | | - |
61 | | -#### Security Note |
62 | | -Be default we put the sqlite databse in the web folder. This is not a good idea. We solved this by putting in a htaccess file to not allow the database to be downloaded. |
63 | | - |
64 | | -Still, you should move this file out of the webserver directory and change the location in `Config.php` |
65 | | - |
66 | | -### Using Docker(Full Stack) |
67 | | -Make sure docker in running in daemon mode with restart previously running containers on |
68 | | -`docker -d -r` or you could louse your notes if you do not know what your doing |
69 | | - |
70 | | -Pull the current docker image |
71 | | -`docker pull foxusa/opennote` |
72 | | - |
73 | | -and run it on port 80 |
74 | | -`sudo docker run -d -p 80:80 -p 443:443 foxusa/opennote` |
75 | | - |
76 | | -or if port 80 is in use |
77 | | -`sudo docker run -d -p 8080:80 -p 8443:443 foxusa/opennote` |
78 | | - |
79 | | -### Manual |
80 | | -####MYSql |
81 | | -- Create a MYSQL database named "OpenNote" |
82 | | -- Download and extract OpenNote into a folder on your php web-server called "OpenNote" |
83 | | -- Open up the `Service/model/sql` folder and run `notebook.sql` in your OpenNote database |
84 | | -- Change the database connection settings inside of `Service/Config.php` to match your db settings. |
85 | | -These are stored in the following lines of code in `/OpenNote/Config.php`: |
86 | | -```php |
87 | | - $dbUserName = "notebook"; |
88 | | - $dbPassword = "password"; |
89 | | - $dbServer = "127.0.0.1"; |
90 | | - $dbName = "notebook"; |
91 | 30 | ``` |
| 31 | +## Start |
| 32 | +`docker-compose up -d` to start |
92 | 33 |
|
93 | | -- Now the site install is complete. You can now open the site by going to your webserver url +/OpenNote |
94 | 34 |
|
95 | | -####SQLite |
96 | | -- Download and extract OpenNote into a folder on your php web-server called "OpenNote" |
97 | | -- Create a SQLite database file and execute the SQL DDL from `Service/model/sql` and run `notebook.sqlite.sql`. |
98 | | -- Change the database connection settings inside of `Service/Config.php` to match your db settings. |
99 | | -- These are stored in the following lines of code in `/OpenNote/Config.php`: |
100 | | -- Also make sure you have php5-sqlite driver installed and have group write access to SQLite database file, or you cannot register or login and you can't see any useful error messages. |
101 | | - |
102 | | -Uncomment the following lines in the dbConfig function: |
103 | | - |
104 | | -`return self::sqliteConfig()` |
105 | | - |
106 | | -Comment the following lines in the dbConfig function: |
107 | | - |
108 | | -`//return self::mysqlConfig();` |
109 | | - |
110 | | -```php |
111 | | - $dbName = "../<relative path>/OpenNote.sqlite"; |
112 | | -``` |
113 | 35 |
|
114 | | -- Now the site install is complete. You can now open the site by going to your webserver url +/OpenNote |
115 | 36 |
|
116 | | -[Download]: https://github.com/FoxUSA/OpenNote/releases |
| 37 | +## Uninstall |
| 38 | +If you ever want to shutdown OpenNote run `docker-compose down` in the same folder as `docker-compose.yml`. This will shut down the containers associated with OpenNote. |
0 commit comments