小编Has*_*sha的帖子

cURL 错误 60:SSL 证书问题:证书已过期

我们在 amazon ec2 ( backend.abc.com & frontend.abc.com )上运行 2 个应用程序。对于该应用程序,我们使用了付费 SSL 证书。该证书到期日为2021 年 6 月。但是今天,我们遇到了一个错误——

cURL error 60: SSL certificate problem: certificate has expired (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
Run Code Online (Sandbox Code Playgroud)

我们检查了证书有效期,但没有问题(2021 年 6 月)。然后我们按照这个线程 - curl:(60)SSL证书问题:无法获得本地颁发者证书(@Dahomz答案)

之后,当我们通过 - 卷曲 abc.com 时curl -v --url https://backend.abc.com --cacert /etc/ssl/ssl.cert/cacert.pem,它工作正常。像这样的回应——

* Rebuilt URL to: https://backend.abc.com/
*   Trying 127.0.0.1...
* Connected to backend.abc.com (127.0.0.1) port 443 (#0)
* found 139 certificates in /etc/ssl/ssl.cert/cacert.pem
* found 600 certificates in /etc/ssl/certs
* ALPN, offering …
Run Code Online (Sandbox Code Playgroud)

ssl curl

36
推荐指数
4
解决办法
4万
查看次数

Mysql查询根据两个逻辑过滤掉数据

这是一个示例表:

  sample_id  |      timestamp       | p_id
============================================
    62054    |  2018-09-25 10:18:15 |  2652
    62054    |  2018-09-27 16:44:57 |  966
    62046    |  null                |  1809
    62046    |  2018-09-25 10:18:15 |  2097
Run Code Online (Sandbox Code Playgroud)

我们需要过滤掉唯一的sample_id列,但逻辑是

  1. 如果timestamp列为null,则返回那些空列数据

        62046 | null | 1809
    
    Run Code Online (Sandbox Code Playgroud)
  2. 如果timestamp列不为null,则返回最新的时间戳列数据

     62054 | 2018-09-27 16:44:57 | 966
    
    Run Code Online (Sandbox Code Playgroud)

所以如果有人提供sql查询,那就太好了.

我们需要这样的事情,

WHERE
IF(
    NOT NULL = all row group by sample_id,
    row where cancelled_at is maximum,
    null column
)
Run Code Online (Sandbox Code Playgroud)

mysql sql

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

通过电子邮件或手机在 Laravel 中重置密码

默认情况下,Laravel 5.5 的密码重置系统适用于电子邮件,但我需要添加对手机号码的支持(通过 OTP 验证并生成令牌并重定向到密码重置页面)。我正在做这一切,我在 password_resets 表上创建了一个移动列。

但问题是\Illuminate\Auth\Passwords\DatabaseTokenRepository&& \Illuminate\Auth\Passwords\TokenRepositoryInterfaceONexist方法,它似乎不可配置。

public function exists(CanResetPasswordContract $user, $token)
{
    $record = (array) $this->getTable()->where(
        'email', $user->getEmailForPasswordReset()
    )->first();

    return $record &&
           ! $this->tokenExpired($record['created_at']) &&
             $this->hasher->check($token, $record['token']);
}
Run Code Online (Sandbox Code Playgroud)

我需要覆盖该方法。继承的东西太多了。我需要扩展哪些类以及如何覆盖该方法。

php laravel laravel-authentication

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

获取所有秘密并将其放入 Jenkins 和 hashcorpVault 上的 env 文件中

目前我们正在构建詹金斯部署管道。在这些构建中,我们使用 HachiCorp 金库进行秘密管理。为了获取秘密,我们使用hashcorp-vault-plugin。问题是我们想要声明管道脚本上的所有变量,就像这样-testing'、'testing_again'、secret/another_test(我们不希望这样)

node {
    // define the secrets and the env variables
    // engine version can be defined on secret, job, folder or global.
    // the default is engine version 2 unless otherwise specified globally.
    def secrets = [
        [path: 'secret/testing', engineVersion: 1, secretValues: [
            [envVar: 'testing', vaultKey: 'value_one'],
            [envVar: 'testing_again', vaultKey: 'value_two']]],
        [path: 'secret/another_test', engineVersion: 2, secretValues: [
            [vaultKey: 'another_test']]]
    ]

    // optional configuration, if you do not provide this the next higher configuration …
Run Code Online (Sandbox Code Playgroud)

jenkins jenkins-plugins hashicorp-vault

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

bootstrap selectpicker:使选择下拉菜单成为必需

我正在使用引导选择器,我想设置一个下拉菜单。使引导选择器选择所需的正确方法是什么?(我不想使用任何其他 jquery 插件)。

{!! Form::select('from', [], null, ['class' => 'selectpicker form-control', 'data-live-search' => '1', 'data-size' => '6', 'title' => 'Select a partner',]) !!}
Run Code Online (Sandbox Code Playgroud)

我正在将 selectpicker 用于 laravel 形式的集合中。

bootstrap-select laravel-form

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

VeeValidate(vue.js)图像文件大小和尺寸验证

如何在vue.js中使用vee validate以这种形式设置验证

  • 图像尺寸小于500 * 500像素

  • 图片大小小于100kb

vue.js vuejs2 vee-validate

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