Skip to content

Commit a770ce6

Browse files
committed
Release prep
1 parent 6001882 commit a770ce6

37 files changed

+466
-452
lines changed

Changelog.md

Whitespace-only changes.

Gruntfile.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ module.exports = function(grunt) {
139139
//Plugin loading
140140
grunt.loadNpmTasks("grunt-contrib-jshint");
141141
grunt.loadNpmTasks("grunt-contrib-less");
142-
grunt.loadNpmTasks("grunt-contrib-watch");
143142
grunt.loadNpmTasks("grunt-shell");
144143
grunt.loadNpmTasks("grunt-manifest");
145144
grunt.loadNpmTasks("grunt-contrib-compress");
@@ -159,6 +158,5 @@ module.exports = function(grunt) {
159158
grunt.registerTask("testDeploy", ["shell:clean", "buildProd", "connect:server"]);
160159

161160
//testing
162-
grunt.registerTask("devmode", ["karma:unit", "watch"]);
163161
grunt.registerTask("ci", "Build the app and runs tests on it", ["jshint:all", "buildProd", "connect:serverNoAlive", "shell:test" ]);
164162
};

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ Documentation
4646
- [How to install][Install]
4747
- [How to upgrade][Upgrade]
4848
- [How to build](https://github.com/FoxUSA/OpenNote/blob/master/docs/Build.md)
49-
-[Themes][Themes]
49+
- [Themes][Themes]
50+
- [Project history][History]
5051

5152
License
5253
-------
@@ -73,6 +74,7 @@ Credits
7374
[responsive]: ./docs/screenShots/OpenNote.png
7475

7576
[Install]: https://github.com/FoxUSA/OpenNote/blob/master/docs/Install.md
77+
[History]: https://github.com/FoxUSA/OpenNote/blob/master/docs/History.md
7678
[Upgrade]: https://github.com/FoxUSA/OpenNote/blob/master/docs/Upgrade.md
7779
[Dependencies]: https://github.com/FoxUSA/OpenNote/blob/master/docs/Dependencies.md
7880
[Themes]: https://github.com/FoxUSA/OpenNote/blob/master/docs/Themes.md

docs/Build.md

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,36 @@
44
- Grunt `npm install -g grunt-cli`
55

66
## Build
7-
Clone this project
8-
`cd` into the project
9-
Run `npm install` to fetch and install dependencies
10-
Then run
11-
`grunt build`
12-
this will start a webpack dev server.
7+
Clone [this project](https://github.com/FoxUSA/OpenNote) an the [SharedServices Project](https://github.com/FoxUSA/OpenNoteService-PHP)
8+
9+
My project folder structure is setup as follows
10+
```
11+
Some working folder
12+
├─ OpenNote
13+
├─ OpenNote-SharedServices
14+
├─ OpenNote-Docer
15+
└─ OpenNote-CLI
16+
```
17+
1318

14-
To test production bundles run `grunt testDeploy`
19+
`cd` into the OpenNote
20+
Run `npm install` to fetch and install dependencies
21+
Then run`grunt` this will start a webpack dev server and open your browser.
1522

16-
//TODO new stuff and note in an ascii tree how the shared services are are expected to be neighbors of the cli and OpenNoteFolder
23+
To test production bundles run `grunt testDeploy`.
1724

1825

19-
//TODO grunt --help to get steps
26+
### Usefull commands
27+
You can see a full list of commands by running `grunt --help`.
2028

21-
Super important
22-
grunt default or grunt
23-
grunt ci
24-
grunt deploy //TODO
29+
Below are the most important commands
30+
- `grunt default` or `grunt` to have webpack in development mode
31+
- `grunt ci` run linting and tests
32+
- `grunt deploy` Package up the project
2533

2634

2735
To develop tests
2836
```
29-
grunt dev # in terminal A
30-
npm run testChrome # in terminal B. Iterate on this terminal
37+
grunt # in terminal A
38+
npm run testSingle # in terminal B. Iterate on this terminal
3139
```

docs/History.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# OpenNote History
2+
3+
Back in 2013 OneNote was started. Back then Microsoft OneNote did not have a full featured web interface. I used that at the time and had many notebooks. I wanted a way of taking those notes with me on my phone. I had limited data and wanted an application that would sync all my notes, let me modify them, and sync them back. I tried a bunch of applications and there were none that fulfilled my offline and tree structure requirements.
4+
5+
## Open note
6+
OpenNote has a text only design. No icons or symbols other than ascii non alphabetical characters. The application just so happened to end up this way. It has a very clean feel to it and does not distract you. I would like to keep this going forward
7+
### Generation Alpha
8+
The first version of OpenNote was a PHP fat application. Views were prepared by PHP and sent to the browser via a full load or AJAX.
9+
10+
### Generation Beta
11+
Second major revision was the switch to the then booming Angular 1 framework and use HTML5 application manifest and CouchDB to provided offline access and syncing.
12+
13+
### Current Generation
14+
The most recent efforts have been to add modern features. Tags, markdown, and a CLI.

docs/HowToUse.md

Lines changed: 57 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,70 @@
1-
How to use
2-
--------------
3-
OpenNote uses a touch to open scheme.
4-
If you want to open something just click it.
1+
# How to use
52

6-
## Login
7-
To login simple go to your instance on OpenNote. You will need to have javascript enabled
8-
Then simply click "Login"
3+
```
4+
+---------+ +-------------------------+
5+
|OpenNote | | CouchDB |
6+
|(Web App)+<--------------PouchDB sync----------------------->+//Stores notes and folder|
7+
+----+----+ +--------------+----------+
8+
^ ^
9+
| |
10+
| |PouchDB sync
11+
|Pre-signed urls |
12+
| |
13+
v v
14+
+----+-------------------------+ +----------------------------+----------+
15+
|Minio | | OpenNote-CLI |
16+
|//Stores blob data like images+<-S3 API (TEMP)-+//Allows use of other editors like Atom|
17+
+------------------------------+ +---------------------------------------+
18+
```
919

10-
![][login]
20+
OpenNote, when utilized fulloy, is made up of several components
21+
22+
Component | Purpose
23+
--------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
24+
OpenNote | A PWA(Offline compatible) web application that allows you edit and access notes.
25+
CouchDB | Couch DB is a database that stores your notes. When this is setup, you do not need to worry if your phone gets lost. When fully replicated, your notes will be safely stored in CouchDB. CouchDB also allows multiple browsers to sync. So you can have your notes on all your devices.
26+
Minio | Minio is a blob storage server that implements the AWS S3 API. This allows you to upload your images and non text files for use with OpenNote/
27+
[OpenNote-CLI](https://github.com/FoxUSA/OpenNote-CLI) | OpenNote CLI syncs the database to disk. This allows you to use other editors like Atom to create and edit notes.
28+
29+
## General
30+
31+
OpenNote uses a touch to open scheme. If you want to open something just click it.
1132

1233
## Browsing
13-
Now that you are logged in, you can browse around. At first you won't have any folders or notes. So, create some!
14-
Once you have some stuff simply click on a folder(Always Green) or browse a tree view on the left to crawl into you notes.
1534

16-
![][topLevel]
17-
Eventually you'll find a note(Always blue) that you want to open. Simply click it or touch it.
35+
Now that you are logged in, you can browse around. At first you won't have any folders or notes. So, create some! Once you have some stuff simply click on a folder(Always Green) or browse a tree view on the left to crawl into you notes.
36+
37+
![][toplevel] Eventually you'll find a note(Always blue) that you want to open. Simply click it or touch it.
1838

1939
![][plants]
2040

2141
## Notes
42+
2243
Once you click on a note you'll will be presented with it in a read only view.
2344

24-
![][seedsView]
25-
If you want to edit a note, click on the "Edit" button in the top bar
45+
![][seedsview] If you want to edit a note, click on the "Edit" button in the top bar
46+
47+
![][seedsedit] This will bring you to the editor. Once you are all done editing, click "Save" to store the note.
48+
49+
## Syncing
50+
By default OpenNote is storing info in your browser. Until you setup syncing, you are at risk of lousing your notes. To setup syncing. From the home page click `Settings`, then click database. On the right hand side of the panel you will see a Replication url field. This expect a url to your couchDB database in the form of `$protocol://$user:$password@$serverurl:$port/$database`.
51+
52+
For example if your server information is as follows:
53+
54+
Item | Value
55+
--- | ---
56+
protocol | http
57+
user | admin
58+
password | password
59+
serverurl | 127.0.0.1
60+
port | 6984
61+
database | opennote
62+
63+
then your replication url would be `http://admin:[email protected]:6984/opennote`
2664

27-
![][seedsEdit]
28-
This will bring you to the CKEditor. Once you are all done editing, click "Save" to store the note.
65+
You will see an alert if replication is working.
2966

30-
[login]: https://raw.github.com/FoxUSA/OpenNote/master/Doc/screenShots/login.png
31-
[topLevel]: https://raw.github.com/FoxUSA/OpenNote/master/Doc/screenShots/topLevel.png
32-
[plants]: https://raw.github.com/FoxUSA/OpenNote/master/Doc/screenShots/plants.png
33-
[seedsView]: https://raw.github.com/FoxUSA/OpenNote/master/Doc/screenShots/seedsView.png
34-
[seedsEdit]: https://raw.github.com/FoxUSA/OpenNote/master/Doc/screenShots/seedsEdit.png
67+
[plants]: ./images/plants.png
68+
[seedsedit]: ./images/seedsEdit.png
69+
[seedsview]: ./images/seedsView.png
70+
[toplevel]: ./images/topLevel.png

docs/Install.md

Lines changed: 30 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -1,116 +1,38 @@
11
# 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.
173
```
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
1829
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";
9130
```
31+
## Start
32+
`docker-compose up -d` to start
9233

93-
- Now the site install is complete. You can now open the site by going to your webserver url +/OpenNote
9434

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-
```
11335

114-
- Now the site install is complete. You can now open the site by going to your webserver url +/OpenNote
11536

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.

docs/Upgrade.md

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,35 @@
11
# How to upgrade
22

3-
//TODO
3+
## Upgrading from 17.xx to 18.xx
4+
There are major changes in this release. Make sure your data is backed up.
5+
Launch new instance of OpenNote via the [install instructions](./Install.md). Then simply change your replication url to the new replication url and your notes will sync across.
46

5-
If you have an issue with the html use https://domchristie.github.io/turndown/ to convert
7+
In 18.xx the editor is mark down. If you have an issue with the HTML use https://domchristie.github.io/turndown/ to convert the text into markdown.
68

7-
##Upgrading from 14.xx(Locomotive) to 15.07.01
9+
10+
The `upgrade` command included in [OpenNote-CLI](https://github.com/FoxUSA/OpenNote-CLI) version 18.03 will allow you to migrate all your files to the Minio instance launched by compose. It will also change all the links and pre-sign them for you.
11+
12+
Sample command
13+
```
14+
node index.js upgrade --jsonPath ../uploads.json \
15+
--legacyServiceUrl https://example \
16+
--s3Url http://127.0.0.1:9000 \
17+
--bucket opennote \
18+
--accessKey tests \
19+
--secretKey testssdfasdf
20+
```
21+
22+
Only thing you will need is to dump the uploads table from the mysql legacy service and provide the path to it via the `--jsonPath` option.
23+
24+
## Upgrading from 14.xx(Locomotive) to 15.07.01
825
All you need to do is merge your existing deployment with the release folder while keeping your config files (`openNote\openNote.config.js` and `\Service\Config.php`).
926
Make sure to backup your old folder and database.
1027

1128
There have been major changes in this release.
1229
You will need to follow the CouchDB instructions in the Install documentation.
1330

1431

15-
##Docker(14.07.01 to 14.07.02)
32+
## Docker(14.07.01 to 14.07.02)
1633
Find the container id of your running container by doing a `docker ps` or `docker ps -l` if the OpenNote conatiner was the last one you stopped.
1734
You should see output like this
1835
```
@@ -61,16 +78,16 @@ or if port 80 is in use
6178

6279
All done
6380

64-
##Manual installs
81+
## Manual installs
6582

66-
##Upgrading from 14.07(Locomotive) to 14.07.01(Steam Locomotive) or 14.07.01(Steam Locomotive) to 14.07.02 (Diesel Locomotive).
83+
## Upgrading from 14.07(Locomotive) to 14.07.01(Steam Locomotive) or 14.07.01(Steam Locomotive) to 14.07.02 (Diesel Locomotive).
6784
All you need to do is merge your existing deployment with the release folder while keeping your config files (`openNote\openNote.config.js` and `\Service\Config.php`).
6885

69-
###MySQL(Recomended)
86+
### MySQL(Recomended)
7087
- Make sure you make a copy of you database and the OpenNote directory
7188
- Run `Service/model/sql/updateScripts/` scripts to roll the database up to current specs.
7289
- You will copy need to copy the upload directory contents into the new upload direcory in `Service/upload`.
7390
- You will also need to put int you database information in the new config `Service/Config.php`
7491

75-
###SQLite
92+
### SQLite
7693
Same as the MySQL. You may need to slightly modify the sql upload script to be compatible with SQLite. I have included as much as I can in scripts with the postfix of .sqlite.sql. SQLite does not fully support the ALTER statement.

0 commit comments

Comments
 (0)