Kodi Community Forum
MediaFrontPage - Web interface with widget type architecture to control multiple apps - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Supplementary Tools for Kodi (https://forum.kodi.tv/forumdisplay.php?fid=116)
+--- Thread: MediaFrontPage - Web interface with widget type architecture to control multiple apps (/showthread.php?tid=83304)



- guy_smiley:) - 2011-07-09

Argh, wrong github on Ubuntu. Changed to the proper MediaFrontPage and have edited my config.php. Now it won't let me get off the servercheck.php page :S


- guy_smiley:) - 2011-07-09

guy_smiley:) Wrote:Argh, wrong github on Ubuntu. Changed to the proper MediaFrontPage and have edited my config.php. Now it won't let me get off the servercheck.php page :S

I deleted the firstrun.php and it works... sort of. It loads the normal webpage but when loading wComingEpisodes.php it moves to this as a webpage and loads my router's login page. :S

EDIT: no it doesn't :S It now works but none of the widgets still load. ComingEpisodes is actally erroring out with a 404 Not Found.


- gugahoi - 2011-07-09

guy_smiley:) Wrote:I deleted the firstrun.php and it works... sort of. It loads the normal webpage but when loading wComingEpisodes.php it moves to this as a webpage and loads my router's login page. :S

EDIT: no it doesn't :S It now works but none of the widgets still load. ComingEpisodes is actally erroring out with a 404 Not Found.

I don't know if you actually read the contents of firstrun.php. You're not supposed to delete it urself. If it doesn't go past the servecheck page that means there's something wrong. Probably need to chmod the entire directory and files


- guy_smiley:) - 2011-07-09

gugahoi Wrote:I don't know if you actually read the contents of firstrun.php. You're not supposed to delete it urself. If it doesn't go past the servecheck page that means there's something wrong. Probably need to chmod the entire directory and files

I did read it, not supposed to delete. Everything was ticked on the servercheck though :S I believe it's an issue with my router (as I have remote management enabled, I will turn it off, otherwise when I log in, it won't change to that screen.)

Still have no idea about the widgets Sad


- gugahoi - 2011-07-09

guy_smiley:) Wrote:I did read it, not supposed to delete. Everything was ticked on the servercheck though :S I believe it's an issue with my router (as I have remote management enabled, I will turn it off, otherwise when I log in, it won't change to that screen.)

Still have no idea about the widgets Sad

I don't understand how this has anything to do with firstrun not being deleted? Sounds like there is something wrong with your web server...


- guy_smiley:) - 2011-07-09

gugahoi Wrote:I don't understand how this has anything to do with firstrun not being deleted? Sounds like there is something wrong with your web server...

OK, I put the file back and it won't go past servercheck.php again.

This is my mfp.conf for Apache2 in ./sites-enabled

Code:
<VirtualHost *:80>

        SSLProxyEngine on
        ProxyRequests On
        ProxyPreserveHost Off
        ErrorLog logs/mfp_error_loag
        TransferLog logs/mfp_access_log
        DocumentRoot /var/www

        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order deny,allow
        </Directory>

        <Location /xbmc>
                order deny,allow
                ProxyPass http://10.1.1.3:8085
                ProxyPassReverse http://10.1.1.3:8085
        </Location>

        <Location /xbmc/jsonrpc>
                order deny,allow
                ProxyPass http://10.1.1.3:8085/jsonrpc
                ProxyPassReverse http://10.1.1.3:8085/jsonrpc
        </Location>

        <Location /sabnzbd>
                order deny,allow
                ProxyPass http://localhost:8080/sabnzbd
                ProxyPassReverse http://localhost:8080/sabnzbd
        </Location>

        <Location /tvshows>
                order deny,allow
                ProxyPass http://localhost:8081/tvshows
                ProxyPassReverse http://localhost:8081/tvshows
        </Location>

        <Location /movies>
               order deny,allow
                ProxyPass http://10.1.1.3:5000
                ProxyPassReverse http://10.1.1.3:5000
        </Location>

        <Location /headphones>
                order deny,allow
                ProxyPass http://10.1.1.3:8181
                ProxyPassReverse http://10.1.1.3:8181
        </Location>

        <Proxy *>
                Order deny,allow
                Allow from all
        </Proxy>

</VirtualHost>

I've done the a2enmod proxy, ssl etc as mentioned.


- guy_smiley:) - 2011-07-09

I finally did the right thing and checked the log file;

