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
4 changes: 3 additions & 1 deletion .github/workflows/erlang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
otp: ['28.0']
otp: ['28.3.1']
rebar3: ['3.26.0']
steps:
- uses: actions/checkout@v4
Expand All @@ -22,6 +22,8 @@ jobs:
version-type: strict
- name: Compile
run: rebar3 compile
- name: Run eunit
run: rebar3 eunit
- name: Run dialyzer
run: rebar3 dialyzer
- name: Run xref
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build stage 0
FROM erlang:27.0.1.0-alpine
FROM erlang:28.3.1.0-alpine

# Set working directory
RUN mkdir /buildroot
Expand All @@ -12,7 +12,7 @@ RUN apk add --update git
RUN rebar3 release

# Build stage 1
FROM alpine
FROM alpine:3.23

# Install some libs
RUN apk add --no-cache openssl && \
Expand Down
4 changes: 0 additions & 4 deletions config/sys.config
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
}
}}
]},
{pg_types, [
{uuid_format, string},
{json_config, {json, [maps, binary], [maps, binary, atom_keys]}}
]},
{nova, [
{cowboy_configuration, #{
port => 8095
Expand Down
4 changes: 0 additions & 4 deletions config/sys.docker.config
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
}
}}
]},
{pg_types, [
{uuid_format, string},
{json_config, {json, [maps, binary], [maps, binary, atom_keys]}}
]},
{nova, [
{cowboy_configuration, #{
port => 8095
Expand Down
9 changes: 5 additions & 4 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
]}.

{deps, [
{kura, {git, "https://github.com/Taure/kura.git", {tag, "v2.0.8"}}},
{kura_postgres, {git, "https://github.com/Taure/kura_postgres.git", {tag, "v0.4.2"}}},
{kura, {git, "https://github.com/Taure/kura.git", {tag, "v2.20.12"}}},
{kura_postgres, {git, "https://github.com/Taure/kura_postgres.git", {tag, "v1.1.3"}}},
{datastar, {git, "https://github.com/Taure/datastar.git", {branch, "main"}}},
{datastar_nova, {git, "https://github.com/Taure/datastar_nova.git", {tag, "v0.1.0"}}},
nova
Expand All @@ -35,7 +35,7 @@
%% Plugins for rebar3
{plugins, [
rebar3_auto,
rebar3_kura,
{rebar3_kura, {git, "https://github.com/Taure/rebar3_kura.git", {tag, "v0.16.4"}}},
{rebar3_erlydtl_plugin, ".*",
{git, "https://github.com/tsloughter/rebar3_erlydtl_plugin.git", {branch, "master"}}},
erlfmt
Expand Down Expand Up @@ -65,7 +65,8 @@
{files, [
"{rebar.config, elvis.config, src, include,test}/*.{hrl,erl}",
"src/controllers/*.erl",
"src/plugins/*.erl",
"src/schemas/*.erl",
"src/migrations/*.erl",
"config/*"
]}
]}.
Expand Down
37 changes: 14 additions & 23 deletions rebar.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{"1.2.0",
[{<<"backoff">>,{pkg,<<"backoff">>,<<"1.1.6">>},2},
{<<"cowboy">>,{pkg,<<"cowboy">>,<<"2.15.0">>},1},
{<<"cowlib">>,{pkg,<<"cowlib">>,<<"2.17.1">>},2},
[{<<"cowboy">>,{pkg,<<"cowboy">>,<<"2.18.0">>},1},
{<<"cowlib">>,{pkg,<<"cowlib">>,<<"2.19.0">>},2},
{<<"datastar">>,
{git,"https://github.com/Taure/datastar.git",
{ref,"fcc11f399294b305620a7c99ed633b898ce3889b"}},
Expand All @@ -14,45 +13,37 @@
{<<"jhn_stdlib">>,{pkg,<<"jhn_stdlib">>,<<"5.11.2">>},1},
{<<"kura">>,
{git,"https://github.com/Taure/kura.git",
{ref,"fdb1abc5fdc0cc48c34b7d33fd8e0d6748c4a7d1"}},
{ref,"2fa6d253af528f3185dd5669efecc018fc9e27cf"}},
0},
{<<"kura_postgres">>,
{git,"https://github.com/Taure/kura_postgres.git",
{ref,"30651b35986bda5fc84d89fc141936cb70b636ab"}},
{ref,"794fbae00a9fe22ac91770e3e52e612fd7cf61b7"}},
0},
{<<"nova">>,{pkg,<<"nova">>,<<"0.14.3">>},0},
{<<"opentelemetry_api">>,{pkg,<<"opentelemetry_api">>,<<"1.5.0">>},2},
{<<"pg_types">>,{pkg,<<"pg_types">>,<<"0.6.0">>},2},
{<<"pgo">>,{pkg,<<"pgo">>,<<"0.20.0">>},1},
{<<"minato">>,{pkg,<<"minato">>,<<"1.0.2">>},1},
{<<"nova">>,{pkg,<<"nova">>,<<"0.16.1">>},0},
{<<"ranch">>,{pkg,<<"ranch">>,<<"2.2.0">>},2},
{<<"routing_tree">>,{pkg,<<"routing_tree">>,<<"1.0.11">>},1},
{<<"telemetry">>,{pkg,<<"telemetry">>,<<"1.4.2">>},1},
{<<"thoas">>,{pkg,<<"thoas">>,<<"1.2.1">>},1}]}.
[
{pkg_hash,[
{<<"backoff">>, <<"83B72ED2108BA1EE8F7D1C22E0B4A00CFE3593A67DBC792799E8CCE9F42F796B">>},
{<<"cowboy">>, <<"9CFE86ED7117BF045E10ADBEDB0170AF7BE57F2A3637E7BE143433D8DD267396">>},
{<<"cowlib">>, <<"3E6053016D1AB245730F0AF688755476DCEDB1C25ED8FB5751F59A2BFDC0C9AF">>},
{<<"cowboy">>, <<"BFF388EB4D6356CB3F88C26E65B515976BF04B401B805D31550C3E60EBA8FE18">>},
{<<"cowlib">>, <<"C9D11C9D035472E27A740C9F327786C61ED209269B4BE0260D59D3EC07B8949F">>},
{<<"erlydtl">>, <<"964B2DC84F8C17ACFAA69C59BA129EF26AC45D2BA898C3C6AD9B5BDC8BA13CED">>},
{<<"jhn_stdlib">>, <<"785074F3CA368EAA8E9AF1592BC19AE9EF1F7AF30B2CD6456A6083173A8F5CCB">>},
{<<"nova">>, <<"2F08F11162A871CB1AA361BFEFE66D945F3284243F7EA6582AD8CA709BAFE2F3">>},
{<<"opentelemetry_api">>, <<"1A676F3E3340CAB81C763E939A42E11A70C22863F645AA06AAFEFC689B5550CF">>},
{<<"pg_types">>, <<"B530C56330A59288BE49CDD27739EC025B6E877A475AE70BF95B04F1E3A817C4">>},
{<<"pgo">>, <<"4F4A1FCB0A4894311BE238195BDAD4DF80312AB091DB87FE5348FAFA4DA75F87">>},
{<<"minato">>, <<"962EE20DA49457633BB2B4D01ACF0C8D504BA6407AC8CF93BC075C9F88832043">>},
{<<"nova">>, <<"E1C9C5B7E4E8B7452200C9D091FF7AE8BC53D5539EB9837472874A6512A1D333">>},
{<<"ranch">>, <<"25528F82BC8D7C6152C57666CA99EC716510FE0925CB188172F41CE93117B1B0">>},
{<<"routing_tree">>, <<"72ACEF2095F0EC804F7AFD07EF781DDE5009425A1CA0A28F0706B1DB334A4812">>},
{<<"telemetry">>, <<"A0CB522801DFFB1C49FE6E30561BADFFC7B6D0E180DB1300DF759FAA22062855">>},
{<<"thoas">>, <<"19A25F31177A17E74004D4840F66D791D4298C5738790FA2CC73731EB911F195">>}]},
{pkg_hash_ext,[
{<<"backoff">>, <<"CF0CFFF8995FB20562F822E5CC47D8CCF664C5ECDC26A684CBE85C225F9D7C39">>},
{<<"cowboy">>, <<"179FB65140FB440A17B767AD53B755081506F9596C4DB5C49C0396D8C8643668">>},
{<<"cowlib">>, <<"FF08BD17E6DD931445B18AF77315B9B5FE052407110964AD2588C686B57B5E3F">>},
{<<"cowboy">>, <<"62D0B26ABCF455054972B0DA242389C69D5982CE5914AFB8C344517F667B9600">>},
{<<"cowlib">>, <<"6DC66E3135B229193EA4DCB14294E79520C923D391315C9C962EF0B4BEA72356">>},
{<<"erlydtl">>, <<"D80EC044CD8F58809C19D29AC5605BE09E955040911B644505E31E9DD8143431">>},
{<<"jhn_stdlib">>, <<"2329CD16DEE46704AAB6184D09508E59DBA31C4D3255271DBB7D34D115ECA508">>},
{<<"nova">>, <<"D35D0CEF073749958D2E7E446DED07354F5A3A6B96A31009A2E89D382BE72EF4">>},
{<<"opentelemetry_api">>, <<"F53EC8A1337AE4A487D43AC89DA4BD3A3C99DDF576655D071DEED8B56A2D5DDA">>},
{<<"pg_types">>, <<"9949A4849DD13408FA249AB7B745E0D2DFDB9532AEE2B9722326E33CD082A778">>},
{<<"pgo">>, <<"2F11E6649CEB38E569EF56B16BE1D04874AE5B11A02867080A2817CE423C683B">>},
{<<"minato">>, <<"387F943683287F06C3570852B79CC2A35D36E2EFC5A3B997587845C4E0286053">>},
{<<"nova">>, <<"05F87B2F4C05DFAA87A93CFADAEF71B735FE3E5DDEC430596170EF4A9C443804">>},
{<<"ranch">>, <<"FA0B99A1780C80218A4197A59EA8D3BDAE32FBFF7E88527D7D8A4787EFF4F8E7">>},
{<<"routing_tree">>, <<"85982C7AC502892C5179CD2A591331003BACD2D2A71723640BA7D23F45408E6E">>},
{<<"telemetry">>, <<"928F6495066506077862C0D1646609EED891A4326BEE3126BA54B60AF61FEBB1">>},
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/ldf_www_controller.erl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ submit_history(Req0) ->
ldf_srv:get_history(
thoas:encode(#{type => Type, value => Value, timestamp => Timestamp})
),
status_patch(~"Request submitted - matching messages appear in the Receiver tab.");
status_patch(~"Request submitted - matching messages appear in the Monitor tab.");
_ ->
status_patch(~"Target type and value are required.")
end.
Expand Down
1 change: 0 additions & 1 deletion src/ldf.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
runtime_tools,
nova,
xmerl,
pgo,
kura,
kura_postgres,
datastar,
Expand Down
40 changes: 22 additions & 18 deletions src/migrations/m20260624090043_update_schema.erl
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,28 @@

-spec up() -> [kura_migration:operation()].
up() ->
[{create_table, ~"ldf_message", [
#kura_column{name = id, type = id, primary_key = true},
#kura_column{name = message_id, type = uuid, nullable = false},
#kura_column{name = payload, type = string},
#kura_column{name = content_length, type = string}
]},
{create_table, ~"li", [
#kura_column{name = id, type = id, primary_key = true},
#kura_column{name = type, type = string, nullable = false},
#kura_column{name = value, type = string, nullable = false},
#kura_column{name = callback_id, type = uuid, nullable = false},
#kura_column{name = user_id, type = uuid, nullable = false},
#kura_column{name = username, type = string},
#kura_column{name = phone_number, type = string},
#kura_column{name = email, type = string}
]}].
[
{create_table, ~"ldf_message", [
#kura_column{name = id, type = id, primary_key = true},
#kura_column{name = message_id, type = uuid, nullable = false},
#kura_column{name = payload, type = string},
#kura_column{name = content_length, type = string}
]},
{create_table, ~"li", [
#kura_column{name = id, type = id, primary_key = true},
#kura_column{name = type, type = string, nullable = false},
#kura_column{name = value, type = string, nullable = false},
#kura_column{name = callback_id, type = uuid, nullable = false},
#kura_column{name = user_id, type = uuid, nullable = false},
#kura_column{name = username, type = string},
#kura_column{name = phone_number, type = string},
#kura_column{name = email, type = string}
]}
].

-spec down() -> [kura_migration:operation()].
down() ->
[{drop_table, ~"ldf_message"},
{drop_table, ~"li"}].
[
{drop_table, ~"ldf_message"},
{drop_table, ~"li"}
].
16 changes: 10 additions & 6 deletions src/migrations/m20260624171034_alter_ldf_message.erl
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@

-spec up() -> [kura_migration:operation()].
up() ->
[{alter_table, ~"ldf_message", [
{modify_column, payload, text}
]}].
[
{alter_table, ~"ldf_message", [
{modify_column, payload, text}
]}
].

-spec down() -> [kura_migration:operation()].
down() ->
[{alter_table, ~"ldf_message", [
{modify_column, payload, string}
]}].
[
{alter_table, ~"ldf_message", [
{modify_column, payload, string}
]}
].
13 changes: 7 additions & 6 deletions src/schemas/ldf_message.erl
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@

table() -> ~"ldf_message".

fields() -> [
#kura_field{name = id, type = id, primary_key = true},
#kura_field{name = message_id, type = uuid, nullable = false},
#kura_field{name = payload, type = text},
#kura_field{name = content_length, type = string}
].
fields() ->
[
#kura_field{name = id, type = id, primary_key = true},
#kura_field{name = message_id, type = uuid, nullable = false},
#kura_field{name = payload, type = text},
#kura_field{name = content_length, type = string}
].
21 changes: 11 additions & 10 deletions src/schemas/li.erl
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@

table() -> ~"li".

fields() -> [
#kura_field{name = id, type = id, primary_key = true},
#kura_field{name = type, type = string, nullable = false},
#kura_field{name = value, type = string, nullable = false},
#kura_field{name = callback_id, type = uuid, nullable = false},
#kura_field{name = user_id, type = uuid, nullable = false},
#kura_field{name = username, type = string},
#kura_field{name = phone_number, type = string},
#kura_field{name = email, type = string}
].
fields() ->
[
#kura_field{name = id, type = id, primary_key = true},
#kura_field{name = type, type = string, nullable = false},
#kura_field{name = value, type = string, nullable = false},
#kura_field{name = callback_id, type = uuid, nullable = false},
#kura_field{name = user_id, type = uuid, nullable = false},
#kura_field{name = username, type = string},
#kura_field{name = phone_number, type = string},
#kura_field{name = email, type = string}
].
2 changes: 1 addition & 1 deletion src/views/admin.dtl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "base.dtl" %}
{% block title %}Listeners{% endblock %}
{% block title %}Admin{% endblock %}
{% block content %}
<h1 class="page-title">Interception targets</h1>
<p class="page-sub">Listeners currently provisioned. Add or remove targets &mdash; changes propagate live to every open console.</p>
Expand Down
6 changes: 3 additions & 3 deletions src/views/base.dtl
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
<header class="topbar">
<div class="brand"><b>LDF</b><span>ETSI&nbsp;103707</span></div>
<nav class="nav">
<a href="/www/receiver"{% if active == "receiver" %} class="active"{% endif %}>Receiver</a>
<a href="/www/admin"{% if active == "admin" %} class="active"{% endif %}>Listeners</a>
<a href="/www/history"{% if active == "history" %} class="active"{% endif %}>History</a>
<a href="/www/receiver"{% if active == "receiver" %} class="active"{% endif %}>Monitor</a>
<a href="/www/admin"{% if active == "admin" %} class="active"{% endif %}>Admin</a>
<a href="/www/history"{% if active == "history" %} class="active"{% endif %}>Retained messages</a>
</nav>
<div class="live-pill">{% if live %}<span class="dot"></span> Stream live{% else %}Standby{% endif %}</div>
</header>
Expand Down
10 changes: 5 additions & 5 deletions src/views/history.dtl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{% extends "base.dtl" %}
{% block title %}History{% endblock %}
{% block title %}Retained messages{% endblock %}
{% block content %}
<h1 class="page-title">History submission</h1>
<p class="page-sub">Replay stored messages for a target as historic interception, from a given timestamp.</p>
<h1 class="page-title">Request for retained messages</h1>
<p class="page-sub">Retrieve messages for a target, from a given timestamp.</p>

<div class="panel" data-signals="{timestamp_ms: 0}">
<div class="panel-head"><h2>Submit history request</h2></div>
<div class="panel-head"><h2>Request retained messages</h2></div>
<div class="panel-body">
<div class="row">
<label class="seg"><input type="radio" value="email" data-bind:type checked> Email</label>
Expand All @@ -16,7 +16,7 @@
<input type="datetime-local" step="1" lang="sv-SE" data-bind:timestamp data-on:change="$timestamp_ms = el.value ? (new Date(el.value).getTime() || 0) : 0">
<button class="btn" data-on:click="@post('/www/history')">Submit request</button>
</div>
<p class="hint">Requires an active listener for this target &mdash; add one on the <a href="/www/admin">Listeners</a> tab first. Matching messages replay into the <a href="/www/receiver">Receiver</a> tab, from the chosen local time onward.</p>
<p class="hint">Requires an active listener for this target &mdash; add one on the <a href="/www/admin">Admin</a> tab first. Matching messages are delivered to the <a href="/www/receiver">Monitor</a> tab, from the chosen local time onward.</p>
<div id="hist-status" style="margin-top:16px;color:var(--dim);font-size:12.5px">&nbsp;</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/views/receiver.dtl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "base.dtl" %}
{% block title %}Receiver{% endblock %}
{% block title %}Monitor{% endblock %}
{% block content %}
<h1 class="page-title">Intercepted messages</h1>
<p class="page-sub">Live feed of messages received from monitored targets &mdash; new entries stream in automatically, no refresh.</p>
Expand Down
Loading