Author
Topic: News flash (Read 9075 times)

Maybe a nice feature would be that a LinuxMCE "administrator" could send a kind of news flash that's pushed to all LinuxMCE installation?

Today, when you log in with ssh, you see from time to time update messages. Mostly i do this, but i'm always afraid that i can/will break something with this. For examply the message "New release precise available". I've seen on this forum that this will break the system?! So luckly i've seen the message? But i think that not everyone is looking each time all posts on the forum.

So maybe it would be nice that we can see a message from 'linuxMCE' that this is a bad idea? This could also be used for mayor updates messages, new features...?

The message could/should appear when you login with ssh.And maybe also on the admin page, an orbiter... ?

#!/bin/sh -e## 95-lmce-dynamic-motd - display the motd message from LinuxMCE SVN# useful to advise against release upgrades## Based on the below:# 91-release-upgrade - display upgrade message or update the cache# in the background## Originally Copyright (C) 2010 Canonical Ltd.## Original Authors: Dustin Kirkland <kirkland@canonical.com># Authors: Steve Daniels <ste@stedaniels.co.uk>## This program is free software: you can redistribute it and/or modify# it under the terms of the GNU General Public License as published by# the Free Software Foundation, version 3 of the License.## This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the# GNU General Public License for more details.## You should have received a copy of the GNU General Public License# along with this program. If not, see <http://www.gnu.org/licenses/>.

You will want to send a message to the Orbiter Plugin, for Display Message. This will do what you want.

You can prototype the message using the web admin advanced>configure>devices, going to the orbiter plugin, selecting send command, and looking for the Display Message command. It will show you the messagesend command it constructs, as you build the message.

I'd imagine there would want to be some discussion over sending messages to the Orbiters and the web admin.

The web admin is easy, because it could just display a banner of some sort. But when you start to think of acknowledging it, setting a database flag perhaps? It starts to get more complicated. Same with MessageSend, you don't want the script running every time someone logs into SSH or every time the cron runs and MessageSend-ing to all the orbiters. There needs to be some kind of acknowledgement flagging. Then there's formatting for colours, font weight, etc. It'd need to be different for each output, console/web/Orbiter.

The script I've written specifically caters for the SSH MOTD. While it could be expanded, I'm more of a KISS kind of guy, that script in that location shouldn't be messing around with other things. It's purpose is just to generate and output an MOTD fragment.

For further discussion, the script looks at a fictional URL http://svn.linuxmce.org/svn/trunk/lmce-dynamic-motd there would need to be a policy governing it's content and update frequency. I pointed at SVN because it has a good audit trail, which I think is important if your going to be sending messages to so many systems. It also means we can use raw files and not have to set up a fancy administration system for the messages.

I don't see a problem with that. Any preferences on where you'd like the messages pulled from?

The way I see it is, you'd obviously not want to have messages being pulled into everyone's systems if you didn't have ultimate control of the source.

If the source was a file on SVN you'd have that control while being able to update it at will, but it would require giving me write access to a subset of SVN, a bit of .htaccess magic could easily restrict my access if you felt it necessary.

If the source was something like Twitter, it's not very secure from a multiple people being able to access it and change the password point of view.

I could probably enhance my bash, to pull the latest post from a specific topic on the forum.. though if you'd prefer it to pull the content from forum then it'd be easier to do in Perl.

It is not about *where* to pull stuff from, but to provide the source of information in a meaning full manor, i.e. YOU go around the places, and put everything news worthy together manually, and provide an rss feed of it, that everyone else can use. I was not referring to a programming task, but to a blogger task.

If this script goes out, it's in every new/upgraded LinuxMCE installation. This means whoever controls the source where the script gets it's updates from can send all manner of messages out to that entire user base. Although I deem myself a very trustworthy person, it would be foolish for the source not to be on a linuxmce.org controlled resource. Even if I'm the one compiling it and publishing it, it should be at a LinuxMCE resource.