TG-353 Правки настроки плагина Bitwarden:

* Исправлен шаблон конфигурационного файла
* Исправлен скрипт настройки плагина
test
parent 312c418d4c
commit e64128e71e

@ -1,13 +1,69 @@
# Calculate pkg(www-plugins/chrome-bitwarden)!=&&ini(user_credentials.nextcloud_url)!=&&ini(user_credentials.nextcloud_login)!=&&ini(user_credentials.nextcloud_pw)!= run=/bin/bash
# Calculate pkg(www-plugins/chrome-bitwarden)!= run=/bin/bash
plugin_id="nngceckbapebfimnlniiiahkandclblb"
mkdir -p #-ur_home_path-#/.config/chromium/Default/Extensions/${plugin_id}
mkdir -p "#-ur_home_path-#/.config/chromium/Default/Local Extension Settings" &>/dev/null
cp -r /usr/share/chrome-bitwarden/* #-ur_home_path-#/.config/chromium/Default/Extensions/$plugin_id
/usr/share/chrome-bitwarden/configure.py #-ur_home_path-#/.config/chromium $plugin_id &>/dev/null <<EOF
/usr/share/chrome-bitwarden/configure.py #-ur_home_path-#/.config/chromium $plugin_id "#-ini(user_credentials.bitwarden_login)-#" "#-ini(user_credentials.bitwarden_pw)-#" <<EOF
{
"freedommarks_settings": "{\"bookmark_main_tab\":false,\"password\":\"#-ini(user_credentials.nextcloud_pw)-#\",\"search_main_tab\":true,\"server_url\":\"#-ini(user_credentials.nextcloud_url)-#\",\"username\":\"#-ini(user_credentials.nextcloud_login)-#\"}"
"userId": {
"data": {
"ciphers": {
"encrypted": {}
},
"collections": {
"encrypted": {}
},
"folders": {
"encrypted": {}
}
},
"keys": {
"cryptoSymmetricKey": {
"encrypted": {}
},
"organizationKeys": {
"encrypted": {}
},
"privateKey": {
"encrypted": {}
},
"providerKeys": {
"encrypted": {}
}
},
"profile": {
"userId": {}
},
"settings": {
"avatarColor": null,
"defaultUriMatch": 1,
"enableAutoFillOnPageLoad": true,
"environmentUrls": {
"api": null,
"base": {},
"events": null,
"icons": null,
"identity": null,
"keyConnector": null,
"notifications": null,
"webVault": null
},
"vaultTimeout": null,
"vaultTimeoutAction": "lock"
},
"tokens": {
"accessToken": {},
"refreshToken": {}
}
},
"userId_masterkey_auto": {},
"activeUserId": {},
"authenticatedAccounts": {},
"global": {
"stateVersion":7,
"theme":"system"
}
}
EOF

@ -47,7 +47,7 @@ def authorization(password,login):
Авторизация и получение данных
"""
global Key, PrivateKey, hashKey, access_token, refresh_token, userId
global url, Key, PrivateKey, hashKey, access_token, refresh_token, userId
url = "https://vw.calculate.ru"
pre_login_url = url + "/identity/accounts/prelogin"
@ -111,15 +111,18 @@ def update_json(data_list):
id = data_list[f'{userId}']
keys = id['keys']
profile = id['profile']
settings = id['settings']
environmentUrls = settings['environmentUrls']
tokens = id['tokens']
keys['cryptoSymmetricKey']['encrypted'] = Key
keys['privateKey']['encrypted'] = PrivateKey
profile['userId'] = userId
environmentUrls['base'] = url
tokens['accessToken'] = access_token
tokens['refreshToken'] = refresh_token
data_list[f'{userId_masterkey_auto}'] = hashKey
data_list['activeUserId'] = userId
data_list['authenticatedAccounts'] = [userId]
data_list[f'{userId_masterkey_auto}'] = hashKey
data_list[f'{userId}'] = json.dumps(id)
data_list[f'{userId_masterkey_auto}'] = json.dumps(data_list[f'{userId_masterkey_auto}'])
@ -143,7 +146,11 @@ authorization(password,login)
update_json(data_list)
db_path = path.join(chrome_dir,"Default/Local Extension Settings", ext_id)
db = plyvel.DB(db_path, create_if_missing=True)
try:
db = plyvel.DB(db_path, create_if_missing=True)
except IOError:
sys.stderr.write("Закройте браузер!")
sys.exit(1)
for k, v in data_list.items():
db.put(bytes(k,encoding='utf-8'), bytes(str(v),encoding='utf-8'))

Loading…
Cancel
Save