Skip to content

Commit f96792b

Browse files
committed
Merge pull request #131 from FoxUSA/Fox-Working
Fox working
2 parents 6112c02 + 26e41f7 commit f96792b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2423
-1151
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/bower_components
22
/node_modules
3-
/build
3+
/build
4+
/OpenNote/openNote.appcache

Doc/Build.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,26 @@ You will need to clone the front end and the backend
55
https://github.com/FoxUSA/OpenNote
66
https://github.com/FoxUSA/OpenNoteService-PHP
77

8-
Most of the buid tasks require the OpenNote and OpenNoteService-PHP to be in the same folder
8+
Most of the buid tasks require the OpenNote and OpenNoteService-PHP to be in the same folder
99

10-
## Build Requirments
11-
- Bower
12-
- Grunt
10+
For example
11+
In the folder `OpenNote` we expect `openNote`, and `Service` to be sister folders.
12+
13+
I normally have `Service` folder as a symbolic link to `OpenNoteService-PHP/Service`;
14+
15+
Once the `OpenNote` and `OpenNoteService-PHP` project have been cloned you need to build the projects
16+
17+
To do so for the front end project
18+
- Run `npm install` to get the dev dependencies
19+
- Then, you need to run `grunt build` in `OpenNote/`(This runs bower install and builds the less CSS)
20+
21+
In the PHP service you will need too
22+
- You need to run `php ./composer.phar install -v` to install all the PHP dependencies and build the projects autoloading structure
23+
24+
## Build Requirements
25+
- npm
26+
- Bower `npm install -g bower`
27+
- Grunt `npm install -g grunt-cli`
1328
- Composer
1429

1530
## Build

Doc/HowToUse.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ How to use
22
--------------
33
OpenNote uses a touch to open scheme.
44
If you want to open something just click it.
5-
5+
66
## Login
77
To login simple go to your instance on OpenNote. You will need to have javascript enabled
88
Then simply click "Login"
@@ -16,7 +16,7 @@ Once you have some stuff simply click on a folder(Always Green) or browse a tree
1616
![][topLevel]
1717
Eventually you'll find a note(Always blue) that you want to open. Simply click it or touch it.
1818

19-
![][plants]
19+
![][plants]
2020

2121
## Notes
2222
Once you click on a note you'll will be presented with it in a read only view.
@@ -26,10 +26,9 @@ If you want to edit a note, click on the "Edit" button in the top bar
2626

2727
![][seedsEdit]
2828
This will bring you to the CKEditor. Once you are all done editing, click "Save" to store the note.
29-
Dont worry to much about the changing the content of your notes. The program keeps a history of what you changed.
3029

31-
[login]: https://raw.github.com/FoxUSA/OpenNote/master/Doc/screenShots/login.png
30+
[login]: https://raw.github.com/FoxUSA/OpenNote/master/Doc/screenShots/login.png
3231
[topLevel]: https://raw.github.com/FoxUSA/OpenNote/master/Doc/screenShots/topLevel.png
33-
[plants]: https://raw.github.com/FoxUSA/OpenNote/master/Doc/screenShots/plants.png
32+
[plants]: https://raw.github.com/FoxUSA/OpenNote/master/Doc/screenShots/plants.png
3433
[seedsView]: https://raw.github.com/FoxUSA/OpenNote/master/Doc/screenShots/seedsView.png
35-
[seedsEdit]: https://raw.github.com/FoxUSA/OpenNote/master/Doc/screenShots/seedsEdit.png
34+
[seedsEdit]: https://raw.github.com/FoxUSA/OpenNote/master/Doc/screenShots/seedsEdit.png

Doc/Install.md

Lines changed: 73 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,89 @@
11
# How To Install
22
[Download most resent release from here.][Download]
33

4-
# Using Docker(Full Stack)
5-
Make sure docker in running in daemon mode with restart previously running containers on
6-
`docker -d -r` or you could louse your notes if you do not know what your doing
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.
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
17+
```
718

8-
Pull the current docker image
9-
`docker pull foxusa/opennote`
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+
```
1052

