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
2 changes: 1 addition & 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 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 @@ -11,7 +11,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
1 change: 0 additions & 1 deletion config/sys.config.local
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
{pre_request, chatli_multipart_plugin, #{}},
{pre_request, nova_request_plugin, #{
decode_json_body => true,
parse_bindings => true,
parse_qs => true
}}
]}
Expand Down
8 changes: 4 additions & 4 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
{deps, [
nova,
mimerl,
{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"}}},
{jwerl, ".*",
{git, "https://github.com/Taure/jwerl.git",
{ref, "5f856e7987bb65ceec1593c21a01fd9aef87abda"}}}
Expand Down Expand Up @@ -50,7 +50,7 @@
%% Plugins for rebar3
{project_plugins, [
erlfmt,
rebar3_kura,
{rebar3_kura, {git, "https://github.com/Taure/rebar3_kura.git", {tag, "v0.16.4"}}},
{rebar3_lint, "4.2.2"},
{rebar3_erlydtl_plugin, ".*",
{git, "https://github.com/tsloughter/rebar3_erlydtl_plugin.git", {branch, "master"}}}
Expand All @@ -68,7 +68,6 @@
jhn_stdlib,
edoc,
xmerl,
uuid,
cowboy,
erlydtl,
cowlib,
Expand All @@ -82,6 +81,7 @@
"{rebar.config, elvis.config, src, include,test}/*.{hrl,erl}",
"src/controllers/*.erl",
"src/plugins/*.erl",
"src/migrations/*.erl",
"config/*"
]}
]}.
81 changes: 29 additions & 52 deletions rebar.lock
Original file line number Diff line number Diff line change
@@ -1,76 +1,53 @@
{"1.2.0",
[{<<"backoff">>,{pkg,<<"backoff">>,<<"1.1.6">>},2},
{<<"cowboy">>,{pkg,<<"cowboy">>,<<"2.12.0">>},1},
{<<"cowlib">>,{pkg,<<"cowlib">>,<<"2.13.0">>},2},
[{<<"cowboy">>,{pkg,<<"cowboy">>,<<"2.18.0">>},1},
{<<"cowlib">>,{pkg,<<"cowlib">>,<<"2.19.0">>},2},
{<<"erlydtl">>,{pkg,<<"erlydtl">>,<<"0.14.0">>},1},
{<<"jhn_stdlib">>,{pkg,<<"jhn_stdlib">>,<<"5.1.0">>},1},
{<<"jhn_stdlib">>,{pkg,<<"jhn_stdlib">>,<<"5.11.2">>},1},
{<<"jsx">>,{pkg,<<"jsx">>,<<"2.10.0">>},1},
{<<"jwerl">>,
{git,"https://github.com/Taure/jwerl.git",
{ref,"5f856e7987bb65ceec1593c21a01fd9aef87abda"}},
0},
{<<"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},
{<<"mimerl">>,{pkg,<<"mimerl">>,<<"1.3.0">>},0},
{<<"nova">>,{pkg,<<"nova">>,<<"0.10.2">>},0},
{<<"opentelemetry_api">>,{pkg,<<"opentelemetry_api">>,<<"1.3.1">>},2},
{<<"opentelemetry_semantic_conventions">>,
{pkg,<<"opentelemetry_semantic_conventions">>,<<"0.2.0">>},
3},
{<<"pg_types">>,{pkg,<<"pg_types">>,<<"0.4.0">>},2},
{<<"pgo">>,{pkg,<<"pgo">>,<<"0.20.0">>},1},
{<<"pmod_transform">>,{pkg,<<"pmod_transform">>,<<"1.1.0">>},1},
{<<"quickrand">>,{pkg,<<"quickrand">>,<<"2.0.7">>},2},
{<<"ranch">>,{pkg,<<"ranch">>,<<"1.8.0">>},2},
{<<"routing_tree">>,{pkg,<<"routing_tree">>,<<"1.0.9">>},1},
{<<"mimerl">>,{pkg,<<"mimerl">>,<<"1.5.0">>},0},
{<<"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.0">>},1},
{<<"uuid">>,{pkg,<<"uuid_erl">>,<<"2.0.7">>},1}]}.
{<<"thoas">>,{pkg,<<"thoas">>,<<"1.2.1">>},1}]}.
[
{pkg_hash,[
{<<"backoff">>, <<"83B72ED2108BA1EE8F7D1C22E0B4A00CFE3593A67DBC792799E8CCE9F42F796B">>},
{<<"cowboy">>, <<"F276D521A1FF88B2B9B4C54D0E753DA6C66DD7BE6C9FCA3D9418B561828A3731">>},
{<<"cowlib">>, <<"DB8F7505D8332D98EF50A3EF34B34C1AFDDEC7506E4EE4DD4A3A266285D282CA">>},
{<<"cowboy">>, <<"BFF388EB4D6356CB3F88C26E65B515976BF04B401B805D31550C3E60EBA8FE18">>},
{<<"cowlib">>, <<"C9D11C9D035472E27A740C9F327786C61ED209269B4BE0260D59D3EC07B8949F">>},
{<<"erlydtl">>, <<"964B2DC84F8C17ACFAA69C59BA129EF26AC45D2BA898C3C6AD9B5BDC8BA13CED">>},
{<<"jhn_stdlib">>, <<"55338ABE96EEB12222EF50C8506F3204EE5BD287BFF3961886189847FB4E092C">>},
{<<"jhn_stdlib">>, <<"785074F3CA368EAA8E9AF1592BC19AE9EF1F7AF30B2CD6456A6083173A8F5CCB">>},
{<<"jsx">>, <<"77760560D6AC2B8C51FD4C980E9E19B784016AA70BE354CE746472C33BEB0B1C">>},
{<<"mimerl">>, <<"D0CD9FC04B9061F82490F6581E0128379830E78535E017F7780F37FEA7545726">>},
{<<"nova">>, <<"CB5A8245462F01C099AFDEED9A1B4059B5E07D5E9ADBCE0647E2E0F9E340C2B6">>},
{<<"opentelemetry_api">>, <<"83B4713593F80562D9643C4AB0B6F80F3C5FA4C6D0632C43E11B2CCB6B04DFA7">>},
{<<"opentelemetry_semantic_conventions">>, <<"B67FE459C2938FCAB341CB0951C44860C62347C005ACE1B50F8402576F241435">>},
{<<"pg_types">>, <<"3CE365C92903C5BB59C0D56382D842C8C610C1B6F165E20C4B652C96FA7E9C14">>},
{<<"pgo">>, <<"4F4A1FCB0A4894311BE238195BDAD4DF80312AB091DB87FE5348FAFA4DA75F87">>},
{<<"pmod_transform">>, <<"A3A4FA607B947C90410BC459DCA27F6B60D25D1588D568280F7276AC8767E106">>},
{<<"quickrand">>, <<"D2BD76676A446E6A058D678444B7FDA1387B813710D1AF6D6E29BB92186C8820">>},
{<<"ranch">>, <<"8C7A100A139FD57F17327B6413E4167AC559FBC04CA7448E9BE9057311597A1D">>},
{<<"routing_tree">>, <<"F7B95CF21CAEF1F184948C547780BAB4EC2B2CB0CD75B8CB2BE49F86F0DFD523">>},
{<<"mimerl">>, <<"F35ACA6F23242339B3666E0AC0702379E362B469D0AEA167F6CC713547E777ED">>},
{<<"minato">>, <<"962EE20DA49457633BB2B4D01ACF0C8D504BA6407AC8CF93BC075C9F88832043">>},
{<<"nova">>, <<"E1C9C5B7E4E8B7452200C9D091FF7AE8BC53D5539EB9837472874A6512A1D333">>},
{<<"ranch">>, <<"25528F82BC8D7C6152C57666CA99EC716510FE0925CB188172F41CE93117B1B0">>},
{<<"routing_tree">>, <<"72ACEF2095F0EC804F7AFD07EF781DDE5009425A1CA0A28F0706B1DB334A4812">>},
{<<"telemetry">>, <<"A0CB522801DFFB1C49FE6E30561BADFFC7B6D0E180DB1300DF759FAA22062855">>},
{<<"thoas">>, <<"73B0546BAFF5008E6ED209558FD7B0606B035D96F9F3DE24EF42879100E094D4">>},
{<<"uuid">>, <<"B2078D2CC814F53AFA52D36C91E08962C7E7373585C623F4C0EA6DFB04B2AF94">>}]},
{<<"thoas">>, <<"19A25F31177A17E74004D4840F66D791D4298C5738790FA2CC73731EB911F195">>}]},
{pkg_hash_ext,[
{<<"backoff">>, <<"CF0CFFF8995FB20562F822E5CC47D8CCF664C5ECDC26A684CBE85C225F9D7C39">>},
{<<"cowboy">>, <<"8A7ABE6D183372CEB21CAA2709BEC928AB2B72E18A3911AA1771639BEF82651E">>},
{<<"cowlib">>, <<"E1E1284DC3FC030A64B1AD0D8382AE7E99DA46C3246B815318A4B848873800A4">>},
{<<"cowboy">>, <<"62D0B26ABCF455054972B0DA242389C69D5982CE5914AFB8C344517F667B9600">>},
{<<"cowlib">>, <<"6DC66E3135B229193EA4DCB14294E79520C923D391315C9C962EF0B4BEA72356">>},
{<<"erlydtl">>, <<"D80EC044CD8F58809C19D29AC5605BE09E955040911B644505E31E9DD8143431">>},
{<<"jhn_stdlib">>, <<"760B45C0310FF6E379BC08B0A9E5C2F8C4076223D7E1BDC253D69C7D7055E687">>},
{<<"jhn_stdlib">>, <<"2329CD16DEE46704AAB6184D09508E59DBA31C4D3255271DBB7D34D115ECA508">>},
{<<"jsx">>, <<"9A83E3704807298016968DB506F9FAD0F027DE37546EB838B3AE1064C3A0AD62">>},
{<<"mimerl">>, <<"A1E15A50D1887217DE95F0B9B0793E32853F7C258A5CD227650889B38839FE9D">>},
{<<"nova">>, <<"5C9E6CF451A54CF84B8278F50E49FF17EBB8F8B0D892085742FEFA33DFA2F99D">>},
{<<"opentelemetry_api">>, <<"9E8A5CC38671E3AC61BE48ABE5F6B3AFDBBB50A1DC08B7950C56F169611505C1">>},
{<<"opentelemetry_semantic_conventions">>, <<"D61FA1F5639EE8668D74B527E6806E0503EFC55A42DB7B5F39939D84C07D6895">>},
{<<"pg_types">>, <<"B02EFA785CAECECF9702C681C80A9CA12A39F9161A846CE17B01FB20AEEED7EB">>},
{<<"pgo">>, <<"2F11E6649CEB38E569EF56B16BE1D04874AE5B11A02867080A2817CE423C683B">>},
{<<"pmod_transform">>, <<"68C7FF7354C0D837681990D093D367FCC617C32570A1009B8E7ACFF6445499AA">>},
{<<"quickrand">>, <<"B8ACBF89A224BC217C3070CA8BEBC6EB236DBE7F9767993B274084EA044D35F0">>},
{<<"ranch">>, <<"49FBCFD3682FAB1F5D109351B61257676DA1A2FDBE295904176D5E521A2DDFE5">>},
{<<"routing_tree">>, <<"FB9A05EA0F3A8B77CC39CED3952B98391C617BA448AF63DDD5908F8557D8C029">>},
{<<"mimerl">>, <<"DB648CE065BAE14EA84CA8B5DD123F42F49417CEF693541110BF6F9E9BE9ECC4">>},
{<<"minato">>, <<"387F943683287F06C3570852B79CC2A35D36E2EFC5A3B997587845C4E0286053">>},
{<<"nova">>, <<"05F87B2F4C05DFAA87A93CFADAEF71B735FE3E5DDEC430596170EF4A9C443804">>},
{<<"ranch">>, <<"FA0B99A1780C80218A4197A59EA8D3BDAE32FBFF7E88527D7D8A4787EFF4F8E7">>},
{<<"routing_tree">>, <<"85982C7AC502892C5179CD2A591331003BACD2D2A71723640BA7D23F45408E6E">>},
{<<"telemetry">>, <<"928F6495066506077862C0D1646609EED891A4326BEE3126BA54B60AF61FEBB1">>},
{<<"thoas">>, <<"540C8CB7D9257F2AD0A14145DC23560F91ACDCA995F0CCBA779EB33AF5D859D1">>},
{<<"uuid">>, <<"4E4C5CA3461DC47C5E157ED42AA3981A053B7A186792AF972A27B14A9489324E">>}]}
{<<"thoas">>, <<"E38697EDFFD6E91BD12CEA41B155115282630075C2A727E7A6B2947F5408B86A">>}]}
].
1 change: 0 additions & 1 deletion src/chatli.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
kernel,
stdlib,
nova,
pgo,
kura,
kura_postgres,
jwerl,
Expand Down
108 changes: 56 additions & 52 deletions src/migrations/m20260624090455_update_schema.erl
Original file line number Diff line number Diff line change
Expand Up @@ -4,57 +4,61 @@
-export([up/0, down/0]).

