Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup, use grisp_cryptoauth TLS helper and start supporting grisp_u… #36

Merged
merged 1 commit into from
Jul 30, 2024

Conversation

sylane
Copy link
Contributor

@sylane sylane commented Jul 26, 2024

…pdater

@sylane sylane requested a review from ziopio July 26, 2024 12:22
@sylane sylane force-pushed the sylane/cleanup branch 3 times, most recently from eb096f7 to 4456c9d Compare July 26, 2024 16:17
@sylane
Copy link
Contributor Author

sylane commented Jul 26, 2024

Requires a new grisp release, and a new grisp_cryptoauth release.

README.md Outdated

echo "$(ip addr show | grep 'inet ' | grep -v 127.0.0.1 | awk '{print $2}' | cut -d/ -f1 | head -n 1) www.seawater.local" >> grisp/default/common/deploy/files/etc/hosts

The deploy the release, configure rebar3_grisp's deploy configuration in
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To deploy...

@@ -0,0 +1,3 @@
149.248.205.211 devices.grisp.io
37.16.30.91 devices.stage.grisp.io
212.25.1.1 0.europe.pool.ntp.org
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the NTP server IP is subject to change, we should not version it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should rely on dhcp now

Copy link
Contributor Author

@sylane sylane Jul 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ziopio This was in erl_inetrc, I just moved it there...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah right, actually, now that grisp 2.6.0 is out we would not need this hosts file anymore

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll update the grisp rep and remove this

.gitignore Show resolved Hide resolved
src/grisp_connect_logger_bin.erl Show resolved Hide resolved
@@ -99,6 +105,10 @@ handle_info({gun_ws, Pid, Stream, {close, Code, Message}},
#state{gun_pid = Pid, ws_stream = Stream} = S) ->
?LOG_WARNING(#{event => stream_closed, code => Code, reason => Message}),
{noreply, S};
handle_info({gun_error, Pid, _Stream, Reason}, #state{gun_pid = Pid} = S) ->
?LOG_INFO(#{event => ws_closed, reason => Reason}),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you replace ws_closed with gun_error for the event field? I think it is more appropriate.

Copy link
Member

@ziopio ziopio Jul 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I would use LOG_ERROR, otherwise you miss this log in notice mode and you do not know why WS restarted.

Copy link
Contributor Author

@sylane sylane Jul 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ziopio ok, for it being a LOG_ERROR, what I am confused with it why gun_error instead of ws_close ?? I see that everywhere that the connection is closed it use the event ws_close even though the trigger is gun_down, so my idea was that the even represent the outcome, not the trigger, and in case of a a gun_error the outcome. If I change it to gun_error, the logic would be to change the other to gun_down...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used ws_cloded because in the match head I match ws atom from gun.
In this case I'd like to underline that this is a gun_error and not just some gun reaction.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But LOG_ERROR is enough to make it distinct, I'm fine with ws_closed and LOG_ERROR

@sylane sylane requested a review from GalaxyGorilla July 29, 2024 13:50
@sylane sylane force-pushed the sylane/cleanup branch 2 times, most recently from 32b8ee0 to 5d62b46 Compare July 30, 2024 09:13
@ziopio ziopio self-requested a review July 30, 2024 15:28
@sylane sylane merged commit a7fa97c into main Jul 30, 2024
1 check passed
@sylane sylane deleted the sylane/cleanup branch July 30, 2024 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants