Skip to content

Commit

Permalink
Fix up formatting and testing
Browse files Browse the repository at this point in the history
  • Loading branch information
mobileoverlord committed May 16, 2024
1 parent 966881b commit 91e214e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Peridiod is configured via a json formatted file on the filesystem. The location
* `extra_args`: A list of extra arguments to pass to the fwup command used for applying fwup archives. Helpful when needing to use the --unsafe flag in fwup.
* `env`: A json object of `"ENV_VAR": "value"` pairs to decorate the environment which fwup is executed from.
* `remote_shell`: Enable or disable the remote getty feature.
* `remote_iex`: Enable or disable the remote IEx feature. Useful if you are deploying a Nerves distribution.
* `remote_iex`: Enable or disable the remote IEx feature. Useful if you are deploying a Nerves distribution. Enabling this takes precedence over `remote_shell`
* `node`: Node configuration settings
* `key_pair_source`: Options are `file`, `uboot-env`, `pkcs11`. This determines the source of the identity key information.
* `key_pair_config`: Different depending on the `key_pair_source`
Expand Down Expand Up @@ -126,7 +126,7 @@ config :peridiod,

## Running with Docker

You can debug using docker by generating an SSL certificta eand private key pair that is trusted by Peridio Cloud and pass it into the container.
You can debug using docker by generating an SSL certificate and private key pair that is trusted by Peridio Cloud and pass it into the container.

Building the container:

Expand Down
3 changes: 1 addition & 2 deletions lib/peridiod/fwup_config.ex
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ defmodule Peridiod.FwupConfig do
update_available: update_available_fun
}


def parse_fwup_env(%{} = fwup_env), do: Enum.to_list(fwup_env)
def parse_fwup_env([_] = fwup_env), do: fwup_env
def parse_fwup_env(fwup_env) when is_list(fwup_env), do: fwup_env

@doc "Raises an ArgumentError on invalid arguments"
@spec validate!(t()) :: t()
Expand Down
1 change: 1 addition & 0 deletions lib/peridiod/socket.ex
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ defmodule Peridiod.Socket do
if socket.assigns.remote_iex do
RemoteConsole.IEx.window_change(socket.assigns.remote_console_pid, width, height)
end

{:ok, socket}
end

Expand Down
17 changes: 9 additions & 8 deletions lib/peridiod/update_manager.ex
Original file line number Diff line number Diff line change
Expand Up @@ -261,14 +261,15 @@ defmodule Peridiod.UpdateManager do

@spec fwup_args(FwupConfig.t()) :: [String.t()]
defp fwup_args(%FwupConfig{} = config) do
args = [
"--apply",
"--no-unmount",
"-d",
config.fwup_devpath,
"--task",
config.fwup_task
] ++ config.fwup_extra_args
args =
[
"--apply",
"--no-unmount",
"-d",
config.fwup_devpath,
"--task",
config.fwup_task
] ++ config.fwup_extra_args

Enum.reduce(config.fwup_public_keys, args, fn public_key, args ->
args ++ ["--public-key", public_key]
Expand Down

0 comments on commit 91e214e

Please sign in to comment.