diff --git a/acinclude.m4 b/acinclude.m4 index 0f67ee152..4df1f9754 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -210,14 +210,22 @@ dnl automake <= 1.6 needs this specifications AC_SUBST(CONFIGDIR) AC_SUBST(DATADIR) AC_SUBST(FONTDIR) +AC_SUBST(FONTDIR_VAR) AC_SUBST(GAMESDIR) AC_SUBST(LIBDIR) AC_SUBST(MNTDIR) AC_SUBST(PLUGINDIR) +AC_SUBST(PLUGINDIR_VAR) +AC_SUBST(WEBTVDIR) +AC_SUBST(WEBTVDIR_VAR) +AC_SUBST(PLUGINDIR_MNT) AC_SUBST(LUAPLUGINDIR) AC_SUBST(LOCALEDIR) +AC_SUBST(LOCALEDIR_VAR) AC_SUBST(THEMESDIR) +AC_SUBST(THEMESDIR_VAR) AC_SUBST(ICONSDIR) +AC_SUBST(ICONSDIR_VAR) AC_SUBST(PRIVATE_HTTPDDIR) AC_SUBST(PUBLIC_HTTPDDIR) AC_SUBST(HOSTED_HTTPDDIR) diff --git a/configure.ac b/configure.ac index 1ceb93bdd..9c7f9173c 100644 --- a/configure.ac +++ b/configure.ac @@ -367,6 +367,7 @@ data/pictures/backgrounds/Makefile data/pictures/screensaver/Makefile data/scripts/Makefile data/themes/Makefile +data/webtv/Makefile data/y-web/Makefile data/y-web/images/Makefile data/y-web/info/Makefile diff --git a/data/Makefile.am b/data/Makefile.am index 6c1c0e1cd..5c1b89d24 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -10,6 +10,7 @@ SUBDIRS = \ pictures \ scripts \ themes \ + webtv \ y-web if BOXTYPE_TRIPLE diff --git a/data/icons/locale/Makefile.am b/data/icons/locale/Makefile.am index 386924c4c..4b66f961e 100644 --- a/data/icons/locale/Makefile.am +++ b/data/icons/locale/Makefile.am @@ -2,11 +2,11 @@ installdir = $(ICONSDIR) install_DATA = \ deutsch.png \ - english.png \ - nederlands.png \ - slovak.png + english.png unmaintained = \ + nederlands.png \ + slovak.png \ unmaintained/bayrisch.png \ unmaintained/bosanski.png \ unmaintained/ch-baslerdeutsch.png \ @@ -20,4 +20,4 @@ unmaintained = \ unmaintained/suomi.png \ unmaintained/svenska.png -install_DATA += $(unmaintained) +#install_DATA += $(unmaintained) diff --git a/data/icons/status/ca/Makefile.am b/data/icons/status/ca/Makefile.am index 2da5da09e..d7db8b6bf 100644 --- a/data/icons/status/ca/Makefile.am +++ b/data/icons/status/ca/Makefile.am @@ -4,6 +4,8 @@ install_DATA = \ biss_green.png \ biss_white.png \ biss_yellow.png \ + ci+_green.png \ + ci+_grey.png \ conax_green.png \ conax_white.png \ conax_yellow.png \ @@ -13,21 +15,34 @@ install_DATA = \ d_green.png \ d_white.png \ d_yellow.png \ + dec_card.png \ + dec_fta.png \ + dec_int.png \ + dec_na.png \ + dec_net.png \ + doscam_green.png \ + doscam_yellow.png \ + gbox_green.png \ ird_green.png \ ird_white.png \ ird_yellow.png \ + mgcamd_green.png \ nagra_green.png \ nagra_white.png \ nagra_yellow.png \ nds_green.png \ nds_white.png \ nds_yellow.png \ + newcs_green.png \ + oscam_green.png \ + osemu_green.png \ powervu_green.png \ powervu_white.png \ powervu_yellow.png \ seca_green.png \ seca_white.png \ seca_yellow.png \ + srv_green.png \ via_green.png \ via_white.png \ via_yellow.png \ diff --git a/data/icons/status/ca/ci+_green.png b/data/icons/status/ca/ci+_green.png new file mode 100644 index 000000000..06e50001e Binary files /dev/null and b/data/icons/status/ca/ci+_green.png differ diff --git a/data/icons/status/ca/ci+_grey.png b/data/icons/status/ca/ci+_grey.png new file mode 100644 index 000000000..f31756c16 Binary files /dev/null and b/data/icons/status/ca/ci+_grey.png differ diff --git a/data/icons/status/ca/dec_card.png b/data/icons/status/ca/dec_card.png new file mode 100644 index 000000000..3bd0741a4 Binary files /dev/null and b/data/icons/status/ca/dec_card.png differ diff --git a/data/icons/status/ca/dec_fta.png b/data/icons/status/ca/dec_fta.png new file mode 100644 index 000000000..002ea7e5d Binary files /dev/null and b/data/icons/status/ca/dec_fta.png differ diff --git a/data/icons/status/ca/dec_int.png b/data/icons/status/ca/dec_int.png new file mode 100644 index 000000000..af1f61ce9 Binary files /dev/null and b/data/icons/status/ca/dec_int.png differ diff --git a/data/icons/status/ca/dec_na.png b/data/icons/status/ca/dec_na.png new file mode 100644 index 000000000..b412b671f Binary files /dev/null and b/data/icons/status/ca/dec_na.png differ diff --git a/data/icons/status/ca/dec_net.png b/data/icons/status/ca/dec_net.png new file mode 100644 index 000000000..e82ac479a Binary files /dev/null and b/data/icons/status/ca/dec_net.png differ diff --git a/data/icons/status/ca/doscam_green.png b/data/icons/status/ca/doscam_green.png new file mode 100644 index 000000000..38837ca70 Binary files /dev/null and b/data/icons/status/ca/doscam_green.png differ diff --git a/data/icons/status/ca/doscam_yellow.png b/data/icons/status/ca/doscam_yellow.png new file mode 100644 index 000000000..2ab2c586f Binary files /dev/null and b/data/icons/status/ca/doscam_yellow.png differ diff --git a/data/icons/status/ca/gbox_green.png b/data/icons/status/ca/gbox_green.png new file mode 100644 index 000000000..2f8553160 Binary files /dev/null and b/data/icons/status/ca/gbox_green.png differ diff --git a/data/icons/status/ca/mgcamd_green.png b/data/icons/status/ca/mgcamd_green.png new file mode 100644 index 000000000..1df2f9a9a Binary files /dev/null and b/data/icons/status/ca/mgcamd_green.png differ diff --git a/data/icons/status/ca/newcs_green.png b/data/icons/status/ca/newcs_green.png new file mode 100644 index 000000000..04705d7a5 Binary files /dev/null and b/data/icons/status/ca/newcs_green.png differ diff --git a/data/icons/status/ca/oscam_green.png b/data/icons/status/ca/oscam_green.png new file mode 100644 index 000000000..1a84219bf Binary files /dev/null and b/data/icons/status/ca/oscam_green.png differ diff --git a/data/icons/status/ca/osemu_green.png b/data/icons/status/ca/osemu_green.png new file mode 100644 index 000000000..fe28db3ad Binary files /dev/null and b/data/icons/status/ca/osemu_green.png differ diff --git a/data/icons/status/ca/srv_green.png b/data/icons/status/ca/srv_green.png new file mode 100644 index 000000000..c1486b15a Binary files /dev/null and b/data/icons/status/ca/srv_green.png differ diff --git a/data/icons/status/info/Makefile.am b/data/icons/status/info/Makefile.am index 2753cb3d8..2f8451945 100644 --- a/data/icons/status/info/Makefile.am +++ b/data/icons/status/info/Makefile.am @@ -9,4 +9,6 @@ install_DATA = \ info2_off.png \ info2_on.png \ info3_off.png \ - info3_on.png + info3_on.png \ + info4_off.png \ + info4_on.png diff --git a/data/icons/status/info/info4_off.png b/data/icons/status/info/info4_off.png new file mode 100644 index 000000000..fe55f387e Binary files /dev/null and b/data/icons/status/info/info4_off.png differ diff --git a/data/icons/status/info/info4_on.png b/data/icons/status/info/info4_on.png new file mode 100644 index 000000000..11df1a313 Binary files /dev/null and b/data/icons/status/info/info4_on.png differ diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 87b048c50..9fe918891 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -227,11 +227,11 @@ bouqueteditor.savingchanges Änderungen werden gespeichert. Bitte warten ... bouqueteditor.switch Kanal aufnehmen/entfernen bouqueteditor.switchmode TV/Radio bouquetlist.head Bouquets -bouquetname.hdtv HD Kanäle +bouquetname.hdtv HD-Kanäle bouquetname.new Neue Kanäle bouquetname.other Unbekannter Provider bouquetname.removed Gelöschte Kanäle -bouquetname.webtv WebTV Kanäle +bouquetname.webtv WebTV-Kanäle buildinfo.compiled_on Build Host buildinfo.compiled_with Compiler Version buildinfo.compiler_flags Compiler Flags @@ -504,8 +504,8 @@ extra.key_timeshift Timeshift extra.key_unlock Entsperrtaste extra.ladirection Breitengrad-Ausrichtung extra.latitude Breitengrad -extra.loadconfig Einstellungen: Laden von -extra.loadkeys Lade Tastenbelegung von +extra.loadconfig Einstellungen laden +extra.loadkeys Tastenbelegungen laden extra.lodirection Längengrad-Ausrichtung extra.longitude Längengrad extra.menu_left_exit "links" = Menü zurück @@ -516,8 +516,8 @@ extra.rotor_swap Rotor dreht Ost/West extra.rounded_corners Eckendarstellung extra.rounded_corners_off eckig extra.rounded_corners_on abgerundet -extra.saveconfig Einstellungen: Sichern als -extra.savekeys Speichere Tastenbelegung als +extra.saveconfig Einstellungen sichern +extra.savekeys Tastenbelegungen sichern extra.scrambled_message Verschlüsselung melden extra.show_mute_icon Mute-Icon bei Lautstärke 0 extra.sms_channel SMS-Modus bei Kanalsuche @@ -647,7 +647,7 @@ filesystem.is.utf8.option.iso8859.1 ISO-8859-1 filesystem.is.utf8.option.utf8 UTF-8 flashupdate.actionreadflash lese Flash flashupdate.apply_settings Sollen die aktuellen Einstellungen in das neue Image übernommen werden? -flashupdate.autocheck Beim Start nach Updates suchen +flashupdate.autocheck Regelmäßig nach Updates suchen flashupdate.cantopenfile kann Datei nicht öffnen flashupdate.cantopenmtd kann MTD nicht öffnen flashupdate.checkupdate_internet Online-Update @@ -945,8 +945,8 @@ keybindingmenu.cancel Kanalliste schließen keybindingmenu.channeldown Kanal runter keybindingmenu.channellist Kanalliste keybindingmenu.channelup Kanal hoch -keybindingmenu.edit Bearbeiten -keybindingmenu.head Tasten-Belegungen bearbeiten +keybindingmenu.edit Tastenbelegungen bearbeiten +keybindingmenu.head Tastenbelegungen keybindingmenu.lastchannel Letzter Kanal keybindingmenu.longkeypress_duration Langer Tastendruck keybindingmenu.misc Sonstige @@ -1313,7 +1313,7 @@ menu.hint_key_record Konfigurieren Sie die Taste für den Aufnahmestart menu.hint_key_repeatblock Die Verzögerung nach einem Tastendruck bis die Box reagieren soll menu.hint_key_repeatblockgeneric Die Verzögerung zwischen den Tastewiederholungen bis die Box reagieren soll menu.hint_key_right Wählen Sie die Funktion für die Tasten 'links' und 'rechts' im TV/Radio- und Movieplayer-Modus -menu.hint_key_save Speichern Sie Ihre Tastenbelegungen in einer Datei ab +menu.hint_key_save Speichern Sie Ihre Tastenbelegungen in einer Datei namens keys.conf ab menu.hint_key_screenshot Weisen Sie eine Taste zu, um Menü- und/oder TV-Screenshots zu speichern menu.hint_key_sort Weisen Sie eine Taste für das Sortieren in der Kanalliste zu menu.hint_key_special_active Deaktivieren oder aktivieren einiger Sondertasten @@ -1504,7 +1504,7 @@ menu.hint_restore Wiederherstellen von vorher erstellten Sicherungen menu.hint_rotor_swap Tauschen der Rotordrehrichtung Ost/West in den Motor-Einstellungen menu.hint_rounded_corners Aktiviert die Darstellung abgerundeter Ecken für die Menüs menu.hint_save_settings Speichert ihre Einstellungen -menu.hint_saveas Speichern der Einstellungen in eine Datei +menu.hint_saveas Speichern der Einstellungen in einer Datei namens neutrino.conf menu.hint_scan_auto Automatischer Suchlauf ausgewählter Anbieter menu.hint_scan_autoall Automatischer Suchlauf aller ausgewählten Anbieter menu.hint_scan_autoall_select Suchlauf nur in ausgewählten Satelliten @@ -2533,7 +2533,7 @@ servicemenu.restart_tuner Tuner neu starten servicemenu.restarting_tuner Tuner wird neu gestartet servicemenu.scants Kanalsuche servicemenu.update Software-Aktualisierung -settings.backup NI-Backup: Sichern +settings.backup NI-Backup sichern settings.backup_failed Sicherung fehlgeschlagen! settings.help Hilfe settings.menu_hints Hinweise anzeigen @@ -2550,7 +2550,7 @@ settings.pos_higher_center höher zentriert settings.pos_top_center oben zentriert settings.pos_top_left oben links settings.pos_top_right oben rechts -settings.restore NI-Backup: Wiederherstellen +settings.restore NI-Backup wiederherstellen settings.restore_warn Alle Settings werden ersetzt.\nDie Box wird neu gestartet.\nWeiter? settings.teams Team-übergreifende Einstellungen settings.teams.backup Sichern diff --git a/data/locale/english.locale b/data/locale/english.locale index 023fcede6..c582c5a41 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -504,8 +504,8 @@ extra.key_timeshift Timeshift extra.key_unlock Unlock key extra.ladirection LaDirection extra.latitude Latitude -extra.loadconfig Settings: Load from -extra.loadkeys Load keys from +extra.loadconfig Load settings +extra.loadkeys Load keybindings extra.lodirection LoDirection extra.longitude Longitude extra.menu_left_exit "Left" = menu back @@ -516,8 +516,8 @@ extra.rotor_swap Swap rotor east/west extra.rounded_corners Shape of corners extra.rounded_corners_off angular extra.rounded_corners_on rounded -extra.saveconfig Settings: Save as -extra.savekeys Save keys as +extra.saveconfig Save settings +extra.savekeys Save keybindings extra.scrambled_message Scrambled Message extra.show_mute_icon mute-icon at volume 0 extra.sms_channel SMS-mode channel @@ -647,7 +647,7 @@ filesystem.is.utf8.option.iso8859.1 ISO-8859-1 filesystem.is.utf8.option.utf8 UTF-8 flashupdate.actionreadflash reading flashupdate.apply_settings Import current settings into new image? -flashupdate.autocheck Auto-check updates on boot +flashupdate.autocheck Check updates periodically flashupdate.cantopenfile can't open file flashupdate.cantopenmtd can't open MTD flashupdate.checkupdate_internet Online update @@ -945,8 +945,8 @@ keybindingmenu.cancel close channellist keybindingmenu.channeldown channel down keybindingmenu.channellist Channellist keybindingmenu.channelup channel up -keybindingmenu.edit Edit -keybindingmenu.head Edit Keybindings +keybindingmenu.edit Edit keybindings +keybindingmenu.head Keybindings keybindingmenu.lastchannel Quick Zap keybindingmenu.longkeypress_duration Long key-press keybindingmenu.misc Misc @@ -1313,7 +1313,7 @@ menu.hint_key_record Assign button to start a recording menu.hint_key_repeatblock Delay after button press and before\nfirst key repeat menu.hint_key_repeatblockgeneric Delay between key repeats\nwhile button pressed menu.hint_key_right Select function for 'left' and 'right' keys in live TV/Radio mode and movieplayer mode -menu.hint_key_save Save keybindings to file +menu.hint_key_save Save keybindings to a file named keys.conf menu.hint_key_screenshot Assign button to save GUI and/or TV screenshot menu.hint_key_sort Assign button to change channel list sort order menu.hint_key_special_active Disable or enable some special keys @@ -1504,7 +1504,7 @@ menu.hint_restore Restore files from selected backup menu.hint_rotor_swap Swap rotor east/west directions\nin motor control menu.hint_rounded_corners Draw round or rectangular windows corners menu.hint_save_settings Save all settings to flash -menu.hint_saveas Save GUI settings to file +menu.hint_saveas Save GUI settings to a file named neutrino.conf menu.hint_scan_auto Auto-scan selected provider menu.hint_scan_autoall Scan several selected providers at once menu.hint_scan_autoall_select Add selected satellites to scan @@ -2533,7 +2533,7 @@ servicemenu.restart_tuner Restart tuner servicemenu.restarting_tuner Restarting tuner servicemenu.scants Servicescan servicemenu.update Software Update -settings.backup NI-Backup: save +settings.backup Save NI-Backup settings.backup_failed Backup failed! settings.help Help settings.menu_hints Show menu hints @@ -2550,7 +2550,7 @@ settings.pos_higher_center higher center settings.pos_top_center top center settings.pos_top_left top left settings.pos_top_right top right -settings.restore NI-Backup: restore +settings.restore Load NI-Backup settings.restore_warn This will replace all settings and reboot\nContinue ? settings.teams Cross-Team Settings settings.teams.backup Save diff --git a/data/webtv/Makefile.am b/data/webtv/Makefile.am new file mode 100644 index 000000000..f55df6a7c --- /dev/null +++ b/data/webtv/Makefile.am @@ -0,0 +1,9 @@ +installdir = $(WEBTVDIR) + +install_DATA = \ + filmon.lua \ + filmon.xml \ + hdporntv.lua \ + hdporntv.xml \ + yt_live.lua \ + yt_live.xml diff --git a/data/webtv/filmon.lua b/data/webtv/filmon.lua new file mode 100644 index 000000000..61d118c7b --- /dev/null +++ b/data/webtv/filmon.lua @@ -0,0 +1,73 @@ +local n = neutrino(0, 0, SCREEN.X_RES, SCREEN.Y_RES); +n:checkVersion(1, 31); + +json = require "json" + +if #arg < 1 then return nil end +local _url = arg[1] +local ret = {} +local Curl = nil + +function getdata(Url) + if Url == nil then return nil end + if Curl == nil then + Curl = curl.new() + end + local ret, data = Curl:download{ url=Url, A="Mozilla/5.0"} + if ret == CURL.OK then + return data + else + return nil + end +end + +function getVideoData(url) + if url == nil then return 0 end + local data = getdata('http://www.filmon.com/tv/channel/info/' .. url) + if data == nil then return 0 end + + local data = json:decode(data) + if data==nil then return 0 end + data = data['data'] + if data==nil then return 0 end + + local title=data['title'] + if title==nil then name='nil' end + title=title .. ' - filmon' + + data = data['streams'] + if data==nil then return 0 end + + local highurl=nil + local lowurl=nil + local quality=nil + local surl=nil + for i,stream in ipairs(data) do + quality=stream['quality'] + surl=stream['url'] + if (quality=='high')or(quality=='HD') then + if (stream['watch-timeout']>=3600)and(surl:find('mustbeasubscriber')==nil) then + highurl = surl + end + elseif (quality=='low')or(quality=='SD') then + lowurl = surl + end + end + local count=0 + if highurl ~= nil then + --if lowurl ~= nil then highurl=lowurl:gsub('low.stream','high.stream') end + count = 1 + ret[1]={ url = highurl, band = "1500000", name = title, res1 = "854", res2 = "480" } + end + if lowurl ~= nil then + count = count+1 + ret[count]={ url = lowurl, band = "500000", name = title, res1 = "576", res2 = "322" } + end + return count +end + +if (getVideoData(_url) > 0) then + return json:encode(ret) +end + +return nil diff --git a/data/webtv/filmon.xml b/data/webtv/filmon.xml new file mode 100644 index 000000000..2098f1208 --- /dev/null +++ b/data/webtv/filmon.xml @@ -0,0 +1,1107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/webtv/hdporntv.lua b/data/webtv/hdporntv.lua new file mode 100644 index 000000000..f23ff397b --- /dev/null +++ b/data/webtv/hdporntv.lua @@ -0,0 +1,66 @@ + +local n = neutrino(0, 0, SCREEN.X_RES, SCREEN.Y_RES); +M = misc.new(); M:checkVersion(1, 31) +json = require "json" + +if #arg < 1 then return nil end +local _url = arg[1] +local ret = {} +local Curl = nil + +function getdata(Url) + if Url == nil then return nil end + if Curl == nil then + Curl = curl.new() + end + local ret, data = Curl:download{ url=Url, ipv4=true, A="Mozilla/5.0 (Linux; Android 5.1.1; Nexus 4 Build/LMY48M)"} + if ret == CURL.OK then + return data + else + return nil + end +end + +function getVideoData(url) + local data = getdata(url) + local count = 0 + if data then + local title = data:match("(.-)") + local newname = url:match('tv/(.-)%.html') + local url_m3u8 = data:match('stream":%s+[\'"](.-%.m3u8)[\'"]') + if url_m3u8 then + entry = {} + entry['url'] = url_m3u8 + entry['band'] = "1" + entry['res1'] = "1" + entry['res2'] = "1" + entry['name'] = "xx" + local infodata = getdata(url_m3u8) + if infodata then + local band,res1,res2 = infodata:match('BANDWIDTH=(%d+),RESOLUTION=(%d+)x(%d+)') + if band and res1 and res2 then + entry['band'] = band + entry['res1'] = res1 + entry['res2'] = res2 + end + end + if newname then + entry['name'] = newname + end + if title then + entry['name'] = title + end + count = 1 + ret[count] = {} + ret[count] = entry + end + return count + end + return 0 +end + +if (getVideoData(_url) > 0) then + return json:encode(ret) +end + +return "" diff --git a/data/webtv/hdporntv.xml b/data/webtv/hdporntv.xml new file mode 100644 index 000000000..d2b12d5d8 --- /dev/null +++ b/data/webtv/hdporntv.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/data/webtv/yt_live.lua b/data/webtv/yt_live.lua new file mode 100644 index 000000000..74da6c7ff --- /dev/null +++ b/data/webtv/yt_live.lua @@ -0,0 +1,61 @@ + +json = require "json" + +if #arg < 1 then return nil end +local _url = arg[1] +local ret = {} +local Curl = nil + +function getdata(Url) + if Url == nil then return nil end + if Curl == nil then + Curl = curl.new() + end + local ret, data = Curl:download{ url=Url, A="Mozilla/5.0"} + if ret == CURL.OK then + return data + else + return nil + end +end + +function getVideoData(url) + if url == nil then return 0 end + local data = getdata(url) + if data then + local m3u_url = data:match('hlsvp.:.(https:\\.-m3u8)') + local newname = data:match('(.-)') + if m3u_url == nil then return 0 end + m3u_url = m3u_url:gsub("\\", "") + local videodata = getdata(m3u_url) + local url = "" + local band = "" + local res1 = "" + local res2 = "" + local count = 0 + for band, res1, res2, url in videodata:gmatch('#EXT.X.STREAM.INF.BANDWIDTH=(%d+).-RESOLUTION=(%d+)x(%d+).-(http.-)\n') do + if url ~= nil then + entry = {} + entry['url'] = url + entry['band'] = band + entry['res1'] = res1 + entry['res2'] = res2 + entry['name'] = "" + if newname then + entry['name'] = newname + end + count = count + 1 + ret[count] = {} + ret[count] = entry + end + end + return count + end + return 0 +end + +if (getVideoData(_url) > 0) then + return json:encode(ret) +end + +return "" diff --git a/data/webtv/yt_live.xml b/data/webtv/yt_live.xml new file mode 100644 index 000000000..50184397e --- /dev/null +++ b/data/webtv/yt_live.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/data/y-web/Y_Settings_automount.yhtm b/data/y-web/Y_Settings_automount.yhtm index d8cdbf827..8368de139 100644 --- a/data/y-web/Y_Settings_automount.yhtm +++ b/data/y-web/Y_Settings_automount.yhtm @@ -102,8 +102,8 @@ function do_save2() var dir = document.f.dir.value; if(dir.indexOf("/") == 0) dir = dir.substr(1); - mstr += ((mstr!="")?",":"")+"unc="+"//"+document.f.ip.value+"/"+dir; - mstr += "%20//"+document.f.ip.value+"/"+dir; + //mstr += ((mstr!="")?",":"")+"unc="+"//"+document.f.ip.value+"/"+dir; + mstr += "%20://"+document.f.ip.value+"/"+dir; } show_waitbox(false); mstr = mstr.replace(/=/gi,",,"); diff --git a/data/y-web/favicon.ico b/data/y-web/favicon.ico index 5e17fbdcf..48c5e0d54 100644 Binary files a/data/y-web/favicon.ico and b/data/y-web/favicon.ico differ diff --git a/data/y-web/index.html b/data/y-web/index.html index 44623a6f7..383e5223f 100644 --- a/data/y-web/index.html +++ b/data/y-web/index.html @@ -4,6 +4,15 @@ yWeb + diff --git a/src/global.h b/src/global.h index 54ae6d816..fadfa39cf 100644 --- a/src/global.h +++ b/src/global.h @@ -24,7 +24,6 @@ */ #include -#include //NI #ifndef NEUTRINO_CPP #define NEUTRINO_CPP extern diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index 303e6eb4d..5b7edcfe7 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -107,6 +107,7 @@ libneutrino_gui_a_SOURCES = \ timeosd.cpp \ tmdb.cpp \ update.cpp \ + update_check.cpp \ update_menue.cpp \ update_settings.cpp \ user_menue.cpp \ diff --git a/src/gui/hdd_menu.cpp b/src/gui/hdd_menu.cpp index 44a59ccc7..38416139a 100644 --- a/src/gui/hdd_menu.cpp +++ b/src/gui/hdd_menu.cpp @@ -66,11 +66,7 @@ #define EJECT_BIN "/bin/eject" //NI -#ifdef BOXMODEL_CS_HD2 -#define MDEV_MOUNT "/lib/mdev/fs/mount" -#else -#define MDEV_MOUNT "/etc/mdev/mdev-mount.sh" -#endif +#define MDEV_MOUNT "/lib/mdev/fs/mdev-mount" #define MOUNT_BASE "/media/" #define HDD_NOISE_OPTION_COUNT 4 diff --git a/src/gui/keybind_setup.cpp b/src/gui/keybind_setup.cpp index 951d35b0c..60da2d2ac 100644 --- a/src/gui/keybind_setup.cpp +++ b/src/gui/keybind_setup.cpp @@ -106,7 +106,7 @@ int CKeybindSetup::exec(CMenuTarget* parent, const std::string &actionKey) else if(actionKey == "savekeys") { CFileBrowser fileBrowser; fileBrowser.Dir_Mode = true; - if (fileBrowser.exec("/var/tuxbox") == true) { + if (fileBrowser.exec("/media") == true) { std::string fname = "keys.conf"; CKeyboardInput * sms = new CKeyboardInput(LOCALE_EXTRA_SAVEKEYS, &fname); sms->exec(NULL, ""); @@ -245,7 +245,7 @@ int CKeybindSetup::showKeySetup() //keysetup menu CMenuWidget* keySettings = new CMenuWidget(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_KEYBINDING, width, MN_WIDGET_ID_KEYSETUP); - keySettings->addIntroItems(LOCALE_MAINSETTINGS_KEYBINDING, LOCALE_KEYBINDINGMENU_HEAD); + keySettings->addIntroItems(LOCALE_MAINSETTINGS_KEYBINDING); //keybindings menu CMenuWidget bindSettings(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_KEYBINDING, width, MN_WIDGET_ID_KEYSETUP_KEYBINDING); @@ -261,12 +261,12 @@ int CKeybindSetup::showKeySetup() mf->setHint("", LOCALE_MENU_HINT_KEY_BINDING); keySettings->addItem(mf); - mf = new CMenuForwarder(LOCALE_EXTRA_LOADKEYS, true, NULL, this, "loadkeys", CRCInput::RC_green); - mf->setHint("", LOCALE_MENU_HINT_KEY_LOAD); + mf = new CMenuForwarder(LOCALE_EXTRA_SAVEKEYS, true, NULL, this, "savekeys", CRCInput::RC_green); + mf->setHint("", LOCALE_MENU_HINT_KEY_SAVE); keySettings->addItem(mf); - mf = new CMenuForwarder(LOCALE_EXTRA_SAVEKEYS, true, NULL, this, "savekeys", CRCInput::RC_yellow); - mf->setHint("", LOCALE_MENU_HINT_KEY_SAVE); + mf = new CMenuForwarder(LOCALE_EXTRA_LOADKEYS, true, NULL, this, "loadkeys", CRCInput::RC_yellow); + mf->setHint("", LOCALE_MENU_HINT_KEY_LOAD); keySettings->addItem(mf); keySettings->addItem(GenericMenuSeparatorLine); diff --git a/src/gui/settings_manager.cpp b/src/gui/settings_manager.cpp index ed4d44b84..59be6f523 100644 --- a/src/gui/settings_manager.cpp +++ b/src/gui/settings_manager.cpp @@ -92,7 +92,7 @@ int CSettingsManager::exec(CMenuTarget* parent, const std::string &actionKey) else if(actionKey == "saveconfig") { fileBrowser.Dir_Mode = true; - if (fileBrowser.exec("/var/tuxbox") == true) + if (fileBrowser.exec("/media") == true) { std::string fname = "neutrino.conf"; CKeyboardInput * sms = new CKeyboardInput(LOCALE_EXTRA_SAVECONFIG, &fname); diff --git a/src/gui/update_check.cpp b/src/gui/update_check.cpp new file mode 100644 index 000000000..1cc14bac1 --- /dev/null +++ b/src/gui/update_check.cpp @@ -0,0 +1,112 @@ +/* + update-check + + Copyright (C) 2017 'vanhofen' + Homepage: http://www.neutrino-images.de/ + + License: GPL + + 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; either version 2 of the License, or + (at your option) any later version. + + 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, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +#include +#include + +#include +#include + +#include "update_check.h" + +#define C4U_SLEEP (6 * 60 * 60) // 6 hours +#define C4U_FLAGFILE FLAGDIR "/.update" + +/* ----------------------------------------------------------------- */ + +CFlashUpdateCheck::CFlashUpdateCheck() +{ + c4u_thread = 0; +} + +CFlashUpdateCheck::~CFlashUpdateCheck() +{ + stopThread(); +} + +CFlashUpdateCheck* CFlashUpdateCheck::getInstance() +{ + static CFlashUpdateCheck * c4u = NULL; + if (!c4u) + c4u = new CFlashUpdateCheck(); + + return c4u; +} + +void CFlashUpdateCheck::startThread() +{ + if (!c4u_thread) + { + printf("[CFlashUpdateCheck]: starting thread\n"); + pthread_create(&c4u_thread, NULL, c4u_proc, (void*) NULL); + pthread_detach(c4u_thread); + } +} + +void CFlashUpdateCheck::stopThread() +{ + if (c4u_thread) + { + printf("[CFlashUpdateCheck]: stopping thread\n"); + pthread_cancel(c4u_thread); + } + c4u_thread = 0; +} + +void* CFlashUpdateCheck::c4u_proc(void*) +{ + set_threadname("n:flashupdatecheck"); + + pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, 0); + pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, 0); + + CFlashUpdate flashupdate; + + //printf("[CFlashUpdateCheck] %s: starting loop\n", __FUNCTION__); + while(1) + { + //printf("[CFlashUpdateCheck]: check for updates\n"); + if (flashupdate.checkOnlineVersion()) + { + //printf("[CFlashUpdateCheck]: update available\n"); + if (FILE *f = fopen(C4U_FLAGFILE, "w")) + fclose(f); + } + else + { + if (access(C4U_FLAGFILE, F_OK) == 0) + unlink(C4U_FLAGFILE); + } + + sleep(C4U_SLEEP); + } + return 0; +} diff --git a/src/gui/update_check.h b/src/gui/update_check.h new file mode 100644 index 000000000..808757787 --- /dev/null +++ b/src/gui/update_check.h @@ -0,0 +1,44 @@ +/* + update-check + + Copyright (C) 2017 'vanhofen' + Homepage: http://www.neutrino-images.de/ + + License: GPL + + 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; either version 2 of the License, or + (at your option) any later version. + + 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, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#ifndef __update_check__ +#define __update_check__ + +class CFlashUpdateCheck +{ + public: + CFlashUpdateCheck(); + ~CFlashUpdateCheck(); + static CFlashUpdateCheck* getInstance(); + + void startThread(); + void stopThread(); + + private: + + pthread_t c4u_thread; + static void* c4u_proc(void *arg); +}; + +#endif // __update_check__ diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index be26a18f4..4511f0e09 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -277,7 +277,7 @@ void CMenuItem::paintItemCaption(const bool select_mode, const char * right_text right_bg_col = COL_MENUCONTENTINACTIVE_TEXT; right_frame_col = COL_MENUCONTENTINACTIVE_TEXT; } - CComponentsShapeSquare col(stringstartposOption, y + 2, dx - stringstartposOption + x - 2, item_height - 4, NULL, false, right_frame_col, right_bg_col); + CComponentsShapeSquare col(stringstartposOption, y + OFFSET_INNER_SMALL, dx - stringstartposOption + x - OFFSET_INNER_MID, item_height - 2*OFFSET_INNER_SMALL, NULL, false, right_frame_col, right_bg_col); col.setFrameThickness(1); //NI col.setCorner(RADIUS_SMALL); col.paint(false); @@ -582,7 +582,7 @@ void CMenuWidget::Init(const std::string &NameString, const std::string &Icon, c offx = offy = 0; from_wizard = SNeutrinoSettings::WIZARD_OFF; fade = true; - sb_width = 0; + scrollbar_width = 0; savescreen = false; preselected = -1; nextShortcut = 1; @@ -1092,7 +1092,7 @@ void CMenuWidget::hide() info_box->kill(); if (details_line) details_line->hide(); - frameBuffer->paintBackgroundBoxRel(x, y, full_width, full_height + fbutton_height); + frameBuffer->paintBackgroundBoxRel(x, y, full_width, full_height); //paintHint(-1); } paintHint(-1); @@ -1163,10 +1163,10 @@ void CMenuWidget::calcSize() } /* set the max height to 9/10 of usable screen height debatable, if the callers need a possibility to set this */ - height = (frameBuffer->getScreenHeight() - fbutton_height - hint_height) / 20 * 18; /* make sure its a multiple of 2 */ + height = (frameBuffer->getScreenHeight() - hint_height) / 20 * 18; /* make sure its a multiple of 2 */ - if(height > ((int)frameBuffer->getScreenHeight() - OFFSET_INNER_MID)) - height = frameBuffer->getScreenHeight() - OFFSET_INNER_MID; + if (height > ((int)frameBuffer->getScreenHeight() - 2*OFFSET_INNER_MID)) + height = frameBuffer->getScreenHeight() - 2*OFFSET_INNER_MID; int neededWidth = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(getName()); if (neededWidth > width - frameBuffer->scale2Res(48)) { @@ -1215,14 +1215,21 @@ void CMenuWidget::calcSize() // shrink menu if less items height = std::min(height, hheight + maxItemHeight); + /* + Always add a bottom offset. + Most menus has an upper offset too, + which is added with the intro-items + */ + height += OFFSET_INNER_MID; //scrollbar width - sb_width=0; - if(total_pages > 1) - sb_width=SCROLLBAR_WIDTH; + scrollbar_width=0; + if (total_pages > 1) + scrollbar_width = scrollbar_width; + + full_width = width + scrollbar_width + OFFSET_SHADOW; + full_height = height + fbutton_height + OFFSET_SHADOW + OFFSET_INTER; // hintbox is handled separately - full_width = /*DETAILSLINE_WIDTH+*/width+sb_width+OFFSET_SHADOW; - full_height = height+RADIUS_LARGE+OFFSET_SHADOW*2 /*+hint_height+OFFSET_INTER*/; /* + DETAILSLINE_WIDTH for the hintbox connection line * + center_offset for symmetry * + 20 for setMenuPos calculates 10 pixels border left and right */ @@ -1230,7 +1237,7 @@ void CMenuWidget::calcSize() int max_possible = (int)frameBuffer->getScreenWidth() - DETAILSLINE_WIDTH - center_offset - 2*OFFSET_INNER_MID; if (full_width > max_possible) { - width = max_possible - sb_width - OFFSET_SHADOW; + width = max_possible - scrollbar_width - OFFSET_SHADOW; full_width = max_possible + center_offset; /* symmetry in MENU_POS_CENTER case */ } @@ -1269,7 +1276,7 @@ void CMenuWidget::paint() // paint head if (header == NULL){ - header = new CComponentsHeader(x, y, width + sb_width, hheight, getName(), iconfile); + header = new CComponentsHeader(x, y, width + scrollbar_width, hheight, getName(), iconfile); header->enableShadow(CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT); header->setOffset(OFFSET_INNER_MID); } @@ -1280,16 +1287,16 @@ void CMenuWidget::paint() header->enableGradientBgCleanUp(savescreen); header->paint(CC_SAVE_SCREEN_NO); - // paint body shadow - frameBuffer->paintBoxRel(x+OFFSET_SHADOW, y + hheight + OFFSET_SHADOW, width + sb_width, height - hheight + RADIUS_LARGE + (fbutton_count ? fbutton_height : 0), COL_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); + // paint body and footer shadow + frameBuffer->paintBoxRel(x + OFFSET_SHADOW, y + hheight + OFFSET_SHADOW, width + scrollbar_width, height - hheight + fbutton_height, COL_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); // paint body background - frameBuffer->paintBoxRel(x, y+hheight, width + sb_width, height-hheight + RADIUS_LARGE, COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, (fbutton_count ? CORNER_NONE : CORNER_BOTTOM)); + frameBuffer->paintBoxRel(x, y + hheight, width + scrollbar_width, height - hheight, COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, (fbutton_count ? CORNER_NONE : CORNER_BOTTOM)); item_start_y = y+hheight; paintItems(); washidden = false; if (fbutton_count) - ::paintButtons(x, y + height + RADIUS_LARGE, width + sb_width, fbutton_count, fbutton_labels, width, fbutton_height); + ::paintButtons(x, y + height, width + scrollbar_width, fbutton_count, fbutton_labels, width, fbutton_height); } void CMenuWidget::setMenuPos(const int& menu_width) @@ -1298,7 +1305,7 @@ void CMenuWidget::setMenuPos(const int& menu_width) int scr_y = frameBuffer->getScreenY(); int scr_w = frameBuffer->getScreenWidth(); int scr_h = frameBuffer->getScreenHeight(); - int real_h = full_height + fbutton_height + hint_height; + int real_h = full_height + hint_height; int x_old = x; int y_old = y; //configured positions @@ -1350,11 +1357,11 @@ void CMenuWidget::paintItems() // Scrollbar if(total_pages>1) { - int item_height=height-(item_start_y-y); - paintScrollBar(x+ width, item_start_y, sb_width, item_height, total_pages, current_page); + int scrollbar_height = height - hheight - OFFSET_INNER_MID; + paintScrollBar(x + width, item_start_y, scrollbar_width, scrollbar_height, total_pages, current_page); /* background of menu items, paint every time because different items can have * different height and this might leave artifacts otherwise after changing pages */ - frameBuffer->paintBoxRel(x,item_start_y, width,item_height, COL_MENUCONTENT_PLUS_0); + frameBuffer->paintBoxRel(x, item_start_y, width, scrollbar_height, COL_MENUCONTENT_PLUS_0); } int ypos=item_start_y; @@ -1418,7 +1425,7 @@ void CMenuWidget::saveScreen() return; delete[] background; - saveScreen_height = full_height+fbutton_height; + saveScreen_height = full_height; saveScreen_width = full_width; saveScreen_y = y; saveScreen_x = x; @@ -1487,15 +1494,15 @@ void CMenuWidget::paintHint(int pos) item->hintText = " "; int iheight = item->getHeight(); - int rad = RADIUS_LARGE; int xpos = x - DETAILSLINE_WIDTH; - int ypos2 = y + height + fbutton_height + rad + OFFSET_SHADOW + OFFSET_INTER; - int iwidth = width+sb_width; + int ypos2 = y + full_height; + int iwidth = width + scrollbar_width; //init details line and infobox dimensions int ypos1 = item->getYPosition(); int ypos1a = ypos1 + (iheight/2); int ypos2a = ypos2 + (hint_height/2); + int rad = RADIUS_LARGE; int markh = hint_height > rad*2 ? hint_height - rad*2 : hint_height; int imarkh = iheight/2; @@ -1519,7 +1526,7 @@ void CMenuWidget::paintHint(int pos) info_box->setFrameThickness(g_settings.show_menu_hints_line ? 1 : 0); //NI //NI info_box->removeLineBreaks(str); info_box->setText(str, CTextBox::AUTO_WIDTH, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT], COL_MENUCONTENT_TEXT); - info_box->setCorner(RADIUS_LARGE); + info_box->setCorner(rad); info_box->setColorAll(COL_FRAME_PLUS_0, COL_MENUCONTENTDARK_PLUS_0); info_box->setTextColor(COL_MENUCONTENTDARK_TEXT); info_box->enableShadow(); @@ -2311,7 +2318,7 @@ int CMenuSeparator::paint(bool selected) item_bgcolor = COL_MENUCONTENT_PLUS_0; } - frameBuffer->paintBoxRel(x,y, dx, height, item_bgcolor); + frameBuffer->paintBoxRel(x, y, dx, height, item_bgcolor); if ((type & LINE)) { int grad = g_settings.theme.menu_Separator_gradient_enable ? CC_COLGRAD_COL_DARK_LIGHT_DARK : CC_COLGRAD_OFF; diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index 6c89f878e..ce736ada3 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -553,7 +553,7 @@ class CMenuWidget : public CMenuTarget, public CComponentsSignals int preselected; int selected; int iconOffset; - int sb_width; + int scrollbar_width; fb_pixel_t *background; int full_width, full_height; bool savescreen; diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 3c39e924d..9ee6c7130 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -93,6 +93,7 @@ #include "gui/start_wizard.h" #include "gui/update_ext.h" #include "gui/update.h" +#include "gui/update_check.h" #include "gui/videosettings.h" #include "gui/audio_select.h" #include "gui/webtv_setup.h" //NI @@ -380,6 +381,7 @@ int CNeutrinoApp::loadSetup(const char * fname) else if (i==1) sprintf(cfg_value, "/var/etc/.call"); else if (i==2) sprintf(cfg_value, "/var/etc/.srv"); else if (i==3) sprintf(cfg_value, "/var/etc/.card"); + else if (i==4) sprintf(cfg_value, "/var/etc/.update"); else strcpy(cfg_value, ""); g_settings.mode_icons_flag[i] = configfile.getString(cfg_key, cfg_value); } @@ -1103,13 +1105,11 @@ void CNeutrinoApp::upgradeSetup(const char * fname) configfile.setString("usermenu_tv_yellow", g_settings.usermenu[SNeutrinoSettings::BUTTON_YELLOW]->items); } } - //NI if (g_settings.version_pseudo < "20160804110000") { if (g_settings.tmdb_api_key == "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") g_settings.tmdb_api_key = "7270f1b571c4ecbb5b204ddb7f8939b1"; } - //NI if (g_settings.version_pseudo < "20161411235900") { //convert and remove obsolete recording_tevents key @@ -1159,13 +1159,11 @@ void CNeutrinoApp::upgradeSetup(const char * fname) configfile.deleteKey("screen_width"); configfile.deleteKey("screen_height"); } - //NI if (g_settings.version_pseudo < "20170516150000") { if (g_settings.movieplayer_bisection_jump == 1) g_settings.movieplayer_bisection_jump = 5; } - //NI if (g_settings.version_pseudo < "20170606000000") { //remove CProgressBar::PB_GRAPHIC @@ -1175,13 +1173,18 @@ void CNeutrinoApp::upgradeSetup(const char * fname) g_settings.theme.progressbar_gradient = 1; } } - //NI if (g_settings.version_pseudo < "20170606215500") { //align fontsize.filebrowser_item to new default if (configfile.getInt32("fontsize.filebrowser_item", 16) == 16) configfile.setInt32("fontsize.filebrowser_item", 17); } + if (g_settings.version_pseudo < "20170904080000") + { + //add flagfile for periodically update-check + if (g_settings.mode_icons_flag[4].empty()) + g_settings.mode_icons_flag[4] = FLAGDIR "/.update"; + } g_settings.version_pseudo = NEUTRINO_VERSION_PSEUDO; configfile.setString("version_pseudo", g_settings.version_pseudo); @@ -2594,6 +2597,7 @@ TIMER_START(); TIMER_STOP("################################## after all ##################################"); if (g_settings.softupdate_autocheck) { +#if 0 hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_CHECKUPDATE_INTERNET)); hintBox->paint(); CFlashUpdate flash; @@ -2604,6 +2608,8 @@ TIMER_STOP("################################## after all ####################### } hintBox->hide(); delete hintBox; +#endif + CFlashUpdateCheck::getInstance()->startThread(); } RealRun(); @@ -4853,6 +4859,8 @@ void stop_daemons(bool stopall, bool for_flash) cs_deregister_messenger(); } + delete CFlashUpdateCheck::getInstance(); + if (for_flash) { delete cHddStat::getInstance(); delete CRecordManager::getInstance(); diff --git a/src/nhttpd/nhttpd.conf.in b/src/nhttpd/nhttpd.conf.in index 57757c2d8..5d249142b 100644 --- a/src/nhttpd/nhttpd.conf.in +++ b/src/nhttpd/nhttpd.conf.in @@ -8,10 +8,10 @@ WebsiteMain.hosted_directory=@TARGET_HOSTED_HTTPDDIR@ configfile.version=4 mod_auth.authenticate=false mod_auth.no_auth_client= -mod_auth.password=coolstream +mod_auth.password=ni mod_auth.username=root mod_cache.cache_directory=/tmp/.cache -mod_sendfile.mime_types=htm:text/html,html:text/html,xml:text/xml,txt:text/plain,jpg:image/jpeg,jpeg:image/jpeg,gif:image/gif,png:image/png,bmp:image/bmp,css:text/css,js:text/plain,img:application/octet-stream,ico:image/x-icon,m3u:application/octet-stream,tar:application/octet-stream,gz:text/x-gzip,ts:application/octet-stream +mod_sendfile.mime_types=htm:text/html,html:text/html,xml:text/xml,txt:text/plain,jpg:image/jpeg,jpeg:image/jpeg,gif:image/gif,png:image/png,bmp:image/bmp,css:text/css,js:text/plain,yjs:text/plain,img:application/octet-stream,ico:image/x-icon,m3u:application/octet-stream,tar:application/octet-stream,gz:text/x-gzip,ts:video/MP2T,mkv:video/x-matroska,avi:video/avi,mp3:audio/mpeg,ogg:audio/ogg mod_weblog.log_format= mod_weblog.logfile=/tmp/yhttpd.log server.chroot= diff --git a/src/nhttpd/tuxboxapi/Makefile.am b/src/nhttpd/tuxboxapi/Makefile.am index f208f7b02..2376c052c 100644 --- a/src/nhttpd/tuxboxapi/Makefile.am +++ b/src/nhttpd/tuxboxapi/Makefile.am @@ -21,5 +21,7 @@ AM_CPPFLAGS += \ noinst_LIBRARIES = libnhttpd_tuxboxapi.a libnhttpd_tuxboxapi_a_SOURCES = \ - neutrinoapi.cpp neutrinoyparser.cpp controlapi.cpp + controlapi.cpp \ + neutrinoapi.cpp \ + neutrinoyparser.cpp diff --git a/src/nhttpd/tuxboxapi/controlapi.h b/src/nhttpd/tuxboxapi/controlapi.h index 38679f3f2..afa823635 100644 --- a/src/nhttpd/tuxboxapi/controlapi.h +++ b/src/nhttpd/tuxboxapi/controlapi.h @@ -155,10 +155,10 @@ public: CControlAPI(CNeutrinoAPI *_NeutrinoAPI); // virtual functions for HookHandler/Hook - virtual std::string getHookName(void) {return std::string("mod_ControlAPI");} - virtual std::string getHookVersion(void) {return std::string("$Revision$");} - virtual THandleStatus Hook_SendResponse(CyhookHandler *hh); - virtual THandleStatus Hook_PrepareResponse(CyhookHandler *hh); + virtual std::string getHookName(void) {return std::string("controlapi");} + virtual std::string getHookVersion(void) {return std::string("$Revision$");} + virtual THandleStatus Hook_SendResponse(CyhookHandler *hh); + virtual THandleStatus Hook_PrepareResponse(CyhookHandler *hh); }; #endif /* __nhttpd_neutrinocontrolapi_hpp__ */ diff --git a/src/nhttpd/tuxboxapi/neutrinoapi.cpp b/src/nhttpd/tuxboxapi/neutrinoapi.cpp index 3d9fe8959..a21238f91 100644 --- a/src/nhttpd/tuxboxapi/neutrinoapi.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoapi.cpp @@ -102,7 +102,6 @@ const char * _getISO639Description(const char * const iso) //============================================================================= // Initialization of static variables //============================================================================= -std::string CNeutrinoAPI::Dbox_Hersteller[4] = {"none", "Nokia", "Philips", "Sagem"}; std::string CNeutrinoAPI::videooutput_names[5] = {"CVBS", "RGB with CVBS", "S-Video", "YUV with VBS", "YUV with CVBS"}; std::string CNeutrinoAPI::videoformat_names[5] = {"automatic", "4:3", "14:9", "16:9", "20:9"}; std::string CNeutrinoAPI::audiotype_names[5] = {"none", "single channel","dual channel","joint stereo","stereo"}; diff --git a/src/nhttpd/tuxboxapi/neutrinoapi.h b/src/nhttpd/tuxboxapi/neutrinoapi.h index 77e51baa0..44c6d8b4a 100644 --- a/src/nhttpd/tuxboxapi/neutrinoapi.h +++ b/src/nhttpd/tuxboxapi/neutrinoapi.h @@ -49,7 +49,6 @@ public: //bool standby_mode; // some constants - static std::string Dbox_Hersteller[4]; static std::string videooutput_names[5]; static std::string videoformat_names[5]; static std::string audiotype_names[5]; diff --git a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp index a8e2503a9..03141e128 100644 --- a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp @@ -111,26 +111,26 @@ THandleStatus CNeutrinoYParser::Hook_ReadConfig(CConfigFile *Config, CStringList //============================================================================= const CNeutrinoYParser::TyFuncCall CNeutrinoYParser::yFuncCallList[]= { - {"mount-get-list", &CNeutrinoYParser::func_mount_get_list}, - {"mount-set-values", &CNeutrinoYParser::func_mount_set_values}, - {"get_bouquets_as_dropdown", &CNeutrinoYParser::func_get_bouquets_as_dropdown}, - {"get_bouquets_as_templatelist",&CNeutrinoYParser::func_get_bouquets_as_templatelist}, - {"get_actual_bouquet_number", &CNeutrinoYParser::func_get_actual_bouquet_number}, - {"get_channels_as_dropdown", &CNeutrinoYParser::func_get_channels_as_dropdown}, + {"mount-get-list", &CNeutrinoYParser::func_mount_get_list}, + {"mount-set-values", &CNeutrinoYParser::func_mount_set_values}, + {"get_bouquets_as_dropdown", &CNeutrinoYParser::func_get_bouquets_as_dropdown}, + {"get_bouquets_as_templatelist", &CNeutrinoYParser::func_get_bouquets_as_templatelist}, + {"get_actual_bouquet_number", &CNeutrinoYParser::func_get_actual_bouquet_number}, + {"get_channels_as_dropdown", &CNeutrinoYParser::func_get_channels_as_dropdown}, {"get_bouquets_with_epg", &CNeutrinoYParser::func_get_bouquets_with_epg}, {"get_actual_channel_id", &CNeutrinoYParser::func_get_actual_channel_id}, - {"get_logo_name", &CNeutrinoYParser::func_get_logo_name}, - {"get_mode", &CNeutrinoYParser::func_get_mode}, - {"get_video_pids", &CNeutrinoYParser::func_get_video_pids}, - {"get_audio_pid", &CNeutrinoYParser::func_get_radio_pid}, - {"get_audio_pids_as_dropdown", &CNeutrinoYParser::func_get_audio_pids_as_dropdown}, - {"umount_get_list", &CNeutrinoYParser::func_unmount_get_list}, + {"get_logo_name", &CNeutrinoYParser::func_get_logo_name}, + {"get_mode", &CNeutrinoYParser::func_get_mode}, + {"get_video_pids", &CNeutrinoYParser::func_get_video_pids}, + {"get_audio_pid", &CNeutrinoYParser::func_get_radio_pid}, + {"get_audio_pids_as_dropdown", &CNeutrinoYParser::func_get_audio_pids_as_dropdown}, + {"umount_get_list", &CNeutrinoYParser::func_unmount_get_list}, {"get_partition_list", &CNeutrinoYParser::func_get_partition_list}, - {"get_boxtype", &CNeutrinoYParser::func_get_boxtype}, - {"get_boxmodel", &CNeutrinoYParser::func_get_boxmodel}, + {"get_boxtype", &CNeutrinoYParser::func_get_boxtype}, + {"get_boxmodel", &CNeutrinoYParser::func_get_boxmodel}, {"get_current_stream_info", &CNeutrinoYParser::func_get_current_stream_info}, - {"get_timer_list", &CNeutrinoYParser::func_get_timer_list}, - {"set_timer_form", &CNeutrinoYParser::func_set_timer_form}, + {"get_timer_list", &CNeutrinoYParser::func_get_timer_list}, + {"set_timer_form", &CNeutrinoYParser::func_set_timer_form}, {"bouquet_editor_main", &CNeutrinoYParser::func_bouquet_editor_main}, {"set_bouquet_edit_form", &CNeutrinoYParser::func_set_bouquet_edit_form}, //NI y-funcs diff --git a/src/nhttpd/tuxboxapi/neutrinoyparser.h b/src/nhttpd/tuxboxapi/neutrinoyparser.h index 2dbb77984..31404d08d 100644 --- a/src/nhttpd/tuxboxapi/neutrinoyparser.h +++ b/src/nhttpd/tuxboxapi/neutrinoyparser.h @@ -65,8 +65,9 @@ public: // virtual functions for BaseClass virtual std::string YWeb_cgi_func(CyhookHandler *hh, std::string ycmd); + // virtual functions for HookHandler/Hook - virtual std::string getHookName(void) {return std::string("mod_NeutrinoYParser-Coolstream");} + virtual std::string getHookName(void) {return std::string("neutrinoyparser");} virtual std::string getHookVersion(void) {return std::string("$Revision$");} virtual THandleStatus Hook_SendResponse(CyhookHandler *hh); virtual THandleStatus Hook_ReadConfig(CConfigFile *Config, CStringList &ConfigList); diff --git a/src/nhttpd/yconfig.h b/src/nhttpd/yconfig.h index 01eaecb32..94f8954be 100644 --- a/src/nhttpd/yconfig.h +++ b/src/nhttpd/yconfig.h @@ -21,61 +21,59 @@ //----------------------------------------------------------------------------- // System Choice ONE choice //----------------------------------------------------------------------------- -#ifndef CONFIG_SYSTEM_BY_COMPILER // use Compiler directive to set CONFIG_SYSTEM -//#define CONFIG_SYSTEM_TUXBOX y // Tuxbox project -#define CONFIG_SYSTEM_TUXBOX_COOLSTREAM y // Tuxbox project for coolstream +#ifndef CONFIG_SYSTEM_BY_COMPILER // use Compiler directive to set CONFIG_SYSTEM +#define CONFIG_SYSTEM_TUXBOX y // Tuxbox project #endif //----------------------------------------------------------------------------- // General central Definitions //----------------------------------------------------------------------------- -#define HTTPD_VERSION "3.4.0" // Webserver version (can be overloaded) -#define YHTTPD_VERSION "1.3.2" // Webserver version (Version of yhttpd-core!) -#define IADDR_LOCAL "127.0.0.1" // local IP -#define HTTPD_NAME "yhttpd" // Webserver name (can be overloaded) -#define YHTTPD_NAME "yhttpd_core" // Webserver name (Name of yhttpd-core!) -#define AUTH_NAME_MSG "yhhtpd" // Name in Authentication Dialogue -#define CONF_VERSION 4 // Version of yhttpd-conf file -#define HTTPD_KEEPALIVE_TIMEOUT 500000 // Timeout for Keep-Alive in mircoseconds +#define HTTPD_VERSION "3.4.0" // Webserver version (can be overloaded) +#define YHTTPD_VERSION "1.3.2" // Webserver version (Version of yhttpd-core!) +#define IADDR_LOCAL "127.0.0.1" // local IP +#define HTTPD_NAME "yhttpd" // Webserver name (can be overloaded) +#define YHTTPD_NAME "yhttpd_core" // Webserver name (Name of yhttpd-core!) +#define AUTH_NAME_MSG "yhttpd" // Name in Authentication Dialogue +#define CONF_VERSION 4 // Version of yhttpd-conf file +#define HTTPD_KEEPALIVE_TIMEOUT 500000 // Timeout for Keep-Alive in mircoseconds //============================================================================= // Features wanted //============================================================================= //----------------------------------------------------------------------------- // modules //----------------------------------------------------------------------------- -//#define Y_CONFIG_USE_TESTHOOK y // Add mod: "Test-Hook" (hook example) -#define Y_CONFIG_USE_YPARSER y // Add mod: "y-Parsing" -#define Y_CONFIG_USE_AUTHHOOK y // Add mod: "Authentication" -#define Y_CONFIG_USE_WEBLOG y // Add mod: "WebLogging" -#define Y_CONFIG_USE_CACHE y // Add mod: Can cache production pages -#define Y_CONFIG_USE_SENDFILE y // Add mod: can send static files (mandantory) +#define Y_CONFIG_USE_YPARSER y // Add mod: "y-Parsing" +#define Y_CONFIG_USE_AUTHHOOK y // Add mod: "Authentication" +#define Y_CONFIG_USE_WEBLOG y // Add mod: "WebLogging" +#define Y_CONFIG_USE_CACHE y // Add mod: Can cache production pages +#define Y_CONFIG_USE_SENDFILE y // Add mod: can send static files (mandantory) //----------------------------------------------------------------------------- // Features & Build //----------------------------------------------------------------------------- -#define Y_CONFIG_FEATURE_CHECK_PORT_AUTORITY y // System: Port < 1024 need Admin-Privileges-Check -#define Y_CONFIG_HAVE_SENDFILE y // System: Have *IX SendFile -#define Y_CONFIG_FEATURE_UPLOAD y // Add Feature: File Upload POST Command -#define Y_CONFIG_USE_HOSTEDWEB y // Add Feature: Use HOSTED Web -#define Y_CONFIG_FEATURE_SHOW_SERVER_CONFIG y // Add Feature (in yParser): add /y/server-config -//#define Y_CONFIG_USE_OPEN_SSL y // Add Feature: use openSSL +#define Y_CONFIG_FEATURE_CHECK_PORT_AUTORITY y // System: Port < 1024 need Admin-Privileges-Check +#define Y_CONFIG_HAVE_SENDFILE y // System: Have *IX SendFile +#define Y_CONFIG_FEATURE_UPLOAD y // Add Feature: File Upload POST Command +#define Y_CONFIG_USE_HOSTEDWEB y // Add Feature: Use HOSTED Web +#define Y_CONFIG_FEATURE_SHOW_SERVER_CONFIG y // Add Feature (in yParser): add /y/server-config +//#define Y_CONFIG_USE_OPEN_SSL y // Add Feature: use openSSL //#define Y_CONFIG_FEATURE_KEEP_ALIVE y // Add Feature: Keep-alive //FIXME: does not work correctly now #define Y_CONFIG_FEATUE_SENDFILE_CAN_ACCESS_ALL y // Add Feature: every file can be accessed (use carefully: security!!) -//#define Y_CONFIG_FEATURE_CHROOT y // Add Feature: Use Change Root for Security +//#define Y_CONFIG_FEATURE_CHROOT y // Add Feature: Use Change Root for Security //#define Y_CONFIG_FEATURE_HTTPD_USER y // Add Feature: Set User for yhttpd-Process -#define Y_CONFIG_BUILD_AS_DAEMON y // Build as a Daemon -#define Y_CONFIG_FEATURE_THREADING y // Build with possibility for multi threading +#define Y_CONFIG_FEATURE_THREADING y // Build with possibility for multi threading //----------------------------------------------------------------------------- // Define/Undefine Features forced by CONFIG_SYSTEM_xxx // Dependencies //----------------------------------------------------------------------------- //#ifdef Y_CONFIG_USE_OPEN_SSL -//#undef Y_CONFIG_HAVE_SENDFILE // Sendfile does not work for SSL, but we'll fallback to send +//#undef Y_CONFIG_HAVE_SENDFILE // Sendfile does not work for SSL, but we'll fallback to send //#endif -#if defined(CONFIG_SYSTEM_TUXBOX) || defined(CONFIG_SYSTEM_TUXBOX_COOLSTREAM) +#ifdef CONFIG_SYSTEM_TUXBOX #define Y_CONFIG_FEATURE_UPLOAD y #define Y_CONFIG_USE_YPARSER y #define Y_CONFIG_USE_AUTHHOOK y #endif + #ifdef Y_CONFIG_FEATURE_KEEP_ALIVE #define HTTP_PROTOCOL "HTTP/1.1" #else @@ -85,50 +83,45 @@ // Configurations for systems/OSs //============================================================================= //----------------------------------------------------------------------------- -// Configurations for LINUX (Tuxbox dbox2, coolstream) -//-----------------------------------------------------------------------,js:text/plain------ +// Configurations for LINUX (Tuxbox) +//----------------------------------------------------------------------------- #undef HTTPD_NAME -#define HTTPD_NAME "nhttpd" -#define HTTPD_STANDARD_PORT 80 -#define HTTPD_MAX_CONNECTIONS 50 -#define HTTPD_REQUEST_LOG "/tmp/httpd_log" -#define SSL_PEMFILE HTTPD_CONFIGDIR "/server.pem" -#define SSL_CA_FILE HTTPD_CONFIGDIR "/cacert.pem" -#define LOG_FILE "/tmp/yhhtpd.log" -#define LOG_FORMAT "" -#define UPLOAD_TMP_FILE "/tmp/upload.tmp" -#define CACHE_DIR "/tmp/.cache" -#define HTTPD_ERRORPAGE "/Y_ErrorPage.yhtm" -#define HTTPD_SENDFILE_EXT "htm:text/html,html:text/html,xml:text/xml,txt:text/plain,jpg:image/jpeg,jpeg:image/jpeg,gif:image/gif,png:image/png,bmp:image/bmp,css:text/css,js:text/plain,yjs:text/plain,img:application/octet-stream,ico:image/x-icon,m3u:application/octet-stream,tar:application/octet-stream,gz:text/x-gzip,ts:video/MP2T,mkv:video/x-matroska,avi:video/avi,mp3:audio/mpeg,ogg:audio/ogg" -#define HTTPD_SENDFILE_ALL "false" -#define HTTPD_LANGUAGEDIR "languages" -#define HTTPD_DEFAULT_LANGUAGE "English" -#define AUTHUSER "root" +#define HTTPD_NAME "nhttpd" +#define HTTPD_STANDARD_PORT 80 +#define HTTPD_FALLBACK_PORT 8080 +#define HTTPD_MAX_CONNECTIONS 50 +#define HTTPD_REQUEST_LOG "/tmp/httpd_log" +#define LOG_FILE "/tmp/yhttpd.log" +#define LOG_FORMAT "" +#define UPLOAD_TMP_FILE "/tmp/upload.tmp" +#define CACHE_DIR "/tmp/.cache" +#define HTTPD_ERRORPAGE "/Y_ErrorPage.yhtm" +#define HTTPD_SENDFILE_EXT "htm:text/html,html:text/html,xml:text/xml,txt:text/plain,jpg:image/jpeg,jpeg:image/jpeg,gif:image/gif,png:image/png,bmp:image/bmp,css:text/css,js:text/plain,yjs:text/plain,img:application/octet-stream,ico:image/x-icon,m3u:application/octet-stream,tar:application/octet-stream,gz:text/x-gzip,ts:video/MP2T,mkv:video/x-matroska,avi:video/avi,mp3:audio/mpeg,ogg:audio/ogg" +#define HTTPD_SENDFILE_ALL "true" +#define HTTPD_LANGUAGEDIR "languages" +#define HTTPD_DEFAULT_LANGUAGE "Deutsch" -#define HTTPD_CONFIGDIR CONFIGDIR -#define HTTPD_CONFIGFILE HTTPD_CONFIGDIR"/nhttpd.conf" -#define YWEB_CONFIGFILE HTTPD_CONFIGDIR"/Y-Web.conf" -#define PUBLICDOCUMENTROOT PUBLIC_HTTPDDIR -#define NEUTRINO_CONFIGFILE CONFIGDIR"/neutrino.conf" -#define MOVIEBROWSER_CONFIGFILE CONFIGDIR"/moviebrowser.conf" -#define HOSTEDDOCUMENTROOT HOSTED_HTTPDDIR -#define HOSTEDDOCUMENTURL "/hosted/" -#define EXTRASDOCUMENTROOT HOSTED_HTTPDDIR"/extras" -#define EXTRASDOCUMENTURL "/hosted/extras" -#define ZAPITXMLPATH CONFIGDIR"/zapit" -#define TUXBOX_LOGOS_URL LOGODIR //NI +#define AUTHUSER "root" +#define AUTHPASSWORD "ni" -// switch for Box differences -#ifdef CONFIG_SYSTEM_TUXBOX -#define AUTHPASSWORD "dbox2" -#define PRIVATEDOCUMENTROOT DATADIR "/neutrino/httpd-y" -#endif +#define HTTPD_CONFIGDIR CONFIGDIR +#define HTTPD_CONFIGFILE HTTPD_CONFIGDIR"/nhttpd.conf" +#define YWEB_CONFIGFILE HTTPD_CONFIGDIR"/Y-Web.conf" +#define NEUTRINO_CONFIGFILE CONFIGDIR"/neutrino.conf" +#define MOVIEBROWSER_CONFIGFILE CONFIGDIR"/moviebrowser.conf" -#ifdef CONFIG_SYSTEM_TUXBOX_COOLSTREAM -#define AUTHPASSWORD "coolstream" -#define PRIVATEDOCUMENTROOT PRIVATE_HTTPDDIR -#undef Y_CONFIG_BUILD_AS_DAEMON // No Daemon -#endif +#define PRIVATEDOCUMENTROOT PRIVATE_HTTPDDIR +#define PUBLICDOCUMENTROOT PUBLIC_HTTPDDIR +#define HOSTEDDOCUMENTROOT HOSTED_HTTPDDIR +#define HOSTEDDOCUMENTURL "/hosted/" +#define EXTRASDOCUMENTROOT HOSTED_HTTPDDIR"/extras" +#define EXTRASDOCUMENTURL "/hosted/extras" + +#define ZAPITXMLPATH CONFIGDIR"/zapit" +#define TUXBOX_LOGOS_URL LOGODIR + +#define SSL_PEMFILE HTTPD_CONFIGDIR "/server.pem" +#define SSL_CA_FILE HTTPD_CONFIGDIR "/cacert.pem" //----------------------------------------------------------------------------- // Aggregated definitions //----------------------------------------------------------------------------- diff --git a/src/nhttpd/yhttpd.cpp b/src/nhttpd/yhttpd.cpp index 1aa0c55be..e7b66ddff 100644 --- a/src/nhttpd/yhttpd.cpp +++ b/src/nhttpd/yhttpd.cpp @@ -56,54 +56,22 @@ static CmodCache mod_cache; // static instance #endif //----------------------------------------------------------------------------- -#if defined(CONFIG_SYSTEM_TUXBOX) || defined(CONFIG_SYSTEM_TUXBOX_COOLSTREAM) + +#ifdef CONFIG_SYSTEM_TUXBOX #include "neutrinoapi.h" #include static CNeutrinoAPI *NeutrinoAPI; #endif //============================================================================= -// Main: Main Entry, Command line passing, Webserver Instance creation & Loop +// Main: Main Entry, Webserver thread //============================================================================= -volatile sig_atomic_t Cyhttpd::sig_do_shutdown = 0; -//----------------------------------------------------------------------------- -// Signal Handling -//----------------------------------------------------------------------------- -#ifdef Y_CONFIG_BUILD_AS_DAEMON -static void sig_catch(int msignal) -{ - aprintf("!!! SIGNAL !!! :%d!\n",msignal); - switch (msignal) { - // case SIGTERM: - // case SIGINT: - case SIGPIPE: - aprintf("got signal PIPE, nice!\n"); - break; - case SIGHUP: - case SIGUSR1: - aprintf("got signal HUP/USR1, reading config\n"); - if (yhttpd) - yhttpd->ReadConfig(); - break; - default: - aprintf("No special SIGNAL-Handler:%d!\n",msignal); - // log_level_printf(1, "Got SIGTERM\n"); - Cyhttpd::sig_do_shutdown = 1; - yhttpd->stop_webserver(); - delete yhttpd; - exit(EXIT_SUCCESS); //FIXME: return to main() some way... - break; - - } -} -#endif - -//----------------------------------------------------------------------------- void yhttpd_reload_config() { if (yhttpd) yhttpd->ReadConfig(); } + //----------------------------------------------------------------------------- // Main Entry //----------------------------------------------------------------------------- @@ -118,7 +86,6 @@ void thread_cleanup (void *p) y = NULL; } -#ifndef Y_CONFIG_BUILD_AS_DAEMON void * nhttpd_main_thread(void *) { set_threadname("yweb:main_thread"); pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, 0); @@ -153,98 +120,6 @@ void * nhttpd_main_thread(void *) { aprintf("Main end\n"); return (void *) EXIT_SUCCESS; } -#endif -#ifdef Y_CONFIG_BUILD_AS_DAEMON -int main(int argc, char **argv) -{ - aprintf("Webserver %s\n", WEBSERVERNAME); - bool do_fork = true; - yhttpd = new Cyhttpd(); - if(!yhttpd) - { - aprintf("Error initializing WebServer\n"); - return EXIT_FAILURE; - } - for (int i = 1; i < argc; i++) - { - if ((!strncmp(argv[i], "-d", 2)) || (!strncmp(argv[i], "--debug", 7))) - { - CLogging::getInstance()->setDebug(true); - do_fork = false; - } - else if ((!strncmp(argv[i], "-f", 2)) || (!strncmp(argv[i], "--fork", 6))) - { - do_fork = false; - } - else if ((!strncmp(argv[i], "-h", 2)) || (!strncmp(argv[i], "--help", 6))) - { - yhttpd->usage(stdout); - return EXIT_SUCCESS; - } - else if ((!strncmp(argv[i], "-v", 2)) || (!strncmp(argv[i],"--version", 9))) - { - yhttpd->version(stdout); - return EXIT_SUCCESS; - } - else if ((!strncmp(argv[i], "-t", 2)) || (!strncmp(argv[i],"--thread-off", 12))) - { - yhttpd->flag_threading_off = true; - } - else if ((!strncmp(argv[i], "-l", 2)) ) - { - if(argv[i][2] >= '0' && argv[i][2] <= '9') - CLogging::getInstance()->LogLevel = (argv[i][2]-'0'); - } - else - { - yhttpd->usage(stderr); - return EXIT_FAILURE; - } - } - // setup signal catching (subscribing) - signal(SIGPIPE, sig_catch); - signal(SIGINT, sig_catch); - signal(SIGHUP, sig_catch); - signal(SIGUSR1, sig_catch); - signal(SIGTERM, sig_catch); - signal(SIGCLD, SIG_IGN); - // signal(SIGALRM, sig_catch); - - yhttpd->hooks_attach(); - yhttpd->ReadConfig(); - if(yhttpd->Configure()) - { - // Start Webserver: fork ist if not in debug mode - aprintf("Webserver starting...\n"); - if (do_fork) - { - log_level_printf(9,"do fork\n"); - switch (fork()) { - case -1: - dperror("fork"); - return -1; - case 0: - break; - default: - return EXIT_SUCCESS; - } - - if (setsid() == -1) - { - dperror("Error setsid"); - return EXIT_FAILURE; - } - } - dprintf("Start in Debug-Mode\n"); // non forked debugging loop - - yhttpd->run(); - } - delete yhttpd; - - aprintf("Main end\n"); - return EXIT_SUCCESS; -} -#endif //============================================================================= // Class yhttpd //============================================================================= @@ -355,20 +230,6 @@ void Cyhttpd::version(FILE *dest) { fprintf(dest, "%s - Webserver v%s\n", HTTPD_NAME, HTTPD_VERSION); } -//----------------------------------------------------------------------------- -// Show Usage -//----------------------------------------------------------------------------- -void Cyhttpd::usage(FILE *dest) { - version(dest); - fprintf(dest, "command line parameters:\n"); - fprintf(dest, "-d, --debug enable debugging code (implies -f)\n"); - fprintf(dest, "-f, --fork do not fork\n"); - fprintf(dest, "-h, --help display this text and exit\n\n"); - fprintf(dest, "-v, --version display version and exit\n"); - fprintf(dest, "-l, set loglevel (0 .. 9)\n"); - fprintf(dest, "-t, --thread-off set threading off\n"); -} - //----------------------------------------------------------------------------- // Stop WebServer //----------------------------------------------------------------------------- @@ -389,12 +250,7 @@ void Cyhttpd::hooks_attach() { CyhookHandler::attach(auth); #endif -#ifdef Y_CONFIG_USE_TESTHOOK - testhook = new CTesthook(); - CyhookHandler::attach(testhook); -#endif - -#if defined(CONFIG_SYSTEM_TUXBOX) || defined(CONFIG_SYSTEM_TUXBOX_COOLSTREAM) +#ifdef CONFIG_SYSTEM_TUXBOX NeutrinoAPI = new CNeutrinoAPI(); CyhookHandler::attach(NeutrinoAPI->NeutrinoYParser); CyhookHandler::attach(NeutrinoAPI->ControlAPI); @@ -427,12 +283,7 @@ void Cyhttpd::hooks_detach() { delete auth; #endif -#ifdef Y_CONFIG_USE_TESTHOOK - CyhookHandler::detach(testhook); - delete testhook; -#endif - -#if defined(CONFIG_SYSTEM_TUXBOX) || defined(CONFIG_SYSTEM_TUXBOX_COOLSTREAM) +#ifdef CONFIG_SYSTEM_TUXBOX CyhookHandler::detach(NeutrinoAPI->NeutrinoYParser); #else #ifdef Y_CONFIG_USE_YPARSER @@ -471,29 +322,19 @@ void Cyhttpd::ReadConfig(void) { CConfigFile OrgConfig = *Config; Config->clear(); - Config->setInt32("server.log.loglevel", OrgConfig.getInt32( - "LogLevel", 0)); + Config->setInt32("server.log.loglevel", OrgConfig.getInt32("LogLevel", 0)); Config->setInt32("configfile.version", CONF_VERSION); Config->setString("webserver.websites", "WebsiteMain"); - Config->setBool("webserver.threading", OrgConfig.getBool("THREADS", - true)); - Config->setInt32("WebsiteMain.port", OrgConfig.getInt32("Port", - HTTPD_STANDARD_PORT)); - Config->setString("WebsiteMain.directory", OrgConfig.getString( - "PrivatDocRoot", PRIVATEDOCUMENTROOT)); + Config->setBool("webserver.threading", OrgConfig.getBool("THREADS", true)); + Config->setInt32("WebsiteMain.port", OrgConfig.getInt32("Port", HTTPD_STANDARD_PORT)); + Config->setString("WebsiteMain.directory", OrgConfig.getString("PrivatDocRoot", PRIVATEDOCUMENTROOT)); if (!OrgConfig.getString("PublicDocRoot", "").empty()) - Config->setString("WebsiteMain.override_directory", - OrgConfig.getString("PublicDocRoot", - PRIVATEDOCUMENTROOT)); + Config->setString("WebsiteMain.override_directory", OrgConfig.getString("PublicDocRoot", PRIVATEDOCUMENTROOT)); // mod_auth - Config->setString("mod_auth.username", OrgConfig.getString( - "AuthUser", AUTHUSER)); - Config->setString("mod_auth.password", OrgConfig.getString( - "AuthPassword", AUTHPASSWORD)); - Config->setString("mod_auth.no_auth_client", OrgConfig.getString( - "NoAuthClient", "")); - Config->setString("mod_auth.authenticate", OrgConfig.getString( - "Authenticate", "false")); + Config->setString("mod_auth.username", OrgConfig.getString("AuthUser", AUTHUSER)); + Config->setString("mod_auth.password", OrgConfig.getString("AuthPassword", AUTHPASSWORD)); + Config->setString("mod_auth.no_auth_client", OrgConfig.getString("NoAuthClient", "")); + Config->setString("mod_auth.authenticate", OrgConfig.getString("Authenticate", "false")); Config->setString("mod_sendfile.mime_types", HTTPD_SENDFILE_EXT); @@ -504,7 +345,7 @@ void Cyhttpd::ReadConfig(void) { if (Config->getInt32("configfile.version") < 2) { Config->setString("mod_sendfile.mime_types", HTTPD_SENDFILE_EXT); Config->setInt32("configfile.version", CONF_VERSION); - Config->setString("mod_sendfile.sendAll", "false"); + Config->setString("mod_sendfile.sendAll", HTTPD_SENDFILE_ALL); Config->saveConfig(HTTPD_CONFIGFILE); } // Add Defaults for Version 4 @@ -532,29 +373,19 @@ void Cyhttpd::ReadConfig(void) { #endif // get variables - webserver->init(Config->getInt32("WebsiteMain.port", HTTPD_STANDARD_PORT), - Config->getBool("webserver.threading", true)); + webserver->init(Config->getInt32("WebsiteMain.port", HTTPD_STANDARD_PORT), Config->getBool("webserver.threading", true)); // informational use - ConfigList["WebsiteMain.port"] = itoa(Config->getInt32("WebsiteMain.port", - HTTPD_STANDARD_PORT)); - ConfigList["webserver.threading"] = Config->getString( - "webserver.threading", "true"); - ConfigList["configfile.version"] = Config->getInt32("configfile.version", - CONF_VERSION); - ConfigList["server.log.loglevel"] = itoa(Config->getInt32( - "server.log.loglevel", 0)); - ConfigList["server.no_keep-alive_ips"] = Config->getString( - "server.no_keep-alive_ips", ""); - webserver->conf_no_keep_alive_ips = Config->getStringVector( - "server.no_keep-alive_ips"); + ConfigList["WebsiteMain.port"] = itoa(Config->getInt32("WebsiteMain.port", HTTPD_STANDARD_PORT)); + ConfigList["webserver.threading"] = Config->getString("webserver.threading", "true"); + ConfigList["configfile.version"] = Config->getInt32("configfile.version", CONF_VERSION); + ConfigList["server.log.loglevel"] = itoa(Config->getInt32("server.log.loglevel", 0)); + ConfigList["server.no_keep-alive_ips"] = Config->getString("server.no_keep-alive_ips", ""); + webserver->conf_no_keep_alive_ips = Config->getStringVector("server.no_keep-alive_ips"); // MainSite - ConfigList["WebsiteMain.directory"] = Config->getString( - "WebsiteMain.directory", PRIVATEDOCUMENTROOT); - ConfigList["WebsiteMain.override_directory"] = Config->getString( - "WebsiteMain.override_directory", PUBLICDOCUMENTROOT); - ConfigList["WebsiteMain.hosted_directory"] = Config->getString( - "WebsiteMain.hosted_directory", HOSTEDDOCUMENTROOT); + ConfigList["WebsiteMain.directory"] = Config->getString("WebsiteMain.directory", PRIVATEDOCUMENTROOT); + ConfigList["WebsiteMain.override_directory"] = Config->getString("WebsiteMain.override_directory", PUBLICDOCUMENTROOT); + ConfigList["WebsiteMain.hosted_directory"] = Config->getString("WebsiteMain.hosted_directory", HOSTEDDOCUMENTROOT); ConfigList["Tuxbox.DisplayLogos"] = Config->getString("Tuxbox.DisplayLogos", "true"); // Check location of logos @@ -587,15 +418,12 @@ void Cyhttpd::ReadConfig(void) { CySocket::initSSL(); #endif ConfigList["server.user_name"] = Config->getString("server.user_name", ""); - ConfigList["server.group_name"] - = Config->getString("server.group_name", ""); + ConfigList["server.group_name"] = Config->getString("server.group_name", ""); ConfigList["server.chroot"] = Config->getString("server.chroot", ""); // language - ConfigList["Language.directory"] = Config->getString("Language.directory", - HTTPD_LANGUAGEDIR); - ConfigList["Language.selected"] = Config->getString("Language.selected", - HTTPD_DEFAULT_LANGUAGE); + ConfigList["Language.directory"] = Config->getString("Language.directory", HTTPD_LANGUAGEDIR); + ConfigList["Language.selected"] = Config->getString("Language.selected", HTTPD_DEFAULT_LANGUAGE); yhttpd->ReadLanguage(); // Read App specifig settings by Hook @@ -613,7 +441,6 @@ void Cyhttpd::ReadConfig(void) { void Cyhttpd::ReadLanguage(void) { // Init Class vars CLanguage *lang = CLanguage::getInstance(); - log_level_printf(3, "ReadLanguage:%s\n", - ConfigList["Language.selected"].c_str()); + log_level_printf(3, "ReadLanguage:%s\n", ConfigList["Language.selected"].c_str()); lang->setLanguage(ConfigList["Language.selected"]); } diff --git a/src/nhttpd/yhttpd.h b/src/nhttpd/yhttpd.h index eff8a9ac8..f0a7478ef 100644 --- a/src/nhttpd/yhttpd.h +++ b/src/nhttpd/yhttpd.h @@ -39,7 +39,6 @@ public: bool Configure(); void stop_webserver(); // Remove Hooks, Stop Webserver static void version(FILE *dest);// Show Webserver Version - static void usage(FILE *dest); // Show command line usage // Hooks void hooks_attach(); // Add a Hook-Class to HookList void hooks_detach(); // Remove a Hook-Class from HookList diff --git a/src/nhttpd/yhttpd_core/Makefile.am b/src/nhttpd/yhttpd_core/Makefile.am index 5d95d0e77..6f97b33c1 100644 --- a/src/nhttpd/yhttpd_core/Makefile.am +++ b/src/nhttpd/yhttpd_core/Makefile.am @@ -17,6 +17,13 @@ AM_CPPFLAGS += -fno-rtti -fno-exceptions -D_FILE_OFFSET_BITS=64 noinst_LIBRARIES = libyhttpd.a libyhttpd_a_SOURCES = \ - ylogging.cpp helper.cpp ylanguage.cpp\ - ywebserver.cpp yconnection.cpp yrequest.cpp yresponse.cpp yhook.cpp ysocket.cpp + helper.cpp \ + yconnection.cpp \ + yhook.cpp \ + ylanguage.cpp\ + ylogging.cpp \ + yrequest.cpp \ + yresponse.cpp \ + ysocket.cpp \ + ywebserver.cpp diff --git a/src/nhttpd/yhttpd_core/ywebserver.cpp b/src/nhttpd/yhttpd_core/ywebserver.cpp index e1a5f149d..bfd04dbc3 100644 --- a/src/nhttpd/yhttpd_core/ywebserver.cpp +++ b/src/nhttpd/yhttpd_core/ywebserver.cpp @@ -53,7 +53,7 @@ CWebserver::CWebserver() { pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); #endif - port = 80; + port = HTTPD_STANDARD_PORT; } //----------------------------------------------------------------------------- @@ -120,14 +120,15 @@ CWebserver::~CWebserver() { bool CWebserver::run(void) { set_threadname("ywebsrv::run"); if (!listenSocket.listen(port, HTTPD_MAX_CONNECTIONS)) { - if (port != 80) { - fprintf(stderr, "[yhttpd] Socket cannot bind and listen on port %d Abort.\n", port); + if (port != HTTPD_STANDARD_PORT) { + // WebsiteMain.port in nhttpd.conf is changed by user + fprintf(stderr, "[yhttpd] Socket cannot bind and listen on port %d. Abort.\n", port); return false; } - fprintf(stderr, "[yhttpd] cannot bind and listen on port 80, retrying on port 8080.\n"); - port = 8080; + fprintf(stderr, "[yhttpd] Socket cannot bind and listen on port %d. Retrying port %d.\n", HTTPD_STANDARD_PORT, HTTPD_FALLBACK_PORT); + port = HTTPD_FALLBACK_PORT; if (!listenSocket.listen(port, HTTPD_MAX_CONNECTIONS)) { - fprintf(stderr, "[yhttpd] Socket cannot bind and listen on port %d Abort.\n", port); + fprintf(stderr, "[yhttpd] Socket cannot bind and listen on port %d. Abort.\n", HTTPD_FALLBACK_PORT); return false; } } diff --git a/src/nhttpd/yhttpd_mods/Makefile.am b/src/nhttpd/yhttpd_mods/Makefile.am index c3a3791e9..dee165cb5 100644 --- a/src/nhttpd/yhttpd_mods/Makefile.am +++ b/src/nhttpd/yhttpd_mods/Makefile.am @@ -19,5 +19,9 @@ AM_CPPFLAGS += \ noinst_LIBRARIES = libyhttpdmods.a libyhttpdmods_a_SOURCES = \ - mod_yparser.cpp mod_testhook.cpp mod_auth.cpp mod_cache.cpp mod_sendfile.cpp mod_weblog.cpp + mod_auth.cpp \ + mod_cache.cpp \ + mod_sendfile.cpp \ + mod_weblog.cpp \ + mod_yparser.cpp diff --git a/src/nhttpd/yhttpd_mods/mod_auth.cpp b/src/nhttpd/yhttpd_mods/mod_auth.cpp index 3defe1ca8..50c1f6da5 100644 --- a/src/nhttpd/yhttpd_mods/mod_auth.cpp +++ b/src/nhttpd/yhttpd_mods/mod_auth.cpp @@ -1,6 +1,6 @@ //============================================================================= // YHTTPD -// TestHook +// mod_auth : Authentication //============================================================================= #include diff --git a/src/nhttpd/yhttpd_mods/mod_auth.h b/src/nhttpd/yhttpd_mods/mod_auth.h index 4efdcd8e9..9c44c325f 100644 --- a/src/nhttpd/yhttpd_mods/mod_auth.h +++ b/src/nhttpd/yhttpd_mods/mod_auth.h @@ -17,16 +17,12 @@ public: } ; - // Hooks - virtual THandleStatus Hook_PrepareResponse(CyhookHandler *hh); - virtual std::string getHookName(void) { - return std::string("mod_auth"); - } - virtual std::string getHookVersion(void) { - return std::string("$Revision$"); - } - virtual THandleStatus Hook_ReadConfig(CConfigFile *Config, - CStringList &ConfigList); + // virtual functions for HookHandler/Hook + virtual std::string getHookName(void) {return std::string("mod_auth");} + virtual std::string getHookVersion(void) {return std::string("$Revision$");} + virtual THandleStatus Hook_PrepareResponse(CyhookHandler *hh); + virtual THandleStatus Hook_ReadConfig(CConfigFile *Config, CStringList &ConfigList); + protected: bool CheckAuth(CyhookHandler *hh); std::string decodeBase64(const char *b64buffer); diff --git a/src/nhttpd/yhttpd_mods/mod_cache.h b/src/nhttpd/yhttpd_mods/mod_cache.h index d4172e6aa..b380c1b38 100644 --- a/src/nhttpd/yhttpd_mods/mod_cache.h +++ b/src/nhttpd/yhttpd_mods/mod_cache.h @@ -48,12 +48,12 @@ public: static void RemoveCategoryFromCache(std::string category); static void DeleteCache(void); - // Hooks + // virtual functions for HookHandler/Hook + virtual std::string getHookName(void) {return std::string("mod_cache");} + virtual std::string getHookVersion(void) {return std::string("$Revision$");} virtual THandleStatus Hook_PrepareResponse(CyhookHandler *hh); virtual THandleStatus Hook_SendResponse(CyhookHandler *hh); - virtual std::string getHookVersion(void) {return std::string("$Revision$");} - virtual std::string getHookName(void) {return std::string("mod_cache");} - virtual THandleStatus Hook_ReadConfig(CConfigFile *Config,CStringList &ConfigList); + virtual THandleStatus Hook_ReadConfig(CConfigFile *Config, CStringList &ConfigList); }; #endif /* __yhttpd_mod_cache_h__ */ diff --git a/src/nhttpd/yhttpd_mods/mod_sendfile.h b/src/nhttpd/yhttpd_mods/mod_sendfile.h index e4294a25f..4dfa4af7f 100644 --- a/src/nhttpd/yhttpd_mods/mod_sendfile.h +++ b/src/nhttpd/yhttpd_mods/mod_sendfile.h @@ -28,11 +28,11 @@ public: CmodSendfile(){}; ~CmodSendfile(void){}; - // Hooks - virtual THandleStatus Hook_PrepareResponse(CyhookHandler *hh); -// virtual THandleStatus Hook_SendResponse(CyhookHandler *hh); + // virtual functions for HookHandler/Hook virtual std::string getHookName(void) {return std::string("mod_sendfile");} virtual std::string getHookVersion(void) {return std::string("$Revision$");} + virtual THandleStatus Hook_PrepareResponse(CyhookHandler *hh); +// virtual THandleStatus Hook_SendResponse(CyhookHandler *hh); virtual THandleStatus Hook_ReadConfig(CConfigFile *Config, CStringList &ConfigList); }; diff --git a/src/nhttpd/yhttpd_mods/mod_testhook.cpp b/src/nhttpd/yhttpd_mods/mod_testhook.cpp deleted file mode 100644 index 6f3195203..000000000 --- a/src/nhttpd/yhttpd_mods/mod_testhook.cpp +++ /dev/null @@ -1,17 +0,0 @@ -//============================================================================= -// YHTTPD -// TestHook -//============================================================================= - -#include "mod_testhook.h" - -THandleStatus CTesthook::Hook_SendResponse(CyhookHandler *hh) -{ - THandleStatus status = HANDLED_NONE; - if(hh->UrlData["filename"] == "test2") - { - hh->yresult = "test it 2222\n"; - status = HANDLED_READY; - } - return status; -} diff --git a/src/nhttpd/yhttpd_mods/mod_testhook.h b/src/nhttpd/yhttpd_mods/mod_testhook.h deleted file mode 100644 index 1f6ed9f2e..000000000 --- a/src/nhttpd/yhttpd_mods/mod_testhook.h +++ /dev/null @@ -1,21 +0,0 @@ -//============================================================================= -// YHTTPD -// TestHook -//============================================================================= -#ifndef TESTHOOK_H_ -#define TESTHOOK_H_ - - -#include -class CTesthook : public Cyhook -{ -public: - THandleStatus Hook_SendResponse(CyhookHandler *hh); - CTesthook(){}; - ~CTesthook(){}; - - virtual std::string getHookName(void) {return std::string("Testhook");} - -}; -#endif /*TESTHOOK_H_*/ - diff --git a/src/nhttpd/yhttpd_mods/mod_weblog.h b/src/nhttpd/yhttpd_mods/mod_weblog.h index bcdf2d96e..4e0d5ca02 100644 --- a/src/nhttpd/yhttpd_mods/mod_weblog.h +++ b/src/nhttpd/yhttpd_mods/mod_weblog.h @@ -33,10 +33,10 @@ public: void AddLogEntry_ELF(CyhookHandler *hh); bool printf(const char *fmt, ...); - // Hooks - virtual THandleStatus Hook_EndConnection(CyhookHandler *hh); + // virtual functions for HookHandler/Hook virtual std::string getHookName(void) {return std::string("mod_weblog");} virtual std::string getHookVersion(void) {return std::string("$Revision$");} + virtual THandleStatus Hook_EndConnection(CyhookHandler *hh); virtual THandleStatus Hook_ReadConfig(CConfigFile *Config, CStringList &ConfigList); }; #endif // __yhttpd_mod_weblog_h__ diff --git a/src/nhttpd/yhttpd_mods/mod_yparser.h b/src/nhttpd/yhttpd_mods/mod_yparser.h index dc6209ec2..bbe7f9dac 100644 --- a/src/nhttpd/yhttpd_mods/mod_yparser.h +++ b/src/nhttpd/yhttpd_mods/mod_yparser.h @@ -113,9 +113,10 @@ public: // virtual functions for BaseClass virtual std::string YWeb_cgi_func(CyhookHandler *hh, std::string ycmd); + // virtual functions for HookHandler/Hook - virtual std::string getHookVersion(void) {return std::string("$Revision$");} virtual std::string getHookName(void) {return "mod_yparser";} + virtual std::string getHookVersion(void) {return std::string("$Revision$");} virtual THandleStatus Hook_SendResponse(CyhookHandler *hh); }; diff --git a/src/system/ansi.h b/src/system/ansi.h deleted file mode 100644 index d46131b26..000000000 --- a/src/system/ansi.h +++ /dev/null @@ -1,61 +0,0 @@ -/* ansi.h */ - -/* ANSI control codes for various neat-o terminal effects - - * Some older versions of Ultrix don't appear to be able to - * handle these escape sequences. If lowercase 'a's are being - * stripped, and/or the output of the ANSI is screwed up, you - * have the Ultrix problem. - * - * To fix the ANSI problem, try replacing the '\x1B' with '\033'. - * To fix the problem with 'a's, replace all occurrences of '\a' - * in the code with '\07'. - * - */ - -#ifndef _ANSI_H_ -#define _ANSI_H_ - -#define BEEP_CHAR '\a' -#define ESC_CHAR '\x1B' - -#define ANSI_BEGIN "\x1B[" - -#define ANSI_NORMAL "\x1B[0m" - -#define ANSI_HILITE "\x1B[1m" -#define ANSI_INVERSE "\x1B[7m" -#define ANSI_BLINK "\x1B[5m" -#define ANSI_UNDERSCORE "\x1B[4m" -#define ANSI_TRUNCATE "\x1B[=71" - -#define ANSI_INV_BLINK "\x1B[7;5m" -#define ANSI_INV_HILITE "\x1B[1;7m" -#define ANSI_BLINK_HILITE "\x1B[1;5m" -#define ANSI_INV_BLINK_HILITE "\x1B[1;5;7m" - -/* Foreground colors */ - -#define ANSI_FOR_BLACK "\x1B[30m" -#define ANSI_FOR_RED "\x1B[31m" -#define ANSI_FOR_GREEN "\x1B[32m" -#define ANSI_FOR_YELLOW "\x1B[33m" -#define ANSI_FOR_BLUE "\x1B[34m" -#define ANSI_FOR_MAGENTA "\x1B[35m" -#define ANSI_FOR_CYAN "\x1B[36m" -#define ANSI_FOR_WHITE "\x1B[37m" - -/* Background colors */ - -#define ANSI_BAC_BLACK "\x1B[40m" -#define ANSI_BAC_RED "\x1B[41m" -#define ANSI_BAC_GREEN "\x1B[42m" -#define ANSI_BAC_YELLOW "\x1B[43m" -#define ANSI_BAC_BLUE "\x1B[44m" -#define ANSI_BAC_MAGENTA "\x1B[45m" -#define ANSI_BAC_CYAN "\x1B[46m" -#define ANSI_BAC_WHITE "\x1B[47m" - -#define ANSI_END "m" - -#endif /* _ANSI_H_ */ diff --git a/version_pseudo.h b/version_pseudo.h index 8e3fea959..5540dd3fd 100644 --- a/version_pseudo.h +++ b/version_pseudo.h @@ -1 +1 @@ -#define NEUTRINO_VERSION_PSEUDO "20170606215500" +#define NEUTRINO_VERSION_PSEUDO "20170904080000"