You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.3 KiB
54 lines
1.3 KiB
7 years ago
|
#ifndef _XD0OTA_H
|
||
|
#define _XD0OTA_H
|
||
|
|
||
|
#include <Arduino.h>
|
||
|
|
||
|
#include <ESP8266HTTPClient.h>
|
||
|
#include <ESP8266httpUpdate.h>
|
||
|
|
||
|
const int FW_VERSION = 10;
|
||
|
const char* httpsFingerprint = "37 42 61 B9 E6 EE 22 36 D1 59 67 7D 55 53 6E A4 C7 AA 60 26";
|
||
|
|
||
|
class XD0OTA {
|
||
|
public:
|
||
|
XD0OTA();
|
||
|
void update(void);
|
||
|
int checkForUpdates();
|
||
|
private:
|
||
|
const char* fwUrlBase = "https://fwupdate.xd0.de/fota/";
|
||
|
String getMAC();
|
||
|
};
|
||
|
|
||
|
#endif /* _XD0OTA_H */
|
||
|
|
||
|
|
||
|
/*
|
||
|
|
||
|
openssl req -x509 -nodes -days 18263 -newkey rsa:2048 -keyout /etc/ssl/private/xd0-fwupdate-selfsigned.key -out /etc/ssl/certs/xd0-fwupdate-selfsigned.crt
|
||
|
|
||
|
openssl x509 -noout -fingerprint -sha1 -inform pem -in /etc/ssl/certs/xd0-fwupdate-selfsigned.crt
|
||
|
|
||
|
|
||
|
server {
|
||
|
listen 443 ssl;
|
||
|
listen [::]:443 ssl;
|
||
|
server_name fwupdate.xd0.de;
|
||
|
|
||
|
# SSL configuration
|
||
|
ssl_certificate /etc/ssl/certs/xd0-fwupdate-selfsigned.crt;
|
||
|
ssl_certificate_key /etc/ssl/private/xd0-fwupdate-selfsigned.key;
|
||
|
|
||
|
root /var/www/fwupdate;
|
||
|
|
||
|
location / {
|
||
|
# First attempt to serve request as file, then
|
||
|
# as directory, then fall back to displaying a 404.
|
||
|
try_files $uri $uri/ =404;
|
||
|
}
|
||
|
|
||
|
access_log /var/log/nginx/fwupdate_access.log;
|
||
|
error_log /var/log/nginx/fwupdate_error.log;
|
||
|
}
|
||
|
|
||
|
*/
|