Skip to content

User data as store flow path#28

Merged
gorenje merged 3 commits into
gorenje:mainfrom
joaohf:user-data-as-store-flow-path
Dec 16, 2025
Merged

User data as store flow path#28
gorenje merged 3 commits into
gorenje:mainfrom
joaohf:user-data-as-store-flow-path

Conversation

@joaohf

@joaohf joaohf commented Dec 16, 2025

Copy link
Copy Markdown
Contributor

compute store flow path based on user_data folder

There are some enviroments whe erlang-red is running as a non-privileged
user. Thus, if erlang-red is installed on /usr/ path it will not have
the correct permissions when writing flows to disk.

This change allows erlang-red compute a store flow path based on:

1. if flow_store application property has been configured, erlang-red
   will use that value. Otherwise:

2. get `user_data` [1] from filename:basedir/2 as a base folder for
   storing flows. e.g.: in my host (linux based) the store folder is
   /home/joaohf/.local/share/erlang-red/

1: https://www.erlang.org/doc/apps/stdlib/filename.html#basedir/3

pg is not part of erlang-red modules.
There are some enviroments whe erlang-red is running as a non-privileged
user. Thus, if erlang-red is installed on /usr/ path it will not have
the correct permissions when writing flows to disk.

This change allows erlang-red compute a store flow path based on:

1. if flow_store application property has been configured, erlang-red
   will use that value. Otherwise:

2. get `user_data` [1] from filename:basedir/2 as a base folder for
   storing flows. e.g.: in my host (linux based) the store folder is
   /home/joaohf/.local/share/erlang-red/

1: https://www.erlang.org/doc/apps/stdlib/filename.html#basedir/3
@joaohf

joaohf commented Dec 16, 2025

Copy link
Copy Markdown
Contributor Author

Hi @gorenje let me know what you think. I tried to describe my use case and a patch to accommodate that situation.

@gorenje

gorenje commented Dec 16, 2025

Copy link
Copy Markdown
Owner

Hi @joaohf

Looks good to me - I'll test locally and then merge here. Not sure about why the tests are failing hence I want to have a look on my local machine first.

Cheers!

@gorenje gorenje merged commit a9f8067 into gorenje:main Dec 16, 2025
0 of 4 checks passed
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