Browse Source

auto update script executed

Toby Chui 1 year ago
parent
commit
b476c2e7ab
2 changed files with 70 additions and 1 deletions
  1. 1 1
      mod/dynamicproxy/dpcore/dpcore.go
  2. 69 0
      web/components/rules.html

+ 1 - 1
mod/dynamicproxy/dpcore/dpcore.go

@@ -95,7 +95,7 @@ func NewDynamicProxyCore(target *url.URL, prepender string, ignoreTLSVerificatio
 	thisTransporter.(*http.Transport).MaxIdleConnsPerHost = 3000
 	thisTransporter.(*http.Transport).IdleConnTimeout = 10 * time.Second
 	thisTransporter.(*http.Transport).MaxConnsPerHost = 0
-	thisTransporter.(*http.Transport).DisableCompression = true
+	//thisTransporter.(*http.Transport).DisableCompression = true
 
 	if ignoreTLSVerification {
 		//Ignore TLS certificate validation error

+ 69 - 0
web/components/rules.html

@@ -33,6 +33,61 @@
                                 <label>Proxy Target require TLS Connection <br><small>(i.e. Your proxy target starts with https://)</small></label>
                             </div>
                         </div>
+                        <!-- Advance configs -->
+                        <div class="ui basic segment" style="background-color: #f7f7f7; border-radius: 1em;">
+                            <div id="advanceProxyRules" class="ui fluid accordion">
+                                <div class="title">
+                                <i class="dropdown icon"></i>
+                                Advance Settings
+                                </div>
+                                <div class="content">
+                                    <p></p>
+                                    <div class="field">
+                                        <div class="ui checkbox">
+                                            <input type="checkbox" id="skipTLSValidation">
+                                            <label>Ignore TLS/SSL Verification Error<br><small>E.g. self-signed, expired certificate (Not Recommended)</small></label>
+                                        </div>
+                                    </div>
+                                    <div class="field">
+                                        <div class="ui checkbox">
+                                            <input type="checkbox" id="requireBasicAuth">
+                                            <label>Require Basic Auth<br><small>Require client to login in order to view the page</small></label>
+                                        </div>
+                                    </div>
+                                    <div id="basicAuthCredentials" class="field">
+                                        <p>Enter the username and password for allowing them to access this proxy endpoint</p>
+                                        <table class="ui very basic celled table">
+                                            <thead>
+                                            <tr>
+                                                <th>Username</th>
+                                                <th>Password</th>
+                                                <th>Remove</th>
+                                            </tr></thead>
+                                            <tbody>
+                                            <tr>
+                                                <td colspan="3"><i class="ui green circle check icon"></i> No Entered Credential</td>
+                                            </tr>
+                                            </tbody>
+                                        </table>
+                                        <div class="three small fields credentialEntry">
+                                            <div class="field">
+                                                <input type="text" placeholder="Username" autocomplete="off">
+                                            </div>
+                                            <div class="field">
+                                                <input type="password" placeholder="Password" autocomplete="off">
+                                            </div>
+                                            <div class="field">
+                                                <button class="ui basic button"><i class="blue add icon"></i> Add Credential</button>
+                                            </div>
+                                        </div>
+                                        <div class="">
+
+                                        </div>
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+                        <br>
                         <button class="ui basic button" onclick="newProxyEndpoint();"><i class="blue add icon"></i> Create Endpoint</button>
                         <br><br>
                     </div>
@@ -63,6 +118,8 @@
     </div>
 </div>
 <script>
+    $("#advanceProxyRules").accordion();
+
     //New Proxy Endpoint
     function newProxyEndpoint(){
         var type = $("#ptype").val();
@@ -152,6 +209,18 @@
     }
 
 
+    function toggleBasicAuth() {
+        var basicAuthDiv = document.getElementById('basicAuthOnly');
+        if ($("#requireBasicAuth").parent().checkbox("is checked")) {
+            $("#basicAuthCredentials").removeClass("disabled");
+        } else {
+            $("#basicAuthCredentials").addClass("disabled");
+        }
+    }
+    $("#requireBasicAuth").on('change', toggleBasicAuth);
+    toggleBasicAuth();
+
+
     //Check if a string is a valid subdomain 
     function isSubdomainDomain(str) {
         const regex = /^(localhost|[a-z0-9]+([\-.]{1}[a-z0-9]+)*\.[a-z]{2,}|[a-z0-9]+([\-.]{1}[a-z0-9]+)*\.[a-z]{2,}\.)$/i;