up() ->
[{create_table, <<"attachment">>, [
#kura_column{name = id, type = uuid, primary_key = true},
#kura_column{name = chat_id, type = uuid, nullable = false},
#kura_column{name = mime, type = string, nullable = false},
#kura_column{name = length, type = integer}
]},
{create_table, <<"callback">>, [
#kura_column{name = id, type = uuid, primary_key = true},
#kura_column{name = user_id, type = uuid, nullable = false},
#kura_column{name = url, type = string, nullable = false}
]},
{create_table, <<"chat">>, [
#kura_column{name = id, type = uuid, primary_key = true},
#kura_column{name = name, type = string, nullable = false},
#kura_column{name = description, type = string},
#kura_column{name = type, type = string}
]},
{create_table, <<"chatli_user">>, [
#kura_column{name = id, type = uuid, primary_key = true},
#kura_column{name = username, type = string, nullable = false},
#kura_column{name = phone_number, type = string},
#kura_column{name = email, type = string},
#kura_column{name = avatar, type = string},
#kura_column{name = password, type = string, nullable = false}
]},
{create_table, <<"device">>, [
#kura_column{name = id, type = uuid, primary_key = true},
#kura_column{name = user_id, type = uuid, nullable = false},
#kura_column{name = name, type = string}
]},
{create_table, <<"message">>, [
#kura_column{name = id, type = uuid, primary_key = true},
#kura_column{name = chat_id, type = uuid, nullable = false},
#kura_column{name = payload, type = jsonb},
#kura_column{name = sender, type = uuid, nullable = false},
#kura_column{name = type, type = string},
#kura_column{name = action, type = string},
#kura_column{name = timestamp, type = integer},
#kura_column{name = sender_info, type = jsonb}
]},
{create_table, <<"participant">>, [
#kura_column{name = id, type = id, primary_key = true},
#kura_column{name = chat_id, type = uuid},
#kura_column{name = user_id, type = uuid}
]}].
[
{create_table, <<"attachment">>, [
#kura_column{name = id, type = uuid, primary_key = true},
#kura_column{name = chat_id, type = uuid, nullable = false},
#kura_column{name = mime, type = string, nullable = false},
#kura_column{name = length, type = integer}
]},
{create_table, <<"callback">>, [
#kura_column{name = id, type = uuid, primary_key = true},
#kura_column{name = user_id, type = uuid, nullable = false},
#kura_column{name = url, type = string, nullable = false}
]},
{create_table, <<"chat">>, [
#kura_column{name = id, type = uuid, primary_key = true},
#kura_column{name = name, type = string, nullable = false},
#kura_column{name = description, type = string},
#kura_column{name = type, type = string}
]},
{create_table, <<"chatli_user">>, [
#kura_column{name = id, type = uuid, primary_key = true},
#kura_column{name = username, type = string, nullable = false},
#kura_column{name = phone_number, type = string},
#kura_column{name = email, type = string},
#kura_column{name = avatar, type = string},
#kura_column{name = password, type = string, nullable = false}
]},
{create_table, <<"device">>, [
#kura_column{name = id, type = uuid, primary_key = true},
#kura_column{name = user_id, type = uuid, nullable = false},
#kura_column{name = name, type = string}
]},
{create_table, <<"message">>, [
#kura_column{name = id, type = uuid, primary_key = true},
#kura_column{name = chat_id, type = uuid, nullable = false},
#kura_column{name = payload, type = jsonb},
#kura_column{name = sender, type = uuid, nullable = false},
#kura_column{name = type, type = string},
#kura_column{name = action, type = string},
#kura_column{name = timestamp, type = integer},
#kura_column{name = sender_info, type = jsonb}
]},
{create_table, <<"participant">>, [
#kura_column{name = id, type = id, primary_key = true},
#kura_column{name = chat_id, type = uuid},
#kura_column{name = user_id, type = uuid}
]}
].

down() ->
[{drop_table, <<"attachment">>},
{drop_table, <<"callback">>},
{drop_table, <<"chat">>},
{drop_table, <<"chatli_user">>},
{drop_table, <<"device">>},
{drop_table, <<"message">>},
{drop_table, <<"participant">>}].
[
{drop_table, <<"attachment">>},
{drop_table, <<"callback">>},
{drop_table, <<"chat">>},
{drop_table, <<"chatli_user">>},
{drop_table, <<"device">>},
{drop_table, <<"message">>},
{drop_table, <<"participant">>}
].
20 changes: 20 additions & 0 deletions src/migrations/m20260911065748_alter_message.erl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-module(m20260911065748_alter_message).
-moduledoc false.
-behaviour(kura_migration).
-export([up/0, down/0, safe/0]).

-spec up() -> [kura_migration:operation()].
up() ->
[
{alter_table, ~"message", [
{modify_column, timestamp, bigint}
]}
].

-spec down() -> [kura_migration:operation()].
down() ->
[].

-spec safe() -> [kura_migration:safe_entry()].
safe() ->
[{modify_column, timestamp}].
Loading
Loading