tls_settings.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  1. {{define "form/tlsSettings"}}
  2. <!-- tls enable -->
  3. <a-form v-if="inbound.canEnableTls()" layout="inline">
  4. <a-divider style="margin:0;"></a-divider>
  5. <table width="100%" class="ant-table-tbody">
  6. <tr>
  7. <td>
  8. <span>{{ i18n "security" }}</span>
  9. </td>
  10. <td>
  11. <a-radio-group v-model="inbound.stream.security" button-style="solid">
  12. <a-radio-button value="none">{{ i18n "none" }}</a-radio-button>
  13. <a-tooltip>
  14. <template slot="title">
  15. <span>{{ i18n "pages.inbounds.xtlsDesc" }}</span>
  16. </template>
  17. <a-radio-button v-if="inbound.canEnableXtls()" value="xtls">XTLS</a-radio-button>
  18. </a-tooltip>
  19. <a-tooltip>
  20. <template slot="title">
  21. <span>{{ i18n "pages.inbounds.realityDesc" }}</span>
  22. </template>
  23. <a-radio-button v-if="inbound.canEnableReality()" value="reality">Reality</a-radio-button>
  24. </a-tooltip>
  25. <a-radio-button value="tls">TLS</a-radio-button>
  26. </a-radio-group>
  27. </td>
  28. </tr>
  29. <!-- tls settings -->
  30. <template v-if="inbound.stream.isTls">
  31. <tr>
  32. <td>SNI</td>
  33. <td>
  34. <a-form-item placeholder="Server Name Indication">
  35. <a-input v-model.trim="inbound.stream.tls.sni" style="width: 250px"></a-input>
  36. </a-form-item>
  37. </td>
  38. </tr>
  39. <tr>
  40. <td>CipherSuites</td>
  41. <td>
  42. <a-form-item>
  43. <a-select v-model="inbound.stream.tls.cipherSuites" style="width: 250px"
  44. :dropdown-class-name="themeSwitcher.currentTheme">
  45. <a-select-option value="">auto</a-select-option>
  46. <a-select-option v-for="key,value in TLS_CIPHER_OPTION"
  47. :value="key">[[ value]]</a-select-option>
  48. </a-select>
  49. </a-form-item>
  50. </td>
  51. </tr>
  52. <tr>
  53. <td>Min/Max Version</td>
  54. <td>
  55. <a-form-item>
  56. <a-input-group compact>
  57. <a-select style="width: 125px" v-model="inbound.stream.tls.minVersion"
  58. :dropdown-class-name="themeSwitcher.currentTheme">
  59. <a-select-option v-for="key in TLS_VERSION_OPTION"
  60. :value="key">[[ key ]]</a-select-option>
  61. </a-select>
  62. <a-select style="width: 125px" v-model="inbound.stream.tls.maxVersion"
  63. :dropdown-class-name="themeSwitcher.currentTheme">
  64. <a-select-option v-for="key in TLS_VERSION_OPTION"
  65. :value="key">[[ key ]]</a-select-option>
  66. </a-select>
  67. </a-input-group>
  68. </a-form-item>
  69. </td>
  70. </tr>
  71. <tr>
  72. <td>uTLS</td>
  73. <td>
  74. <a-form-item>
  75. <a-select v-model="inbound.stream.tls.settings.fingerprint" style="width: 250px"
  76. :dropdown-class-name="themeSwitcher.currentTheme">
  77. <a-select-option value=''>None</a-select-option>
  78. <a-select-option v-for="key in UTLS_FINGERPRINT"
  79. :value="key">[[ key ]]</a-select-option>
  80. </a-select>
  81. </a-form-item>
  82. </td>
  83. </tr>
  84. <tr>
  85. <td>ALPN</td>
  86. <td>
  87. <a-form-item>
  88. <a-select mode="multiple" style="width: 250px"
  89. :dropdown-class-name="themeSwitcher.currentTheme"
  90. v-model="inbound.stream.tls.alpn">
  91. <a-select-option v-for="alpn in ALPN_OPTION"
  92. :value="alpn">[[ alpn ]]</a-select-option>
  93. </a-select>
  94. </a-form-item>
  95. </td>
  96. </tr>
  97. <tr>
  98. <td>Allow insecure</td>
  99. <td>
  100. <a-form-item>
  101. <a-switch v-model="inbound.stream.tls.settings.allowInsecure"></a-switch>
  102. </a-form-item>
  103. </td>
  104. </tr>
  105. <tr>
  106. <td>Reject Unknown SNI</td>
  107. <td>
  108. <a-form-item>
  109. <a-switch v-model="inbound.stream.tls.rejectUnknownSni"></a-switch>
  110. </a-form-item>
  111. </td>
  112. </tr>
  113. <template v-for="cert,index in inbound.stream.tls.certs">
  114. <tr>
  115. <td>{{ i18n "certificate" }}</td>
  116. <td>
  117. <a-form-item>
  118. <a-radio-group v-model="cert.useFile" button-style="solid">
  119. <a-radio-button
  120. :value="true">{{ i18n "pages.inbounds.certificatePath"}}
  121. </a-radio-button>
  122. <a-radio-button
  123. :value="false">{{ i18n "pages.inbounds.certificateContent"}}
  124. </a-radio-button>
  125. </a-radio-group>
  126. <a-button v-if="index === 0" type="primary" size="small"
  127. @click="inbound.stream.tls.addCert()" style="margin-left: 10px">+</a-button>
  128. <a-button v-if="inbound.stream.tls.certs.length>1" type="primary" size="small"
  129. @click="inbound.stream.tls.removeCert(index)" style="margin-left: 10px">-</a-button>
  130. </a-form-item>
  131. </td>
  132. </tr>
  133. <template v-if="cert.useFile">
  134. <tr>
  135. <td>{{ i18n "pages.inbounds.publicKeyPath" }}</td>
  136. <td>
  137. <a-form-item>
  138. <a-input v-model.trim="cert.certFile" style="width:250px;"></a-input>
  139. </a-form-item>
  140. </td>
  141. </tr>
  142. <tr>
  143. <td>{{ i18n "pages.inbounds.keyPath" }}</td>
  144. <td>
  145. <a-form-item>
  146. <a-input v-model.trim="cert.keyFile" style="width:250px;"></a-input>
  147. </a-form-item>
  148. </td>
  149. </tr>
  150. <tr>
  151. <td></td>
  152. <td>
  153. <a-button type="primary" icon="import" @click="setDefaultCertData(index)">
  154. {{ i18n "pages.inbounds.setDefaultCert" }}
  155. </a-button>
  156. </td>
  157. </tr>
  158. </template>
  159. <template v-else>
  160. <tr>
  161. <td>{{ i18n "pages.inbounds.publicKeyContent" }}</td>
  162. <td>
  163. <a-form-item>
  164. <a-input type="textarea" :rows="3" style="width:250px;" v-model="cert.cert"></a-input>
  165. </a-form-item>
  166. </td>
  167. </tr>
  168. <tr>
  169. <td>{{ i18n "pages.inbounds.keyContent" }}</td>
  170. <td>
  171. <a-form-item>
  172. <a-input type="textarea" :rows="3" style="width:250px;" v-model="cert.key"></a-input>
  173. </a-form-item>
  174. </td>
  175. </tr>
  176. </template>
  177. <tr>
  178. <td>ocspStapling</td>
  179. <td>
  180. <a-form-item>
  181. <a-input-number v-model.number="cert.ocspStapling" :min="0"></a-input-number>
  182. </a-form-item>
  183. </td>
  184. </tr>
  185. </template>
  186. </template>
  187. <!-- xtls settings -->
  188. <template v-else-if="inbound.xtls">
  189. <tr>
  190. <td>
  191. <span>SNI</span>
  192. </td>
  193. <td>
  194. <a-form-item>
  195. <a-input v-model.trim="inbound.stream.xtls.server" style="width: 250px"></a-input>
  196. </a-form-item>
  197. </td>
  198. </tr>
  199. <tr>
  200. <td>
  201. <span>Alpn</span>
  202. </td>
  203. <td>
  204. <a-form-item>
  205. <a-select mode="multiple" style="width: 250px" :dropdown-class-name="themeSwitcher.currentTheme"
  206. v-model="inbound.stream.xtls.alpn">
  207. <a-select-option v-for="alpn in ALPN_OPTION" :value="alpn">[[ alpn ]]</a-select-option>
  208. </a-select>
  209. </a-form-item>
  210. </td>
  211. </tr>
  212. <tr>
  213. <td>
  214. <span>Allow insecure</span>
  215. </td>
  216. <td>
  217. <a-form-item>
  218. <a-switch v-model="inbound.stream.xtls.settings.allowInsecure"></a-switch>
  219. </a-form-item>
  220. </td>
  221. </tr>
  222. <template v-for="cert,index in inbound.stream.xtls.certs">
  223. <tr>
  224. <td>{{ i18n "certificate" }}</td>
  225. <td>
  226. <a-form-item>
  227. <a-radio-group v-model="cert.useFile" button-style="solid">
  228. <a-radio-button :value="true">{{ i18n "pages.inbounds.certificatePath"
  229. }}</a-radio-button>
  230. <a-radio-button :value="false">{{ i18n "pages.inbounds.certificateContent"
  231. }}</a-radio-button>
  232. </a-radio-group>
  233. <a-button v-if="index === 0" type="primary" size="small"
  234. @click="inbound.stream.xtls.addCert()" style="margin-left: 10px">+</a-button>
  235. <a-button v-if="inbound.stream.xtls.certs.length>1" type="primary" size="small"
  236. @click="inbound.stream.xtls.removeCert(index)" style="margin-left: 10px">-</a-button>
  237. </a-form-item>
  238. </td>
  239. </tr>
  240. <template v-if="cert.useFile">
  241. <tr>
  242. <td>{{ i18n "pages.inbounds.publicKeyPath" }}</td>
  243. <td>
  244. <a-form-item>
  245. <a-input v-model.trim="cert.certFile" style="width:250px;"></a-input>
  246. </a-form-item>
  247. </td>
  248. </tr>
  249. <tr>
  250. <td>{{ i18n "pages.inbounds.keyPath" }}</td>
  251. <td>
  252. <a-form-item>
  253. <a-input v-model.trim="cert.keyFile" style="width:250px;"></a-input>
  254. </a-form-item>
  255. </td>
  256. </tr>
  257. <tr>
  258. <td></td>
  259. <td>
  260. <a-button type="primary" icon="import" @click="setDefaultCertData(index)">{{ i18n
  261. "pages.inbounds.setDefaultCert" }}</a-button>
  262. </td>
  263. </tr>
  264. </template>
  265. <template v-else>
  266. <tr>
  267. <td>{{ i18n "pages.inbounds.publicKeyContent" }}</td>
  268. <td>
  269. <a-form-item>
  270. <a-input type="textarea" :rows="3" style="width:250px;" v-model="cert.cert"></a-input>
  271. </a-form-item>
  272. </td>
  273. </tr>
  274. <tr>
  275. <td>{{ i18n "pages.inbounds.keyContent" }}</td>
  276. <td>
  277. <a-form-item>
  278. <a-input type="textarea" :rows="3" style="width:250px;" v-model="cert.key"></a-input>
  279. </a-form-item>
  280. </td>
  281. </tr>
  282. </template>
  283. </template>
  284. </template>
  285. <!-- reality settings -->
  286. <template v-else-if="inbound.reality">
  287. <tr>
  288. <td>
  289. <span>Show</span>
  290. </td>
  291. <td>
  292. <a-form-item>
  293. <a-switch v-model="inbound.stream.reality.show"></a-switch>
  294. </a-form-item>
  295. </td>
  296. </tr>
  297. <tr>
  298. <td>
  299. <span>xVer</span>
  300. </td>
  301. <td>
  302. <a-form-item>
  303. <a-input-number v-model="inbound.stream.reality.xver" :min="0"
  304. style="width: 60px"></a-input-number>
  305. </a-form-item>
  306. </td>
  307. </tr>
  308. <tr>
  309. <td>
  310. <span>uTLS</span>
  311. </td>
  312. <td>
  313. <a-form-item>
  314. <a-select v-model="inbound.stream.reality.settings.fingerprint" style="width: 135px"
  315. :dropdown-class-name="themeSwitcher.currentTheme">
  316. <a-select-option v-for="key in UTLS_FINGERPRINT" :value="key">[[ key ]]</a-select-option>
  317. </a-select>
  318. </a-form-item>
  319. </td>
  320. </tr>
  321. <tr>
  322. <td>
  323. <span>Dest</span>
  324. </td>
  325. <td>
  326. <a-form-item>
  327. <a-input v-model.trim="inbound.stream.reality.dest" style="width: 300px"></a-input>
  328. </a-form-item>
  329. </td>
  330. </tr>
  331. <tr>
  332. <td>
  333. <span>Server Names</span>
  334. </td>
  335. <td>
  336. <a-form-item>
  337. <a-input v-model.trim="inbound.stream.reality.serverNames" style="width: 300px"></a-input>
  338. </a-form-item>
  339. </td>
  340. </tr>
  341. <tr>
  342. <td>
  343. <span>ShortIds</span> <a-icon @click="inbound.stream.reality.shortIds = RandomUtil.randomShortId()"
  344. type="sync"> </a-icon>
  345. </td>
  346. <td>
  347. <a-form-item>
  348. <a-input v-model.trim="inbound.stream.reality.shortIds" style="width: 150px;"></a-input>
  349. </a-form-item>
  350. </td>
  351. </tr>
  352. <tr>
  353. <td>
  354. <span>SpiderX</span>
  355. </td>
  356. <td>
  357. <a-form-item>
  358. <a-input v-model.trim="inbound.stream.reality.settings.spiderX" style="width: 150px;"></a-input>
  359. </a-form-item>
  360. </td>
  361. </tr>
  362. <tr>
  363. <td>
  364. <span>Private Key</span>
  365. </td>
  366. <td>
  367. <a-form-item>
  368. <a-input v-model.trim="inbound.stream.reality.privateKey" style="width: 300px"></a-input>
  369. </a-form-item>
  370. </td>
  371. </tr>
  372. <tr>
  373. <td>
  374. <span>Public Key</span>
  375. </td>
  376. <td>
  377. <a-form-item>
  378. <a-input v-model.trim="inbound.stream.reality.settings.publicKey"
  379. style="width: 300px"></a-input>
  380. </a-form-item>
  381. </td>
  382. </tr>
  383. <tr>
  384. <td colspan="2">
  385. <a-button type="primary" icon="import" @click="getNewX25519Cert">Get New Key</a-button>
  386. </td>
  387. </tr>
  388. </template>
  389. </table>
  390. </a-form>
  391. {{end}}