REST API
v1 REST API to manage Users and Configuration.
Hello @jamilbk ! I am curious, what is the idea for the API in terms of stack? Rust/Elixir as well? Looking forward to hearing back from you.
@iamleandro REST API will be in Elixir and live with the rest of our Phoenix app.
I am not familiar with Elixir (yet), but I liked the idea behind firezone. I am quite comfortable building REST APIs but I wouldn't know how to structure the files, which imports I would need and so on. Will sub on this one and use it as an opportunity to learn a new stack.
I'm assuming it will be living under /apps e.g. "fz-api" or something?
Anyways, in the meantime I can check on https://github.com/firezone/elixir-phoenix-realworld-example-app. :)
I'm hoping that allowing devices to be created with the rest api. would also allow importing existing devices public key, preshared key, and ip. I thought I could do it with postgres directly, but the preshared key field is encrypted. So for my org to migrate to firezone i'm blocked with waiting until an rest api supports it, or learning elixr.
I'd like to be able to import ip, presharedkey, and public key per user. I'm wanting to replace an algo wireguard setup without changing the configs on the client side machine.
@jbtule Definitely a hack, but try this:
/opt/firezone/embedded/service/firezone/bin/firezone rpc 'IO.inspect(FzHttp.Devices.create_device(%{user_id: "integer_user_id", name: "...", ...}))'
You can see more fields for creating a device here.
@jamilbk I used it to setup one user, it's looking good in the admin interface, so I'll continue with my migration and generate a shell script of all my users. Thanks!
@jamilbk That worked! Thank you for that hack! We replaced algo with firezone in place!
Unfortunately this didn't quite make it into 0.6.0. It'll be coming soon as part of 0.7.0.