Code:
[Sat Jul 09 20:08:44 2011] [error] [client 192.148.117.104] PHP Notice:  Undefined index: REMOTE_HOST in /var/www/widgets/wSystem.php on line 67, referer: htt
p://myurl.dyndns.org/mediafrontpage.php
[Sat Jul 09 20:08:44 2011] [error] [client 192.148.117.104] PHP Notice:  Undefined variable: newlink in /var/www/widgets/wComingEpisodes.php on line 158, refe
rer: http://myurl.dyndns.org/mediafrontpage.php
[Sat Jul 09 20:08:44 2011] [error] [client 192.148.117.104] PHP Notice:  Undefined variable: newlink in /var/www/widgets/wComingEpisodes.php on line 158, refe
rer: http://myurl.dyndns.org/mediafrontpage.php
[Sat Jul 09 20:08:44 2011] [error] [client 192.148.117.104] PHP Warning:  Invalid argument supplied for foreach() in /var/www/widgets/libXBMCLibrary.php on li
ne 311, referer: http://myurl.dyndns.org/mediafrontpage.php
[Sat Jul 09 20:08:44 2011] [error] [client 192.148.117.104] File does not exist: /var/www/routine_data.js, referer: http://myurl.dyndns.org/widgets/wComin
gEpisodes.php?display=yes
[Sat Jul 09 20:08:44 2011] [error] [client 192.148.117.104] File does not exist: /var/www/msg.js, referer: http://myrul.dyndns.org/widgets/wComingEpisodes
.php?display=yes
[Sat Jul 09 20:08:44 2011] [error] [client 192.148.117.104] File does not exist: /var/www/widgets/util.js, referer: http://myurl.dyndns.org/widgets/wComin
gEpisodes.php?display=yes
[Sat Jul 09 20:08:45 2011] [error] [client 192.148.117.104] PHP Notice:  Undefined variable: newlink in /var/www/widgets/wComingEpisodes.php on line 158, refe
rer: http://myurl.dyndns.org/widgets/wComingEpisodes.php?display=yes
[Sat Jul 09 20:08:45 2011] [error] [client 192.148.117.104] PHP Notice:  Undefined variable: newlink in /var/www/widgets/wComingEpisodes.php on line 158, refe
rer: http://myurl.dyndns.org/widgets/wComingEpisodes.php?display=yes
[Sat Jul 09 20:08:45 2011] [error] [client 192.148.117.104] File does not exist: /var/www/routine_data.js, referer: http://myurl.dyndns.org/widgets/wComin
gEpisodes.php?display=yes
[Sat Jul 09 20:08:46 2011] [error] [client 192.148.117.104] PHP Notice:  Undefined variable: newlink in /var/www/widgets/wComingEpisodes.php on line 158, refe
rer: http://myurl.dyndns.org/widgets/wComingEpisodes.php?display=yes
[Sat Jul 09 20:08:46 2011] [error] [client 192.148.117.104] PHP Notice:  Undefined variable: newlink in /var/www/widgets/wComingEpisodes.php on line 158, refe
rer: http://myurl.dyndns.org/widgets/wComingEpisodes.php?display=yes
[Sat Jul 09 20:08:46 2011] [error] [client 192.148.117.104] File does not exist: /var/www/routine_data.js, referer: http://myurl.dyndns.org/widgets/wComin
gEpisodes.php?display=yes
[Sat Jul 09 20:08:47 2011] [error] [client 192.148.117.104] File does not exist: /var/www/bob_help.html, referer: http://myurl.dyndns.org/widgets/wComingE
pisodes.php?display=yes
[Sat Jul 09 20:08:47 2011] [error] [client 192.148.117.104] File does not exist: /var/www/widgets/hr.gif, referer: http://myurl.dyndns.org/widgets/wComing
Episodes.php?display=yes



- DejaVu - 2011-07-09

@guy_smileySmile
Could not get Reverse Proxy working on my setup properly either, so I gave up and cant really help I'm afraid.
I'm going to wait a while til we can come up with an easier way of doing it (if any). SleepyP & (updated by Gugahoi) shared further information for setting this up on Lighthouse. Have you taken a look on there?

@Gughoi
Loving your new Settings script. That is excellent work.

I know it's still WIP. But I just tried to integrate it into my Repo with the Nav Menu - skinning the Settings page was pretty easy, and everything seemed to work fine. The only thing I think it needs to do (if possible) is reload the page after Saving (perhaps a timeout of 5 seconds or a alert box that refreshes like mfpedit.php).

This would only be to reload the menu once the settings have been saved. Without refreshing, the Menu locks all the tabs in the out position.

Other than that, I think it would integrate quite well, unless you can think of reasons it may not?

Also, I've been looking into trying to change Programs.php.

