Compare commits

...

16 Commits

Author SHA1 Message Date
9a3b521f42 Prepare 0.4.4
All checks were successful
continuous-integration/drone/tag Build is passing
2024-02-09 00:40:13 +01:00
98d060056f Fix network type 2024-02-09 00:35:51 +01:00
4b446e51f0 Prepare 0.4.3
All checks were successful
continuous-integration/drone/tag Build is passing
2024-01-23 14:13:33 +01:00
b1e3c3be53 Fix network and mounts options 2024-01-23 14:12:41 +01:00
a69b4364fd Prepare 0.4.2
All checks were successful
continuous-integration/drone/tag Build is passing
2024-01-08 18:53:34 +01:00
67d954473a Use mounts instead of volumes + exposes volumes and network 2024-01-08 18:52:44 +01:00
a35d78be37 Handle new parameters 2024-01-02 18:04:08 +01:00
cc55808f31 Prepare 0.4.1
All checks were successful
continuous-integration/drone/tag Build is passing
2023-12-11 09:35:22 +01:00
d01ebe66af Fix concatenation failure when zone is not defined 2023-12-11 09:34:52 +01:00
bd820e4c53 Prepare 0.4.0
All checks were successful
continuous-integration/drone/tag Build is passing
2023-12-10 12:41:07 +01:00
734e89e720 Refactor condition for changed result 2023-12-10 12:40:04 +01:00
360bc2a587 Fix get_zone args 2023-12-10 12:39:42 +01:00
106e879eb9 If no zone is given, use the most recent one 2023-12-10 12:39:15 +01:00
5199779fb2 Add the new options NEWSLETTER_SERVER_URL and NEWSLETTER_ID
All checks were successful
continuous-integration/drone/tag Build is passing
2023-11-19 15:37:35 +01:00
9b25bd8412 Prepare 0.3.2
All checks were successful
continuous-integration/drone/tag Build is passing
2023-04-22 15:05:36 +02:00
2ddbb56ce5 Fix result of current_zone when not importing the zone 2023-04-22 15:03:33 +02:00
6 changed files with 58 additions and 19 deletions

View File

@ -1,7 +1,7 @@
---
namespace: happydns
name: happydomain
version: 0.3.1
version: 0.4.4
readme: README.md
authors:
- happyDomain Team <happydomain.org>

View File

@ -62,7 +62,7 @@ def main():
result['current_zone'] = d.current_zone.id
result['msg'] += " and zone imported"
else:
result['current_zone'] = d.current_zone
result['current_zone'] = d.current_zone.id
break
if not found:

View File

