Skip to content

Adding a service

Peter Kwan edited this page May 30, 2025 · 12 revisions

Adding a service

TODO! Rewrite all of this! Services are now declared in config.js and constants.js. The pages are updated using update-service-pages.js. All other setup and management is done automatically.

Making an editable Muttlee service

Muttlee uses git repositories for editable services. You need to use an ssh based repo in order to write changes. In the case of github this means that you need to supply your public key to the github repo and have the matching private key on your Muttlee server. As the automatic merge process might cause conflicts and we don't want to end up with multiple branches we need to issue a command to make sure that everything merges without causing errors.

git config pull.rebase false

Example: Artfax editable service

The repo URL is loaded into the artfax folder using

git@github.com:peterkvt80/service-artfax.git artfax

and this gets cloned into Muttlee at

/var/www/teletext-services/artfax

The pages are processed and copied over to their on-air location together with a manifest at

/var/www/private/onair/artfax

If Muttlee users change pages, then the updated pages are copied back from on-air to our repo clone and merged and pushed back to the repo. --//--

OLD NOTES:

A service is a collection of pages. The broad steps in making a new service is like this. These instructions assume that you have already got a working Muttlee installation complete with automatic updating.

  1. 1 Create a new project folder and add it to Subversion. One Subversion can run multiple services.
  2. 1 On your Raspberry Pi server adjust the scripts to sync up the new folder.
  3. 1 Add a special script to auto copy the pages to a Muttlee compatible format.

Adding service to Subversion

Create a new Subversion repository to hold the new service. It is possible to use an existing server and add a service that way. It goes something like this

sudo svnadmin create /home/pi/repos/digitiser2k

Also need to change ownership so that apache can mess with it

sudo chown -R www-data:www-data /home/pi/repos

Now you can check it out and start adding pages. [note to self: repos are on 192.168.1.13 along with news generating scripts]

Syncing pages to Muttlee

[note to self: Muttlee is on 192.168.1.22 but there is a sneaky redirect from 192.168.1.13] The automatic page updating is done by crontab (sudo crontab -e). In the /home/pi folder there is updatePages.sh which checks out the pages from SVN. onair.sh copies and renames the pages to a Muttlee friendly format.

Checkout the new service. If you have it /home/pi/getteletext is a good reference for how to check stuff out and this is how Teefax is checked out.

svn checkout http://teastop.plus.com/svn/teletext/ ~/teletext

We will make our own so we do this and watch the new pages come in

mkdir ~/digitiser2k
svn checkout http://teastop.plus.com/svn/digitiser2k/ ~/digitiser2k

And to get the pages to update automatically edit updatePages.sh and add the subversion update line

svn update /home/pi/digitiser2k

To get the pages adapted for Muttlee they are copied from the checked out page set to an on-air folder and are modified on the way using onair.sh.

Suppose that the destination folder is /var/www/d2k then copy the for loop code and change teletext to digitiser2k and onair to d2k

for file in $home/digitise2k/*.tti*
do
  mkdir -p /var/www/d2k
  page="$(grep -i PN, $file | sed 's/[PN],\([1-8][A-F a-f 0-9][A-F a-f 0-9]\)[0-9\r]*/\1/' | sed -n '1p' | tr 
'[:upper:]' '[:lower:]')"
  cat "$file" | sed 's/\x8d/\x1bM/' > /var/www/d2k/$page.tti
  echo "$file => $page.tti"
done

When you are done try out the script. You should see your pages going from digitiser2k into /var/www/d2k

sudo /home/pi/onair.sh

Clone this wiki locally