update update check service location
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
ebusd.eu config webservice
|
||||
==========================
|
||||
|
||||
This is the code running on the ebusd.eu config webservice that allows ebusd to download the needed CSV configuration files instead of having to install the ebusd-configuration package.
|
||||
|
||||
It is enabled by default in ebusd due to the default value of the `--configpath=http://ebusd.eu/config/` commandline option.
|
||||
This is the code of the webservice at http://cfg.ebusd.eu/ that allows ebusd to download the needed CSV configuration
|
||||
files instead of having to install the ebusd-configuration package.
|
||||
|
||||
It is enabled by default in ebusd due to the default value of the `--configpath=http://cfg.ebusd.eu/` commandline option.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
$agent = $_SERVER['HTTP_USER_AGENT'];
|
||||
if (substr($agent, 0, 5)!=='ebusd') {
|
||||
header('HTTP/1.1 404 Not Found');
|
||||
header('Location: https://upd.ebusd.eu/', true, 301);
|
||||
exit;
|
||||
}
|
||||
$p=@$_REQUEST['p'];
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
ebusd.eu update webservice
|
||||
==========================
|
||||
|
||||
This is the code running on the ebusd.eu update webservice that allows ebusd to check its own version and the configuration files for availability of new versions.
|
||||
This is the code of the webservice at http://upd.ebusd.eu/ that allows ebusd to check its own version and the
|
||||
configuration files for availability of new versions.
|
||||
|
||||
It is enabled by default in ebusd due to the default value of the `--updatecheck=on` commandline option.
|
||||
|
||||
|
||||
+2
-2
@@ -65,7 +65,7 @@ using std::cout;
|
||||
#endif
|
||||
|
||||
/** the default path of the configuration files. */
|
||||
#define CONFIG_PATH "http://ebusd.eu/config/"
|
||||
#define CONFIG_PATH "http://cfg.ebusd.eu/"
|
||||
|
||||
/** the opened PID file, or nullptr. */
|
||||
static FILE* pidFile = nullptr;
|
||||
@@ -313,7 +313,7 @@ error_t parse_opt(int key, char *arg, struct argp_state *state) {
|
||||
break;
|
||||
|
||||
// Message configuration options:
|
||||
case 'c': // --configpath=http://ebusd.eu/config/
|
||||
case 'c': // --configpath=http://cfg.ebusd.eu/
|
||||
if (arg == nullptr || arg[0] == 0 || strcmp("/", arg) == 0) {
|
||||
argp_error(state, "invalid configpath");
|
||||
return EINVAL;
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ struct options {
|
||||
bool initialSend; //!< send an initial escape symbol after connecting device
|
||||
unsigned int extraLatency; //!< extra transfer latency in ms [0 for USB, 10 for IP]
|
||||
|
||||
const char* configPath; //!< path to CSV configuration files [http://ebusd.eu/config/]
|
||||
const char* configPath; //!< path to CSV configuration files [http://cfg.ebusd.eu/]
|
||||
const char* overridePath; //!< path to CSV configuration files to override the main files with
|
||||
bool scanConfig; //!< pick configuration files matching initial scan
|
||||
/** the initial address to scan for scanconfig
|
||||
|
||||
@@ -332,7 +332,7 @@ void MainLoop::run() {
|
||||
}
|
||||
if (m_runUpdateCheck && !m_shutdown && now > nextCheckRun) {
|
||||
HttpClient client;
|
||||
if (!client.connect("ebusd.eu", 80, PACKAGE_NAME "/" PACKAGE_VERSION)) {
|
||||
if (!client.connect("upd.ebusd.eu", 80, PACKAGE_NAME "/" PACKAGE_VERSION)) {
|
||||
logError(lf_main, "update check connect error");
|
||||
} else {
|
||||
ostringstream ostr;
|
||||
@@ -357,7 +357,7 @@ void MainLoop::run() {
|
||||
m_busHandler->formatUpdateInfo(&ostr);
|
||||
ostr << "}";
|
||||
string response;
|
||||
if (!client.post("/updatecheck/", ostr.str(), &response)) {
|
||||
if (!client.post("/", ostr.str(), &response)) {
|
||||
logError(lf_main, "update check error: %s", response.c_str());
|
||||
} else {
|
||||
m_updateCheck = response.empty() ? "unknown" : response;
|
||||
|
||||
Reference in New Issue
Block a user