network: add trusted ips
This allows the user to set trusted ips to Cloudflare or some other CDN and have the logs have the correct IPs. fixes #801
This commit is contained in:
@@ -1128,9 +1128,7 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
|
||||
};
|
||||
|
||||
Client.prototype.getBlocklist = function (callback) {
|
||||
var config = {};
|
||||
|
||||
get('/api/v1/network/blocklist', config, function (error, data, status) {
|
||||
get('/api/v1/network/blocklist', null, function (error, data, status) {
|
||||
if (error) return callback(error);
|
||||
if (status !== 200) return callback(new ClientError(status, data));
|
||||
callback(null, data.blocklist);
|
||||
@@ -1146,6 +1144,23 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.getTrustedIps = function (callback) {
|
||||
get('/api/v1/network/trusted_ips', null, function (error, data, status) {
|
||||
if (error) return callback(error);
|
||||
if (status !== 200) return callback(new ClientError(status, data));
|
||||
callback(null, data.trustedIps);
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.setTrustedIps = function (trustedIps, callback) {
|
||||
post('/api/v1/network/trusted_ips', { trustedIps: trustedIps }, null, function (error, data, status) {
|
||||
if (error) return callback(error);
|
||||
if (status !== 200) return callback(new ClientError(status, data));
|
||||
|
||||
callback(null);
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.setDynamicDnsConfig = function (enabled, callback) {
|
||||
post('/api/v1/settings/dynamic_dns', { enabled: enabled }, null, function (error, data, status) {
|
||||
if (error) return callback(error);
|
||||
|
||||
Reference in New Issue
Block a user