project-rainstorm / rainstorm

The easiest way to own your cloud. Your data. Your cloud. Rainstorm.
Other
10 stars 5 forks source link

[DISCUSSION] Rainstorm App Settings #102

Open nullcount opened 3 years ago

nullcount commented 3 years ago

The topic of this issue is:

How can we change and apply the variables in config.ym without running the setup again?

Background:

As of (11/2020), rainstorm is configured with setup.sh using variables defined in config.yml.

Much of what is configured with setup.sh is on the OS level (i.e. default user name, setting a drive to mount at boot, creating files and directories to store app data)

It was found useful to also read values from config.yml from the flask API.

Why?

If users could change the config.yml values and apply them to their node, this would allow some customization options and could be used to assist with the 1-click updates feature where an update requires a system level configuration.

An approach

My dumb and slow approach would be to associate a config.yml var with some commands in the yaml itself.

default:
    username: 
           value: drop
           get: 'grep something from  $users'
           update: 'userdel $value && useradd $newvalue '
           setup: 'useradd $default_user'

Then an API method would target the YAML value and run system commands to perform certain actions.

A better way?

This approach reminds me of Ansible. Is this something ansible can do better? Do we know of any frameworks or approaches to this kind of problem?

Happy to provide clarification,