Closed ericfranz closed 4 years ago
Should this be baked into ood_appkit
or into just the system apps? Not sure if injecting messages into apps without the app owner's knowledge is a good thing. Maybe if it is something they can opt-into?
Also, this won't affect the Node.js apps.
Opt in.
Could use a simple yaml file announcement.yml somewhere:
---
severity: warning
content: On Dec 12, we will have a downtime and apps will be unavailable.
/etc/ood/config/announcement.yml
?
or could be /etc/ood/config/motd
that is distinct from /etc/motd
Definitely use a format and specify it with the extension. So at least *.yml
.
motd.yml
makes me think the message will be there every dayannouncement.yml
I am fine withflash.yml
as well as it reminds me of the Rails flash messagenotice.yml
or notices.yml
I'll keep this open. A solution here could be used by the dashboard to replace the changes done in https://github.com/OSC/ood-dashboard/pull/114
http://bundler.io/v1.3/man/bundle-exec.1.html#Shelling-out
Any subshells created inside the block will be given the environment present before Bundler was activated.
We currently use Bundler.with_clean_env
to initialize the database of an app AND to run rake tasks from the Developer web views on the dashboard.
As soon as we start setting many of these variables prior to the Passenger starting, we will no longer be able to just use Bundler.with_clean_env
. Any solution to https://github.com/OSC/ood-dashboard/issues/127 will need to be readdressed.
We can probably provide a helper to get the announcement content and add a template to render.
One option is to make use of the existing markdown template handler:
<%# partial announcement %>
<% if announcement_file.file? %>
<div class="alert alert-warning" role="alert">
<%= render file: announcement_file.to_s %>
</div>
<% end %>
OOD_ANNOUNCEMENT_PATH
could be relative to app root instead, and render :file
expects an absolute path; so the helper announcement_file
would need to have the proper absolute pathThe point is it should be a single partial or helper that one can call to put the announcement alert in the layout. Then a developer can use this or not.
Dashboard has this right now. If we want to make that a feature for other custom apps we can address at a later date.
Using an environment variable or an initializer or config, specify an array of paths to look for "persistent site-wide announcement". Two locations could include a location that is shared between all apps and a location that is specific to this app.
The idea is if you want to display a message to all users across all apps, about a impending downtime, for example, you could create a file in one location and it will display across all apps.
Or, you could target a specific app with a message, such as warning users that an app is going to be replaced by another app (job constructor 1 with job constructor 2).