Code:
<?php
if ($qs == 'SickBeard') {
    echo $sickbeardurl;
}    elseif($qs == 'CouchPotato') {
    echo $cp_url;
}    elseif($qs == 'SabNZBd') {
    echo $saburl;
}    elseif($qs == 'Transmission') {
    echo $transmission_web;
}    elseif($qs == 'uTorrent') {
    echo $utorrent_url;
}    elseif($qs == 'XBMC') {
    echo str_replace("vfs/","",$xbmcimgpath);
}    elseif($qs == 'HeadPhones') {
    echo $HEADPHONES_URL;
}    elseif($qs == 'JDownloader') {
    echo $jd_weburl;
}    elseif($qs == 'SubSonic') {
    echo $subsonicurl;
}
?>
Instead of using elseif's I want to try and load the array from the config.php from $navlinks and $subnavlinks and use the variables specified to show the correct pages. This would then keep MFP loaded, even when visiting external sites. That way, programs.php will never need to be editted. Smile


- Aenima99x - 2011-07-09

guy_smiley:) Wrote:OK, I put the file back and it won't go past servercheck.php again.

This is my mfp.conf for Apache2 in ./sites-enabled

[code]
<VirtualHost *:80>

SSLProxyEngine on
ProxyRequests On
ProxyPreserveHost Off
ErrorLog logs/mfp_error_loag
TransferLog logs/mfp_access_log
DocumentRoot /var/www

You really should set ProxyRequests to Off
It's a little confusing, but by setting it to On, you are actually allowing forward proxy requests to be routed through....which is a big security problem. See the Apache info on this here.
BTW - I've spent a few days getting everything working properly with my reverse proxy and I'll post the configs in a bit. Smile


- chrisuk11 - 2011-07-09

Is there a guide for setting up a secure web server for windows so I can use this software ?

The webserver would be installed on my NAS or PC? Whichever would be prefferred option?

Started looking through the thread, but 172 pages is a lot to trawl through.

I have done some research and I beelive apache could be used? The only concern I have, is setting this up incorrectly, as this would involce opening up ports etc.

Any guidance / links etc would be greatly appreciated

Thanks


- steve1977 - 2011-07-09

chrisuk11 Wrote:Is there a guide for setting up a secure web server for windows so I can use this software ?

The webserver would be installed on my NAS or PC? Whichever would be prefferred option?

Started looking through the thread, but 172 pages is a lot to trawl through.

I have done some research and I beelive apache could be used? The only concern I have, is setting this up incorrectly, as this would involce opening up ports etc.

Any guidance / links etc would be greatly appreciated

