1
0

tls_settings.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. {{define "form/tlsSettings"}}
  2. <!-- tls enable -->
  3. <a-form v-if="inbound.canEnableTls()" :colon="false" :label-col="{ md: {span:8} }" :wrapper-col="{ md: {span:14} }">
  4. <a-divider style="margin:3px 0;"></a-divider>
  5. <a-form-item label='{{ i18n "security" }}'>
  6. <a-radio-group v-model="inbound.stream.security" button-style="solid">
  7. <a-radio-button value="none">{{ i18n "none" }}</a-radio-button>
  8. <a-tooltip>
  9. <template slot="title">
  10. <span>{{ i18n "pages.inbounds.xtlsDesc" }}</span>
  11. </template>
  12. <a-radio-button v-if="inbound.canEnableXtls()" value="xtls">XTLS</a-radio-button>
  13. </a-tooltip>
  14. <a-tooltip>
  15. <template slot="title">
  16. <span>{{ i18n "pages.inbounds.realityDesc" }}</span>
  17. </template>
  18. <a-radio-button v-if="inbound.canEnableReality()" value="reality">REALITY</a-radio-button>
  19. </a-tooltip>
  20. <a-radio-button value="tls">TLS</a-radio-button>
  21. </a-radio-group>
  22. </a-form-item>
  23. <!-- tls settings -->
  24. <template v-if="inbound.stream.isTls">
  25. <a-form-item label="SNI" placeholder="Server Name Indication">
  26. <a-input v-model.trim="inbound.stream.tls.sni"></a-input>
  27. </a-form-item>
  28. <a-form-item label="Cipher Suites">
  29. <a-select v-model="inbound.stream.tls.cipherSuites" :dropdown-class-name="themeSwitcher.currentTheme">
  30. <a-select-option value="">Auto</a-select-option>
  31. <a-select-option v-for="key,value in TLS_CIPHER_OPTION" :value="key">[[ value ]]</a-select-option>
  32. </a-select>
  33. </a-form-item>
  34. <a-form-item label="Min/Max Version">
  35. <a-input-group compact>
  36. <a-select v-model="inbound.stream.tls.minVersion" style="width: 50%" :dropdown-class-name="themeSwitcher.currentTheme">
  37. <a-select-option v-for="key in TLS_VERSION_OPTION" :value="key">[[ key ]]</a-select-option>
  38. </a-select>
  39. <a-select v-model="inbound.stream.tls.maxVersion" style="width: 50%" :dropdown-class-name="themeSwitcher.currentTheme">
  40. <a-select-option v-for="key in TLS_VERSION_OPTION" :value="key">[[ key ]]</a-select-option>
  41. </a-select>
  42. </a-input-group>
  43. </a-form-item>
  44. <a-form-item label="uTLS">
  45. <a-select v-model="inbound.stream.tls.settings.fingerprint" style="width: 50%" :dropdown-class-name="themeSwitcher.currentTheme">
  46. <a-select-option value=''>None</a-select-option>
  47. <a-select-option v-for="key in UTLS_FINGERPRINT" :value="key">[[ key ]]</a-select-option>
  48. </a-select>
  49. </a-form-item>
  50. <a-form-item label="ALPN">
  51. <a-select mode="multiple" :dropdown-class-name="themeSwitcher.currentTheme" v-model="inbound.stream.tls.alpn">
  52. <a-select-option v-for="alpn in ALPN_OPTION" :value="alpn">[[ alpn ]]</a-select-option>
  53. </a-select>
  54. </a-form-item>
  55. <a-form-item label="Allow Insecure">
  56. <a-switch v-model="inbound.stream.tls.settings.allowInsecure"></a-switch>
  57. </a-form-item>
  58. <a-form-item label="Reject Unknown SNI">
  59. <a-switch v-model="inbound.stream.tls.rejectUnknownSni"></a-switch>
  60. </a-form-item>
  61. <a-form-item label="Disable System Root">
  62. <a-switch v-model="inbound.stream.tls.disableSystemRoot"></a-switch>
  63. </a-form-item>
  64. <a-form-item label="Session Resumption">
  65. <a-switch v-model="inbound.stream.tls.enableSessionResumption"></a-switch>
  66. </a-form-item>
  67. <template v-for="cert,index in inbound.stream.tls.certs">
  68. <a-form-item label='{{ i18n "certificate" }}'>
  69. <a-radio-group v-model="cert.useFile" button-style="solid">
  70. <a-radio-button :value="true">{{ i18n "pages.inbounds.certificatePath" }}</a-radio-button>
  71. <a-radio-button :value="false">{{ i18n "pages.inbounds.certificateContent" }}</a-radio-button>
  72. </a-radio-group>
  73. <a-button icon="plus" v-if="index === 0" type="primary" size="small" @click="inbound.stream.tls.addCert()" style="margin-left: 10px"></a-button>
  74. <a-button icon="minus" v-if="inbound.stream.tls.certs.length>1" type="primary" size="small" @click="inbound.stream.tls.removeCert(index)" style="margin-left: 10px"></a-button>
  75. </a-form-item>
  76. <template v-if="cert.useFile">
  77. <a-form-item label='{{ i18n "pages.inbounds.publicKey" }}'>
  78. <a-input v-model.trim="cert.certFile"></a-input>
  79. </a-form-item>
  80. <a-form-item label='{{ i18n "pages.inbounds.privatekey" }}'>
  81. <a-input v-model.trim="cert.keyFile"></a-input>
  82. </a-form-item>
  83. <a-form-item label=" ">
  84. <a-button type="primary" icon="import" @click="setDefaultCertData(index)">{{ i18n "pages.inbounds.setDefaultCert" }}</a-button>
  85. </a-form-item>
  86. </template>
  87. <template v-else>
  88. <a-form-item label='{{ i18n "pages.inbounds.publicKey" }}'>
  89. <a-input type="textarea" :rows="3" v-model="cert.cert"></a-input>
  90. </a-form-item>
  91. <a-form-item label='{{ i18n "pages.inbounds.privatekey" }}'>
  92. <a-input type="textarea" :rows="3" v-model="cert.key"></a-input>
  93. </a-form-item>
  94. </template>
  95. <a-form-item label='OCSP stapling'>
  96. <a-input-number v-model.number="cert.ocspStapling" :min="0"></a-input-number>
  97. </a-form-item>
  98. <a-form-item label="One Time Loading">
  99. <a-switch v-model="cert.oneTimeLoading"></a-switch>
  100. </a-form-item>
  101. <a-form-item label='Usage Option'>
  102. <a-select v-model="cert.usage" style="width: 50%" :dropdown-class-name="themeSwitcher.currentTheme">
  103. <a-select-option v-for="key in USAGE_OPTION" :value="key">[[ key ]]</a-select-option>
  104. </a-select>
  105. </a-form-item>
  106. <a-form-item label="Build Chain">
  107. <a-switch v-model="cert.buildChain"></a-switch>
  108. </a-form-item>
  109. </template>
  110. </template>
  111. <!-- xtls settings -->
  112. <template v-else-if="inbound.xtls">
  113. <a-form-item label="SNI" placeholder="Server Name Indication">
  114. <a-input v-model.trim="inbound.stream.xtls.sni"></a-input>
  115. </a-form-item>
  116. <a-form-item label="ALPN">
  117. <a-select mode="multiple" :dropdown-class-name="themeSwitcher.currentTheme" v-model="inbound.stream.xtls.alpn">
  118. <a-select-option v-for="alpn in ALPN_OPTION" :value="alpn">[[ alpn ]]</a-select-option>
  119. </a-select>
  120. </a-form-item>
  121. <a-form-item label="Allow Insecure">
  122. <a-switch v-model="inbound.stream.xtls.settings.allowInsecure"></a-switch>
  123. </a-form-item>
  124. <template v-for="cert,index in inbound.stream.xtls.certs">
  125. <a-form-item label='{{ i18n "certificate" }}'>
  126. <a-radio-group v-model="cert.useFile" button-style="solid">
  127. <a-radio-button :value="true">{{ i18n "pages.inbounds.certificatePath" }}</a-radio-button>
  128. <a-radio-button :value="false">{{ i18n "pages.inbounds.certificateContent" }}</a-radio-button>
  129. </a-radio-group>
  130. <a-button icon="plus" v-if="index === 0" type="primary" size="small" @click="inbound.stream.xtls.addCert()" style="margin-left: 10px"></a-button>
  131. <a-button icon="minus" v-if="inbound.stream.xtls.certs.length>1" type="primary" size="small" @click="inbound.stream.xtls.removeCert(index)" style="margin-left: 10px"></a-button>
  132. </a-form-item>
  133. <template v-if="cert.useFile">
  134. <a-form-item label='{{ i18n "pages.inbounds.publicKey" }}'>
  135. <a-input v-model.trim="cert.certFile"></a-input>
  136. </a-form-item>
  137. <a-form-item label='{{ i18n "pages.inbounds.privatekey" }}'>
  138. <a-input v-model.trim="cert.keyFile"></a-input>
  139. </a-form-item>
  140. <a-form-item label=" ">
  141. <a-button type="primary" icon="import" @click="setDefaultCertXtls(index)">{{ i18n "pages.inbounds.setDefaultCert" }}</a-button>
  142. </a-form-item>
  143. </template>
  144. <template v-else>
  145. <a-form-item label='{{ i18n "pages.inbounds.publicKey" }}'>
  146. <a-input type="textarea" :rows="3" v-model="cert.cert"></a-input>
  147. </a-form-item>
  148. <a-form-item label='{{ i18n "pages.inbounds.privatekey" }}'>
  149. <a-input type="textarea" :rows="3" v-model="cert.key"></a-input>
  150. </a-form-item>
  151. </template>
  152. <a-form-item label='OCSP stapling'>
  153. <a-input-number v-model.number="cert.ocspStapling" :min="0"></a-input-number>
  154. </a-form-item>
  155. <a-form-item label="One Time Loading">
  156. <a-switch v-model="cert.oneTimeLoading"></a-switch>
  157. </a-form-item>
  158. <a-form-item label='Usage Option'>
  159. <a-select v-model="cert.usage" style="width: 50%" :dropdown-class-name="themeSwitcher.currentTheme">
  160. <a-select-option v-for="key in USAGE_OPTION" :value="key">[[ key ]]</a-select-option>
  161. </a-select>
  162. </a-form-item>
  163. </template>
  164. </template>
  165. <!-- reality settings -->
  166. <template v-if="inbound.stream.isReality">
  167. <a-form-item label='Show'>
  168. <a-switch v-model="inbound.stream.reality.show"></a-switch>
  169. </a-form-item>
  170. <a-form-item label='Xver'>
  171. <a-input-number v-model.number="inbound.stream.reality.xver" :min="0"></a-input-number>
  172. </a-form-item>
  173. <a-form-item label='uTLS'>
  174. <a-select v-model="inbound.stream.reality.settings.fingerprint" style="width: 50%" :dropdown-class-name="themeSwitcher.currentTheme">
  175. <a-select-option v-for="key in UTLS_FINGERPRINT" :value="key">[[ key ]]</a-select-option>
  176. </a-select>
  177. </a-form-item>
  178. <a-form-item label='Dest'>
  179. <a-input v-model.trim="inbound.stream.reality.dest"></a-input>
  180. </a-form-item>
  181. <a-form-item label='SNI'>
  182. <a-input v-model.trim="inbound.stream.reality.serverNames"></a-input>
  183. </a-form-item>
  184. <a-form-item label='Max Time Diff (ms)'>
  185. <a-input-number v-model.number="inbound.stream.reality.maxTimediff" :min="0"></a-input-number>
  186. </a-form-item>
  187. <a-form-item>
  188. <template slot="label">
  189. <a-tooltip>
  190. <template slot="title">
  191. <span>{{ i18n "reset" }}</span>
  192. </template> Short IDs <a-icon @click="inbound.stream.reality.shortIds = RandomUtil.randomShortIds()" type="sync"></a-icon>
  193. </a-tooltip>
  194. </template>
  195. <a-input v-model.trim="inbound.stream.reality.shortIds"></a-input>
  196. </a-form-item>
  197. <a-form-item label='SpiderX'>
  198. <a-input v-model.trim="inbound.stream.reality.settings.spiderX"></a-input>
  199. </a-form-item>
  200. <a-form-item label='{{ i18n "pages.inbounds.privatekey" }}'>
  201. <a-input v-model.trim="inbound.stream.reality.privateKey"></a-input>
  202. </a-form-item>
  203. <a-form-item label='{{ i18n "pages.inbounds.publicKey" }}'>
  204. <a-input v-model.trim="inbound.stream.reality.settings.publicKey"></a-input>
  205. </a-form-item>
  206. <a-form-item label=" ">
  207. <a-button type="primary" icon="import" @click="getNewX25519Cert">Get New Cert</a-button>
  208. </a-form-item>
  209. </template>
  210. </a-form>
  211. {{end}}