@ -54,9 +54,10 @@ def main():
for d in domains:
if d.domain == p['domain'] or d.domain == p['domain'] + ".":
for z in d.zone_history:
if z == p['zone']:
zone = d.get_zone(z)
if p['zone'] is None or z == p['zone']:
zone = d.get_zone(z.id)
skipAdd = False
if p['subdomain'].removesuffix(d.domain) in zone.services:
for s in zone.services[p['subdomain'].removesuffix(d.domain)]:
if s._svctype == p['type']:
@ -67,19 +68,20 @@ def main():
differ = True
break
if p['erase_others']:
if p['state'] == 'absent' and not differ:
s.delete()
result['changed'] = True
elif p['erase_others']:
if differ:
s.delete()
result['changed'] = True
elif not differ:
if p['state'] == 'absent':
s.delete()
result['changed'] = True
else:
module.exit_json(**result)
return
skipAdd = True
elif not differ:
module.exit_json(**result)
return
if p['state'] != 'absent':
if not skipAdd and p['state'] != 'absent':
zone.add_zone_service(
p['subdomain'].removesuffix(d.domain),
p['type'],
@ -88,14 +90,16 @@ def main():
result['changed'] = True
if p['apply_changes']:
if p['apply_changes'] and result['changed']:
zone.apply_changes()
result['published'] = True
result['changed'] = True
break
else:
module.fail_json(msg="No zone found with id " + p['zone'])
if p['zone'] is None:
module.fail_json(msg="No zone found in domain " + p['domain'])
else:
module.fail_json(msg="No zone found with id " + p['zone'])
return
break
else:

View File

@ -7,24 +7,33 @@ happydomain_version: "latest"
happydomain_data_dir: "" # defaults to /var/lib/happydomain.{{ instance_name }} if not filled
happydomain_inner_data_dir: "/data"
happydomain_docker_mounts:
- source: "{% if happydomain_data_dir != '' %}{{ happydomain_data_dir }}{% else %}/var/lib/{% if instance_name != 'happyDomain' %}happydomain.{% endif %}{{ instance_name }}{% endif %}"
target: "{{ happydomain_inner_data_dir }}"
type: "bind"
happydomain_admin_bind: "./happydomain.sock"
happydomain_baseurl: ""
happydomain_custom_body_html: ""
happydomain_custom_head_html: ""
happydomain_default_nameserver: "127.0.0.1:53"
happydomain_disable_providers_edit: "false"
happydomain_endpoint: ":8081"
happydomain_external_auth: ""
happydomain_external_url: "http://localhost:8081"
happydomain_hide_feedback_button: "false"
happydomain_jwt_secret_key: ""
happydomain_storage_leveldb_path: "./happydomain.db"
happydomain_mail_from: "happyDomain <happydomain@localhost>"
happydomain_mail_smtp_host: ""
happydomain_mail_smtp_port: "465"
happydomain_mail_smtp_username: ""
happydomain_mail_smtp_password: ""
happydomain_mail_smtp_tls_no_verify: ""
happydomain_msg_header_text: ""
happydomain_msg_header_color: "danger"
happydomain_newsletter_server_url: ""
happydomain_newsletter_id: ""
happydomain_no_auth: "false"
happydomain_ovh_application_key: ""
happydomain_ovh_application_secret: ""
happydomain_storage_engine: "leveldb"
happydomain_storage_leveldb_path: "./happydomain.db"

View File

@ -4,22 +4,30 @@
name: "{{ instance_name }}"
image: "happydomain/happydomain:{{ happydomain_version }}"
pull: true
volumes:
- "{% if happydomain_data_dir != '' %}{{ happydomain_data_dir }}{% else %}/var/lib/{% if instance_name != 'happyDomain' %}happydomain.{% endif %}{{ instance_name }}{% endif %}:{{ happydomain_inner_data_dir }}"
state: started
restart: "{{ happydomain_docker_restart | default('no') }}"
restart_policy: unless-stopped
memory: 256M
memory_swap: 512M
mounts: "{{ happydomain_docker_mounts }}"
tmpfs: "{{ happydomain_docker_tmpfs | default([]) }}"
networks: "{{ happydomain_docker_network | default([]) }}"
env:
HAPPYDOMAIN_ADMIN_BIND: "{{ happydomain_admin_bind }}"
HAPPYDOMAIN_BIND: "0.0.0.0:8081"
HAPPYDOMAIN_BASEURL: "{{ happydomain_baseurl }}"
HAPPYDOMAIN_CUSTOM_HEAD_HTML: "{{ happydomain_custom_head_html }}"
HAPPYDOMAIN_DEFAULT_NS: "{{ happydomain_default_nameserver }}"
HAPPYDOMAIN_DISABLE_PROVIDERS_EDIT: "{{ happydomain_disable_providers_edit }}"
HAPPYDOMAIN_EXTERNAL_AUTH: "{{ happydomain_external_auth }}"
HAPPYDOMAIN_EXTERNALURL: "{{ happydomain_external_url }}"
HAPPYDOMAIN_HIDE_FEEDBACK_BUTTON: "{{ happydomain_hide_feedback_button }}"
HAPPYDOMAIN_JWT_SECRET_KEY: "{{ happydomain_jwt_secret_key }}"
HAPPYDOMAIN_LEVELDB_PATH: "{{ happydomain_storage_leveldb_path }}"
HAPPYDOMAIN_MSG_HEADER_TEXT: "{{ happydomain_msg_header_text }}"
HAPPYDOMAIN_MSG_HEADER_COLOR: "{{ happydomain_msg_header_color }}"
HAPPYDOMAIN_NEWSLETTER_SERVER_URL: "{{ happydomain_newsletter_server_url }}"
HAPPYDOMAIN_NEWSLETTER_ID: "{{ happydomain_newsletter_id }}"
HAPPYDOMAIN_MAIL_FROM: "{{ happydomain_mail_from }}"
HAPPYDOMAIN_MAIL_SMTP_HOST: "{{ happydomain_mail_smtp_host }}"
HAPPYDOMAIN_MAIL_SMTP_PORT: "{{ happydomain_mail_smtp_port }}"

View File

@ -16,6 +16,9 @@ custom-body-html={{ happydomain_custom_body_html }}
{% if happydomain_default_nameserver is defined and happydomain_default_nameserver != "" %}
default-ns={{ happydomain_default_nameserver }}
{% endif %}
{% if happydomain_disable_providers_edit is defined and happydomain_disable_providers_edit != "" %}
disable-providers-edit={{ happydomain_disable_providers_edit }}
{% endif %}
{% if happydomain_external_auth is defined and happydomain_external_auth != "" %}
external-auth={{ happydomain_external_auth }}
{% endif %}
@ -25,6 +28,9 @@ externalurl={{ happydomain_external_url }}
{% if happydomain_jwt_secret_key is defined and happydomain_jwt_secret_key != "" %}
jwt-secret-key={{ happydomain_jwt_secret_key }}
{% endif %}
{% if happydomain_hide_feedback_button is defined and happydomain_hide_feedback_button %}
hide-feedback-button={{ happydomain_hide_feedback_button }}
{% endif %}
leveldb-path={{ happydomain_storage_leveldb_path | default(happydomain_data_dir + '/happydomain.db') }}
{% if happydomain_mail_from is defined and happydomain_mail_from != "" %}
mail-from={{ happydomain_mail_from }}
@ -44,6 +50,18 @@ mail-smtp-password={{ happydomain_mail_smtp_password }}
{% if happydomain_mail_smtp_tls_no_verify is defined and happydomain_mail_smtp_tls_no_verify != "" %}
mail-smtp-tls-no-verify={{ happydomain_mail_smtp_tls_no_verify }}
{% endif %}
{% if happydomain_msg_header_text is defined and happydomain_msg_header_text != "" %}
msg-header-text={{ happydomain_msg_header_text }}
{% endif %}
{% if happydomain_msg_header_color is defined and happydomain_msg_header_color != "" %}
msg-header-color={{ happydomain_msg_header_color }}
{% endif %}
{% if happydomain_newsletter_server_url is defined and happydomain_newsletter_server_url != "" %}
newsletter-server-url={{ happydomain_newsletter_server_url }}
{% endif %}
{% if happydomain_newsletter_id is defined and happydomain_newsletter_id != "" %}
newsletter-id={{ happydomain_newsletter_id }}
{% endif %}
{% if happydomain_no_auth is defined and happydomain_no_auth != "" %}
no-auth={{ happydomain_no_auth }}
{% endif %}