How to setup kopia/htmlui for development?

I just started to have a look at the htmlui. When I start it, it tried to access the api at http://localhost:3000/api/v1/

Is there somewhere documentation how to setup a dev environment?

What do you mean by “dev environment”? Do you want to setup a test server or do you really want to mess with the code?

My plan is to “mess with the code” … in case I’ve got some spare time… There are some things in the UI I’d like to give it a try if I could improve.

(One thing that’s in my mind: It’s so nice that I can mount a directory from any snapshot in the UI with a single click. But it happened to me now that I forgot which directory I did mount so I had to click around a bit before checking mount from the CLI. So I thought it would be nice to keep a list of mounted directories in the UI accessible. Maybe add a new tab that is only visible when there are mounts.)

But after starting react-scripts start the UI just shows “Request failed with status code 504” as it tries to access the API at localhost:3000/api. And of course there is nothing running. So I expect that some more setup is needed which might be part of a different project.

What worked for me was to fork Kopia on GH to my own account and then setting up Github on my target machine - in this case a Linux box, using the Github repo and rpms.

Then I checked out my fork of Kopia where I had performed my changes to test them out. Getting gh to work is essential, since it pulls-in a lot of dependencies.

In one terminal do:

$ cd kopia
$ go run . server start --insecure --without-password --disable-csrf-token-checks --log-level=debug

In another:

$ cd htmlui
$ npm run start

You can now access kopia UI on localhost:3000

1 Like

this worked well, nice - thanks! :slight_smile:

So now I did “mess” a little with the code: Added directory breadcrumb buttons to see path and navigate back

Would be nice to know if this goes in a direction that you’d approve.