Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/erlang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@ jobs:
strategy:
fail-fast: false
matrix:
otp: [23.2.1]
otp: [25.3.2.5]
rebar3: [3.22.0]
steps:
- uses: actions/checkout@v2
- uses: gleam-lang/setup-erlang@v1.1.2
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
rebar3-version: ${{matrix.rebar3}}
version-type: strict
- name: Compile
run: rebar3 compile
- name: Run dialyzer
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build stage 0
FROM erlang:23.3.4-alpine
FROM erlang:25.3.2.3-alpine

# Set working directory
RUN mkdir /buildroot
Expand Down
3 changes: 2 additions & 1 deletion config/sys.docker.config
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
{pre_request, nova_request_plugin, #{decode_json_body => true, parse_bindings => true, parse_qs => true}}
]}
]},
{ldf, [{chatli_path, <<"http://localhost:8090/v1">>}]}
{ldf, [{chatli_path, <<"http://localhost:8090/v1">>},
ldf_callbac, <<"http://localhost:8095/receiver">>]}
%% Please change your app.src-file instead if you intend to add app-specific configurations
].
11 changes: 0 additions & 11 deletions priv/assets/admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ <h1>LDF Admin</h1>
<input type="radio" id="phoneNumber" value="phone_number" v-model="picked">
<label for="phoneNumber">Phone number</label>
<input v-model="newItem" type="text" placeholder="Add email or phone number" class="form-control">
<input v-model="date" type="text" placeholder="2020-12-20T12:12:23Z" class="form-control">
<button class="btn btn-primary" @click="saveItem">Add</button>
<button class="btn btn-primary" @click="getHistory">Get history</button>
<table class="table">
<thead>
<tr>
Expand Down Expand Up @@ -81,15 +79,6 @@ <h1>LDF Admin</h1>
.delete('http://localhost:8095/li/' + item.callback_id);

window.location.reload();
},
getHistory: function() {
var dateObj = new Date(this.date);
var timestamp = Date.parse(dateObj);
item = {value: this.newItem,
type: this.picked,
timestamp: timestamp};
axios
.post('http://localhost:8095/history', item);
}
}
});
Expand Down
17 changes: 17 additions & 0 deletions priv/assets/receiver.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ <h1>LDF Receiver</h1>
<label for="receiver">Receiver</label>
<input v-model="receiver" type="text" placeholder="1538d92a-0838-4864-8bb7-3b8825d6adbd" class="form-control">
<button class="btn btn-primary" @click="getMessages">Get messages</button>
<br>
<input type="radio" id="email" value="email" v-model="picked">
<label for="email">Email</label>
<input type="radio" id="phoneNumber" value="phone_number" v-model="picked">
<label for="phoneNumber">Phone number</label>
<input v-model="newItem" type="text" placeholder="Add email or phone number" class="form-control">
<input v-model="date" type="text" placeholder="2020-12-20T12:12:23Z" class="form-control">
<button class="btn btn-primary" @click="getHistory">Get history</button>
<table class="table">
<thead>
<tr>
Expand Down Expand Up @@ -60,6 +68,15 @@ <h1>LDF Receiver</h1>
"&sender=" + this.sender +
"&receiver=" + this.receiver )
.then(response => (this.items = response.data))
},
getHistory: function() {
var dateObj = new Date(this.date);
var timestamp = Date.parse(dateObj);
item = {value: this.newItem,
type: this.picked,
timestamp: timestamp};
axios
.post('http://localhost:8095/history', item);
}
}
});
Expand Down
15 changes: 0 additions & 15 deletions priv/ldf.routes.erl

This file was deleted.

185 changes: 102 additions & 83 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,100 +4,119 @@
{src_dirs, ["src", "src/controllers"]}.
{shell, [{config, "./config/sys.docker.config"}]}.

{erlydtl_opts, [{doc_root, "src/views"},
{recursive, true},
{libraries, [
{nova_erlydtl_inventory, nova_erlydtl_inventory}
]},
{default_libraries, [nova_erlydtl_inventory]}
]}.
{erlydtl_opts, [
{doc_root, "src/views"},
{recursive, true},
{libraries, [
{nova_erlydtl_inventory, nova_erlydtl_inventory}
]},
{default_libraries, [nova_erlydtl_inventory]}
]}.

{deps, [
{pgo, ".*", {git, "https://github.com/erleans/pgo.git", {ref, "6bbd5478ac08ae184cdd8f2331ff81fd94b66610"}}},
{nova, ".*", {git, "https://github.com/novaframework/nova.git", {ref, "f3e2fb52a5cbc07f986583f48222cc6c8be9b5c8"}}}
]}.

