New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[enh] Hooks for custom DNS confs #517

Open
wants to merge 6 commits into
base: stretch-unstable
from

Conversation

Projects
None yet
3 participants
@Josue-T
Copy link
Contributor

Josue-T commented Aug 26, 2018

The problem

We can't add a custom rule in the dns config.

Solution

Add a hook to make a possibility to add a custom rule

PR Status

Tested. Mybe we need to do some more tests.

Note that this PR depends of #526.

How to test

  • Checkout the branch
  • Rebase on the branch hook_return (PR #526 )
  • Add a dns hook in /etc/yunohost/hooks.d/custom_dns_rules with by example that :
if [[ $1 = "example.com" ]]
then
echo '[{"type": "SRV", "name": "_matrix._tcp.example.com.", "value": "10 domain.tld.", "ttl": 3600}]' > $YNH_STDRETURN
fi

Validation

  • Principle agreement 0/2 :
  • Quick review 0/1 :
  • Simple test 0/1 :
  • Deep review 0/1 :

#print(hook_return)
#for r in hook_return.:
result['stdreturn'].extend(hook_return) #for r in hook_return

This comment has been minimized.

@alexAubin

alexAubin Aug 26, 2018

Member

I would rather have result[name]['stdreturn'] (in anticipation of the new diagnosis system ;P)
And I would propagate this hierarchy also for the state a few line before to have result[name][state] ... which in turns need to be propagated where this result value is used (I found backup and service)

@Josue-T Josue-T force-pushed the Josue-T:domain_hook branch from 15f494b to f83e9ca Aug 29, 2018

@Josue-T Josue-T referenced this pull request Aug 29, 2018

Open

Hook return #526

0 of 4 tasks complete

@Josue-T Josue-T requested a review from alexAubin Aug 30, 2018

@Psycojoker
Copy link
Member

Psycojoker left a comment

The docstring of _build_dns_conf needs to be updated to inform about this new behavior and potentially new addition to the datastructure.

@Josue-T

This comment has been minimized.

Copy link
Contributor

Josue-T commented Sep 4, 2018

The docstring of _build_dns_conf needs to be updated to inform about this new behavior and potentially new addition to the datastructure.

Should be fixed

@Josue-T Josue-T requested a review from Psycojoker Sep 7, 2018

@alexAubin alexAubin added this to the 3.x milestone Oct 24, 2018

@alexAubin alexAubin changed the title Domain hook [enh] Hooks for custom DNS confs Oct 24, 2018

@@ -4,7 +4,8 @@
Copyright (C) 2013 YunoHost
This program is free software; you can redistribute it and/or modify
This progra
m is free software; you can redistribute it and/or modify

This comment has been minimized.

@Psycojoker

Psycojoker Jan 7, 2019

Member

Looks like a mistake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment