Compare commits

..

No commits in common. "d51f3599b21f3d5b0ef759da05ecfeb4a68f6e12" and "e9f1cd354ee84cbd461e7bebdaed1599eb60c370" have entirely different histories.

8 changed files with 11 additions and 30 deletions

View File

@ -38,8 +38,7 @@ USER root
RUN apt-get update && apt-get --no-install-recommends -y install libc-bin libc6 libgpiod2 libyaml-cpp0.7 libi2c0 libulfius2.7 libusb-1.0-0-dev liborcania2.3 libssl3 && \
apt-get clean && rm -rf /var/lib/apt/lists/* \
&& mkdir -p /var/lib/meshtasticd \
&& mkdir -p /etc/meshtasticd/config.d \
&& mkdir -p /etc/meshtasticd/ssl
&& mkdir -p /etc/meshtasticd/config.d
# Fetch compiled binary from the builder
COPY --from=builder /tmp/firmware/release/meshtasticd /usr/sbin/

View File

@ -29,8 +29,7 @@ USER root
RUN apk add libstdc++ libgpiod yaml-cpp libusb i2c-tools \
&& mkdir -p /var/lib/meshtasticd \
&& mkdir -p /etc/meshtasticd/config.d \
&& mkdir -p /etc/meshtasticd/ssl
&& mkdir -p /etc/meshtasticd/config.d
COPY --from=builder /tmp/firmware/release/meshtasticd /usr/sbin/
WORKDIR /var/lib/meshtasticd

View File

@ -184,8 +184,6 @@ Logging:
Webserver:
# Port: 443 # Port for Webserver & Webservices
# RootPath: /usr/share/meshtasticd/web # Root Dir of WebServer
# SSLKey: /etc/meshtasticd/ssl/private_key.pem # Path to SSL Key, generated if not present
# SSLCert: /etc/meshtasticd/ssl/certificate.pem # Path to SSL Certificate, generated if not present
General:
MaxNodes: 200

View File

@ -2,4 +2,3 @@ etc/meshtasticd
etc/meshtasticd/config.d
etc/meshtasticd/available.d
usr/share/meshtasticd/web
etc/meshtasticd/ssl

View File

@ -72,8 +72,6 @@ install -D -m 0644 bin/meshtasticd.service %{buildroot}%{_unitdir}/meshtasticd.s
# Install the web files under /usr/share/meshtasticd/web
mkdir -p %{buildroot}%{_datadir}/meshtasticd/web
cp -r web/* %{buildroot}%{_datadir}/meshtasticd/web
# Install default SSL storage directory (for web)
mkdir -p %{buildroot}%{_sysconfdir}/meshtasticd/ssl
%files
%license LICENSE
@ -88,7 +86,6 @@ mkdir -p %{buildroot}%{_sysconfdir}/meshtasticd/ssl
%dir %{_datadir}/meshtasticd
%dir %{_datadir}/meshtasticd/web
%{_datadir}/meshtasticd/web/*
%dir %{_sysconfdir}/meshtasticd/ssl
%changelog
%autochangelog

View File

@ -65,9 +65,6 @@ mail: marchammermann@googlemail.com
#define DEFAULT_REALM "default_realm"
#define PREFIX ""
#define KEY_PATH settingsStrings[websslkeypath].c_str()
#define CERT_PATH settingsStrings[websslcertpath].c_str()
struct _file_config configWeb;
// We need to specify some content-type mapping, so the resources get delivered with the
@ -387,13 +384,13 @@ char *read_file_into_string(const char *filename)
int PiWebServerThread::CheckSSLandLoad()
{
// read certificate
cert_pem = read_file_into_string(CERT_PATH);
cert_pem = read_file_into_string("certificate.pem");
if (cert_pem == NULL) {
LOG_ERROR("ERROR SSL Certificate File can't be loaded or is missing");
return 1;
}
// read private key
key_pem = read_file_into_string(KEY_PATH);
key_pem = read_file_into_string("private_key.pem");
if (key_pem == NULL) {
LOG_ERROR("ERROR file private_key can't be loaded or is missing");
return 2;
@ -418,8 +415,8 @@ int PiWebServerThread::CreateSSLCertificate()
return 2;
}
// Open file to write private key file
FILE *pkey_file = fopen(KEY_PATH, "wb");
// Ope file to write private key file
FILE *pkey_file = fopen("private_key.pem", "wb");
if (!pkey_file) {
LOG_ERROR("Error opening private key file");
return 3;
@ -429,19 +426,18 @@ int PiWebServerThread::CreateSSLCertificate()
fclose(pkey_file);
// open Certificate file
FILE *x509_file = fopen(CERT_PATH, "wb");
FILE *x509_file = fopen("certificate.pem", "wb");
if (!x509_file) {
LOG_ERROR("Error opening cert");
return 4;
}
// write certificate
// write cirtificate
PEM_write_X509(x509_file, x509);
fclose(x509_file);
EVP_PKEY_free(pkey);
LOG_INFO("Create SSL Key %s successful", KEY_PATH);
X509_free(x509);
LOG_INFO("Create SSL Cert %s successful", CERT_PATH);
LOG_INFO("Create SSL Cert -certificate.pem- succesfull ");
return 0;
}

View File

@ -524,12 +524,7 @@ bool loadConfig(const char *configPath)
if (yamlConfig["Webserver"]) {
settingsMap[webserverport] = (yamlConfig["Webserver"]["Port"]).as<int>(-1);
settingsStrings[webserverrootpath] =
(yamlConfig["Webserver"]["RootPath"]).as<std::string>("/usr/share/meshtasticd/web");
settingsStrings[websslkeypath] =
(yamlConfig["Webserver"]["SSLKey"]).as<std::string>("/etc/meshtasticd/ssl/private_key.pem");
settingsStrings[websslcertpath] =
(yamlConfig["Webserver"]["SSLCert"]).as<std::string>("/etc/meshtasticd/ssl/certificate.pem");
settingsStrings[webserverrootpath] = (yamlConfig["Webserver"]["RootPath"]).as<std::string>("");
}
if (yamlConfig["General"]) {

View File

@ -81,8 +81,6 @@ enum configNames {
webserver,
webserverport,
webserverrootpath,
websslkeypath,
websslcertpath,
maxtophone,
maxnodes,
ascii_logs,