tls_settings.html 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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%"
  37. :dropdown-class-name="themeSwitcher.currentTheme">
  38. <a-select-option v-for="key in TLS_VERSION_OPTION" :value="key">[[ key ]]</a-select-option>
  39. </a-select>
  40. <a-select v-model="inbound.stream.tls.maxVersion" style="width: 50%"
  41. :dropdown-class-name="themeSwitcher.currentTheme">
  42. <a-select-option v-for="key in TLS_VERSION_OPTION" :value="key">[[ key ]]</a-select-option>
  43. </a-select>
  44. </a-input-group>
  45. </a-form-item>
  46. <a-form-item label="uTLS">
  47. <a-select v-model="inbound.stream.tls.settings.fingerprint" style="width: 50%"
  48. :dropdown-class-name="themeSwitcher.currentTheme">
  49. <a-select-option value=''>None</a-select-option>
  50. <a-select-option v-for="key in UTLS_FINGERPRINT" :value="key">[[ key ]]</a-select-option>
  51. </a-select>
  52. </a-form-item>
  53. <a-form-item label="ALPN">
  54. <a-select mode="multiple" :dropdown-class-name="themeSwitcher.currentTheme" v-model="inbound.stream.tls.alpn">
  55. <a-select-option v-for="alpn in ALPN_OPTION" :value="alpn">[[ alpn ]]</a-select-option>
  56. </a-select>
  57. </a-form-item>
  58. <a-form-item label="Allow Insecure">
  59. <a-switch v-model="inbound.stream.tls.settings.allowInsecure"></a-switch>
  60. </a-form-item>
  61. <a-form-item label="Reject Unknown SNI">
  62. <a-switch v-model="inbound.stream.tls.rejectUnknownSni"></a-switch>
  63. </a-form-item>
  64. <a-form-item label="Disable System Root">
  65. <a-switch v-model="inbound.stream.tls.disableSystemRoot"></a-switch>
  66. </a-form-item>
  67. <a-form-item label="Session Resumption">
  68. <a-switch v-model="inbound.stream.tls.enableSessionResumption"></a-switch>
  69. </a-form-item>
  70. <template v-for="cert,index in inbound.stream.tls.certs">
  71. <a-form-item label='{{ i18n "certificate" }}'>
  72. <a-radio-group v-model="cert.useFile" button-style="solid">
  73. <a-radio-button :value="true">{{ i18n "pages.inbounds.certificatePath" }}</a-radio-button>
  74. <a-radio-button :value="false">{{ i18n "pages.inbounds.certificateContent" }}</a-radio-button>
  75. </a-radio-group>
  76. <a-button icon="plus" v-if="index === 0" type="primary" size="small" @click="inbound.stream.tls.addCert()"
  77. style="margin-left: 10px"></a-button>
  78. <a-button icon="minus" v-if="inbound.stream.tls.certs.length>1" type="primary" size="small"
  79. @click="inbound.stream.tls.removeCert(index)" style="margin-left: 10px"></a-button>
  80. </a-form-item>
  81. <template v-if="cert.useFile">
  82. <a-form-item label='{{ i18n "pages.inbounds.publicKey" }}'>
  83. <a-input v-model.trim="cert.certFile"></a-input>
  84. </a-form-item>
  85. <a-form-item label='{{ i18n "pages.inbounds.privatekey" }}'>
  86. <a-input v-model.trim="cert.keyFile"></a-input>
  87. </a-form-item>
  88. <a-form-item label=" ">
  89. <a-button type="primary" icon="import" @click="setDefaultCertData(index)">
  90. {{ i18n "pages.inbounds.setDefaultCert" }}</a-button>
  91. </a-form-item>
  92. </template>
  93. <template v-else>
  94. <a-form-item label='{{ i18n "pages.inbounds.publicKey" }}'>
  95. <a-input type="textarea" :rows="3" v-model="cert.cert"></a-input>
  96. </a-form-item>
  97. <a-form-item label='{{ i18n "pages.inbounds.privatekey" }}'>
  98. <a-input type="textarea" :rows="3" v-model="cert.key"></a-input>
  99. </a-form-item>
  100. </template>
  101. <a-form-item label='OCSP stapling'>
  102. <a-input-number v-model.number="cert.ocspStapling" :min="0"></a-input-number>
  103. </a-form-item>
  104. <a-form-item label="One Time Loading">
  105. <a-switch v-model="cert.oneTimeLoading"></a-switch>
  106. </a-form-item>
  107. <a-form-item label='Usage Option'>
  108. <a-select v-model="cert.usage" style="width: 50%" :dropdown-class-name="themeSwitcher.currentTheme">
  109. <a-select-option v-for="key in USAGE_OPTION" :value="key">[[ key ]]</a-select-option>
  110. </a-select>
  111. </a-form-item>
  112. <a-form-item label="Build Chain" v-if="cert.usage === 'issue'">
  113. <a-switch v-model="cert.buildChain"></a-switch>
  114. </a-form-item>
  115. </template>
  116. </template>
  117. <!-- xtls settings -->
  118. <template v-else-if="inbound.stream.isXtls">
  119. {{template "form/xtlsSettings"}}
  120. </template>
  121. <!-- reality settings -->
  122. <template v-if="inbound.stream.isReality">
  123. {{template "form/realitySettings"}}
  124. </template>
  125. </a-form>
  126. {{end}}