From 51d99f3487cb185d8c95f82ce6bcb517725725e8 Mon Sep 17 00:00:00 2001 From: Andrea Leopardi Date: Wed, 13 Nov 2024 12:54:45 +0100 Subject: [PATCH] Add missing rebar3_depup plugin --- rebar.config | 20 ++----------------- src/erldns_admin.app.src | 4 +++- src/erldns_admin.erl | 3 ++- ...ns_admin_zone_records_resource_handler.erl | 10 ++++++++-- src/erldns_admin_zone_resource_handler.erl | 20 ++++++++++++++++--- 5 files changed, 32 insertions(+), 25 deletions(-) diff --git a/rebar.config b/rebar.config index 4fe13e9..b49a57f 100644 --- a/rebar.config +++ b/rebar.config @@ -7,22 +7,6 @@ ]}. {project_plugins, [ - erlfmt -]}. - -{deps, [ - {lager, "3.9.2"}, - folsom, - cowboy, - dns_erlang, - erldns -]}. - -{erlfmt, [ - write, - {print_width, 140} -]}. - -{shell, [ - {apps, [erldns_admin]} + erlfmt, + rebar3_depup ]}. diff --git a/src/erldns_admin.app.src b/src/erldns_admin.app.src index 2a88676..6b1ae6d 100644 --- a/src/erldns_admin.app.src +++ b/src/erldns_admin.app.src @@ -2,5 +2,7 @@ {description, "Erlang Authoritative DNS Server Admin API"}, {vsn, "1.1.0"}, {mod, {erldns_admin_app, []}}, - {applications, [kernel, stdlib, inets, crypto, ssl, observer, bear, folsom, ranch, cowboy, erldns]} + {applications, [ + kernel, stdlib, inets, crypto, ssl, observer, bear, folsom, ranch, cowboy, erldns + ]} ]}. diff --git a/src/erldns_admin.erl b/src/erldns_admin.erl index 8b925fd..66f26ce 100644 --- a/src/erldns_admin.erl +++ b/src/erldns_admin.erl @@ -65,7 +65,8 @@ init([]) -> {"/", erldns_admin_root_handler, []}, {"/zones/:zone_name", erldns_admin_zone_resource_handler, []}, {"/zones/:zone_name/records/", erldns_admin_zone_records_resource_handler, []}, - {"/zones/:zone_name/records/:record_name", erldns_admin_zone_records_resource_handler, []}, + {"/zones/:zone_name/records/:record_name", + erldns_admin_zone_records_resource_handler, []}, {"/zones/:zone_name/:action", erldns_admin_zone_control_handler, []} ]} ] diff --git a/src/erldns_admin_zone_records_resource_handler.erl b/src/erldns_admin_zone_records_resource_handler.erl index 7ad1a96..7223a9a 100644 --- a/src/erldns_admin_zone_records_resource_handler.erl +++ b/src/erldns_admin_zone_records_resource_handler.erl @@ -61,9 +61,15 @@ to_json(Req, State) -> case lists:keyfind(<<"type">>, 1, Params) of false -> - lager:debug("Received GET (zone_name: ~p, record_name: ~p, record_type: unspecified)", [ZoneName, RecordName]), + lager:debug( + "Received GET (zone_name: ~p, record_name: ~p, record_type: unspecified)", [ + ZoneName, RecordName + ] + ), {erldns_zone_encoder:zone_records_to_json(ZoneName, RecordName), Req, State}; {<<"type">>, RecordType} -> - lager:debug("Received GET (zone_name: ~p, record_name: ~p, record_type: ~p)", [ZoneName, RecordName, RecordType]), + lager:debug("Received GET (zone_name: ~p, record_name: ~p, record_type: ~p)", [ + ZoneName, RecordName, RecordType + ]), {erldns_zone_encoder:zone_records_to_json(ZoneName, RecordName, RecordType), Req, State} end. diff --git a/src/erldns_admin_zone_resource_handler.erl b/src/erldns_admin_zone_resource_handler.erl index 978d148..ed30f60 100644 --- a/src/erldns_admin_zone_resource_handler.erl +++ b/src/erldns_admin_zone_resource_handler.erl @@ -16,7 +16,13 @@ -module(erldns_admin_zone_resource_handler). -export([init/2]). --export([content_types_provided/2, is_authorized/2, resource_exists/2, allowed_methods/2, delete_resource/2]). +-export([ + content_types_provided/2, + is_authorized/2, + resource_exists/2, + allowed_methods/2, + delete_resource/2 +]). -export([to_html/2, to_json/2, to_text/2]). -behaviour(cowboy_rest). @@ -72,7 +78,11 @@ to_json(Req, State) -> {erldns_zone_encoder:zone_to_json(Zone), Req, State}; {error, Reason} -> lager:error("Error getting zone: ~p", [Reason]), - {halt, cowboy_req:reply(400, [], io_lib:format("Error getting zone: ~p", [Reason]), Req), State} + {halt, + cowboy_req:reply( + 400, [], io_lib:format("Error getting zone: ~p", [Reason]), Req + ), + State} end; _ -> case erldns_zone_cache:get_zone(Name) of @@ -80,6 +90,10 @@ to_json(Req, State) -> {erldns_zone_encoder:zone_meta_to_json(Zone), Req, State}; {error, Reason} -> lager:error("Error getting zone: ~p", [Reason]), - {halt, cowbow_req:reply(400, [], io_lib:format("Error getting zone: ~p", [Reason]), Req), State} + {halt, + cowbow_req:reply( + 400, [], io_lib:format("Error getting zone: ~p", [Reason]), Req + ), + State} end end.