11-
and run it on port 80
12-
`sudo docker run -d -p 80:80 -p 443:443 foxusa/opennote`
53+
Now in `/OpenNote/#/settings/database/` put the following connection string in the `Replication url` field `https://admin:[email protected]:6984/opennote`
1354

14-
or if port 80 is in use
15-
`sudo docker run -d -p 8080:80 -p 8443:443 foxusa/opennote`
55+
To import a database from older versions check out `/OpenNote/#/settings/legacy/`
1656

17-
# Automatic(Wizard Based Install)
57+
# Legacy service
58+
The legacy service is still included to migrate data to the new data structure.
59+
All write endpoints have been hidden with the exception of the file upload api's.
60+
61+
### Automatic(Wizard Based Install)
1862
To run the installer open
1963
`<install path>/Service/install.php`
2064

2165
Make sure you delete `install.php` and `Config.template`.
2266

23-
### Security Note
67+
#### Security Note
2468
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.
2569

2670
Still, you should move this file out of the webserver directory and change the location in `Config.php`
2771

28-
## Manual
29-
###MYSql
72+
### Using Docker(Full Stack)
73+
Make sure docker in running in daemon mode with restart previously running containers on
74+
`docker -d -r` or you could louse your notes if you do not know what your doing
75+
76+
Pull the current docker image
77+
`docker pull foxusa/opennote`
78+
79+
and run it on port 80
80+
`sudo docker run -d -p 80:80 -p 443:443 foxusa/opennote`
81+
82+
or if port 80 is in use
83+
`sudo docker run -d -p 8080:80 -p 8443:443 foxusa/opennote`
84+
85+
### Manual
86+
####MYSql
3087
- Create a MYSQL database named "OpenNote"
3188
- Download and extract OpenNote into a folder on your php web-server called "OpenNote"
3289
- Open up the `Service/model/sql` folder and run `notebook.sql` in your OpenNote database
@@ -38,10 +95,10 @@ These are stored in the following lines of code in `/OpenNote/Config.php`:
3895
$dbServer = "127.0.0.1";
3996
$dbName = "notebook";
4097
```
41-
98+
4299
- Now the site install is complete. You can now open the site by going to your webserver url +/OpenNote
43100

44-
###SQLite
101+
####SQLite
45102
- Download and extract OpenNote into a folder on your php web-server called "OpenNote"
46103
- Create a SQLite database file and execute the SQL DDL from `Service/model/sql` and run `notebook.sqlite.sql`.
47104
- Change the database connection settings inside of `Service/Config.php` to match your db settings.
@@ -59,7 +116,7 @@ Comment the following lines in the dbConfig function:
59116
```php
60117
$dbName = "../<relative path>/OpenNote.sqlite";
61118
```
62-
119+
63120
- Now the site install is complete. You can now open the site by going to your webserver url +/OpenNote
64121

65122
[Download]: https://github.com/FoxUSA/OpenNote/releases

Doc/Upgrade.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# How to upgrade
22

3+
##Upgrading from 14.xx(Locomotive) to 15.07.01
4+
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`).
5+
Make sure to backup your old folder and database.
6+
7+
There have been major changes in this release.
8+
You will need to follow the CouchDB instructions in the Install documentation.
9+
10+
311
##Docker(14.07.01 to 14.07.02)
412
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.
513
You should see output like this
@@ -40,7 +48,7 @@ Commit it
4048
Get another new long containerID
4149
`cf77323ed72659b3462073763e9115ff16bb4ae64ce406176703bbc781011ccb`
4250

43-
and run that with published ports
51+
and run that with published ports
4452
`sudo docker run -d -p 80:80 -p 443:443 cf77323ed72659b3462073763e9115ff16bb4ae64ce406176703bbc781011ccb /run.sh`
4553

4654
or if port 80 is in use
@@ -51,8 +59,8 @@ All done
5159

5260
##Manual installs
5361

