dashboard icon indicating copy to clipboard operation
dashboard copied to clipboard

How to set up keys Not expired

Open HKbool opened this issue 1 year ago • 9 comments

I hope to have a key that never expires

HKbool avatar May 22 '24 08:05 HKbool

QQ截图20240522165255

HKbool avatar May 22 '24 08:05 HKbool

Hello @HKbool, this is not supported by the API. However, you can generate a setup key for up to 365 days.

What would be your use case to don't have it expiring?

If you have concerns regarding peers, the ones activated with a setup-key without ephemeral peers enabled will not expire with the key.

mlsmaycon avatar May 22 '24 09:05 mlsmaycon

the ones activated with a setup-key without ephemeral peers enabled will not expire with the key.
don't understand what you mean

HKbool avatar May 22 '24 09:05 HKbool

If I set 365 days, do I need to update the key after 365 days?

Because I don’t want to update the key

HKbool avatar May 22 '24 09:05 HKbool

the ones activated with a setup-key without ephemeral peers enabled will not expire with the key. don't understand what you mean

It means that by default, if you add a peer with a setup-key, and the setup-key expires, this will not remove the added peer from NetBird.

If I set 365 days, do I need to update the key after 365 days?

Because I don’t want to update the key

You need to update the key only for new node activation. If you are using a self-hosted deployment, you can update the expiration date in the database. But there is no supporting docs for it.

mlsmaycon avatar May 22 '24 09:05 mlsmaycon

修改数据库中的过期日期并延长时间?

HKbool avatar May 22 '24 09:05 HKbool

What database are you using?

HKbool avatar May 22 '24 09:05 HKbool

QQ截图20240522174751 In which container is the database located?

HKbool avatar May 22 '24 09:05 HKbool

Since 0.26, the default database is sqlite, if you deployed prior that, you might need to migrate from json to sqlite.

To get the sqlite file, you can list all the docker volumes and then inspect the one with netbird_management suffix. This will give you the host path where the file resides. After that you can backup the file and use sqlite3 command to update the DB.

Commands example:

$ docker volume ls
...
local     tmp_netbird_management
local     tmp_netbird_zitadel_certs
...

$ docker volume inspect tmp_netbird_management
[
    {
        "CreatedAt": "2024-02-23T15:42:21+01:00",
        "Driver": "local",
        "Labels": {
            "com.docker.compose.project": "tmp",
            "com.docker.compose.version": "2.23.3",
            "com.docker.compose.volume": "netbird_management"
        },
        "Mountpoint": "/var/lib/docker/volumes/tmp_netbird_management/_data",
        "Name": "tmp_netbird_management",
        "Options": null,
        "Scope": "local"
    }
] 

$ cp /var/lib/docker/volumes/tmp_netbird_management/_data/store.db /opt/backup/

$ sqlite3 /var/lib/docker/volumes/tmp_netbird_management/_data/store.db

mlsmaycon avatar May 22 '24 10:05 mlsmaycon

solved @mlsmaycon

HKbool avatar May 24 '24 01:05 HKbool

that's great

mlsmaycon avatar May 24 '24 08:05 mlsmaycon