package com.njzscloud.common.sshtunnel;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.List;

@Getter
@Setter
@ConfigurationProperties("ssh-tunnel")
public class SSHTunnelProperties {
    private boolean enable = false;

    private List<SSHProperties> tunnels;

    @Getter
    @Setter
    public static class SSHProperties {
        private boolean enable = true;

        /**
         * 服务器地址
         */
        private String host;
        /**
         * SSH 端口
         */
        private int port = 22;
        /**
         * 用户名
         */
        private String user;
        /**
         * 密码
         */
        private String pwd;
        /**
         * 秘钥文件
         */
        private String credentials;
        /**
         * 私钥密码
         */
        private String passphrase;
        private List<ProxyProperties> proxy;
    }

    @Getter
    @Setter
    public static class ProxyProperties {
        /**
         * 本地端口
         */
        private int localPort;
        /**
         * 目标主机
         */
        private String targetHost;
        /**
         * 目标端口
         */
        private int targetPort;
    }

}
