remote.cfg: rename userid to 'auth-id'
and fixup config file on upgrades accordingly Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
parent
b57619ea29
commit
10052ea644
9
debian/postinst
vendored
9
debian/postinst
vendored
@ -28,6 +28,15 @@ case "$1" in
|
|||||||
if dpkg --compare-versions "$2" 'le' '0.9.5-1'; then
|
if dpkg --compare-versions "$2" 'le' '0.9.5-1'; then
|
||||||
chown --quiet backup:backup /var/log/proxmox-backup/api/auth.log || true
|
chown --quiet backup:backup /var/log/proxmox-backup/api/auth.log || true
|
||||||
fi
|
fi
|
||||||
|
if dpkg --compare-versions "$2" 'le' '0.9.6-1'; then
|
||||||
|
if [ -e /etc/proxmox-backup/remote.cfg ]; then
|
||||||
|
echo "NOTE: Switching over remote.cfg to new field names.."
|
||||||
|
flock -w 30 /etc/proxmox-backup/.remote.lck \
|
||||||
|
sed -i \
|
||||||
|
-e 's/^\s\+userid /\tauth-id /g' \
|
||||||
|
/etc/proxmox-backup/remote.cfg || true
|
||||||
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
# FIXME: Remove in future version once we're sure no broken entries remain in anyone's files
|
# FIXME: Remove in future version once we're sure no broken entries remain in anyone's files
|
||||||
if grep -q -e ':termproxy::[^@]\+: ' /var/log/proxmox-backup/tasks/active; then
|
if grep -q -e ':termproxy::[^@]\+: ' /var/log/proxmox-backup/tasks/active; then
|
||||||
|
@ -78,7 +78,7 @@ pub fn list_remotes(
|
|||||||
optional: true,
|
optional: true,
|
||||||
default: 8007,
|
default: 8007,
|
||||||
},
|
},
|
||||||
userid: {
|
"auth-id": {
|
||||||
type: Authid,
|
type: Authid,
|
||||||
},
|
},
|
||||||
password: {
|
password: {
|
||||||
@ -178,7 +178,7 @@ pub enum DeletableProperty {
|
|||||||
type: u16,
|
type: u16,
|
||||||
optional: true,
|
optional: true,
|
||||||
},
|
},
|
||||||
userid: {
|
"auth-id": {
|
||||||
optional: true,
|
optional: true,
|
||||||
type: Authid,
|
type: Authid,
|
||||||
},
|
},
|
||||||
@ -214,7 +214,7 @@ pub fn update_remote(
|
|||||||
comment: Option<String>,
|
comment: Option<String>,
|
||||||
host: Option<String>,
|
host: Option<String>,
|
||||||
port: Option<u16>,
|
port: Option<u16>,
|
||||||
userid: Option<Authid>,
|
auth_id: Option<Authid>,
|
||||||
password: Option<String>,
|
password: Option<String>,
|
||||||
fingerprint: Option<String>,
|
fingerprint: Option<String>,
|
||||||
delete: Option<Vec<DeletableProperty>>,
|
delete: Option<Vec<DeletableProperty>>,
|
||||||
@ -252,7 +252,7 @@ pub fn update_remote(
|
|||||||
}
|
}
|
||||||
if let Some(host) = host { data.host = host; }
|
if let Some(host) = host { data.host = host; }
|
||||||
if port.is_some() { data.port = port; }
|
if port.is_some() { data.port = port; }
|
||||||
if let Some(userid) = userid { data.userid = userid; }
|
if let Some(auth_id) = auth_id { data.auth_id = auth_id; }
|
||||||
if let Some(password) = password { data.password = password; }
|
if let Some(password) = password { data.password = password; }
|
||||||
|
|
||||||
if let Some(fingerprint) = fingerprint { data.fingerprint = Some(fingerprint); }
|
if let Some(fingerprint) = fingerprint { data.fingerprint = Some(fingerprint); }
|
||||||
@ -323,7 +323,7 @@ pub async fn remote_client(remote: remote::Remote) -> Result<HttpClient, Error>
|
|||||||
let client = HttpClient::new(
|
let client = HttpClient::new(
|
||||||
&remote.host,
|
&remote.host,
|
||||||
remote.port.unwrap_or(8007),
|
remote.port.unwrap_or(8007),
|
||||||
&remote.userid,
|
&remote.auth_id,
|
||||||
options)?;
|
options)?;
|
||||||
let _auth_info = client.login() // make sure we can auth
|
let _auth_info = client.login() // make sure we can auth
|
||||||
.await
|
.await
|
||||||
|
@ -50,7 +50,7 @@ pub async fn get_pull_parameters(
|
|||||||
let (remote_config, _digest) = remote::config()?;
|
let (remote_config, _digest) = remote::config()?;
|
||||||
let remote: remote::Remote = remote_config.lookup("remote", remote)?;
|
let remote: remote::Remote = remote_config.lookup("remote", remote)?;
|
||||||
|
|
||||||
let src_repo = BackupRepository::new(Some(remote.userid.clone()), Some(remote.host.clone()), remote.port, remote_store.to_string());
|
let src_repo = BackupRepository::new(Some(remote.auth_id.clone()), Some(remote.host.clone()), remote.port, remote_store.to_string());
|
||||||
|
|
||||||
let client = crate::api2::config::remote::remote_client(remote).await?;
|
let client = crate::api2::config::remote::remote_client(remote).await?;
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ pub const REMOTE_PASSWORD_SCHEMA: Schema = StringSchema::new("Password or auth t
|
|||||||
description: "The (optional) port",
|
description: "The (optional) port",
|
||||||
type: u16,
|
type: u16,
|
||||||
},
|
},
|
||||||
userid: {
|
"auth-id": {
|
||||||
type: Authid,
|
type: Authid,
|
||||||
},
|
},
|
||||||
password: {
|
password: {
|
||||||
@ -57,6 +57,7 @@ pub const REMOTE_PASSWORD_SCHEMA: Schema = StringSchema::new("Password or auth t
|
|||||||
}
|
}
|
||||||
)]
|
)]
|
||||||
#[derive(Serialize,Deserialize)]
|
#[derive(Serialize,Deserialize)]
|
||||||
|
#[serde(rename_all = "kebab-case")]
|
||||||
/// Remote properties.
|
/// Remote properties.
|
||||||
pub struct Remote {
|
pub struct Remote {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
@ -65,7 +66,7 @@ pub struct Remote {
|
|||||||
pub host: String,
|
pub host: String,
|
||||||
#[serde(skip_serializing_if="Option::is_none")]
|
#[serde(skip_serializing_if="Option::is_none")]
|
||||||
pub port: Option<u16>,
|
pub port: Option<u16>,
|
||||||
pub userid: Authid,
|
pub auth_id: Authid,
|
||||||
#[serde(skip_serializing_if="String::is_empty")]
|
#[serde(skip_serializing_if="String::is_empty")]
|
||||||
#[serde(with = "proxmox::tools::serde::string_as_base64")]
|
#[serde(with = "proxmox::tools::serde::string_as_base64")]
|
||||||
pub password: String,
|
pub password: String,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
Ext.define('pmx-remotes', {
|
Ext.define('pmx-remotes', {
|
||||||
extend: 'Ext.data.Model',
|
extend: 'Ext.data.Model',
|
||||||
fields: ['name', 'host', 'port', 'userid', 'fingerprint', 'comment',
|
fields: ['name', 'host', 'port', 'auth-id', 'fingerprint', 'comment',
|
||||||
{
|
{
|
||||||
name: 'server',
|
name: 'server',
|
||||||
calculate: function(data) {
|
calculate: function(data) {
|
||||||
@ -129,11 +129,11 @@ Ext.define('PBS.config.RemoteView', {
|
|||||||
dataIndex: 'server',
|
dataIndex: 'server',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
header: gettext('User name'),
|
header: gettext('Auth ID'),
|
||||||
width: 200,
|
width: 200,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
renderer: Ext.String.htmlEncode,
|
renderer: Ext.String.htmlEncode,
|
||||||
dataIndex: 'userid',
|
dataIndex: 'auth-id',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
header: gettext('Fingerprint'),
|
header: gettext('Fingerprint'),
|
||||||
|
@ -29,9 +29,9 @@ Ext.define('PBS.form.RemoteSelector', {
|
|||||||
flex: 1,
|
flex: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
header: gettext('User name'),
|
header: gettext('Auth ID'),
|
||||||
sortable: true,
|
sortable: true,
|
||||||
dataIndex: 'userid',
|
dataIndex: 'auth-id',
|
||||||
renderer: Ext.String.htmlEncode,
|
renderer: Ext.String.htmlEncode,
|
||||||
flex: 1,
|
flex: 1,
|
||||||
},
|
},
|
||||||
|
@ -5,8 +5,6 @@ Ext.define('PBS.window.RemoteEdit', {
|
|||||||
|
|
||||||
onlineHelp: 'backup_remote',
|
onlineHelp: 'backup_remote',
|
||||||
|
|
||||||
userid: undefined,
|
|
||||||
|
|
||||||
isAdd: true,
|
isAdd: true,
|
||||||
|
|
||||||
subject: gettext('Remote'),
|
subject: gettext('Remote'),
|
||||||
@ -93,8 +91,8 @@ Ext.define('PBS.window.RemoteEdit', {
|
|||||||
{
|
{
|
||||||
xtype: 'proxmoxtextfield',
|
xtype: 'proxmoxtextfield',
|
||||||
allowBlank: false,
|
allowBlank: false,
|
||||||
name: 'userid',
|
name: 'auth-id',
|
||||||
fieldLabel: gettext('Userid'),
|
fieldLabel: gettext('Auth ID'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
xtype: 'textfield',
|
xtype: 'textfield',
|
||||||
|
Loading…
Reference in New Issue
Block a user