Kodi Community Forum
Maraschino (formerly HTPC Frontend) - a summary web interface for your XBMC HTPC - Printable Version

+- Kodi Community Forum (http://forum.kodi.tv)
+-- Forum: Help and Support (/forumdisplay.php?fid=33)
+--- Forum: Supplementary Tools for Kodi (/forumdisplay.php?fid=116)
+--- Thread: Maraschino (formerly HTPC Frontend) - a summary web interface for your XBMC HTPC (/showthread.php?tid=113136)



- mrkipling - 2011-11-06 12:25

_Mikie_ Wrote:Why did MFP fall away? It was a nightmare to debug and install. But yeah go ahead I don't mind.

I'm not trying to be an MFP replacement - this is just a personal project of mine that I've been working on in my spare time. In the spirit of sharing I posted it here in case anybody found it useful. You're welcome to use it - or not - entirely up to you. Wink

I still maintain - as I have all along - that as of right now, if you don't know how to configure a web server then this project is probably not for you and will just lead to frustration (although it could serve as a good excuse to become familiar with web servers if you're that way inclined).

I only started development on it two weeks ago, so it's still very early days. Perhaps check back in a couple of months when there's some better documentation and I've finished the in-app configuration stuff, it should be easier to set up then.


- HarryRosen - 2011-11-06 16:02

TV show listing is now working with the latest git pull

but I lost my little icons under the applications, it seems the code that dejavu added to show them it's not working anymore

also it seems my now playing and trak.tv doesn't work in internet explorer only firefox


- mrkipling - 2011-11-06 17:20

HarryRosen Wrote:TV show listing is now working with the latest git pull

but I lost my little icons under the applications, it seems the code that dejavu added to show them it's not working anymore

also it seems my now playing and trak.tv doesn't work in internet explorer only firefox

That's right - if you pull from the git repository then any changes that you make to the code yourself will be lost. You could try "git stash" before pulling, and then "git stash pop" after - this will only work if I haven't changed the same bits of code as you, though.

The best way of adding things like the custom icons to the "official" repository is for people to fork, commit and issue a pull request on GitHub. Any nice little touches like that are likely to be accepted as it's one less thing for me to do.

Internet Explorer is not supported at this time and probably won't be for a while, if at all. Currently I can only support modern browsers like Chrome, Firefox and Opera, as Internet Explorer is so far behind in terms of features.


- DejaVu - 2011-11-06 19:10

I shall put in a pull request for it. Wink

EDIT
Done.
But I think lots of things are going to change shortly and might be pretty pointless now. Smile


- percula - 2011-11-06 21:33

mrkipling Wrote:I still maintain - as I have all along - that as of right now, if you don't know how to configure a web server then this project is probably not for you and will just lead to frustration (although it could serve as a good excuse to become familiar with web servers if you're that way inclined).

First let me say thanks, and rather you like it or not, this is the likely replacement for MFP, sometimes we seek fame and sometimes fame finds us.

While setting up and maintaining Linux webservers is not my primary job role, I have been doing it for years non the less. I am not a guru on the systems/Linux side but I am well beyond a n00b phase too. And I can't get this running on Ubuntu and Apache. Frankly I am not alone in this, not being a n00b and not being able to getting this running under Ubuntu + Apache.

Frankly I suspect it is some thing to do with Ubuntu and defaults that ultimately is buggering things up. I have not played with it on other distros, but I suspect that the vast majority of those working under Apache are not on a Ubuntu distro and the vast majority of those failing are on a Ubuntu build.

Since you do not want to do docs right now, and I am sure the community is more than willing to help, would you at least post the spec's on your dev environment? Things like kernel version, Apache version, python/flask version, etc? Maybe we can figure this out with a little more information and a little less attitude.


- percula - 2011-11-06 21:56

Something I really like(ed) about MFP was having all of my XBMC and media related items in one tab. I really don't know how you would make something like that work with the sweet AJAX interface you have going now, but it would be great if there was some way to display the other web apps/sites in a iFrame or something so we can control tab sprawl and/or having to "back, back, back" to get too Maraschino again.

Sweet project, keep up the good work!


- mrkipling - 2011-11-06 22:00

percula Wrote:First let me say thanks, and rather you like it or not, this is the likely replacement for MFP, sometimes we seek fame and sometimes fame finds us.

That's nice and all, but I'm doing this in my spare time because I enjoy it, and comments like these:

percula Wrote:Maybe we can figure this out with a little more information and a little less attitude.

...make it not so fun any more. I have to go to work tomorrow, I don't have time to write in-depth documentation.

