-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
eb096f7
to
4456c9d
Compare
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
src/grisp_connect_ws.erl
Outdated
@@ -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}), |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
32b8ee0
to
5d62b46
Compare
…pdater