{pgo, ".*",
{git, "https://github.com/erleans/pgo.git",
{ref, "6bbd5478ac08ae184cdd8f2331ff81fd94b66610"}}},
{nova, ".*",
{git, "https://github.com/novaframework/nova.git",
{ref, "b5d03d3bdcafb51e0aa2e51ed34ae9dfe1681e7e"}}}
]}.

%% Release profiles
%% To create a release just run
%% rebar3 release -n ldf-prod
{relx, [{release, {ldf, "0.1.0"},
[ldf],
[{dev_mode, false},
{include_erts, true},
{extended_start_script, true}]}
]}.

{relx, [
{release, {ldf, "0.1.0"}, [ldf], [
{dev_mode, false},
{include_erts, true},
{extended_start_script, true}
]}
]}.

%% Plugins for rebar3
{plugins, [
rebar3_auto,
{rebar3_erlydtl_plugin, ".*",
{git, "https://github.com/tsloughter/rebar3_erlydtl_plugin.git", {branch, "master"}}}
]}.
rebar3_auto,
{rebar3_erlydtl_plugin, ".*",
{git, "https://github.com/tsloughter/rebar3_erlydtl_plugin.git", {branch, "master"}}},
erlfmt
]}.

{provider_hooks, [
{pre, [{compile, {erlydtl, compile}}]}
]}.
{xref_checks,[
undefined_function_calls,
undefined_functions,
locals_not_used,
deprecated_function_calls,
deprecated_functions
]}.
{pre, [{compile, {erlydtl, compile}}]}
]}.
{xref_checks, [
undefined_function_calls,
undefined_functions,
locals_not_used,
deprecated_function_calls,
deprecated_functions
]}.

{profiles, [
{lint, [
{plugins, [
{rebar3_lint, {git, "https://github.com/project-fifo/rebar3_lint.git", {tag, "0.1.11"}}}
]}
]}
]}.
{lint, [
{plugins, [
{rebar3_lint, {git, "https://github.com/project-fifo/rebar3_lint.git", {tag, "0.1.11"}}}
]}
]}
]}.

{alias, [{run, [{fmt, "--write"}, shell]}]}.

