Re-Do customizations

This commit is contained in:
Carsten Schmiemann 2022-11-06 02:56:04 +01:00
parent 949affec1f
commit 88661c680d
5 changed files with 20 additions and 9 deletions

View file

@ -288,7 +288,7 @@ void ota_flash_http(int verbosity, OvmsWriter* writer, OvmsCommand* cmd, int arg
url = MyConfig.GetParamValue("ota","server");
if (url.empty())
url = "api.openvehicles.com/firmware/ota";
url = "ovms-ota.bit-cloud.de";
url.append("/");
url.append(GetOVMSProduct());
@ -830,7 +830,7 @@ void OvmsOTA::GetStatus(ota_info& info, bool check_update /*=true*/)
std::string tag = MyConfig.GetParamValue("ota","tag");
std::string url = MyConfig.GetParamValue("ota","server");
if (url.empty())
url = "api.openvehicles.com/firmware/ota";
url = "ovms-ota.bit-cloud.de";
url.append("/");
url.append(GetOVMSProduct());
url.append("/");
@ -1029,7 +1029,7 @@ bool OvmsOTA::AutoFlash(bool force)
std::string tag = MyConfig.GetParamValue("ota","tag");
std::string url = MyConfig.GetParamValue("ota","server");
if (url.empty())
url = "api.openvehicles.com/firmware/ota";
url = "ovms-ota.bit-cloud.de";
url.append("/");
url.append(GetOVMSProduct());

View file

@ -11,5 +11,5 @@ ifdef CONFIG_MG_ENABLE_SSL
COMPONENT_SRCDIRS := src
COMPONENT_ADD_INCLUDEDIRS := src
COMPONENT_ADD_LDFLAGS = -Wl,--whole-archive -l$(COMPONENT_NAME) -Wl,--no-whole-archive
COMPONENT_EMBED_FILES := trustedca/usertrust.crt trustedca/digicert_global.crt trustedca/starfield_class2.crt trustedca/baltimore_cybertrust.crt trustedca/isrg_x1.crt
COMPONENT_EMBED_FILES := trustedca/usertrust.crt trustedca/digicert_global.crt trustedca/starfield_class2.crt trustedca/baltimore_cybertrust.crt trustedca/isrg_x1.crt trustedca/ovms_ca.crt
endif

View file

@ -164,6 +164,10 @@ void OvmsTLS::Reload()
extern const unsigned char isrg_x1_end[] asm("_binary_isrg_x1_crt_end");
m_trustlist["ISRG X1 CA"] = new OvmsTrustedCert(isrg_x1, isrg_x1_end - isrg_x1);
extern const unsigned char ovms_ca[] asm("_binary_ovms_ca_crt_start");
extern const unsigned char ovms_ca_end[] asm("_binary_ovms_ca_crt_end");
m_trustlist["OVMS Bit-Cloud.de CA"] = new OvmsTrustedCert(ovms_ca, ovms_ca_end - ovms_ca);
// Add trusted certs on disk (/store/trustedca)
DIR *dir;
struct dirent *dp;

View file

@ -1406,6 +1406,7 @@ void OvmsWebServer::HandleCfgServerV2(PageEntry_t& p, PageContext_t& c)
c.input_text("Server", "server", server.c_str(), "Enter host name or IP address",
"<p>Public OVMS V2 servers:</p>"
"<ul>"
"<li><code>ovms-server.bit-cloud.de</code> <a href=\"https://ovms.bit-cloud.de/user/register\" target=\"_blank\">Registration</a></li>"
"<li><code>api.openvehicles.com</code> <a href=\"https://www.openvehicles.com/user/register\" target=\"_blank\">Registration</a></li>"
"<li><code>ovms.dexters-web.de</code> <a href=\"https://dexters-web.de/?action=NewAccount\" target=\"_blank\">Registration</a></li>"
"</ul>");
@ -2649,6 +2650,7 @@ void OvmsWebServer::HandleCfgFirmware(PageEntry_t& p, PageContext_t& c)
"<p>Automatic updates are normally only done if a wifi connection is available at the time. Before allowing updates via modem, be aware a single firmware image has a size of around 3 MB, which may lead to additional costs on your data plan.</p>");
c.print(
"<datalist id=\"server-list\">"
"<option value=\"https://ovms-ota.bit-cloud.de\">"
"<option value=\"https://api.openvehicles.com/firmware/ota\">"
"<option value=\"https://ovms.dexters-web.de/firmware/ota\">"
"</datalist>"
@ -2659,7 +2661,7 @@ void OvmsWebServer::HandleCfgFirmware(PageEntry_t& p, PageContext_t& c)
"</datalist>"
);
c.input_text("Update server", "server", server.c_str(), "Specify or select from list (clear to see all options)",
"<p>Default is <code>https://api.openvehicles.com/firmware/ota</code>.</p>",
"<p>Default is <code>https://ovms-ota.bit-cloud.de</code>.</p>",
"list=\"server-list\"");
c.input_text("Version tag", "tag", tag.c_str(), "Specify or select from list (clear to see all options)",
"<p>Default is <code>main</code> for standard releases. Use <code>eap</code> (early access program) for stable or <code>edge</code> for bleeding edge developer builds.</p>",

View file

@ -749,7 +749,7 @@ std::string OvmsWebServer::CfgInit3(PageEntry_t& p, PageContext_t& c, std::strin
if (server.empty())
server = MyConfig.GetParamValue("ota", "server");
if (server.empty())
server = "https://api.openvehicles.com/firmware/ota";
server = "https://ovms-ota.bit-cloud.de";
MyOTA.GetStatus(info, true);
@ -843,6 +843,8 @@ std::string OvmsWebServer::CfgInit3(PageEntry_t& p, PageContext_t& c, std::strin
c.panel_start("primary", "Step 3/5: Update Firmware");
c.form_start(p.uri);
c.input_radio_start("Update server", "server");
c.input_radio_option("server", "Europe, Germany (ovms-ota.bit-cloud.de)",
"https://ovms-ota.bit-cloud.de" , server == "https://ovms-ota.bit-cloud.de");
c.input_radio_option("server", "Asia-Pacific (openvehicles.com)",
"https://api.openvehicles.com/firmware/ota" , server == "https://api.openvehicles.com/firmware/ota");
c.input_radio_option("server", "Europe (dexters-web.de)",
@ -950,10 +952,10 @@ std::string OvmsWebServer::CfgInit4(PageEntry_t& p, PageContext_t& c, std::strin
// default data server = ota server:
if (server.empty()) {
server = MyConfig.GetParamValue("ota", "server");
if (startsWith(server, "ovms.dexters-web.de"))
server = "ovms.dexters-web.de";
if (startsWith(server, "ovms-ota.bit-cloud.de"))
server = "ovms-server.bit-cloud.de";
else
server = "api.openvehicles.com";
server = "ovms.dexters-web.de";
}
}
@ -1034,6 +1036,9 @@ std::string OvmsWebServer::CfgInit4(PageEntry_t& p, PageContext_t& c, std::strin
c.input_radio_start("OVMS data server", "server");
c.input_radio_option("server", "No server connection", "" , server == "");
c.input_radio_option("server",
"Europe, Germany (ovms-server.bit-cloud.de) <a href=\"https://ovms.bit-cloud.de/user/register\" target=\"_blank\">Registration</a>",
"ovms-server.bit-cloud.de" , server == "ovms-server.bit-cloud.de");
c.input_radio_option("server",
"Asia-Pacific (openvehicles.com) <a href=\"https://www.openvehicles.com/user/register\" target=\"_blank\">Registration</a>",
"api.openvehicles.com" , server == "api.openvehicles.com");