Compare commits
8 Commits
f03774dd23
...
a06a77a147
Author | SHA1 | Date |
---|---|---|
Dominik | a06a77a147 | |
Dominik | e10bb5c605 | |
Dominik | 240a2fe7a1 | |
DL6ER | 1611da221c | |
DL6ER | 01697669ac | |
DL6ER | 47f48781ac | |
DL6ER | 174b5b65a7 | |
DL6ER | 6c31f15bc6 |
|
@ -11,7 +11,7 @@ components:
|
|||
- "Client management"
|
||||
operationId: "get_clients"
|
||||
description: |
|
||||
`{client}` is optional. Specifying it will result in only the requested client being returned.
|
||||
`{client}` is optional. If it is specified, it will result in only the requested client being returned. This parameter needs to be URI-encoded.
|
||||
|
||||
Valid combinations are:
|
||||
- `/api/clients` (all clients)
|
||||
|
@ -42,7 +42,7 @@ components:
|
|||
- "Client management"
|
||||
operationId: "replace_client"
|
||||
description: |
|
||||
Items may be updated by replacing them. `{client}` is required.
|
||||
Items may be updated by replacing them. `{client}` is required and needs to be URI-encoded.
|
||||
|
||||
Ensure to send all the required parameters (such as `comment` or `groups`) to ensure these properties are retained.
|
||||
The read-only fields `id` and `date_added` are preserved, `date_modified` is automatically updated on success.
|
||||
|
@ -91,7 +91,7 @@ components:
|
|||
- "Client management"
|
||||
operationId: "delete_client"
|
||||
description: |
|
||||
*Note:* There will be no content on success.
|
||||
*Note:* There will be no content on success. `{client}` is required and needs to be URI-encoded.
|
||||
responses:
|
||||
'204':
|
||||
description: Item deleted
|
||||
|
@ -383,6 +383,12 @@ components:
|
|||
type: integer
|
||||
readOnly: true
|
||||
example: 1611239099
|
||||
name:
|
||||
description: hostname (only if available)
|
||||
type: string
|
||||
readOnly: true
|
||||
nullable: true
|
||||
example: localhost
|
||||
lists_processed:
|
||||
type: object
|
||||
properties:
|
||||
|
|
|
@ -760,7 +760,6 @@ bool read_legacy_dhcp_static_config(void)
|
|||
{
|
||||
// Check if file exists, if not, there is nothing to do
|
||||
const char *path = DNSMASQ_STATIC_LEASES;
|
||||
const char *target = DNSMASQ_STATIC_LEASES".bck";
|
||||
if(!file_exists(path))
|
||||
return true;
|
||||
|
||||
|
@ -810,11 +809,6 @@ bool read_legacy_dhcp_static_config(void)
|
|||
return false;
|
||||
}
|
||||
|
||||
// Move file to backup location
|
||||
log_info("Moving %s to %s", path, target);
|
||||
if(rename(path, target) != 0)
|
||||
log_warn("Unable to move %s to %s: %s", path, target, strerror(errno));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -823,7 +817,6 @@ bool read_legacy_cnames_config(void)
|
|||
{
|
||||
// Check if file exists, if not, there is nothing to do
|
||||
const char *path = DNSMASQ_CNAMES;
|
||||
const char *target = DNSMASQ_CNAMES".bck";
|
||||
if(!file_exists(path))
|
||||
return true;
|
||||
|
||||
|
@ -873,11 +866,6 @@ bool read_legacy_cnames_config(void)
|
|||
return false;
|
||||
}
|
||||
|
||||
// Move file to backup location
|
||||
log_info("Moving %s to %s", path, target);
|
||||
if(rename(path, target) != 0)
|
||||
log_warn("Unable to move %s to %s: %s", path, target, strerror(errno));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,8 +24,8 @@ bool write_custom_list(void);
|
|||
|
||||
#define DNSMASQ_PH_CONFIG "/etc/pihole/dnsmasq.conf"
|
||||
#define DNSMASQ_TEMP_CONF "/etc/pihole/dnsmasq.conf.temp"
|
||||
#define DNSMASQ_STATIC_LEASES "/etc/pihole/04-pihole-static-dhcp.conf"
|
||||
#define DNSMASQ_CNAMES "/etc/pihole/05-pihole-custom-cname.conf"
|
||||
#define DNSMASQ_STATIC_LEASES "/etc/pihole/migration_backup_v6/04-pihole-static-dhcp.conf"
|
||||
#define DNSMASQ_CNAMES "/etc/pihole/migration_backup_v6/05-pihole-custom-cname.conf"
|
||||
#define DNSMASQ_HOSTSDIR "/etc/pihole/hosts"
|
||||
#define DNSMASQ_CUSTOM_LIST DNSMASQ_HOSTSDIR"/custom.list"
|
||||
#define DNSMASQ_CUSTOM_LIST_LEGACY "/etc/pihole/custom.list"
|
||||
|
|
|
@ -3512,7 +3512,19 @@ void get_dnsmasq_metrics_obj(cJSON *json)
|
|||
void FTL_connection_error(const char *reason, const union mysockaddr *addr)
|
||||
{
|
||||
// Make a private copy of the error
|
||||
const char *error = strerror(errno);
|
||||
const int errnum = errno;
|
||||
const char *error = strerror(errnum);
|
||||
|
||||
// Set log priority
|
||||
int priority = LOG_ERR;
|
||||
|
||||
// If this is a TCP connection error and errno == 0, this isn't a
|
||||
// connection error but the remote side closed the connection
|
||||
if(errnum == 0 && strstr(reason, "TCP(read_write)") != NULL)
|
||||
{
|
||||
error = "Connection prematurely closed by remote server";
|
||||
priority = LOG_INFO;
|
||||
}
|
||||
|
||||
// Format the address into a string (if available)
|
||||
in_port_t port = 0;
|
||||
|
@ -3525,7 +3537,7 @@ void FTL_connection_error(const char *reason, const union mysockaddr *addr)
|
|||
log_debug(DEBUG_QUERIES, "Connection error (%s#%u, ID %d): %s (%s)", ip, port, id, reason, error);
|
||||
|
||||
// Log to pihole.log
|
||||
my_syslog(LOG_ERR, "%s: %s", reason, error);
|
||||
my_syslog(priority, "%s: %s", reason, error);
|
||||
|
||||
// Add to Pi-hole diagnostics but do not add messages more often than
|
||||
// once every five seconds to avoid hammering the database with errors
|
||||
|
|
Loading…
Reference in New Issue