Skip to content

Commit

Permalink
luci-app-ddns: diverse fixes, i18n corrections, and code improvements
Browse files Browse the repository at this point in the history
-trimmed redundant and repeated code
-fixed adding a new service section, which... never worked.
-removed some defaults
-changed log formatting
-opkg -> package-manager

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
  • Loading branch information
systemcrash committed Dec 2, 2024
1 parent 96afb61 commit 8d26279
Show file tree
Hide file tree
Showing 40 changed files with 8,835 additions and 8,997 deletions.

Large diffs are not rendered by default.

473 changes: 239 additions & 234 deletions applications/luci-app-ddns/po/ar/ddns.po

Large diffs are not rendered by default.

443 changes: 214 additions & 229 deletions applications/luci-app-ddns/po/bg/ddns.po

Large diffs are not rendered by default.

443 changes: 214 additions & 229 deletions applications/luci-app-ddns/po/bn_BD/ddns.po

Large diffs are not rendered by default.

443 changes: 214 additions & 229 deletions applications/luci-app-ddns/po/ca/ddns.po

Large diffs are not rendered by default.

480 changes: 242 additions & 238 deletions applications/luci-app-ddns/po/cs/ddns.po

Large diffs are not rendered by default.

443 changes: 214 additions & 229 deletions applications/luci-app-ddns/po/da/ddns.po

Large diffs are not rendered by default.

494 changes: 249 additions & 245 deletions applications/luci-app-ddns/po/de/ddns.po

Large diffs are not rendered by default.

443 changes: 214 additions & 229 deletions applications/luci-app-ddns/po/el/ddns.po

Large diffs are not rendered by default.

488 changes: 246 additions & 242 deletions applications/luci-app-ddns/po/es/ddns.po

Large diffs are not rendered by default.

443 changes: 214 additions & 229 deletions applications/luci-app-ddns/po/fa/ddns.po

Large diffs are not rendered by default.

455 changes: 224 additions & 231 deletions applications/luci-app-ddns/po/fi/ddns.po

Large diffs are not rendered by default.

486 changes: 245 additions & 241 deletions applications/luci-app-ddns/po/fr/ddns.po

Large diffs are not rendered by default.

480 changes: 242 additions & 238 deletions applications/luci-app-ddns/po/ga/ddns.po

Large diffs are not rendered by default.

443 changes: 214 additions & 229 deletions applications/luci-app-ddns/po/he/ddns.po

Large diffs are not rendered by default.

443 changes: 214 additions & 229 deletions applications/luci-app-ddns/po/hi/ddns.po

Large diffs are not rendered by default.

478 changes: 240 additions & 238 deletions applications/luci-app-ddns/po/hu/ddns.po

Large diffs are not rendered by default.

486 changes: 245 additions & 241 deletions applications/luci-app-ddns/po/it/ddns.po

Large diffs are not rendered by default.

479 changes: 242 additions & 237 deletions applications/luci-app-ddns/po/ja/ddns.po

Large diffs are not rendered by default.

443 changes: 214 additions & 229 deletions applications/luci-app-ddns/po/ko/ddns.po

Large diffs are not rendered by default.

481 changes: 243 additions & 238 deletions applications/luci-app-ddns/po/lt/ddns.po

Large diffs are not rendered by default.

443 changes: 214 additions & 229 deletions applications/luci-app-ddns/po/mr/ddns.po

Large diffs are not rendered by default.

443 changes: 214 additions & 229 deletions applications/luci-app-ddns/po/ms/ddns.po

Large diffs are not rendered by default.

443 changes: 214 additions & 229 deletions applications/luci-app-ddns/po/nb_NO/ddns.po

Large diffs are not rendered by default.

480 changes: 242 additions & 238 deletions applications/luci-app-ddns/po/nl/ddns.po

Large diffs are not rendered by default.

480 changes: 242 additions & 238 deletions applications/luci-app-ddns/po/pl/ddns.po

Large diffs are not rendered by default.

480 changes: 242 additions & 238 deletions applications/luci-app-ddns/po/pt/ddns.po

Large diffs are not rendered by default.

488 changes: 246 additions & 242 deletions applications/luci-app-ddns/po/pt_BR/ddns.po

Large diffs are not rendered by default.

477 changes: 241 additions & 236 deletions applications/luci-app-ddns/po/ro/ddns.po

Large diffs are not rendered by default.

486 changes: 245 additions & 241 deletions applications/luci-app-ddns/po/ru/ddns.po

Large diffs are not rendered by default.

446 changes: 217 additions & 229 deletions applications/luci-app-ddns/po/sk/ddns.po

Large diffs are not rendered by default.

449 changes: 220 additions & 229 deletions applications/luci-app-ddns/po/sv/ddns.po

Large diffs are not rendered by default.

443 changes: 214 additions & 229 deletions applications/luci-app-ddns/po/templates/ddns.pot

Large diffs are not rendered by default.

478 changes: 241 additions & 237 deletions applications/luci-app-ddns/po/tr/ddns.po

