From 1bae196f835309b72abe5cfc60434c68741a4c5c Mon Sep 17 00:00:00 2001 From: Jeff Davis Date: Wed, 30 Sep 2015 14:44:19 -0700 Subject: [PATCH] Flesh out install instructions Thanks to Michael Peters for testing and providing README revisions! Signed-off-by: Jeff Davis --- README.txt | 110 +++++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 67 insertions(+), 43 deletions(-) diff --git a/README.txt b/README.txt index b2c7ef8..0541065 100644 --- a/README.txt +++ b/README.txt @@ -9,7 +9,7 @@ development machine before executable code can be deployed on a production server. -A. Prerequisites, development machine +A. Prerequisites 1. Install nodejs.org @@ -18,9 +18,41 @@ A. Prerequisites, development machine # sudo npm install --global requirejs -B. Production Deployment +B. Compiling and Production Deployment + +1. Configure od_config.coffee to match your production +values. + +#cp src/od_config_template.coffee src/od_config.coffee +#vi src/od_config.coffee + +Map the full org unit name for each branch (as displayed in the Home +Library field of the Account Preferences tab in My Account in the OPAC) +to its corresponding Overdrive authorization name (provided by +Overdrive). + +Follow the comments in the file to create your oAuth credential in +Base64 format. + +Add your account and website ID values as described here: +https://developer.overdrive.com/apis/patron-auth + +Indicate whether a user password is required for Overdrive +authentication (this depends on how your Overdrive account is +configured). The no_password array should contain a comma-separated +list of the full long name of each library that does not require +passwords. Alternatively, you can modify the password_required block to +always return true (if all your libraries require a password for +Overdrive) or false (if none require a password). + +Edit the value for baseURL. This is your specific +*.lib.overdrive.com/ContentDetails.htm URL. Overdrive can assist with +finding this if you do not know it. + +Define productbaseURLs. This is the FQDN for your library specific URLs +for Overdrive products (i.e. the domain name used in your links to +Overdrive titles in MARC 856 tags). -1. Put yourself at top-level project directory. 2. Compile source files from Coffeescript to Javascript @@ -30,27 +62,40 @@ B. Production Deployment (short form) # coffee -cb -o app src -3. Minify Javascript files + +3. Minify Javascript files (optional, but recommended) # r.js -o build.js -4. Deploy minified files to production server -# rsync -e 'ssh -l sitkastaff' -azv build/overdrive.js servername.domainname:/var/tmp +4. Deploy files to production server + +If you minified the files: +# cp build/overdrive.js /openils/var/web/js/ui/default/opac + +If you did not minify the files: +# cp app/* /openils/var/web/js/ui/default/opac + + +C. Configuration of the TPAC template files -On production server: -# sudo chown opensrf:opensrf /var/tmp/overdrive.js -# sudo mv /var/tmp/overdrive.js /srv/openils/var/web/js/ui/default/opac +Merge the following commits from Sitka into your local Evergreen git repo. +The best method for this is to add Sitka as a remote, and cherry-pick from it. +You could also attempt to patch by hand, but this is prone to more errors. +# git remote add sitka git://git.sitka.bclibraries.ca/sitka/evergreen.git +# git fetch sitka -C. Configuration of Web Service +http://git.sitka.bclibraries.ca/gitweb/?p=sitka/evergreen.git;a=commit;h=f8d5d13 +http://git.sitka.bclibraries.ca/gitweb/?p=sitka/evergreen.git;a=commit;h=b4e4270 +http://git.sitka.bclibraries.ca/gitweb/?p=sitka/evergreen.git;a=commit;h=2ba716b +http://git.sitka.bclibraries.ca/gitweb/?p=sitka/evergreen.git;a=commit;h=946333b +http://git.sitka.bclibraries.ca/gitweb/?p=sitka/evergreen.git;a=commit;h=4ab3d89 -1. Add the following script tag to /srv/openils/var/templates/opac/parts/js.tt2. +(TODO: Make these changes available in a branch in the working repo.) - -2. Define the file /etc/apache2/mods-available/proxy_http.conf, with the +D. Enabling the mod_proxy_http module for Apache + +1. Create the file /etc/apache2/mods-available/proxy_http.conf, with the following contents. @@ -69,12 +114,13 @@ following contents. ProxyPassReverse /od/fulfill http://fulfill.contentreserve.com -3. Ensure that the proxy_http module is enabled. -# cat /etc/apache2/mods-available/proxy_http.load -> LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so +2. Ensure that the proxy_http module is enabled. + +# sudo a2enmod proxy_http.load + -4. Gracefully restart the Apache web service. +3. Gracefully restart the Apache web service. # sudo service apache2 graceful @@ -96,27 +142,5 @@ moment.min.js jquery-ui.min.js jquery-ui.min.css +(You will see additional files if you did not minify JS.) -E. Development Cycle - -During development, you will cycle between compiling source files, deploying -unminified files, and testing. - -- Run the compiler in watch mode and as a background process. - -# coffee -cbw -o app src & - -- Edit a file. It will be compiled automatically via the background process. - -- Deploy unminified files in app directory to the test server. (A convenient - way is to upload the files to /var/tmp/od/ and to symbolically link each file - to the target directory, /srv/openils/var/web/js/ui/default/opac.) - -# rsync -e 'ssh -l sitkastaff' -azv app/ servername.domainname:/var/tmp/od - - On servername.domainname machine, repeat for each js files: - -# sudo ln -s /var/tmp/od/overdrive.js /srv/openils/var/web/js/ui/default/opac - -- Reload your browser, https://libraryname.servername.domainname, to run the - modified files. Ensure that the browser's cache is disabled. -- 2.11.0