The amount of entitlement that some people are exhibiting (and I'm not directing this towards you personally) is a bit shocking, to be honest.

But anyway...

percula Wrote:Since you do not want to do docs right now, and I am sure the community is more than willing to help, would you at least post the spec's on your dev environment? Things like kernel version, Apache version, python/flask version, etc?

Of course. I'm serving this on:

Ubuntu 10.10
2.6.35-30-generic
SMP Tue Oct 11 17:52:57 UTC 2011

Apache/2.2.16 (Ubuntu)

Python 2.6.6 (r266:84292, Sep 15 2010, 16:22:56)

Flask 0.8


- Shaolin - 2011-11-06 22:46

mrkipling Wrote:That's nice and all, but I'm doing this in my spare time because I enjoy it, and comments like these:
percula Wrote:Maybe we can figure this out with a little more information and a little less attitude.
mrkipling Wrote:...make it not so fun any more.

The amount of entitlement that some people are exhibiting (and I'm not directing this towards you personally) is a bit shocking, to be honest.

I honestly think that percula was referring to this infantile comment:

_Mikie_ Wrote:Why does everyone insist on making stuff a nightmare for the end user?? The reason installers are around is because it means everything can be packaged together and you can go from nothing to everything within minutes. Nobody wants to be fiddling for hours just to get something to work. All the projects that succeed are easy to install.

and not acting like one of the entitled to which you so accurately refer. Or at least that's the way i read his post; maybe i'm wrong though. Anwyay, keep up the good work, not everyone has an air of entitlement; most people are just grateful for all the freebies which are willingly offered in such opensource communities.


- percula - 2011-11-06 22:50

mrkipling Wrote:That's nice and all, but I'm doing this in my spare time because I enjoy it, and comments like these:



...make it not so fun any more. I have to go to work tomorrow, I don't have time to write in-depth documentation.

The amount of entitlement that some people are exhibiting (and I'm not directing this towards you personally) is a bit shocking, to be honest.

I am sorry to offend, but your attitude that if you can't get this running you are too dumb to use this is offensive too. That being said, I understand where you are coming from, this is a personal project that you are doing for you and you decided to share and are taking crap because of it.

Please take it context, its really a compliment. People love, and I mean LOVE your work and they desperately want to run it. So when they follow directions to the letter and it fails, they feel cheated, then to have someone say more or less that if you can't get this running, there is something wrong with you, it gets emotional.

So away lets let the emotional side drop, you have a great project that the XBMC community can really benefit from, we all just need to pull together and figure it out, after all that is what community is all about right.

mrkipling Wrote:Of course. I'm serving this on:

Ubuntu 10.10
2.6.35-30-generic
SMP Tue Oct 11 17:52:57 UTC 2011

Apache/2.2.16 (Ubuntu)

Python 2.6.6 (r266:84292, Sep 15 2010, 16:22:56)

Flask 0.8

Irony is just too much, LMAO!

So for grins I setup a CentOS 6.0 VM with current updates applied and I setup Maraschino and wham works like a charm. I will produce detailed "how to" docs for CentOS 6 today and post in this thread for anyone wanting to go that route.

I am down'ing the current Ubuntu desktop 64bit ISO (11.10) now and will setup a VM with it and try to get Maraschino working in it too and produce detailed "how to" docs for Ubuntu 11.10 too assuming I can get it working too.

For comparison my XBMC box that will not run Maraschino via Apache...

Ubuntu 10.04 with kernel 2.6.32-21 generic
Python 2.6.5
Mod_WSGI 3.3 (complied locally)
Apache 2.2.14 (Ubuntu)
Flask 0.8-py2.6.egg


- mrkipling - 2011-11-06 23:55

mrkipling Wrote:The best way of adding things like the custom icons to the "official" repository is...

FYI, I've just merged in DejaVu's pull request which adds the ability to define icons in your settings.py file. Thanks for that, DejaVu!

So if you wanted to add an icon then an example entry in settings.py would look like this:

Code:
APPLICATIONS = [
    {
        'name': 'XBMC',
        'url': 'http://whatever:8080/',
        'description': 'Media library',
        'image':'/static/images/applications/XBMC.png',
    },
]

Just a head-up though - once I've finished the in-app-config stuff, the only entry in settings.py is going to be the location of your sqlite database as all settings are going to be editable from within the application interface itself and stored in a (very small) database. This will be easier than editing a Python file to customise your installation. It's about 75% done, just need to re-work the applications module and then it can be released.

Definitely going to be keeping application icons though; these will also be definable from within the app.


CentOS 6 "How To" - percula - 2011-11-07 00:58

Maraschino “how to” for CentOS 6

Prerequisites

  • Apache
  • Python
  • mod_WSGI
  • Python Setup Tools
  • Git
  • Flask
  • jsonrpclib
  • Admin tool for SELinux
  • A working install of pre-Eden XBMC either on the CentOS install or on another computer

Get up to date before starting

Open a terminal session and SU

Code:
[xbmc-user@localhost Desktop]$ su
Password:
[root@localhost Desktop]# yum update

After the update is complete reboot the system.

Code:
[root@localhost Desktop]# reboot

Install the prerequisites

Open a terminal and SU to root.

Code:
[xbmc-user@localhost Desktop]$ su
Password:
[root@localhost Desktop]# yum install httpd mod_wsgi python python-setuptools git policycoreutils-gui
[root@localhost Desktop]# easy_install Flask
[root@localhost Desktop]# easy_install jsonrpclib

Get Maraschino

http://www.maraschinoproject.com/
Open a terminal and SU to root and clone Maraschino to your www directories.

Code:
[xbmc-user@localhost Desktop]$ su
Password:
[root@localhost Desktop]# git clone https://github.com/mrkipling/maraschino /var/www/html/maraschino

Lets get ownership right and set SElinux to permissive.

Code:
[root@localhost Desktop]# chown -R apache.apache  /var/www/html/maraschino
[root@localhost Desktop]# system-config-selinux

Set SELinux to “permissive” in the GUI that will start

Get it configured

Use your favorite text editor to make the settings.py file per the directions at http://www.maraschinoproject.com/

Now we need to create the WSGI file, I am using gedit in the example.

Code:
[root@localhost Desktop]# gedit  /var/www/html/maraschino/maraschino.wsgi

Here is my maraschino.wsgi file

Code:
import sys
sys.path.insert(0, "/var/www/html/maraschino")
from htpcfrontend import app as application
Note currently the main Python file is still called by the old project name htpcfrontend.py this is likely to change at some point to maraschino.py

Now lets setup Apache

Code:
[root@localhost Desktop]# gedit  /etc/httpd/conf.d/maraschino.conf

Here is my maraschino.conf file
Note I have a local account and group called “xbmc-user” that I created during the CentOS install. So below use your regular username/groupname in the .conf file

Code:
<VirtualHost *>
    WSGIDaemonProcess maraschino user=xbmc-user group=xbmc-user threads=5
    WSGIScriptAlias / /var/www/html/maraschino/maraschino.wsgi

    <Directory /var/www/html/maraschino>
        WSGIProcessGroup maraschino
        WSGIApplicationGroup %{GLOBAL}
        Order deny,allow
        Allow from all
    </Directory>
</VirtualHost>

Set Apache to start at boot and start Apache

Code:
[root@localhost Desktop]# chkconfig httpd on
[root@localhost Desktop]#service httpd start

Everything is setup time to test it out.

Open a web browser and point it to http://your_centos6_IP_address/

Trouble Shooting

The Apache logs are your friend, use them. I like to “tail” then so I can see real time what is happening.

Open a terminal and tail the Apache error log

Code:
[xbmc-user@localhost Desktop]$ su
Password:
[root@localhost Desktop]# tail -f /var/log/httpd/error_log

Open another terminal and restart Apache and look for errors.

Code:
[xbmc-user@localhost Desktop]$ su
Password:
[root@localhost Desktop]#service httpd restart

Access the site with your browser and look for errors.

More times than not you missed spelled something in either the /var/www/html/maraschino/maraschino.wsgi file or the /etc/httpd/conf.d/maraschino.conf file or have something a miss in the settings.py file.

As of the writting of this “how to” the main Python script is still named htpcfrontend.py this is likely to change to maraschino.py at some point.


- mrkipling - 2011-11-07 01:20

percula Wrote:...a whole bunch of setup instructions...

...Nice work! Thanks for taking the time to write this, I'm sure that it will help a lot of people. I'll update the website with a link to this post as a short-term measure.

Long-term, if you don't mind, I'll put it on the website (and give you credit of course) after a few modifications, as a few things are going to be changing. For example, the way that settings.py works, a new dependency (Flask-SQLAlchemy), and as speculated I'm going to be renaming htpcfrontend.py to maraschino.py.


- percula - 2011-11-07 01:35

mrkipling Wrote:...Nice work! Thanks for taking the time to write this, I'm sure that it will help a lot of people. I'll update the website with a link to this post as a short-term measure.

Long-term, if you don't mind, I'll put it on the website (and give you credit of course) after a few modifications, as a few things are going to be changing. For example, the way that settings.py works, a new dependency (Flask-SQLAlchemy), and as speculated I'm going to be renaming htpcfrontend.py to maraschino.py.

I don't need credit, it belongs to the community now, run with it, change as needed.

I will work on the Ubuntu in a bit, got to get some grocery shopping done first.


Ubuntu 11.10 "How To" guide - percula - 2011-11-07 04:25

This "how to" guide is specifically for Ubuntu 11.10, however it may work for other versions too.

Let me add that my current XBMC box is Ubuntu 10.04, I followed the guide as below to install Maraschino on it, only to see failures. After much messing around , trail and error I found that on 10.04 Apparmor was hosing Maraschino. Specifically it was preventing Apache from creating the sock file for WSGI applications.

Since my XBMC box is not on a public network, and my cats haven't quite figured out how to hack it, I just removed Apparmor and life is good.

Code:
xbmc-user@ubuntu:~$ sudo apt-get remove apparmor

Maraschino “how to” for Ubuntu 11.10


Prerequisites
  • Apache
  • Python
  • mod_WSGI
  • Python Setup Tools
  • Git
  • Flask
  • jsonrpclib
  • A working install of pre-Eden XBMC either on the Ubuntu install or on another computer

Get up to date before starting

Open a terminal session or use the update-manager and get your system up to date before proceeding.

Code:
xbmc-user@ubuntu:~$ sudo apt-get update

After the update is complete reboot the system.

Install the prerequisites

Code:
xbmc-user@ubuntu:~$ sudo apt-get install apache2 libapache2-mod-wsgi python python-setuptools git
xbmc-user@ubuntu:~$ sudo easy_install Flask
xbmc-user@ubuntu:~$ sudo easy_install jsonrpclib

Get Maraschino

http://www.maraschinoproject.com/
Open a terminal and clone Maraschino to your www directories.

Code:
xbmc-user@ubuntu:~$ sudo git clone https://github.com/mrkipling/maraschino /var/www/maraschino

Lets get ownership right.

Code:
xbmc-user@ubuntu:~$ sudo chown -R www-data /var/www/

Get it configured

Use your favorite text editor to make the settings.py file per the directions at http://www.maraschinoproject.com/

Now we need to create the WSGI file, I am using gedit in the example.

Code:
xbmc-user@ubuntu:~$ sudo gedit  /var/www/maraschino/maraschino.wsgi

Here is my maraschino.wsgi file

Code:
import sys
sys.path.insert(0, "/var/www/maraschino")
from htpcfrontend import app as application
Note currently the main Python file is still called by the old project name htpcfrontend.py this is likely to change at some point to maraschino.py

Now lets setup Apache

We will be replacing the default Apache site with the maraschino site.

Code:
xbmc-user@ubuntu:~$ sudo gedit /etc/apache2/sites-available/default

Here is my default file, note that I replaced the existing config with mine.
Note I have a local account and group called “xbmc-user” that I created during the Ubuntu install. So below use your regular username/groupname in the default file

Code:
<VirtualHost *>
    WSGIDaemonProcess maraschino user=xbmc-user group=xbmc-user threads=5
    WSGIScriptAlias / /var/www/maraschino/maraschino.wsgi

    <Directory /var/www/maraschino>
        WSGIProcessGroup maraschino
        WSGIApplicationGroup %{GLOBAL}
        Order deny,allow
        Allow from all
    </Directory>
</VirtualHost>

Start Apache

Code:
xbmc-user@ubuntu:~$ sudo apache2ctl start

Everything is setup time to test it out.

Open a web browser and point it to http://your_ubuntu_IP_address/

Trouble Shooting

The Apache logs are your friend, use them. I like to “tail” then so I can see real time what is happening.

Open a terminal and tail the Apache error log

Code:
xbmc-user@ubuntu:~$ sudo tail -f /var/log/apache/error.log

Open another terminal and restart Apache and look for errors.

Code:
xbmc-user@ubuntu:~$ sudo apache2ctl restart

Access the site with your browser and look for errors.

More times than not you missed spelled something in either the /var/www/maraschino/maraschino.wsgi file or the /etc/apache2/sites-available/default file.

As of the writting of this “how to” the main Python script is still named htpcfrontend.py this is likely to change to maraschino.py at some point.


- shadower - 2011-11-07 06:52

Just tried this and it works a treat on Ubuntu 10.04 running XBMCLive, it ignores the port defined in the settings.py file though. Not that this is an issue as im happy to use port 80, as its a local machine only Smile

percula Wrote:Start Apache

Code:
xbmc-user@ubuntu:~$ sudo apachectl start

Just one thing is for the above command you will need to alter it as per below for Ubuntu 10.04:

Code:
sudo apache2ctl restart

Thanks for your guide percula, I think the major difference to previous attempts was the below command:

Code:
sudo chown -R www-data /var/www/

This seemed to be missing command.

Also big thanks to mrkipling, this is a great project. I'm eagerly awaiting your next update.