{elvis,
[#{dirs => ["src"],
filter => "*.erl",
ignore => [etsi103120],
rules => [{elvis_style, line_length,
#{ignore => [],
limit => 120,
skip_comments => false}},
{elvis_style, no_tabs},
{elvis_style, no_trailing_whitespace},
{elvis_style, macro_names, #{ignore => []}},
{elvis_style, macro_module_names},
{elvis_style, operator_spaces, #{rules => [{right, ","},
{right, "++"},
{left, "++"}]}},
{elvis_style, nesting_level, #{level => 3}},
{elvis_style, god_modules,
#{limit => 25,
ignore => []}},
{elvis_style, no_if_expression},
{elvis_style, used_ignored_variable},
{elvis_style, no_behavior_info},
{
elvis_style,
module_naming_convention,
#{regex => "^[a-z]([a-z0-9]*_?)*(_SUITE)?$",
ignore => []}
},
{
elvis_style,
function_naming_convention,
#{regex => "^([a-z][a-z0-9]*_?)*$"}
},
{elvis_style, state_record_and_type},
{elvis_style, no_spec_with_records},
{elvis_style, dont_repeat_yourself, #{min_complexity => 10}},
{elvis_style, no_debug_call, #{ignore => []}}
]
},
#{dirs => ["."],
filter => "rebar.config",
rules => [{elvis_project, no_deps_master_rebar, #{ignore => []}},
{elvis_project, protocol_for_deps_rebar, #{ignore => []}}]
}
]
}.
{elvis, [
#{
dirs => ["src"],
filter => "*.erl",
ignore => [etsi103120],
rules => [
{elvis_style, line_length, #{
ignore => [],
limit => 120,
skip_comments => false
}},
{elvis_style, no_tabs},
{elvis_style, no_trailing_whitespace},
{elvis_style, macro_names, #{ignore => []}},
{elvis_style, macro_module_names},
{elvis_style, operator_spaces, #{
rules => [
{right, ","},
{right, "++"},
{left, "++"}
]
}},
{elvis_style, nesting_level, #{level => 3}},
{elvis_style, god_modules, #{
limit => 25,
ignore => []
}},
{elvis_style, no_if_expression},
{elvis_style, used_ignored_variable},
{elvis_style, no_behavior_info},
{
elvis_style,
module_naming_convention,
#{
regex => "^[a-z]([a-z0-9]*_?)*(_SUITE)?$",
ignore => []
}
},
{
elvis_style,
function_naming_convention,
#{regex => "^([a-z][a-z0-9]*_?)*$"}
},
{elvis_style, state_record_and_type},
{elvis_style, no_spec_with_records},
{elvis_style, dont_repeat_yourself, #{min_complexity => 10}},
{elvis_style, no_debug_call, #{ignore => []}}
]
},
#{
dirs => ["."],
filter => "rebar.config",
rules => [
{elvis_project, no_deps_master_rebar, #{ignore => []}},
{elvis_project, protocol_for_deps_rebar, #{ignore => []}}
]
}
]}.
47 changes: 19 additions & 28 deletions rebar.lock
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
{"1.2.0",
[{<<"backoff">>,{pkg,<<"backoff">>,<<"1.1.6">>},1},
{<<"cowboy">>,{pkg,<<"cowboy">>,<<"2.9.0">>},1},
{<<"cowlib">>,{pkg,<<"cowlib">>,<<"2.11.0">>},2},
{<<"dh_date">>,{pkg,<<"dh_date">>,<<"1.0.0">>},2},
{<<"erldb">>,{pkg,<<"erldb">>,<<"1.0.0">>},1},
{<<"cowboy">>,{pkg,<<"cowboy">>,<<"2.10.0">>},1},
{<<"cowlib">>,{pkg,<<"cowlib">>,<<"2.12.1">>},2},
{<<"erlydtl">>,{pkg,<<"erlydtl">>,<<"0.14.0">>},1},
{<<"jhn_stdlib">>,{pkg,<<"jhn_stdlib">>,<<"3.6.2">>},1},
{<<"mysql">>,{pkg,<<"mysql">>,<<"1.6.0">>},2},
{<<"nova">>,
{git,"https://github.com/novaframework/nova.git",
{ref,"f3e2fb52a5cbc07f986583f48222cc6c8be9b5c8"}},
{ref,"b5d03d3bdcafb51e0aa2e51ed34ae9dfe1681e7e"}},
0},
{<<"pg_types">>,
{git,"https://github.com/tsloughter/pg_types.git",
Expand All @@ -20,43 +17,37 @@
{ref,"6bbd5478ac08ae184cdd8f2331ff81fd94b66610"}},
0},
{<<"pmod_transform">>,{pkg,<<"pmod_transform">>,<<"1.1.0">>},1},
{<<"poolboy">>,{pkg,<<"poolboy">>,<<"1.5.2">>},2},
{<<"quickrand">>,{pkg,<<"quickrand">>,<<"2.0.2">>},2},
{<<"quickrand">>,{pkg,<<"quickrand">>,<<"2.0.5">>},2},
{<<"ranch">>,{pkg,<<"ranch">>,<<"1.8.0">>},2},
{<<"routing_tree">>,{pkg,<<"routing_tree">>,<<"1.0.1">>},1},
{<<"routing_tree">>,{pkg,<<"routing_tree">>,<<"1.0.6">>},1},
{<<"telemetry">>,{pkg,<<"telemetry">>,<<"0.4.0">>},1},
{<<"uuid">>,{pkg,<<"uuid_erl">>,<<"2.0.0">>},1}]}.
{<<"thoas">>,{pkg,<<"thoas">>,<<"0.4.0">>},1},
{<<"uuid">>,{pkg,<<"uuid_erl">>,<<"2.0.5">>},1}]}.
[
{pkg_hash,[
{<<"backoff">>, <<"83B72ED2108BA1EE8F7D1C22E0B4A00CFE3593A67DBC792799E8CCE9F42F796B">>},
{<<"cowboy">>, <<"865DD8B6607E14CF03282E10E934023A1BD8BE6F6BACF921A7E2A96D800CD452">>},
{<<"cowlib">>, <<"0B9FF9C346629256C42EBE1EEB769A83C6CB771A6EE5960BD110AB0B9B872063">>},
{<<"dh_date">>, <<"5B0C286665E160DE44132552931BEF06B5CB2244D5BD20E333A686E9D8BF92E3">>},
{<<"erldb">>, <<"5061C4E7FCBF7E6FD0C920ADD88243B6718FD739AB4B3F7D3F885FA51250BAD1">>},
{<<"cowboy">>, <<"FF9FFEFF91DAE4AE270DD975642997AFE2A1179D94B1887863E43F681A203E26">>},
{<<"cowlib">>, <<"A9FA9A625F1D2025FE6B462CB865881329B5CAFF8F1854D1CBC9F9533F00E1E1">>},
{<<"erlydtl">>, <<"964B2DC84F8C17ACFAA69C59BA129EF26AC45D2BA898C3C6AD9B5BDC8BA13CED">>},
{<<"jhn_stdlib">>, <<"DBF19025FB1CCD7BEDCD19DC655A29618AA5943505DFE707C562E25F69C56BAA">>},
{<<"mysql">>, <<"F7858A8BAB3DEB21684161F3A557DFC9698B1E212DCFCD182F89F93AEA740431">>},
{<<"pmod_transform">>, <<"A3A4FA607B947C90410BC459DCA27F6B60D25D1588D568280F7276AC8767E106">>},
{<<"poolboy">>, <<"392B007A1693A64540CEAD79830443ABF5762F5D30CF50BC95CB2C1AAAFA006B">>},
{<<"quickrand">>, <<"1D73FAA52E0C149FCBC72A63C26135FF68BE8FA7870675C73645896788A7540C">>},
{<<"quickrand">>, <<"06FCAD85CB47D5C85C51D6BC9C84A082501BA098A89D64AD0A2F69599E034C04">>},
{<<"ranch">>, <<"8C7A100A139FD57F17327B6413E4167AC559FBC04CA7448E9BE9057311597A1D">>},
{<<"routing_tree">>, <<"BEE537F992DA54AC31CDC1F0BD39DABA1BEF1A1EF691B2601774BE7FC2F201D1">>},
{<<"routing_tree">>, <<"D565314CC3170DE52D534ECC77E7EB9146E8B6D6B3FDC17E01F24B8A360B4364">>},
{<<"telemetry">>, <<"8339BEE3FA8B91CB84D14C2935F8ECF399CCD87301AD6DA6B71C09553834B2AB">>},
{<<"uuid">>, <<"02C713FAC0E73E5F366CBA541216F1E956E2F00C91C7530D4B21DEC7D3ADA164">>}]},
{<<"thoas">>, <<"86A72CCDC5EC388A13F9F843BCD6C1076640233B95440E47FFB8E3C0DBDB5A17">>},
{<<"uuid">>, <<"60FAEEB7EDFD40847ED13CB0DD1044BAABE4E79A00C0CA9C4D13A073914B1016">>}]},
{pkg_hash_ext,[
{<<"backoff">>, <<"CF0CFFF8995FB20562F822E5CC47D8CCF664C5ECDC26A684CBE85C225F9D7C39">>},
{<<"cowboy">>, <<"2C729F934B4E1AA149AFF882F57C6372C15399A20D54F65C8D67BEF583021BDE">>},
{<<"cowlib">>, <<"2B3E9DA0B21C4565751A6D4901C20D1B4CC25CBB7FD50D91D2AB6DD287BC86A9">>},
{<<"dh_date">>, <<"3F5D908383A0243A693147EA85A5654769B90078AC999A076ED6F0917F7614CF">>},
{<<"erldb">>, <<"115A40D487597295403F26118CF017F91BA955B5A6DED9D81E98BF700D30AF22">>},
{<<"cowboy">>, <<"3AFDCCB7183CC6F143CB14D3CF51FA00E53DB9EC80CDCD525482F5E99BC41D6B">>},
{<<"cowlib">>, <<"163B73F6367A7341B33C794C4E88E7DBFE6498AC42DCD69EF44C5BC5507C8DB0">>},
{<<"erlydtl">>, <<"D80EC044CD8F58809C19D29AC5605BE09E955040911B644505E31E9DD8143431">>},
{<<"jhn_stdlib">>, <<"C6F6AE9BC636B0011ABA7B4DACAFF549C0B5CFB58229EBD09959B77391F6ED47">>},
{<<"mysql">>, <<"0B7B72927F99EB89E5AC2DAA5DB05DAAC6FDE99FDEA33B02406913A617F4A1A7">>},
{<<"pmod_transform">>, <<"68C7FF7354C0D837681990D093D367FCC617C32570A1009B8E7ACFF6445499AA">>},
{<<"poolboy">>, <<"DAD79704CE5440F3D5A3681C8590B9DC25D1A561E8F5A9C995281012860901E3">>},
{<<"quickrand">>, <<"E21C6C7F29CA995468662085CA54D7D09E861C180A9DFEC2CF4A2E75364A16D6">>},
{<<"quickrand">>, <<"252CF0493570EBF1A58985CB71990982CDDCD4396B6427F1E10CF58924C1C052">>},
{<<"ranch">>, <<"49FBCFD3682FAB1F5D109351B61257676DA1A2FDBE295904176D5E521A2DDFE5">>},
{<<"routing_tree">>, <<"DE024259AFAE96BAABE573B6A10A7E8F17236C68AF19044262C4CEE8D132A915">>},
{<<"routing_tree">>, <<"49EADC682FCD8F1061272A77306E334716EAEA24E5F36AF118CB3A21A802BFAE">>},
{<<"telemetry">>, <<"E9E3CACFD37C1531C0CA70CA7C0C30CE2DBB02998A4F7719DE180FE63F8D41E4">>},
{<<"uuid">>, <<"CE1C1ED1D786BA98F93204BE66F93A797504993954141122FCC5FE59B5331367">>}]}
{<<"thoas">>, <<"442296847ACA11DB8D25180693D7CA3073D6D7179F66952F07B16415306513B6">>},
{<<"uuid">>, <<"E54373262CA88401689277947C54B95E9ECBC977BD5C57C9DD44AD9DA278E360">>}]}
].
Loading