Large diffs are not rendered by default.

455 changes: 224 additions & 231 deletions applications/luci-app-ddns/po/uk/ddns.po

Large diffs are not rendered by default.

476 changes: 240 additions & 236 deletions applications/luci-app-ddns/po/vi/ddns.po

Large diffs are not rendered by default.

443 changes: 214 additions & 229 deletions applications/luci-app-ddns/po/yua/ddns.po

Large diffs are not rendered by default.

481 changes: 243 additions & 238 deletions applications/luci-app-ddns/po/zh_Hans/ddns.po

Large diffs are not rendered by default.

494 changes: 253 additions & 241 deletions applications/luci-app-ddns/po/zh_Hant/ddns.po

Large diffs are not rendered by default.

31 changes: 19 additions & 12 deletions applications/luci-app-ddns/root/usr/share/rpcd/ucode/ddns.uc
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,15 @@ const methods = {
const dnsServer = s['dns_server'] || '';
const forceIpVersion = int(s['force_ipversion'] || 0);
const forceDnsTcp = int(s['force_dnstcp'] || 0);
const isGlue = int(s['is_glue'] || 0);
// const isGlue = int(s['is_glue'] || 0);
const useIpv6 = int(s['use_ipv6'] || 0);
const lookupHost = s['lookup_host'] || '_nolookup_';
let command = [luci_helper];

if (useIpv6 == 1) push(command, '-6');
if (forceIpVersion == 1) push(command, '-f');
if (forceDnsTcp == 1) push(command, '-t');
if (isGlue == 1) push(command, '-g');
// if (isGlue == 1) push(command, '-g');

push(command, '-l', lookupHost);
push(command, '-S', section);
Expand All @@ -148,12 +148,12 @@ const methods = {

let _uptime = int(uptime());

const forceSeconds = calc_seconds(
const forcedUpdateInterval = calc_seconds(
int(s['force_interval']) || 72,
s['force_unit'] || 'hours'
);

const checkSeconds = calc_seconds(
const checkInterval = calc_seconds(
int(s['check_interval']) || 10,
s['check_unit'] || 'minutes'
);
Expand All @@ -163,13 +163,13 @@ const methods = {
const epoch = time() - _uptime + lastUpdate;
convertedLastUpdate = epoch2date(epoch);
// convertedLastUpdate = get_date(epoch, dateFormat);
nextUpdate = epoch2date(epoch + forceSeconds + checkSeconds);
// nextUpdate = get_date(epoch + forceSeconds + checkSeconds, dateFormat);
nextUpdate = epoch2date(epoch + forcedUpdateInterval + checkInterval);
// nextUpdate = get_date(epoch + forcedUpdateInterval + checkInterval, dateFormat);
}

if (pid > 0 && (lastUpdate + forceSeconds + checkSeconds - _uptime) <= 0) {
if (pid > 0 && (lastUpdate + forcedUpdateInterval + checkInterval - _uptime) <= 0) {
nextUpdate = 'Verify';
} else if (forceSeconds === 0) {
} else if (forcedUpdateInterval === 0) {
nextUpdate = 'Run once';
} else if (pid == 0 && s['enabled'] == '0') {
nextUpdate = 'Disabled';
Expand Down Expand Up @@ -243,6 +243,13 @@ const methods = {
return result;
};

const hasGNUWgetSsl = () => {
if (cache['has_gnuwgetssl']) return cache['has_gnuwgetssl'];
const result = hasWget() && system(`wget -V 2>&1 | grep -iqF '+https'`) == 0 ? true: false;
cache['has_gnuwgetssl'] = result;
return result;
};

const hasCurl = () => {
if (cache['has_curl']) return cache['has_curl'];
const result = hasCommand('curl');
Expand Down Expand Up @@ -277,10 +284,10 @@ const methods = {
res['has_wget'] = hasWget();
res['has_curl'] = hasCurl();

res['has_ssl'] = hasWgetSsl() || hasCurlSsl() || (hasFetch() && hasFetchSsl());
res['has_proxy'] = hasWgetSsl() || hasCurlPxy() || hasFetch() || hasBbwget();
res['has_forceip'] = hasWgetSsl() || hasCurl() || hasFetch();
res['has_bindnet'] = hasCurl() || hasWgetSsl();
res['has_ssl'] = hasGNUWgetSsl()|| hasWgetSsl() || hasCurlSsl() || (hasFetch() && hasFetchSsl());
res['has_proxy'] = hasGNUWgetSsl() || hasWgetSsl() || hasCurlPxy() || hasFetch() || hasBbwget();
res['has_forceip'] = hasGNUWgetSsl() || hasWgetSsl() || hasCurl() || hasFetch();
res['has_bindnet'] = hasCurl() || hasGNUWgetSsl();

const hasBindHost = () => {
if (cache['has_bindhost']) return cache['has_bindhost'];
Expand Down

0 comments on commit 8d26279

Please sign in to comment.