1
0

tls_settings.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  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.settings.disableSystemRoot"></a-switch>
  63. </a-form-item>
  64. <a-form-item label="Session Resumption">
  65. <a-switch v-model="inbound.stream.tls.settings.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. </template>
  107. </template>
  108. <!-- xtls settings -->
  109. <template v-else-if="inbound.xtls">
  110. <a-form-item label="SNI" placeholder="Server Name Indication">
  111. <a-input v-model.trim="inbound.stream.xtls.sni"></a-input>
  112. </a-form-item>
  113. <a-form-item label="ALPN">
  114. <a-select mode="multiple" :dropdown-class-name="themeSwitcher.currentTheme" v-model="inbound.stream.xtls.alpn">
  115. <a-select-option v-for="alpn in ALPN_OPTION" :value="alpn">[[ alpn ]]</a-select-option>
  116. </a-select>
  117. </a-form-item>
  118. <a-form-item label="Allow Insecure">
  119. <a-switch v-model="inbound.stream.xtls.settings.allowInsecure"></a-switch>
  120. </a-form-item>
  121. <template v-for="cert,index in inbound.stream.xtls.certs">
  122. <a-form-item label='{{ i18n "certificate" }}'>
  123. <a-radio-group v-model="cert.useFile" button-style="solid">
  124. <a-radio-button :value="true">{{ i18n "pages.inbounds.certificatePath" }}</a-radio-button>
  125. <a-radio-button :value="false">{{ i18n "pages.inbounds.certificateContent" }}</a-radio-button>
  126. </a-radio-group>
  127. <a-button icon="plus" v-if="index === 0" type="primary" size="small" @click="inbound.stream.xtls.addCert()" style="margin-left: 10px"></a-button>
  128. <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>
  129. </a-form-item>
  130. <template v-if="cert.useFile">
  131. <a-form-item label='{{ i18n "pages.inbounds.publicKey" }}'>
  132. <a-input v-model.trim="cert.certFile"></a-input>
  133. </a-form-item>
  134. <a-form-item label='{{ i18n "pages.inbounds.privatekey" }}'>
  135. <a-input v-model.trim="cert.keyFile"></a-input>
  136. </a-form-item>
  137. <a-form-item label=" ">
  138. <a-button type="primary" icon="import" @click="setDefaultCertXtls(index)">{{ i18n "pages.inbounds.setDefaultCert" }}</a-button>
  139. </a-form-item>
  140. </template>
  141. <template v-else>
  142. <a-form-item label='{{ i18n "pages.inbounds.publicKey" }}'>
  143. <a-input type="textarea" :rows="3" v-model="cert.cert"></a-input>
  144. </a-form-item>
  145. <a-form-item label='{{ i18n "pages.inbounds.privatekey" }}'>
  146. <a-input type="textarea" :rows="3" v-model="cert.key"></a-input>
  147. </a-form-item>
  148. </template>
  149. <a-form-item label='OCSP stapling'>
  150. <a-input-number v-model.number="cert.ocspStapling" :min="0"></a-input-number>
  151. </a-form-item>
  152. <a-form-item label="One Time Loading">
  153. <a-switch v-model="cert.oneTimeLoading"></a-switch>
  154. </a-form-item>
  155. <a-form-item label='Usage Option'>
  156. <a-select v-model="cert.usage" style="width: 50%" :dropdown-class-name="themeSwitcher.currentTheme">
  157. <a-select-option v-for="key in USAGE_OPTION" :value="key">[[ key ]]</a-select-option>
  158. </a-select>
  159. </a-form-item>
  160. </template>
  161. </template>
  162. <!-- reality settings -->
  163. <template v-if="inbound.stream.isReality">
  164. <a-form-item label='Show'>
  165. <a-switch v-model="inbound.stream.reality.show"></a-switch>
  166. </a-form-item>
  167. <a-form-item label='Xver'>
  168. <a-input-number v-model.number="inbound.stream.reality.xver" :min="0"></a-input-number>
  169. </a-form-item>
  170. <a-form-item label='uTLS'>
  171. <a-select v-model="inbound.stream.reality.settings.fingerprint" style="width: 50%" :dropdown-class-name="themeSwitcher.currentTheme">
  172. <a-select-option v-for="key in UTLS_FINGERPRINT" :value="key">[[ key ]]</a-select-option>
  173. </a-select>
  174. </a-form-item>
  175. <a-form-item label='Dest'>
  176. <a-input v-model.trim="inbound.stream.reality.dest"></a-input>
  177. </a-form-item>
  178. <a-form-item label='SNI'>
  179. <a-input v-model.trim="inbound.stream.reality.serverNames"></a-input>
  180. </a-form-item>
  181. <a-form-item>
  182. <template slot="label">
  183. <a-tooltip>
  184. <template slot="title">
  185. <span>{{ i18n "reset" }}</span>
  186. </template> Short ID <a-icon @click="inbound.stream.reality.shortIds = RandomUtil.randomShortId()" type="sync"></a-icon>
  187. </a-tooltip>
  188. </template>
  189. <a-input v-model.trim="inbound.stream.reality.shortIds"></a-input>
  190. </a-form-item>
  191. <a-form-item label='SpiderX'>
  192. <a-input v-model.trim="inbound.stream.reality.settings.spiderX"></a-input>
  193. </a-form-item>
  194. <a-form-item label='{{ i18n "pages.inbounds.privatekey" }}'>
  195. <a-input v-model.trim="inbound.stream.reality.privateKey"></a-input>
  196. </a-form-item>
  197. <a-form-item label='{{ i18n "pages.inbounds.publicKey" }}'>
  198. <a-input v-model.trim="inbound.stream.reality.settings.publicKey"></a-input>
  199. </a-form-item>
  200. <a-form-item label=" ">
  201. <a-button type="primary" icon="import" @click="getNewX25519Cert">Get New Cert</a-button>
  202. </a-form-item>
  203. </template>
  204. </a-form>
  205. {{end}}