Spaces:
Sleeping
Sleeping
Commit
·
ee67a9e
1
Parent(s):
f1fabdd
BuyPass setup
Browse files
app.py
CHANGED
@@ -47,11 +47,17 @@ def update_ca_server(wildcard: bool):
|
|
47 |
else:
|
48 |
return gr.update(choices=["Let's Encrypt (Testing)","Let's Encrypt", "ZeroSSL", "Google (Testing)","Google", "SSL.com"], value="Let's Encrypt")
|
49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
def app():
|
51 |
with gr.Blocks(title="Project Gatekeeper - Get free SSL Certificates") as webui:
|
52 |
with gr.Tab("STEP 1: Generate CNAME Records"):
|
53 |
with gr.Row():
|
54 |
-
cname_domains = gr.Textbox(label="Enter Domains", placeholder="thenayankasturi.eu.org, dash.thenayankasturi.eu.org, www.thenayankasturi.eu.org", type="text", interactive=True)
|
55 |
btn1 = gr.Button(value="Generate CNAME Records & Values")
|
56 |
with gr.Row():
|
57 |
records = gr.Dataframe(label="CNAME Records", headers=["CNAME", "CNAME VALUE"], row_count=(1), col_count=(2))
|
@@ -73,7 +79,8 @@ def app():
|
|
73 |
ca_server = gr.Dropdown(label="Select Certificate Authority", choices=["Let's Encrypt (Testing)","Let's Encrypt", "Buypass (Testing)", "Buypass", "ZeroSSL", "Google (Testing)","Google", "SSL.com"], interactive=True, value="Let's Encrypt (Testing)")
|
74 |
key_type = gr.Radio(label="Select SSL key type", choices=["rsa", "ec"], interactive=True, value='ec')
|
75 |
key_size_dropdown = gr.Dropdown(label="Select Key Size", choices=['2048', '4096'], value='4096', visible=False) # Initially visible
|
76 |
-
key_curve_dropdown = gr.Dropdown(label="Select Key Curve", choices=['SECP256R1', 'SECP384R1'], value='
|
|
|
77 |
key_type.change(fn=update_key_options, inputs=key_type, outputs=[key_size_dropdown, key_curve_dropdown])
|
78 |
wildcard.change(fn=update_ca_server, inputs=wildcard, outputs=ca_server)
|
79 |
btn3 = gr.Button(value="Generate SSL Certificate")
|
@@ -89,8 +96,7 @@ def app():
|
|
89 |
crtfile = gr.File(label="Download your SSL Certificate")
|
90 |
btn3.click(gen_ssl, inputs=[domains_input, wildcard, email_input, ca_server, key_type, key_size_dropdown, key_curve_dropdown], outputs=[pvt, pvtfile, csr, csrfile, crt, crtfile])
|
91 |
try:
|
92 |
-
|
93 |
-
webui.queue().launch()
|
94 |
except Exception as e:
|
95 |
print(f"Error: {e}")
|
96 |
|
|
|
47 |
else:
|
48 |
return gr.update(choices=["Let's Encrypt (Testing)","Let's Encrypt", "ZeroSSL", "Google (Testing)","Google", "SSL.com"], value="Let's Encrypt")
|
49 |
|
50 |
+
def update_buypass_options(ca_server):
|
51 |
+
if ca_server == "Buypass (Testing)" or ca_server == "Buypass":
|
52 |
+
return gr.update(choices=['SECP256R1'])
|
53 |
+
else:
|
54 |
+
return gr.update(choices=['SECP256R1', 'SECP384R1'])
|
55 |
+
|
56 |
def app():
|
57 |
with gr.Blocks(title="Project Gatekeeper - Get free SSL Certificates") as webui:
|
58 |
with gr.Tab("STEP 1: Generate CNAME Records"):
|
59 |
with gr.Row():
|
60 |
+
cname_domains = gr.Textbox(value="thenayankasturi.eu.org, dash.thenayankasturi.eu.org, www.thenayankasturi.eu.org", label="Enter Domains", placeholder="thenayankasturi.eu.org, dash.thenayankasturi.eu.org, www.thenayankasturi.eu.org", type="text", interactive=True)
|
61 |
btn1 = gr.Button(value="Generate CNAME Records & Values")
|
62 |
with gr.Row():
|
63 |
records = gr.Dataframe(label="CNAME Records", headers=["CNAME", "CNAME VALUE"], row_count=(1), col_count=(2))
|
|
|
79 |
ca_server = gr.Dropdown(label="Select Certificate Authority", choices=["Let's Encrypt (Testing)","Let's Encrypt", "Buypass (Testing)", "Buypass", "ZeroSSL", "Google (Testing)","Google", "SSL.com"], interactive=True, value="Let's Encrypt (Testing)")
|
80 |
key_type = gr.Radio(label="Select SSL key type", choices=["rsa", "ec"], interactive=True, value='ec')
|
81 |
key_size_dropdown = gr.Dropdown(label="Select Key Size", choices=['2048', '4096'], value='4096', visible=False) # Initially visible
|
82 |
+
key_curve_dropdown = gr.Dropdown(label="Select Key Curve", choices=['SECP256R1', 'SECP384R1'], value='SECP256R1', visible=True) # Initially hidden
|
83 |
+
ca_server.change(fn=update_buypass_options, inputs=ca_server, outputs=key_curve_dropdown)
|
84 |
key_type.change(fn=update_key_options, inputs=key_type, outputs=[key_size_dropdown, key_curve_dropdown])
|
85 |
wildcard.change(fn=update_ca_server, inputs=wildcard, outputs=ca_server)
|
86 |
btn3 = gr.Button(value="Generate SSL Certificate")
|
|
|
96 |
crtfile = gr.File(label="Download your SSL Certificate")
|
97 |
btn3.click(gen_ssl, inputs=[domains_input, wildcard, email_input, ca_server, key_type, key_size_dropdown, key_curve_dropdown], outputs=[pvt, pvtfile, csr, csrfile, crt, crtfile])
|
98 |
try:
|
99 |
+
webui.queue(default_concurrency_limit=15).launch()
|
|
|
100 |
except Exception as e:
|
101 |
print(f"Error: {e}")
|
102 |
|
main.py
CHANGED
@@ -74,7 +74,7 @@ def main(i_domains, wildcard, email, ca_server, key_type, key_size=None, key_cur
|
|
74 |
|
75 |
if __name__ == "__main__":
|
76 |
DOMAINS = 'raannakasturi.eu.org'
|
77 |
-
ca_server = "
|
78 |
EMAIL = "raannak@mail.com"
|
79 |
key_type = "ec"
|
80 |
key_curve = "ec384"
|
|
|
74 |
|
75 |
if __name__ == "__main__":
|
76 |
DOMAINS = 'raannakasturi.eu.org'
|
77 |
+
ca_server = "SSL.com" #Let's Encrypt (Testing), Let's Encrypt, Google (Testing), Google, Buypass (Testing), Buypass, ZeroSSL, SSL.com
|
78 |
EMAIL = "raannak@mail.com"
|
79 |
key_type = "ec"
|
80 |
key_curve = "ec384"
|