[ server] [ func.xray ] - 增加Config JSON 的Bean文件
This commit is contained in:
14
server/src/main/java/io/wdd/func/xray/beans/Account.java
Normal file
14
server/src/main/java/io/wdd/func/xray/beans/Account.java
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
package io.wdd.func.xray.beans;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.sql.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class Account extends User {
|
||||||
|
|
||||||
|
private String aid;
|
||||||
|
private Date activationDate;
|
||||||
|
private Date expireDate;
|
||||||
|
|
||||||
|
}
|
||||||
11
server/src/main/java/io/wdd/func/xray/beans/Client.java
Normal file
11
server/src/main/java/io/wdd/func/xray/beans/Client.java
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
package io.wdd.func.xray.beans;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class Client {
|
||||||
|
|
||||||
|
private String id;
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
}
|
||||||
13
server/src/main/java/io/wdd/func/xray/beans/Order.java
Normal file
13
server/src/main/java/io/wdd/func/xray/beans/Order.java
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
package io.wdd.func.xray.beans;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class Order extends User{
|
||||||
|
|
||||||
|
private String oid;
|
||||||
|
private Integer days;
|
||||||
|
private Boolean isActivated;
|
||||||
|
|
||||||
|
}
|
||||||
14
server/src/main/java/io/wdd/func/xray/beans/User.java
Normal file
14
server/src/main/java/io/wdd/func/xray/beans/User.java
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
package io.wdd.func.xray.beans;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class User {
|
||||||
|
|
||||||
|
private Integer uid;
|
||||||
|
private String username;
|
||||||
|
private String email;
|
||||||
|
private String password;
|
||||||
|
private Boolean isAdmin;
|
||||||
|
|
||||||
|
}
|
||||||
23
server/src/main/java/io/wdd/func/xray/beans/XrayConfig.java
Normal file
23
server/src/main/java/io/wdd/func/xray/beans/XrayConfig.java
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
package io.wdd.func.xray.beans;
|
||||||
|
|
||||||
|
|
||||||
|
import io.wdd.func.xray.beans.xray.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* https://github.com/LarryZeta/xray-manager/blob/master/src/main/java/cc/larryzeta/manager/entity/XrayConfig.java
|
||||||
|
*/
|
||||||
|
public class XrayConfig {
|
||||||
|
|
||||||
|
private LogObject log;
|
||||||
|
private ApiObject api;
|
||||||
|
private DnsObject dns;
|
||||||
|
private PolicyObject policy;
|
||||||
|
private List<InboundObject> inbounds;
|
||||||
|
private List<OutboundObject> outbounds;
|
||||||
|
private TransportObject transport;
|
||||||
|
private RoutingObject routing;
|
||||||
|
private ReverseObject reverse;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package io.wdd.func.xray.beans.xray;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ApiObject {
|
||||||
|
|
||||||
|
private String tag;
|
||||||
|
private List<String> services;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package io.wdd.func.xray.beans.xray;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DnsObject {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* string, ip address
|
||||||
|
*/
|
||||||
|
private Map<String, String> hosts;
|
||||||
|
|
||||||
|
private List<Object> servers;
|
||||||
|
|
||||||
|
private String clientIp;
|
||||||
|
|
||||||
|
private String tag;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
class ServerObject {
|
||||||
|
|
||||||
|
private String address;
|
||||||
|
private Integer port;
|
||||||
|
private List<String> domains;
|
||||||
|
private List<String> expectIPs;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package io.wdd.func.xray.beans.xray;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||||
|
import io.wdd.func.xray.beans.xray.protocol.inbound.vless.VLESS;
|
||||||
|
import io.wdd.func.xray.beans.xray.protocol.inbound.vmess.VMESS;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "protocol")
|
||||||
|
@JsonSubTypes(value = {
|
||||||
|
@JsonSubTypes.Type(value = VLESS.class, name = "vless"),
|
||||||
|
@JsonSubTypes.Type(value = VMESS.class, name = "vmess"),
|
||||||
|
})
|
||||||
|
public abstract class InboundObject {
|
||||||
|
|
||||||
|
private String listen;
|
||||||
|
private Integer port;
|
||||||
|
private String protocol;
|
||||||
|
private StreamSettingsObject streamSettings;
|
||||||
|
private String tag;
|
||||||
|
private SniffingObject sniffing;
|
||||||
|
private AllocateObject allocate;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
class SniffingObject {
|
||||||
|
|
||||||
|
private Boolean enabled;
|
||||||
|
private String destOverride;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
class AllocateObject {
|
||||||
|
|
||||||
|
private String strategy;
|
||||||
|
private Integer refresh;
|
||||||
|
private Integer concurrency;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package io.wdd.func.xray.beans.xray;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class LogObject {
|
||||||
|
|
||||||
|
private String access;
|
||||||
|
private String error;
|
||||||
|
private String loglevel;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package io.wdd.func.xray.beans.xray;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class OutboundObject {
|
||||||
|
|
||||||
|
private String sendThrough;
|
||||||
|
private String protocol;
|
||||||
|
private Object settings;
|
||||||
|
private String tag;
|
||||||
|
private StreamSettingsObject streamSettings;
|
||||||
|
private ProxySettingsObject proxySettings;
|
||||||
|
private MuxObject mux;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
class ProxySettingsObject {
|
||||||
|
private String tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
class MuxObject {
|
||||||
|
|
||||||
|
private Boolean enabled;
|
||||||
|
private Integer concurrency;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package io.wdd.func.xray.beans.xray;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class PolicyObject {
|
||||||
|
|
||||||
|
private Map<String, LevelPolicyObject> level;
|
||||||
|
private SystemPolicyObject system;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
class LevelPolicyObject {
|
||||||
|
|
||||||
|
private Integer handshake;
|
||||||
|
private Integer connIdle;
|
||||||
|
private Integer uplinkOnly;
|
||||||
|
private Integer downlinkOnly;
|
||||||
|
private Boolean statsUserUplink;
|
||||||
|
private Boolean statsUserDownlink;
|
||||||
|
private Integer bufferSize;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
class SystemPolicyObject {
|
||||||
|
|
||||||
|
private Boolean statsInboundUplink;
|
||||||
|
private Boolean statsInboundDownlink;
|
||||||
|
private Boolean statsOutboundUplink;
|
||||||
|
private Boolean statsOutboundDownlink;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
package io.wdd.func.xray.beans.xray;
|
||||||
|
|
||||||
|
public class ReverseObject {
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package io.wdd.func.xray.beans.xray;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class RoutingObject {
|
||||||
|
|
||||||
|
private String domainStrategy;
|
||||||
|
private List<RuleObject> rules;
|
||||||
|
private List<BalancerObject> balancerObjects;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
class RuleObject {
|
||||||
|
|
||||||
|
private String type;
|
||||||
|
private List<String> domain;
|
||||||
|
private List<String> ip;
|
||||||
|
private String port;
|
||||||
|
private String sourcePort;
|
||||||
|
private String network;
|
||||||
|
private List<String> source;
|
||||||
|
private List<String> user;
|
||||||
|
private List<String> inboundTag;
|
||||||
|
private String protocol;
|
||||||
|
private String attrs;
|
||||||
|
private String outboundTag;
|
||||||
|
private String balancerTag;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
class BalancerObject {
|
||||||
|
|
||||||
|
private String tag;
|
||||||
|
private List<String> selector;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
package io.wdd.func.xray.beans.xray;
|
||||||
|
|
||||||
|
public class StatsObject {
|
||||||
|
}
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
package io.wdd.func.xray.beans.xray;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class StreamSettingsObject extends TransportObject{
|
||||||
|
|
||||||
|
private String network;
|
||||||
|
private String security;
|
||||||
|
private TLSObject tlsSettings;
|
||||||
|
private XTLSObject xtlsSettings;
|
||||||
|
private SockoptObject sockopt;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
class TLSObject {
|
||||||
|
private String serverName;
|
||||||
|
private List<String> alpn;
|
||||||
|
private String minVersion;
|
||||||
|
private String maxVersion;
|
||||||
|
private Boolean preferServerCipherSuites;
|
||||||
|
private String cipherSuites;
|
||||||
|
private Boolean allowInsecure;
|
||||||
|
private Boolean disableSystemRoot;
|
||||||
|
private Boolean enableSessionResumption;
|
||||||
|
private List<CertificateObject> certificates;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
class XTLSObject extends TLSObject{
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
class CertificateObject {
|
||||||
|
|
||||||
|
private Integer ocspStapling;
|
||||||
|
private String usage;
|
||||||
|
private String certificateFile;
|
||||||
|
private List<String> certificate;
|
||||||
|
private String keyFile;
|
||||||
|
private List<String> key;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
class SockoptObject {
|
||||||
|
|
||||||
|
private Integer mark;
|
||||||
|
private Boolean tcpFastOpen;
|
||||||
|
private String tproxy;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package io.wdd.func.xray.beans.xray;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class TransportObject {
|
||||||
|
|
||||||
|
private TcpObject tcpSettings;
|
||||||
|
private KcpObject kcpSettings;
|
||||||
|
private WebSocketObject wsSettings;
|
||||||
|
private HttpObject httpSettings;
|
||||||
|
private QuicObject quicSettings;
|
||||||
|
private DomainSocketObject dsSettings;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class TcpObject {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class KcpObject {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
class WebSocketObject {
|
||||||
|
|
||||||
|
private Boolean acceptProxyProtocol;
|
||||||
|
private String path;
|
||||||
|
private Map<String, String> headers;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class HttpObject {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class QuicObject {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class DomainSocketObject {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
package io.wdd.func.xray.beans.xray.protocol.inbound;
|
||||||
|
|
||||||
|
import cc.larryzeta.manager.entity.xray.InboundObject;
|
||||||
|
|
||||||
|
public class DokodemoDoor extends InboundObject {
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package io.wdd.func.xray.beans.xray.protocol.inbound.vless;
|
||||||
|
|
||||||
|
import cc.larryzeta.manager.entity.Client;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ClientObject extends Client {
|
||||||
|
|
||||||
|
private Integer level;
|
||||||
|
private String flow;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package io.wdd.func.xray.beans.xray.protocol.inbound.vless;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class FallbackObject {
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
private String alpn;
|
||||||
|
private String path;
|
||||||
|
private Object dest;
|
||||||
|
private Integer xver;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package io.wdd.func.xray.beans.xray.protocol.inbound.vless;
|
||||||
|
|
||||||
|
import cc.larryzeta.manager.entity.xray.InboundObject;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class VLESS extends InboundObject {
|
||||||
|
private VlessConfig settings;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package io.wdd.func.xray.beans.xray.protocol.inbound.vless;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class VlessConfig {
|
||||||
|
|
||||||
|
private List<ClientObject> clients;
|
||||||
|
private String decryption;
|
||||||
|
private List<FallbackObject> fallbacks;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package io.wdd.func.xray.beans.xray.protocol.inbound.vmess;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ClientObject extends Client {
|
||||||
|
|
||||||
|
private Integer level;
|
||||||
|
private Integer alterId;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package io.wdd.func.xray.beans.xray.protocol.inbound.vmess;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DefaultObject {
|
||||||
|
private Integer level;
|
||||||
|
private Integer alterId;
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package io.wdd.func.xray.beans.xray.protocol.inbound.vmess;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DetourObject {
|
||||||
|
private String to;
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package io.wdd.func.xray.beans.xray.protocol.inbound.vmess;
|
||||||
|
|
||||||
|
import io.wdd.func.xray.beans.xray.InboundObject;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class VMESS extends InboundObject {
|
||||||
|
private VmessConfig settings;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package io.wdd.func.xray.beans.xray.protocol.inbound.vmess;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class VmessConfig {
|
||||||
|
|
||||||
|
private List<ClientObject> clients;
|
||||||
|
private DetourObject detour;
|
||||||
|
@JsonProperty("default")
|
||||||
|
private DefaultObject _default;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package io.wdd.func.xray.beans.xray.protocol.outbound;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class Blackhole extends OutboundConfigurationObject{
|
||||||
|
|
||||||
|
private ResponseObject response;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
class ResponseObject {
|
||||||
|
private String type;
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package io.wdd.func.xray.beans.xray.protocol.outbound;
|
||||||
|
|
||||||
|
|
||||||
|
public class DNS extends OutboundConfigurationObject{
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package io.wdd.func.xray.beans.xray.protocol.outbound;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class Freedom extends OutboundConfigurationObject{
|
||||||
|
|
||||||
|
private String domainStrategy;
|
||||||
|
private String redirect;
|
||||||
|
private Integer userLevel;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
package io.wdd.func.xray.beans.xray.protocol.outbound;
|
||||||
|
|
||||||
|
public abstract class OutboundConfigurationObject {
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package io.wdd.func.xray.beans.xray.protocol.outbound;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class VLESS extends OutboundConfigurationObject {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package io.wdd.func.xray.beans.xray.protocol.outbound;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class VMESS extends OutboundConfigurationObject {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user