- yweb: re-introduce 'WebsiteMain.hosted_directory'

* this directory can be used to host some of your cracy stuff.
  yhtm, yjs and ysh will also parsed now. it is reachable with
  <boxip>/hosted/
* if exist a subdir named 'logos' in this directory you can use
  this as an external logo-dir for yweb too
* path can be configured with '--with-hosted_httpddir=PATH'
This commit is contained in:
svenhoefer
2013-06-27 12:20:29 +02:00
parent ac53313da4
commit 9078775a0a
12 changed files with 59 additions and 28 deletions

View File

@@ -490,7 +490,7 @@ void Cyhttpd::ReadConfig(void) {
Config->setString("Language.selected", HTTPD_DEFAULT_LANGUAGE);
Config->setString("Language.directory", HTTPD_LANGUAGEDIR);
if (Config->getString("WebsiteMain.hosted_directory", "") == "")
Config->setString("WebsiteMain.hosted_directory", "/var/hosted");
Config->setString("WebsiteMain.hosted_directory", HOSTEDDOCUMENTROOT);
Config->saveConfig(HTTPD_CONFIGFILE);
}
}
@@ -527,14 +527,20 @@ void Cyhttpd::ReadConfig(void) {
// Check location of logos
if (Config->getString("Tuxbox.LogosURL", "") == "") {
if (access(std::string(ConfigList["WebsiteMain.directory"] + "/logos").c_str(), 4) == 0) {
Config->setString("Tuxbox.LogosURL", ConfigList["WebsiteMain.directory"] + "/logos");
have_config = false; //save config
}
else if (access(std::string(ConfigList["WebsiteMain.override_directory"] ).c_str(), 4) == 0){
if (access(std::string(ConfigList["WebsiteMain.override_directory"] + "/logos").c_str(), 4) == 0) {
Config->setString("Tuxbox.LogosURL", ConfigList["WebsiteMain.override_directory"] + "/logos");
have_config = false; //save config
}
else if (access(std::string(ConfigList["WebsiteMain.directory"] + "/logos").c_str(), 4) == 0){
Config->setString("Tuxbox.LogosURL", ConfigList["WebsiteMain.directory"] + "/logos");
have_config = false; //save config
}
#ifdef Y_CONFIG_USE_HOSTEDWEB
else if (access(std::string(ConfigList["WebsiteMain.hosted_directory"] + "/logos").c_str(), 4) == 0){
Config->setString("Tuxbox.LogosURL", ConfigList["WebsiteMain.hosted_directory"] + "/logos");
have_config = false; //save config
}
#endif //Y_CONFIG_USE_HOSTEDWEB
}
ConfigList["Tuxbox.LogosURL"] = Config->getString("Tuxbox.LogosURL", "");