Skip to content

Commit

Permalink
Adding possibility of passing the RELEASE_COOKIE via ENV VAR to allow…
Browse files Browse the repository at this point in the history
… /bin/calori remote connections
  • Loading branch information
thiagoesteves authored and Thiago Esteves committed May 24, 2024
1 parent 5d97c0d commit 07761e1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,11 @@ Avoid the execute a hotupgrade in the following situations:

#### 1. IEX shell Access to Deployex App

Connecting the iex shell:
To connect to the iex shell, you may need to export the cookie if AWS is configured with a value different from the default 'cookie', which is highly recommended to change.

```bash
ubuntu@ip-10-0-1-56:~$ sudo su
root@ip-10-0-1-56:/home/ubuntu$ export RELEASE_COOKIE=COOKIE12345678912345789
root@ip-10-0-1-56:/home/ubuntu$ /opt/deployex/bin/deployex remote
Erlang/OTP 26 [erts-14.2.1] [source] [64-bit] [smp:1:1] [ds:1:1:10] [async-threads:1] [jit:ns]

Expand All @@ -215,15 +216,16 @@ iex(deployex@ip-10-0-1-56)1>
##### 2. IEX shell Access to Calori App
Connecting the iex shell:
To connect to the iex shell, you may need to export the cookie if AWS is configured with a value different from the default 'cookie', which is highly recommended to change.
```bash
root@ip-10-0-1-56:/home/ubuntu$ sudo -su deployex
deployex@ip-10-0-1-56:$ /var/lib/deployex/service/calori/current/bin/calori remote
Erlang/OTP 26 [erts-14.2.1] [source] [64-bit] [smp:1:1] [ds:1:1:10] [async-threads:1] [jit:ns]
ubuntu@ip-10-0-1-56:~$ sudo su
root@ip-10-0-1-56:/home/ubuntu$ export RELEASE_COOKIE=COOKIE12345678912345789
root@ip-10-0-1-56:/home/ubuntu$ /var/lib/deployex/service/calori/current/bin/calori remote
Erlang/OTP 26 [erts-14.1.1] [source] [64-bit] [smp:1:1] [ds:1:1:10] [async-threads:1] [jit:ns]
Interactive Elixir (1.16.0) - press Ctrl+C to exit (type h() ENTER for help)
iex(calori@ip-10-0-1-56)1>
iex(calori@ip-10-0-1-174)1>
```
##### 3. Logs
Expand Down Expand Up @@ -262,7 +264,7 @@ root@ip-10-0-1-56:/home/ubuntu$ tail -f /var/log/calori-stdout.log
##### 4. Updating CALORI_PHX_HOST
In case you need to update the *__CALORI_PHX_HOST__*, there are 2 files that need to be updated: `/etc/systemd/system/deployex.service` and `/etc/nginx/sites-available/default` (you need to be `root`` user to update them).
In case you need to update the *__CALORI_PHX_HOST__*, there are 2 files that need to be updated: `/etc/systemd/system/deployex.service` and `/etc/nginx/sites-available/default` (you need to be `root` user to update them).
```bash
ubuntu@ip-10-0-1-56:~$ sudo su
Expand Down
4 changes: 3 additions & 1 deletion rel/env.sh.eex
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ export ELIXIR_ERL_OPTIONS="-proto_dist inet_tls -ssl_dist_optfile /tmp/inet_tls.
# export RELEASE_DISTRIBUTION=name
# export RELEASE_NODE=<%= @release.name %>

export RELEASE_COOKIE="cookie"
# The Erlang cookie value is expected to be sourced by AWS and the next line
# defines it if not passed to allow ./bin/app remote to use RELEASE_COOKIE
[ -z ${RELEASE_COOKIE} ] && export RELEASE_COOKIE="cookie"
export RELEASE_DISTRIBUTION=sname
export RELEASE_NODE=<%= @release.name %>

0 comments on commit 07761e1

Please sign in to comment.