diff --git a/.meteor/packages b/.meteor/packages
index da820fd..a7c0206 100644
--- a/.meteor/packages
+++ b/.meteor/packages
@@ -33,8 +33,8 @@ arillo:flow-router-helpers # Provides various template helpers such as {{pathFo
#tomwasd:flow-router-seo
kadira:blaze-layout
-shell-server@0.4.0 # ???
-meteortoys:allthings
+#shell-server@0.4.0 # ???
+#meteortoys:allthings
stylus@2.513.13
session@1.2.0
##browser-policy # Adds support for specifying browser level security rules related to content and what's allowed to laod on the page.
@@ -55,7 +55,7 @@ aldeed:collection2
#twbs:bootstrap # Requires jquery 1.9-2.x, not 3+
fortawesome:fontawesome
momentjs:moment
-mizzao:bootboxjs # ???
+#mizzao:bootboxjs # ???
aldeed:template-extension
juliancwirko:s-alert # Client error/alert handling
jcbernack:reactive-aggregate # Allows us to create a new client collection (from the server) with the contents being an aggregate of server data. Note that aggregation can only be done on the server currently as mini-mongo does not support it.
@@ -66,3 +66,4 @@ markdown@1.0.12
wcrisman:jquery-custom-scrollbar
underscore@1.0.10
meteorhacks:aggregate # Allows databaseName.aggragate(pipeline) calls the exact same way you would on the command line in the mongo tool.
+babrahams:constellation
diff --git a/.meteor/versions b/.meteor/versions
index 424b559..ccce0d4 100644
--- a/.meteor/versions
+++ b/.meteor/versions
@@ -12,6 +12,9 @@ arillo:flow-router-helpers@0.5.2
autoupdate@1.6.0
babel-compiler@7.3.4
babel-runtime@1.3.0
+babrahams:constellation@0.4.10
+babrahams:editable-json@0.6.5
+babrahams:temple@0.4.7
base64@1.0.12
binary-heap@1.0.11
blaze@2.3.3
@@ -23,6 +26,14 @@ caching-html-compiler@1.1.3
callback-hook@1.1.0
check@1.3.1
coffeescript@1.0.17
+constellation:autopublish@0.4.7
+constellation:console@1.4.7
+constellation:plugins@0.4.9
+constellation:position@0.4.7
+constellation:session@0.4.7
+constellation:subscriptions@0.4.7
+constellation:tiny@0.4.7
+dburles:mongo-collection-instances@0.3.5
ddp@1.4.0
ddp-client@2.3.3
ddp-common@1.4.0
@@ -41,6 +52,8 @@ es5-shim@4.8.0
fetch@0.1.1
fortawesome:fontawesome@4.7.0
geojson-utils@1.0.10
+gwendall:body-events@0.1.6
+gwendall:session-json@0.1.7
hot-code-push@1.0.4
html-tools@1.0.11
htmljs@1.0.11
@@ -52,6 +65,7 @@ jquery@1.11.11
juliancwirko:s-alert@3.2.0
kadira:blaze-layout@2.3.0
kadira:flow-router@2.12.1
+lai:collection-extensions@0.2.1_1
launch-screen@1.1.1
livedata@1.0.18
localstorage@1.2.0
@@ -62,27 +76,9 @@ meteor@1.9.3
meteor-base@1.4.0
meteorhacks:aggregate@1.3.0
meteorhacks:collection-utils@1.2.0
-meteortoys:allthings@4.0.0
-meteortoys:authenticate@4.0.0
-meteortoys:autopub@4.0.0
-meteortoys:blueprint@4.0.0
-meteortoys:email@4.0.0
-meteortoys:hotreload@4.0.0
-meteortoys:listen@4.0.0
-meteortoys:method@4.0.0
-meteortoys:mobile@4.0.0
-meteortoys:pub@4.0.0
-meteortoys:result@4.0.0
-meteortoys:shell@4.0.0
-meteortoys:status@4.0.0
-meteortoys:sub@4.0.0
-meteortoys:throttle@4.0.0
-meteortoys:toggle@4.0.0
-meteortoys:toykit@4.0.2
minifier-css@1.4.2
minifier-js@2.4.1
minimongo@1.4.5
-mizzao:bootboxjs@4.4.0
mobile-experience@1.0.5
mobile-status-bar@1.0.14
modern-browsers@0.1.4
@@ -94,8 +90,6 @@ mongo-decimal@0.1.1
mongo-dev-server@1.1.0
mongo-id@1.0.7
mongo-livedata@1.0.12
-msavin:jetsetter@4.0.0
-msavin:mongol@4.0.1
npm-bcrypt@0.9.3
npm-mongo@3.1.2
observe-sequence@1.0.16
@@ -115,7 +109,6 @@ routepolicy@1.1.0
service-configuration@1.0.11
session@1.2.0
sha@1.0.9
-shell-server@0.4.0
socket-stream-client@0.2.2
softwarerero:accounts-t9n@1.3.11
spacebars@1.0.15
diff --git a/README.md b/README.md
index 6d2f85f..525d0f5 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,22 @@
-# Petit Teton Data Management Application (PTApp)
+# Current Configuration
+
+See below for initial setup and updating instructions.
+
+Currently we have three servers in two locations. Media and FS2 are computers residing on the 18501 property (big barn back top room, and Wynne/Sarah house), and FS1 is a computer residing in SF. All three are accessible via Putty (a windows SSH client - any SSH client will work) via the IP's 192.168.3.101 (Media), 192.168.2.239 (FS1), and 192.168.3.164 (FS2). Note that FS1 is in SF, but is accessible via the LAN because we have a VPN setup between our routers (192.168.3.1, and 192.168.2.1). The VPN makes them look like they are on the same network.
+
+If you SSH (Putty) into each server you can update the server using APT (`sudo apt update`, followed by `update apt upgrade`), reboot `sudo shutdown -r now`, and perform other maintenance routines.
+
+**Currently** Media is the primary server for the PTApp (the Meteor Petit Teton Webapp - versus the Petit Teton web site which is a customer focused informational web site). FS2 is the primary server for all other web sites and web apps and it clones its SSL certifications and www folders to the other two machines. Ultimately the PTApp will need to also be on FS2 primarily along with SSL certificates and an Nginx configuration that only allows certain access outside our LAN (for sales interaction at markets and Cam's home access). The database (MongoDB) is installed on all three machines, forming a cluster such that data written to any of the three is propagated to the other two automatically.
+
+Database backups are not trivial due to the cluster system. Essentially we are doing a simple backup/restore and ignoring the possibility that the database we take from might not have all the latest updates. Doing this on our primary server (FS2) helps ensure that we don't have any problems. MongoDB being a very flexible database and our app not caring too much about data integrity helps as well.
+
+TODO: Linux update procedure.
+
+TODO: Backup procedure.
+
+TODO: Mongo update procedure.
+
+# Setup Petit Teton Data Management Application (PTApp)
This application is designed to track sales and production data.
@@ -27,21 +45,22 @@ Package this application by running 'npm run build' from the command line in the
4. Modify the system to always start Mongod: `sudo systemctl enable mongod`
10. Run tools: (see [descriptions](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/#packages))
- mongod (the mongo database server)
- - mongo (command line shell for interacting with a running db)
- - mongoimport (imports data from: Extended JSON, CSV, or TSV formats created by mongoexport or 3rd party tools)
- - bsondump (converts bson file formats [binary] into human readable formats [JSON] - use with mongodump files)
- - mongodump (produces binary output for backups - not for use with shared clusters and replica sets)
- - mongoexport (produces JSON or CSV data)
- - mongofiles (command line gridfs integration - for manipulating files)
- - mongooplog (replication & polling - ?)
- - mongoperf
- - mongorestore
- - mongostat
- - mongotop (stats)
+ - mongo (command line shell for interacting with a running db)
+ - mongoimport (imports data from: Extended JSON, CSV, or TSV formats created by mongoexport or 3rd party tools)
+ - bsondump (converts bson file formats [binary] into human readable formats [JSON] - use with mongodump files)
+ - mongodump (produces binary output for backups - not for use with shared clusters and replica sets)
+ - mongoexport (produces JSON or CSV data)
+ - mongofiles (command line gridfs integration - for manipulating files)
+ - mongooplog (replication & polling - ?)
+ - mongoperf
+ - mongorestore
+ - mongostat
+ - mongotop (stats)
11. Install nodejs & npm
1. `sudo apt-get install nodejs`
2. `sudo apt-get install npm`
12. Install n
+
1. `sudo npm install -g n`
13. Update nodejs to 4.7.0 (for use with meteor 1.4 - may be another nodejs version for newer meteor versions): `n bin 4.7.0` (may need to first download 4.7.0 - see other docs on linux & nodejs)
1. `sudo n 4.7.0`
@@ -93,11 +112,12 @@ Package this application by running 'npm run build' from the command line in the
NOTE: Use MongoBooster on a windows development machine to connect to the dev database (localhost:3001) and to export.
-#Updating a Meteor Deployment
+# Updating a Meteor Deployment (OLD)
+
1. Run the NPM script for building the app. This can be done either from Webstorm by viewing the NPM display (shows a list of scripts in the package.json file), or typing `npm run build` from the command line. Alternatively you can simply type the build command in the command line: `meteor build --server-only ../` to build it. The command should exit with code zero for success.
2. Find the archive file: it should be in the parent directory if you ran the above script exactly, otherwise it is where ever you specified (path at the end of the command). It should be called "PetitTetonMeteor.tar.gz" as of the writing of this documentation.
-3. Copy the archive to the server. Use what ever tools you want for this, samba and drag and drop works great. Otherwise sftp, or other method also works.
-4. Navigate to /var/www/PTApp (or what ever the folder is).
+3. Copy the archive to the server (**currently** Media/www/PTApp). Use what ever tools you want for this, samba and drag and drop works great. Otherwise sftp, or other method also works.
+4. Navigate to /var/www/PTApp (or what ever the folder is). `cd /var/www/PTApp`
5. Use `sudo tar -xvzf PetitTetonMeteor.tar.gz` to unpack it.
6. Delete the archive (optional): `sudo rm PetitTetonMeteor.tar.gz`
7. Modify the owner of the app: `sudo chown -R www-data bundle` Run this from inside the project directory /var/www/PTApp.
@@ -105,23 +125,27 @@ NOTE: Use MongoBooster on a windows development machine to connect to the dev da
9. Optional: Run NPM's install to update the dependancies (if they changed): `cd /var/www/PTApp/bundle/programs/server && npm install && cd /var/www/PTApp`
10. Restart the meteor app: `sudo passenger-config restart-app /var/www/PTApp`
-# Updating a Meteor Deployment #2
+# Updating a Meteor Deployment (NEW)
1. Run the NPM script for building the app `npm run build` which will package the app for the selected platform (in the package.json definition for the build script). Can double click the build script in WebStorm's UI for NPM alternatively. Can also manually run the script: `npm install --product && meteor build --architecture os.linux.x86_64 --server-only ../`. This will generate an archive file for the project that is production ready.
-2. Copy the archive to the deployment server. Can use Samba for this. I place it in the web folder for the app.
+2. Copy the archive to the deployment server (**currently** Media/www/PTApp). Can use Samba for this. I place it in the web folder for the app.
3. Run the deploy.sh script `sudo ./deploy.sh` which exists in the web directory for the app: `/var/www/PTApp`. This will unpack the archive, remove the archive, change file permissions, run NPM's install on the app, and restart the app in Phusion Passenger.
4. Look at the debug output by viewing the html files stored in `/tmp`. Use Samba to view them remotely.
5. Look at the Nginx logs (should be the same as the stuff in /tmp).
# Updating a Meteor Deployment *with* a NodeJS and Meteor version change.
+Check which version of meteor you have on the development machine (meteor is not installed ever on the production machine). If the version has changed, it may require a newer version of NodeJS. You have to read the Meteor notes for your version (or older versions) to figure out which NodeJS is required.
+
1. Update the meteor app as normal (copy it to the /var/www/xxx directory as a build bundle, then run the script to unpack it).
2. Run `sudo n` to get the current version of NodeJS being used. Use `sudo n x.x.x` to download and change to the new version of NodeJS.
3. Edit the app's nginx file in /etc/nginx/sites-available/ to reference the new NodeJS install location. For example my current install location is specified as `server {... passenger_nodejs /usr/local/n/versions/node/8.9.3/bin/node ...}`}
+## Running Server Side Code
-#Running Server Side Code
This is useful for importing data or running scripts that might perform some one time task.
+
1. Open a console and enter the server shell for meteor.
-#Server Error Handling
+## Server Error Handling
+
Errors are generated in meteor, but handled by passenger. Passenger will log the error on the client screen with a code, and will log the same message in the nginx error logs. The error will be findable in the tmp folder as an html file starting with passenger and ending with the code. This is the place to look for the real error output.
\ No newline at end of file
diff --git a/client/client.js b/client/client.js
index b6c437b..5f413b9 100644
--- a/client/client.js
+++ b/client/client.js
@@ -14,6 +14,7 @@ import '/imports/util/resize/ResizeSensor.js';
import '/imports/util/resize/ElementQueries.js';
import '/imports/ui/layouts/Body.js';
import '/imports/ui/layouts/Login.js';
+import '/imports/ui/layouts/Empty.js';
import '/imports/ui/accounts/accounts.js';
import '/imports/util/select2/select2.css';
import '/imports/util/select2/select2.full.js';
diff --git a/client/head.html b/client/head.html
index cc91107..18e3b3f 100644
--- a/client/head.html
+++ b/client/head.html
@@ -1,5 +1,6 @@