mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-02-21 10:01:46 +00:00
set psql application_name in startup script
This commit is contained in:
parent
a2ffe8c05e
commit
dc61f78916
@ -150,7 +150,7 @@ PostgreSQL::PostgreSQL(const Identity &myId, const char *path, int listenPort, R
|
|||||||
{
|
{
|
||||||
char myAddress[64];
|
char myAddress[64];
|
||||||
_myAddressStr = myId.address().toString(myAddress);
|
_myAddressStr = myId.address().toString(myAddress);
|
||||||
_connString = std::string(path) + " application_name=controller_" + _myAddressStr;
|
_connString = std::string(path);
|
||||||
auto f = std::make_shared<PostgresConnFactory>(_connString);
|
auto f = std::make_shared<PostgresConnFactory>(_connString);
|
||||||
_pool = std::make_shared<ConnectionPool<PostgresConnection> >(
|
_pool = std::make_shared<ConnectionPool<PostgresConnection> >(
|
||||||
15, 5, std::static_pointer_cast<ConnectionFactory>(f));
|
15, 5, std::static_pointer_cast<ConnectionFactory>(f));
|
||||||
|
@ -62,9 +62,11 @@ popd
|
|||||||
|
|
||||||
DEFAULT_PORT=9993
|
DEFAULT_PORT=9993
|
||||||
|
|
||||||
|
APP_NAME="controller-$(cat /var/lib/zerotier-one/identity.public | cut -d ':' -f 1)"
|
||||||
|
|
||||||
echo "{
|
echo "{
|
||||||
\"settings\": {
|
\"settings\": {
|
||||||
\"controllerDbPath\": \"postgres:host=${ZT_DB_HOST} port=${ZT_DB_PORT} dbname=${ZT_DB_NAME} user=${ZT_DB_USER} password=${ZT_DB_PASSWORD} sslmode=prefer sslcert=${DB_CLIENT_CERT} sslkey=${DB_CLIENT_KEY} sslrootcert=${DB_SERVER_CA}\",
|
\"controllerDbPath\": \"postgres:host=${ZT_DB_HOST} port=${ZT_DB_PORT} dbname=${ZT_DB_NAME} user=${ZT_DB_USER} password=${ZT_DB_PASSWORD} application_name=${APP_NAME} sslmode=prefer sslcert=${DB_CLIENT_CERT} sslkey=${DB_CLIENT_KEY} sslrootcert=${DB_SERVER_CA}\",
|
||||||
\"portMappingEnabled\": true,
|
\"portMappingEnabled\": true,
|
||||||
\"softwareUpdate\": \"disable\",
|
\"softwareUpdate\": \"disable\",
|
||||||
\"interfacePrefixBlacklist\": [
|
\"interfacePrefixBlacklist\": [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user