54-
##Upgrading from 14.07(Locomotive) to 14.07.01(Steam Locomotive) or 14.07.01(Steam Locomotive) to 14.07.02 (Diesel Locomotive).
55-
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`).
62+
##Upgrading from 14.07(Locomotive) to 14.07.01(Steam Locomotive) or 14.07.01(Steam Locomotive) to 14.07.02 (Diesel Locomotive).
63+
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`).
5664

5765
###MySQL(Recomended)
5866
- Make sure you make a copy of you database and the OpenNote directory

Gruntfile.js

Lines changed: 39 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = function(grunt) {
22
//Initializing the configuration object
3-
grunt.initConfig({
3+
grunt.initConfig({
44
//Style
55
less: {
66
devDark: {
@@ -15,12 +15,12 @@ module.exports = function(grunt) {
1515
"OpenNote/openNote/style/invert/dark/note.css": "OpenNote/openNote/style/invert/note.less",
1616
"OpenNote/openNote/style/invert/dark/alertify.css": "OpenNote/openNote/style/invert/alertify.less",
1717
"OpenNote/openNote/style/invert/dark/intojs.css": "OpenNote/openNote/style/invert/introjs.less",
18-
18+
1919
"OpenNote/openNote/style/simplicity/dark/style.css": "OpenNote/openNote/style/simplicity/style.less",
2020
"OpenNote/openNote/style/simplicity/dark/note.css": "OpenNote/openNote/style/simplicity/note.less",
2121
"OpenNote/openNote/style/simplicity/dark/alertify.css": "OpenNote/openNote/style/simplicity/alertify.less",
2222
"OpenNote/openNote/style/simplicity/dark/intojs.css": "OpenNote/openNote/style/simplicity/introjs.less"
23-
23+
2424
}
2525
},
2626
devLight: {
@@ -35,7 +35,7 @@ module.exports = function(grunt) {
3535
"OpenNote/openNote/style/invert/light/note.css": "OpenNote/openNote/style/invert/note.less",
3636
"OpenNote/openNote/style/invert/light/alertify.css": "OpenNote/openNote/style/invert/alertify.less",
3737
"OpenNote/openNote/style/invert/light/intojs.css": "OpenNote/openNote/style/invert/introjs.less",
38-
38+
3939
"OpenNote/openNote/style/simplicity/light/style.css": "OpenNote/openNote/style/simplicity/style.less",
4040
"OpenNote/openNote/style/simplicity/light/note.css": "OpenNote/openNote/style/simplicity/note.less",
4141
"OpenNote/openNote/style/simplicity/light/alertify.css": "OpenNote/openNote/style/simplicity/alertify.less",
@@ -55,12 +55,12 @@ module.exports = function(grunt) {
5555
"OpenNote/openNote/style/invert/dark/note.css": "OpenNote/openNote/style/invert/note.less",
5656
"OpenNote/openNote/style/invert/dark/alertify.css": "OpenNote/openNote/style/invert/alertify.less",
5757
"OpenNote/openNote/style/invert/dark/intojs.css": "OpenNote/openNote/style/invert/introjs.less",
58-
58+
5959
"OpenNote/openNote/style/simplicity/dark/style.css": "OpenNote/openNote/style/simplicity/style.less",
6060
"OpenNote/openNote/style/simplicity/dark/note.css": "OpenNote/openNote/style/simplicity/note.less",
6161
"OpenNote/openNote/style/simplicity/dark/alertify.css": "OpenNote/openNote/style/simplicity/alertify.less",
6262
"OpenNote/openNote/style/simplicity/dark/intojs.css": "OpenNote/openNote/style/simplicity/introjs.less"
63-
63+
6464
}
6565
},
6666
prodLight: {
@@ -102,15 +102,15 @@ module.exports = function(grunt) {
102102
tasks: ["karma:unit:run"]
103103
}
104104
},
105-
shell: {
106-
bowerInstall: {
105+
shell: {
106+
bowerInstall: {
107107
command: [ "cd OpenNote",
108108
"bower install" ].join("&&")
109109
},
110110
clean:{
111111
command: [ "rm -rf build",
112112
"cd OpenNote",
113-
"rm -rf bower_components",
113+
"rm -rf bower_components",
114114
"cd openNote/style/invert/",
115115
"rm -rf dark",
116116
"rm -rf light"].join("&&")
@@ -122,28 +122,50 @@ module.exports = function(grunt) {
122122
"cp -r ../../OpenNoteService-PHP/Service ./",
123123
"cp -r ../../OpenNoteService-PHP/vendor ./"].join("&&")
124124
}
125-
}
125+
},
126+
//HTML 5
127+
manifest: {
128+
generate: {
129+
options: {
130+
basePath: "OpenNote/",
131+
exclude: ["openNote.appcache", "Service", "bower_components/intro.js"],
132+
verbose: true,
133+
timestamp: true,
134+
hash: true,
135+
master: ["index.html"]
136+
},
137+
src: [
138+
"**/*.js",
139+
"**/*.css",
140+
"**/*.html",
141+
"**/*.png",
142+
"**/*.jpg"
143+
],
144+
dest: "openNote/openNote.appcache"
145+
}
146+
}
126147
});
127148

128149
//Plugin loading
129150
grunt.loadNpmTasks("grunt-contrib-less");
130151
grunt.loadNpmTasks("grunt-contrib-watch");
131152
grunt.loadNpmTasks("grunt-karma");
132153
grunt.loadNpmTasks("grunt-shell");
133-
154+
grunt.loadNpmTasks("grunt-manifest");
155+
134156
//Task definition
135157
//css
136158
grunt.registerTask("buildDevCSS", ["less:devDark","less:devLight"]);
137159
grunt.registerTask("buildProdCSS", ["less:prodDark","less:prodLight"]);
138-
160+
139161
//deployment
140-
grunt.registerTask("clean", ["shell:clean"]);
141-
grunt.registerTask("build", ["shell:bowerInstall", "buildDevCSS"]);
162+
// you can run individual command using the plug-in command syntax suck as manifest:generate or shell:clean
163+
grunt.registerTask("build", ["shell:bowerInstall", "buildDevCSS", "manifest:generate"]);
142164
grunt.registerTask("default", ["build"]);
143-
grunt.registerTask("deploy", ["clean", "shell:bowerInstall", "buildProdCSS", "shell:phpPackage"]);
144-
165+
grunt.registerTask("deploy", ["shell:clean", "shell:bowerInstall", "buildProdCSS", "manifest:generate", "shell:phpPackage"]);
166+
145167
//testing
146168
grunt.registerTask("devmode", ["karma:unit", "watch"]);
147169
grunt.registerTask("test", ["karma:travis"])
148170
grunt.registerTask("ci", ["build","karma:travis"])
149-
};
171+
};

OpenNote.Test/karma.conf.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@ module.exports = function(config){
22
config.set({
33
basePath : "../",
44
files : [
5+
"node_modules/es5-shim/es5-shim.min.js",
56
"OpenNote/bower_components/angular/angular.js",
67
"OpenNote/bower_components/angular-mocks/angular-mocks.js",
78
"OpenNote/bower_components/angular-route/angular-route.js",
89
"OpenNote/bower_components/angular-resource/angular-resource.js",
910
"OpenNote/bower_components/angular-sanitize/angular-sanitize.js",
1011
"OpenNote/bower_components/angular-animate/angular-animate.js",
1112
"OpenNote/bower_components/angular-ui-tree/dist/angular-ui-tree.js",
13+
"OpenNote/bower_components/ng-file-upload/ng-file-upload-shim.min.js",
14+
"OpenNote/bower_components/ng-file-upload/ng-file-upload.min.js",
15+
"OpenNote/bower_components/pouchdb/dist/pouchdb.min.js",
1216
"OpenNote/bower_components/jquery/jquery.js",
1317
"OpenNote/openNote/openNote.js",
1418
"OpenNote/openNote/**/*.js",

0 commit comments

Comments
 (0)