How to set up keys Not expired
I hope to have a key that never expires
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.
the ones activated with a setup-key without ephemeral peers enabled will not expire with the key.
don't understand what you mean
If I set 365 days, do I need to update the key after 365 days?
Because I don’t want to update the key
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.
修改数据库中的过期日期并延长时间?
What database are you using?
In which container is the database located?
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
solved @mlsmaycon
that's great