github.com/mholt/caddy-l4@v0.0.0-20241104153248-ec8fae209322/integration/caddyfile_adapt/gd_matcher_openvpn.caddytest (about)

     1  {
     2  	layer4 {
     3  		:8843 {
     4  			@plain openvpn {
     5  				modes plain
     6  			}
     7  			route @plain {
     8  				proxy localhost:1194
     9  			}
    10  			@auth openvpn {
    11  				modes auth
    12  				auth_digest sha256
    13  				group_key_direction normal
    14  				group_key_file /etc/openvpn/ta.key
    15  			}
    16  			route @auth {
    17  				proxy localhost:1195
    18  			}
    19  			@crypt openvpn {
    20  				modes crypt
    21  				group_key 21d94830510107f8753d3b6f3145e01ded37075115afcb0538ecdd8503ee96637218c9ed38d908d594231d7d143c73da5055310f89d336da99c8b3dcb18909c79dd44f540670ebc0f120beb7211e96839cb542572c48bfa7ffaa9a22cb8304b7869b92f4442918e598745bb78ac8877f02b00a7cdef3f2446c130d39a7c451269ef399fd6029cdfc80a7c604041312ab0a969bc906bdee6e6d707afdcbe8c7fb97beb66049c3d328340775025433ceba1e38008a826cf92443d903106199373bdadd9c2c735cf481e580db4e81b99f12e3f46b6159c687cd1b9e689f7712573c0f02735a45573dfb5cd55cf4649423892c7e91f439bdd7337a8ceebd302cfbfa
    22  			}
    23  			route @crypt {
    24  				proxy localhost:1196
    25  			}
    26  			@crypt2 openvpn {
    27  				modes crypt2
    28  				server_key_file /etc/openvpn/v2-server.key
    29  			}
    30  			route @crypt2 {
    31  				proxy localhost:1197
    32  			}
    33  			route {
    34  				tls
    35  				proxy localhost:8080
    36  			}
    37  		}
    38  	}
    39  }
    40  ----------
    41  {
    42  	"apps": {
    43  		"layer4": {
    44  			"servers": {
    45  				"srv0": {
    46  					"listen": [
    47  						":8843"
    48  					],
    49  					"routes": [
    50  						{
    51  							"match": [
    52  								{
    53  									"openvpn": {
    54  										"modes": [
    55  											"plain"
    56  										]
    57  									}
    58  								}
    59  							],
    60  							"handle": [
    61  								{
    62  									"handler": "proxy",
    63  									"upstreams": [
    64  										{
    65  											"dial": [
    66  												"localhost:1194"
    67  											]
    68  										}
    69  									]
    70  								}
    71  							]
    72  						},
    73  						{
    74  							"match": [
    75  								{
    76  									"openvpn": {
    77  										"modes": [
    78  											"auth"
    79  										],
    80  										"group_key_file": "/etc/openvpn/ta.key",
    81  										"auth_digest": "sha256",
    82  										"group_key_direction": "normal"
    83  									}
    84  								}
    85  							],
    86  							"handle": [
    87  								{
    88  									"handler": "proxy",
    89  									"upstreams": [
    90  										{
    91  											"dial": [
    92  												"localhost:1195"
    93  											]
    94  										}
    95  									]
    96  								}
    97  							]
    98  						},
    99  						{
   100  							"match": [
   101  								{
   102  									"openvpn": {
   103  										"modes": [
   104  											"crypt"
   105  										],
   106  										"group_key": "21d94830510107f8753d3b6f3145e01ded37075115afcb0538ecdd8503ee96637218c9ed38d908d594231d7d143c73da5055310f89d336da99c8b3dcb18909c79dd44f540670ebc0f120beb7211e96839cb542572c48bfa7ffaa9a22cb8304b7869b92f4442918e598745bb78ac8877f02b00a7cdef3f2446c130d39a7c451269ef399fd6029cdfc80a7c604041312ab0a969bc906bdee6e6d707afdcbe8c7fb97beb66049c3d328340775025433ceba1e38008a826cf92443d903106199373bdadd9c2c735cf481e580db4e81b99f12e3f46b6159c687cd1b9e689f7712573c0f02735a45573dfb5cd55cf4649423892c7e91f439bdd7337a8ceebd302cfbfa"
   107  									}
   108  								}
   109  							],
   110  							"handle": [
   111  								{
   112  									"handler": "proxy",
   113  									"upstreams": [
   114  										{
   115  											"dial": [
   116  												"localhost:1196"
   117  											]
   118  										}
   119  									]
   120  								}
   121  							]
   122  						},
   123  						{
   124  							"match": [
   125  								{
   126  									"openvpn": {
   127  										"modes": [
   128  											"crypt2"
   129  										],
   130  										"server_key_file": "/etc/openvpn/v2-server.key"
   131  									}
   132  								}
   133  							],
   134  							"handle": [
   135  								{
   136  									"handler": "proxy",
   137  									"upstreams": [
   138  										{
   139  											"dial": [
   140  												"localhost:1197"
   141  											]
   142  										}
   143  									]
   144  								}
   145  							]
   146  						},
   147  						{
   148  							"handle": [
   149  								{
   150  									"handler": "tls"
   151  								},
   152  								{
   153  									"handler": "proxy",
   154  									"upstreams": [
   155  										{
   156  											"dial": [
   157  												"localhost:8080"
   158  											]
   159  										}
   160  									]
   161  								}
   162  							]
   163  						}
   164  					]
   165  				}
   166  			}
   167  		}
   168  	}
   169  }