TheThingsNetwork / lorawan-stack-migrate

Migrate devices from other LoRaWAN Network Servers to The Things Stack
Apache License 2.0
8 stars 3 forks source link

Add `use` command to setup configuration for the user #74

Open happyRip opened 1 year ago

happyRip commented 1 year ago

Summary

Add use command https://github.com/TheThingsNetwork/lorawan-stack-migrate/issues/56#issuecomment-1328938591

Why do we need this?

To simplify the migration tool setup process for the user, as some of the users have problems with setting up the environment.

What is already there? What do you see now?

We use env variables and flags to setup the environment.

What is missing? What do you want to see?

A simple to use command to setup everything for the user.

Environment

n/a

How do you propose to implement this?

Implement a use command similarly to the lw-stack's use command. The user could provide a URL to a device or app he'd like to export (or a server if he wants to export multiple devices/apps) and the environment would be set automatically. I'm not sure if it would be easy for other sources, but should be doable for TTS.

How do you propose to test this?

Use the command to setup the migration tool for some deployments and export devices.

Can you do this yourself and submit a Pull Request?

Yes.

cc @adriansmares @johanstokking

adriansmares commented 1 year ago

In ttn-lw-cli we have a configuration file .ttn-lw-cli.yml which is created/edited by the use command. The file itself is processed using viper.

Since we already use pflag, I think tying everything together with viper shouldn't be too bad, but this needs some digging.