A simple Rails web app that uses https://ace.c9.io/ for editing files. It is meant to be used in conjunction with other Open OnDemand apps, so it provides a URL pattern for opening a file to edit that is exposed via https://github.com/osc/ood_appkit#file-editor-app. Thus, other Open OnDemand apps can easily provide an "open file for editing" link.
-
Start in the build directory for all sys apps, clone and check out the latest version of the editor app (make sure the app directory's name is
file-editor
):scl enable rh-git29 -- git clone https://github.com/OSC/ood-fileeditor.git file-editor cd file-editor scl enable rh-git29 -- git checkout tags/v1.3.3
-
Install the app for a production environment:
RAILS_ENV=production scl enable rh-git29 rh-ruby24 rh-nodejs6 -- bin/setup
-
Copy the built app directory to the deployment directory, and start the server. i.e.:
sudo mkdir -p /var/www/ood/apps/sys sudo cp -r . /var/www/ood/apps/sys/file-editor
-
Navigate to the app's build directory and check out the latest version:
cd file-editor # cd to build directory scl enable rh-git29 -- git fetch scl enable rh-git29 -- git checkout tags/v1.3.3
-
Update the app for a production environment:
RAILS_ENV=production scl enable rh-git29 rh-ruby24 rh-nodejs6 -- bin/setup
-
Copy the built app directory to the deployment directory:
sudo rsync -rlptv --delete . /var/www/ood/apps/sys/file-editor
- Access files via
APP_PATH
+/edit
+FILE_PATH
- Example
https://ondemand3.osc.edu/pun/sys/file-editor/edit/nfs/08/bmcmichael/Files/tire.k
- Example
The app provides a rudimentary file explorer in the case that a folder is accessed instead of a directory. If the path is readable to the user, it will be displayed when accessed.
- Access readable folder contents via
APP_PATH
+/edit
+FOLDER_PATH
- Example
https://ondemand3.osc.edu/pun/sys/file-editor/edit/nfs/08/bmcmichael/Files/
- Example
Bug reports and pull requests are welcome on GitHub at https://github.com/OSC/ood-fileeditor.
The gem is available as open source under the terms of the MIT License.