Would suggest to download Uniformserver (http://www.uniformserver.com/). It includes not only Apache, but other packages you may find helpful. And yes, you will need to open a port (80), but Uniformserver allows you to manage risk.


- Aenima99x - 2011-07-09

As promised, here's my working reverse proxy setup.

Let me preface this by noting that my config is a little different than most. I'm running this all on a Synology NAS and my ISP has recently blocked port 80, so my website is running on 8080 and I'm doing some redirecting with DynDNS. This really doesn't affect any of the following though and should work for everyone. Just change the ports to whatever you have set.

Code:
External website - www.server.com

Code:
Router - Only forwards port 8080 from external

Apache Config
Code:
<VirtualHost *:8080>
   ProxyRequests Off
   ProxyPreserveHost Off
   ProxyErrorOverride On
    <Proxy *>
           Order Allow,Deny
       Allow from all
    </Proxy>

    <Location /sab/>
       ProxyPass http://127.0.0.1:9002/
       ProxyPassReverse http://127.0.0.1:9002/
    </Location>

    <Location /tv/>
       ProxyPass http://127.0.0.1:9003/tv/
       ProxyPassReverse http://127.0.0.1:9003/tv/
    </Location>

    <Location /movies/>
       ProxyPass http://127.0.0.1:9004/
       ProxyPassReverse http://127.0.0.1:9004/
    </Location>

    <Location /music/>
       ProxyPass http://127.0.0.1:9005/
       ProxyPassReverse http://127.0.0.1:9005/
    </Location>

        <Location /xbmc/>
             ProxyPass        http://192.168.1.5:9203/
             ProxyPassReverse http://192.168.1.5:9203/      
        </Location>

        <Location /xbmc/jsonrpc>
             ProxyPass        http://192.168.1.5:9203/jsonrpc
             ProxyPassReverse http://192.168.1.5:9203/jsonrpc
        </Location>

        <Location /xwmm/>
             ProxyPass        http://192.168.1.5:9203/XWMM/movies/
             ProxyPassReverse http://192.168.1.5:9203/XWMM/movies/
        </Location>
</VirtualHost>
Note - I'm using a MySQL DB and XBMC is on a different box, so that's why the different IP. If XBMC is on the same box as everything else, just put in 127.0.0.1 like the other settings.

MFP Config
Code:
$GLOBAL_MACHINE      = false;
     $GLOBAL_USER_PASS    = true;
     $GLOBAL_IP           = $_SERVER["HTTP_HOST"];
     $GLOBAL_USER         = 'xxxxxxx';
     $GLOBAL_PASS         = 'xxxxxxx';
    
     $REVERSE_PROXY       = true;
     $XBMC_WEBROOT        = 'xbmc';
     $SICKBEARD_WEBROOT   = 'tv';
     $COUCHPOTATO_WEBROOT = 'movies';
     $SABNZBD_WEBROOT     = 'sab';

          $navlink;
          $navlink["XBMC"]           = '/xbmc/';
          $navlink["XWMM"]           = '/xwmm/';
          $navlink["SabNZBd"]        = '/sab/';
          $navlink["Sickbeard"]      = '/tv/';
          $navlink["CouchPotato"]    = '/movies/';
          $navlink["HeadPhones"]     = '/music/';
note the GLOBAL_IP....setting it as that is what really makes all the magic happen lol
Also, all of the sections for xbmc, cp, etc are left empty except for the API info in the SAB section.

CouchPotato Config.ini
Code:
host = 0.0.0.0
port = 9004
urlbase = movies

SickBeard Config.ini
Code:
web_port = 9003
web_host = 0.0.0.0
web_ipv6 = False
web_log = 0
web_root = /tv

SickBeard AutoProcessTV.cfg
Code:
[SickBeard]
host=0.0.0.0
port=9003
username=xxxxx
password=xxxxx
web_root=/tv

SAB Config.ini
Code:
host = 0.0.0.0
port = 9002

The ONLY thing I don't have working right now is Headphones, but that's only because it doesn't have the webroot options in the program yet. Hope this helps. Big Grin


- steve1977 - 2011-07-09

Thanks, this is great. While mine is working, I have a few settings, which are different from yours. Would love to understand differences and whether they matter or not:

Aenima99x Wrote:MFP Config
Code:
$GLOBAL_MACHINE      = false;
     $GLOBAL_USER_PASS    = true;
     $GLOBAL_IP           = $_SERVER["HTTP_HOST"];[/quote]

2 differences here: I have set global-machine to "true" and put in my actual URL instead of $_SERVER["HTTP_HOST"].

[quote=Aenima99x][b]SickBeard Config.ini[/b]
[CODE]web_root = /tv
SickBeard AutoProcessTV.cfg
Code:
[SickBeard]
web_root=/sickbeard

I have put both web-roots to /tv, which is my reverse-proxy (and I thought so it yours).

Aenima99x Wrote:The ONLY thing I don't have working right now is Headphones, but that's only because it doesn't have the webroot options in the program yet. Hope this helps. Big Grin

Where would you use this for? You will still need it manually in the navbar anyways and headphones and no widget is addressing it yet?


Related question - have you tried using subsonic? I believe that this is the very best part, but I don't get it working as part of the navbar (to be more precise, I get videos working, but dont get audio to play).


Again, thanks a lot in advance!!!


- Aenima99x - 2011-07-09

steve1977 Wrote:Thanks, this is great. While mine is working, I have a few settings, which are different from yours. Would love to understand differences and whether they matter or not:
Sure, glad to help cuz I know what a pain it is to get working.


Quote:2 differences here: I have set global-machine to "true" and put in my actual URL instead of $_SERVER["HTTP_HOST"].
I only don't have global-machine set to true because I have 2 boxes, my NAS running the webserver & all the apps and my HTPC running only XBMC. As for the $_SERVER["HTTP_HOST"] - I was having some trouble with everything working properly inside my network and externally and this fixed it. I'm not real sure on the implications of using this yet, but I'll let you know what I find out.


Quote:I have put both web-roots to /tv, which is my reverse-proxy (and I thought so it yours).
Yeah that was my bad, it should be /tv in both.


Quote:Where would you use this for? You will still need it manually in the navbar anyways and headphones and no widget is addressing it yet?

Related question - have you tried using subsonic? I believe that this is the very best part, but I don't get it working as part of the navbar (to be more precise, I get videos working, but dont get audio to play).
Haven't tried Subsonic, but I'll give it a look.


- chrisuk11 - 2011-07-09

Hi,

First off thanks for the helpful links provided. I have XAMPP installed.

I have edited the config file as best as I know and voila webpage loads. It shows HDD space / controls and the RSS feeds.

The tabs along the top all work (apart from couchpotato as not done this yet).

The issue I have is the widgets dont work - sabnzb, xbmc library, recent movies, now playing etc

I'm pretty sure the reason being is because the software is installed between th PC and the NAS.


XAMPP - Installed on PC
XBMC - PC
sabnzbn - NAS
Sickbeard - NAS

I think due to the above, some other config files will need amending. Could anyone give me a heads up on what I should be looking for please?

Edit - I should also ad XBMC is not installed in default location. It is installed at - E:\HTPC\Software\XBMC
Error for coming episodes - Fatal error: Call to undefined function curl_init() in C:\xampp\htdocs\widgets\wComingEpisodes.php on line 213