小编Ami*_*mit的帖子

Visual Studio代码 - 使用SSH身份验证的SFTP扩展

我在Visual Studio Code工作流程中使用vscode-sftp扩展程序,每当我点击保存时,都会将文件上传到我的远程服务器.我正在尝试实现无密码身份验证,就像我以前使用Sublime Text的SFTP插件一样.但是,对于vscode-sftp,在sftp.json文件中,我必须输入我的密码作为纯文本才能使用:

{
    "host": "mysamplehost.com",
    "port": 22,
    "username": "username",
    "password": "password",
    "protocol": "sftp",
    "agent": null,
    "privateKeyPath": null,
    "passphrase": null,
    "passive": false,
    "interactiveAuth": false,
    "remotePath": "/",
    "uploadOnSave": true,
    ...
}
Run Code Online (Sandbox Code Playgroud)

但是,如果我通过SSH连接到我的服务器,我不会被要求输入密码 - 因为我的MacBook中有SSH密钥.如何配置vscode-sftp以使用此身份验证方法?

我在文档中看到以下注释,但是我不知道如何设置它:

  /**
   * string - Path to ssh-agent's UNIX socket for ssh-agent-based user authentication.
   * Windows users: set to 'pageant' for authenticating with Pageant or (actual) path to a cygwin "UNIX socket.
   */
  agent: null, 
  privateKeyPath: null, // …
Run Code Online (Sandbox Code Playgroud)

ssh visual-studio-code

10
推荐指数
3
解决办法
3万
查看次数

从Django注册表单中删除第二个密码输入

我正在使用django-registration v1.0进行注册。默认情况下,注册页面具有4个输入字段:

  • 用户名
  • 电子邮件
  • 密码1
  • 密码2

Django的登记文件证明该密码的重复录入用于捕捉错别字。但是我想删除第二个密码字段。

我该怎么做呢?

python django django-registration

2
推荐指数
1
解决办法
1098
查看次数

输入'NSNotification.Name?' 没有成员'firInstanceIDTokenRefresh'

我在使用Swift的iOS应用中使用Firebase通知,最近我将Firebase Messaging从1.2.3更新为2,我的代码开始向右和向右突破.我解决了大部分问题,但我坚持这个问题.

这是我的部分AppDelegate应用程序功能导致我的问题:

 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    UIApplication.shared.statusBarStyle = .lightContent
    ...

    FirebaseApp.configure()

    // [START add_token_refresh_observer]
    // Add observer for InstanceID token refresh callback.
    NotificationCenter.default.addObserver(self,
                                           selector: #selector(self.tokenRefreshNotification),
                                           name: .firInstanceIDTokenRefresh,
                                           object: nil)
    // [END add_token_refresh_observer]

    return true
}
Run Code Online (Sandbox Code Playgroud)

当我尝试运行我的应用程序时,出现以下错误:

输入'NSNotification.Name?' 没有成员'firInstanceIDTokenRefresh'

已将firInstanceIDTokenRefresh重命名为其他内容吗?

ios firebase swift firebase-cloud-messaging

1
推荐指数
1
解决办法
5562
查看次数