Unarchiving gargoyle_1.14.0-x86-64-generic-ext4-combined.img.gz

If your problem doesn't fall into one of the other categories, report it here.

Moderator: Moderators

Post Reply
rockyd
Posts: 147
Joined: Tue Oct 22, 2019 5:49 am

Unarchiving gargoyle_1.14.0-x86-64-generic-ext4-combined.img.gz

Post by rockyd »

Downloaded gargoyle_1.14.0-x86-64-generic-ext4-combined.img.gz to have a play in a virtualbox virtual machine.
Tried Archive manager and Peazip in Linux Mint both failed. So I tried the console, and it unarchived, but mentions garbage at the end, why is there garbage in it?

gzip: gargoyle_1.14.0-x86-64-generic-ext4-combined.img.gz: decompression OK, trailing garbage ignored

Peazip also mentioned something about garbage at the end of the file but did not extract it.

rockyd
Posts: 147
Joined: Tue Oct 22, 2019 5:49 am

Re: Unarchiving gargoyle_1.14.0-x86-64-generic-ext4-combined.img.gz

Post by rockyd »

The image seems to work, so not sure what the garbage is all about.

Lantis
Moderator
Posts: 7335
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia
Contact:

Re: Unarchiving gargoyle_1.14.0-x86-64-generic-ext4-combined.img.gz

Post by Lantis »

Image metadata is written to the end of the compressed file. This is used during the sysupgrade process.

The decompression works fine, trailing garbage is ignored by all unzip programs written "well".

When you go to sysupgrade in the future do not unzip, just upload it as is.
https://lantisproject.com/downloads/gargoylebuilds for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.
https://lantisproject.com/blog

rockyd
Posts: 147
Joined: Tue Oct 22, 2019 5:49 am

Re: Unarchiving gargoyle_1.14.0-x86-64-generic-ext4-combined.img.gz

Post by rockyd »

Lantis wrote:
Thu Jul 02, 2026 6:40 am
Image metadata is written to the end of the compressed file. This is used during the sysupgrade process.
Thanks that explains it.
Lantis wrote:
Thu Jul 02, 2026 6:40 am
The decompression works fine, trailing garbage is ignored by all unzip programs written "well".
The two Linux Mint GUI unarchivers I tried didn't, unfortunately.
Lantis wrote:
Thu Jul 02, 2026 6:40 am
When you go to sysupgrade in the future do not unzip, just upload it as is.
I don't, I only needed to get the .img file so I could load it in a Virtualbox VM, after conversion to vdi.

Works in the VM and have had a play at adding a button to the Openvpn section to do the regenerate crl thing you told me about the the other section. With assistance from Google AI.
Surprisingly it has helped me get a button on the page, but no luck getting it to do anything. I think I get how its supposed to work, but it doesn't.

Lantis
Moderator
Posts: 7335
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia
Contact:

Re: Unarchiving gargoyle_1.14.0-x86-64-generic-ext4-combined.img.gz

Post by Lantis »

What have you got so far? Happy to help out
https://lantisproject.com/downloads/gargoylebuilds for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.
https://lantisproject.com/blog

rockyd
Posts: 147
Joined: Tue Oct 22, 2019 5:49 am

Re: Unarchiving gargoyle_1.14.0-x86-64-generic-ext4-combined.img.gz

Post by rockyd »

I think I have the mechanics of it working.

Problem I have is

. /usr/lib/gargoyle/openvpn.sh && generate_crl

doesn't work on Gargoyle 1.14

Google AI suggestion of

/usr/lib/gargoyle/openvpn.sh generate_crl

appears to work (completes without showing any errors). But doesn't change any dates when checking with

openssl crl -inform PEM -in /etc/openvpn/crl.pem -text -noout | grep "Update"

I tried

. /usr/lib/gargoyle/openvpn.sh && generate_crl

on 1.15

and that does seem to work, need to find the 1.15 version of
gargoyle_1.14.0-x86-64-generic-ext4-combined.img.gz and see if the modified openvpn.sh will work there.

rockyd
Posts: 147
Joined: Tue Oct 22, 2019 5:49 am

Re: Unarchiving gargoyle_1.14.0-x86-64-generic-ext4-combined.img.gz

Post by rockyd »

LOL Why would I think, it would work in 1.15

Using the 1.14 modified openvpn.sh in 1.15 cause the OpenVPN page to not even load.

Back to square one.

rockyd
Posts: 147
Joined: Tue Oct 22, 2019 5:49 am

Re: Unarchiving gargoyle_1.14.0-x86-64-generic-ext4-combined.img.gz

Post by rockyd »

Ok no idea what happened, when i copied the file across.

But I edited openvpn.sh in www folder and added the bits I needed from the file I had just tried copying across.

I clicked the new button and checked for a date time change on the crl file and it changed. So it did something.

openssl crl -inform PEM -in /etc/openvpn/crl.pem -text -noout | grep "Update"

doesn't work in 1.15 so can't check the actual expiry date.

but
ls -l /etc/openvpn/crl.pem

shows a time change. Which was not happening on 1.14.

Lantis
Moderator
Posts: 7335
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia
Contact:

Re: Unarchiving gargoyle_1.14.0-x86-64-generic-ext4-combined.img.gz

Post by Lantis »

Probably does not work as we install mbedtls, not openssl.
The CRL isn't private or special, I'd probably just throw it into an online CRL decoder to verify quickly.

It's on my todo list to improve mbedtls-clu to decode CRLs, which is the missing piece in my mind to doing a full UI implementation (i.e. show me the expiry date and then I can choose to renew it).
https://lantisproject.com/downloads/gargoylebuilds for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.
https://lantisproject.com/blog

rockyd
Posts: 147
Joined: Tue Oct 22, 2019 5:49 am

Re: Unarchiving gargoyle_1.14.0-x86-64-generic-ext4-combined.img.gz

Post by rockyd »

Lantis wrote:
Sun Jul 05, 2026 8:05 am
The CRL isn't private or special, I'd probably just throw it into an online CRL decoder to verify quickly.
Thanks for that, didn't know about CRL decoders, I pasted the CRL into a decoder and it seems it works.


This is my modified Openvpn.sh

Code: Select all

#!/usr/bin/haserl
<%
	# This program is copyright © 2008-2013 Eric Bishop and is distributed under the terms of the GNU GPL
	# version 2.0 with a special clarification/exception that permits adapting the program to
	# configure proprietary "back end" software provided that all modifications to the web interface
	# itself remain covered by the GPL.
	# See http://gargoyle-router.com/faq.html#qfoss for more information
	eval $( gargoyle_session_validator -c "$COOKIE_hash" -e "$COOKIE_exp" -a "$HTTP_USER_AGENT" -i "$REMOTE_ADDR" -r "login.sh" -t $(uci get gargoyle.global.session_timeout) -b "$COOKIE_browser_time"  )
	gargoyle_header_footer -h -s "connection" -p "openvpn" -j "openvpn.js table.js" -z "openvpn.js" -i openvpn_gargoyle ddns_gargoyle uhttpd dropbear firewall tor gargoyle
%>

<%
# --- START OF YOUR CUSTOM RESTART LOOP ---
if [ "$POST_action" = "renew_crl_and_restart" ] ; then
    echo "Content-type: text/plain"
    echo ""

    # 1. Source the core library function strings into memory
    . /usr/lib/gargoyle/openvpn.sh > /dev/null 2>&1

    # 2. FORCE SYSTEM VARIABLES TO INITIALISE
    # This loads Gargoyle's native pathing variables so 'generate_openvpn_crl' 
    # knows exactly where your keys, configurations, and certificates are stored.
    if [ -f "/lib/config/uci.sh" ] ; then
        . /lib/config/uci.sh
        uci_load openvpn
    fi

    # 3. Trigger the true internal generation engine with the server context
    . /usr/lib/gargoyle/openvpn.sh && generate_crl > /dev/null 2>&1

    # 4. Detach the service restart so it doesn't break the web channel mid-transit
    (sleep 1; /etc/init.d/openvpn restart) > /dev/null 2>&1 &

    echo "SUCCESS"
    exit
fi
# --- END OF YOUR CUSTOM RESTART LOOP ---
%>



<script>
<%

	if [ -e /etc/openvpn/dh.pem ] ; then
		echo "var haveDh = true;"
	else
		echo "var haveDh = false;"
	fi

	client_id=$(uci get openvpn_gargoyle.@client[0].id 2>/dev/null)
	echo "var curClientConf =[]; var curClientCa = []; var curClientCert =[]; var curClientKey = []; var curClientTaKey = []; var curClientSecret = [];"
	if [ -n "$client_id" ] ; then
		if [ -f "/etc/openvpn/${client_id}.conf" ] ; then
			awk '{ gsub(/[\r\n]+$/, "") ; gsub(/\"/, "\\\"") ; print "curClientConf.push(\""$0"\")"}' "/etc/openvpn/${client_id}.conf"      2>/dev/null
		fi
		if [ -f "/etc/openvpn/${client_id}_ca.crt" ] ; then
			awk '{ gsub(/[\r\n]+$/, "") ; gsub(/\"/, "\\\"") ; print "curClientCa.push(\""$0"\");"}'   "/etc/openvpn/${client_id}_ca.crt"   2>/dev/null
		fi
		if [ -f "/etc/openvpn/${client_id}.crt" ] ; then
			awk '{ gsub(/[\r\n]+$/, "") ; gsub(/\"/, "\\\"") ; print "curClientCert.push(\""$0"\");"}' "/etc/openvpn/${client_id}.crt"      2>/dev/null
		fi
		if [ -f "/etc/openvpn/${client_id}.key" ] ; then
			awk '{ gsub(/[\r\n]+$/, "") ; gsub(/\"/, "\\\"") ; print "curClientKey.push(\""$0"\");"}'  "/etc/openvpn/${client_id}.key"      2>/dev/null
		fi
		if [ -f "/etc/openvpn/${client_id}_ta.key" ] ; then
			awk '{ gsub(/[\r\n]+$/, "") }; {print "curClientTaKey.push(\""$0"\");"}'  "/etc/openvpn/${client_id}_ta.key"      2>/dev/null
		fi
		if [ -f "/etc/openvpn/${client_id}.secret" ] ; then
			awk '{ gsub(/[\r\n]+$/, "") }; {print "curClientSecret.push(\""$0"\");"}'  "/etc/openvpn/${client_id}.secret"      2>/dev/null
		fi
	fi

	echo "var tunIp=\""$(ifconfig tun0 2>/dev/null | awk ' { if ( $0 ~ /inet addr:/) { gsub(/^.*:/, "", $2) ; print $2 } }')"\";"
	echo "var openvpnProc=\""$(ps | grep openvpn | grep -v grep | grep -v haserl | awk ' { printf $1 }')"\";"

	tab=$(printf "\t")
	config_file=$(uci get openvpn.custom_config.config 2>/dev/null)
	remote_ping=""
	if [ -f "$config_file" ] ; then
		remote=$(egrep "^[$tab ]*remote[$tab ]" "$config_file" | awk ' { print $2 }')
		if [ -n "$remote" ] ;then
			remote_ping=$(ping -c 1 -W 2 8.8.8.8 2>/dev/null | grep "0% packet loss")
		fi
	fi
	echo "var remotePing=\"$remote_ping\";"

%>

	var uci = uciOriginal.clone();
</script>

<h1 class="page-header">OpenVPN</h1>
<div class="row">
	<div id="openvpn_config_fieldset" class="col-lg-6">
		<div class="panel panel-default">
			<div class="panel-heading">
				<h3 class="panel-title"><%~ openvpn.OCfg %></h3>
			</div>

			<div class="panel-body">
				<div id="openvpn_config_container" class="row form-group">
					<label class="col-xs-5" for='openvpn_config' id='openvpn_config_label'><%~ OCfg %>:</label>
					<span class="col-xs-7">
						<select class="form-control" id='openvpn_config' onchange='setOpenvpnVisibility()'>
							<option value='disabled'><%~ ODis %></option>
							<option value='client'><%~ OClt %></option>
							<option value='server'><%~ OSrv %></option>
						</select>
					</span>
				</div>

				<div class="row form-group" id='openvpn_config_status_container' style="display:none">
					<span class="col-xs-5"><%~ OSts %>:</span>
					<span class="col-xs-7" id='openvpn_config_status'></span>
				</div>

				<div class="row form-group" id='openvpn_clear_keys_container' style='display:none'>
					<span class="col-xs-12"><button id='openvpn_clear_keys_button' class='btn btn-default' onclick='clearOpenvpnKeys()'><%~ OClrK %></button></span>
				</div>
			</div>
		</div>
	</div>
</div>

<div class="row">
	<div id="openvpn_server_fieldset" class="col-lg-6">
		<div class="panel panel-default">
			<div class="panel-heading">
				<h3 class="panel-title"><%~ OSCfg %></h3>
			</div>

			<div class="panel-body">
				<div id="openvpn_server_ip_container" class="row form-group">
					<label class="col-xs-5" for='openvpn_server_ip' id='openvpn_server_ip_label'><%~ OInIP %>:</label>
					<span class="col-xs-7"><input type='text' class="form-control" name='openvpn_server_ip' id='openvpn_server_ip' oninput='proofreadIp(this)' size='20' maxlength='15' /></span>
				</div>

				<div id="openvpn_server_mask_container" class="row form-group">
					<label class="col-xs-5" for='openvpn_server_mask' id='openvpn_server_mask_label'><%~ OIMsk %>:</label>
					<span class="col-xs-7"><input type='text' class="form-control" name='openvpn_server_mask' id='openvpn_server_mask' oninput='proofreadMask(this)' size='20' maxlength='15' /></span>
				</div>

				<div id="openvpn_server_port_container" class="row form-group">
					<label class="col-xs-5" for='openvpn_server_port' id='openvpn_server_port_label'><%~ OPrt %>:</label>
					<span class="col-xs-7"><input type='text' class="form-control"  id='openvpn_server_port'  size='20' maxlength='5' oninput='proofreadPort(this)'/><br/></span>
				</div>

				<div id="openvpn_server_protocol_container" class="row form-group">
					<label class="col-xs-5" for='openvpn_server_protocol' id='openvpn_server_protocol_label'><%~ OProto %>:</label>
					<span class="col-xs-7">
						<select class="form-control" id='openvpn_server_protocol'>
							<option value='udp'>UDP</option>
							<option value='tcp'>TCP</option>
						</select>
					</span>
				</div>

				<div id="openvpn_server_cipher_container" class="row form-group">
					<label class="col-xs-5" for='openvpn_server_cipher' id='openvpn_server_cipher_label'><%~ OCiph %>:</label>
					<span class="col-xs-7">
						<input type="checkbox" id="openvpn_server_cipher_1" value="CHACHA20-POLY1305">
						<label for="openvpn_server_cipher_1" id="openvpn_server_cipher_1_label">Chacha20-Poly1305</label>
					</span>
					<span class="col-xs-7 col-xs-offset-5">
						<input type="checkbox" id="openvpn_server_cipher_2" value="AES-256-GCM">
						<label for="openvpn_server_cipher_2" id="openvpn_server_cipher_2_label">AES-GCM 256bit</label>
					</span>
					<span class="col-xs-7 col-xs-offset-5">
						<input type="checkbox" id="openvpn_server_cipher_3" value="AES-128-GCM">
						<label for="openvpn_server_cipher_3" id="openvpn_server_cipher_3_label">AES-GCM 128bit</label>
					</span>
					<span class="col-xs-7 col-xs-offset-5">
						<input type="checkbox" id="openvpn_server_cipher_4" value="AES-256-CBC">
						<label for="openvpn_server_cipher_4" id="openvpn_server_cipher_4_label">AES-CBC 256bit</label>
					</span>
					<span class="col-xs-7 col-xs-offset-5">
						<input type="checkbox" id="openvpn_server_cipher_5" value="AES-128-CBC">
						<label for="openvpn_server_cipher_5" id="openvpn_server_cipher_5_label">AES-CBC 128bit</label>
					</span>
				</div>

				<div id="openvpn_server_client_to_client_container" class="row form-group">
					<label class="col-xs-5" for='openvpn_server_client_to_client' id='openvpn_server_client_to_client_label'><%~ CCTr %>:</label>
					<span class="col-xs-7">
						<select class="form-control" id='openvpn_server_client_to_client'>
							<option value='true'><%~ CtoC %></option>
							<option value='false'><%~ CtoS %></option>
						</select>
					</span>
				</div>

				<div id="openvpn_server_subnet_access_container" class="row form-group">
					<label class="col-xs-5" for='openvpn_server_subnet_access' id='openvpn_server_subnet_access_label'><%~ LSAc %>:</label>
					<span class="col-xs-7">
						<select class="form-control" id='openvpn_server_subnet_access' onchange='setOpenvpnVisibility()'>
							<option value='true'><%~ CtoH %></option>
							<option value='false'><%~ CnoL %></option>
						</select>
					</span>
				</div>

				<div id='openvpn_server_extra_subnet_container' class="row form-group">
					<label class="col-xs-offset-5 col-xs-7" id="openvpn_server_extra_subnet_add_label" style="text-decoration:underline"><p><%~ SASnetAdd %>:</p></label>
					<div class="row form-group">
						<div class="col-xs-offset-5 col-xs-7">
							<button id='openvpn_server_extra_subnet_add' class='btn btn-default btn-add' onclick='addOvpnServerExtraSubnetsModal()'><%~ Add %></button>
						</div>
					</div>

					<div class='col-xs-offset-5 col-xs-7'>
						<div id="openvpn_server_extra_subnets_table_container" class="table table-responsive"></div>
					</div>
					<div class='col-xs-offset-5 col-xs-7'><em><%~ SASnetHlp %></em></div>
				</div>

				<div id="openvpn_server_duplicate_cn_container" class="row form-group">
					<label class="col-xs-5" for='openvpn_server_duplicate_cn' id='openvpn_server_duplicate_cn_label'><%~ CredR %>:</label>
					<span class="col-xs-7">
						<select class="form-control" id='openvpn_server_duplicate_cn' onchange='updateDupeCn()'>
							<option value='false'><%~ CredSC %></option>
							<option value='true'><%~ CredMC %></option>
						</select>
					</span>
				</div>

				<div id="openvpn_server_redirect_gateway_container" class="row form-group">
					<label class="col-xs-5" for='openvpn_server_redirect_gateway' id='openvpn_server_redirect_gateway_label'><%~ CUse %>:</label>
					<span class="col-xs-7">
						<select class="form-control" id='openvpn_server_redirect_gateway'>
							<option value='true'><%~ ATrff %></option>
							<option value='false'><%~ HTrff %></option>
						</select>
					</span>
				</div>
			</div>
		</div>
	</div>

	<div id="openvpn_allowed_client_fieldset" class="col-lg-6">
		<div class="panel panel-default">
			<div class="panel-heading">
				<h3 class="panel-title"><%~ OSAC %></h3>
			</div>

			<div class="panel-body">
				<label class="col-xs-12" id="openvpn_allowed_client_add_label" style="text-decoration:underline"><p><%~ CfgCred %>:</p></label>

				<div class="row form-group">
					<div class="col-xs-12">
						<button id='openvpn_allowed_client_add' class='btn btn-default btn-add' onclick='addOvpnClientModal()'><%~ Add %></button>
						<button id='openvpn_crl_renew' class='btn btn-primary' onclick='runCrlAndRestartOpenVpn()' style='margin-left: 10px;'><%~ Renew CRL %></button>

					</div>
				</div>

				<div class='internal_divider'></div>

				<label class="col-xs-12" id="openvpn_allowed_client_table_label" style="text-decoration:underline"><p><%~ CClnt %>:</p></label>

				<div id="openvpn_allowed_client_table_container" class="table table-responsive"></div>

				<div><em><%~ ZipCred %></em></div>
			</div>
		</div>
	</div>
</div>

<div class="row">
	<div id="openvpn_client_fieldset" class="col-lg-6">
		<div class="panel panel-default">
			<div class="panel-heading">
				<h3 class="panel-title"><%~ OClt %></h3>
			</div>

			<div class="panel-body">
				<form id='openvpn_client_form' enctype="multipart/form-data" method="post" action="utility/openvpn_upload_client.sh" target="client_add_target">
					<div class="row form-group">
						<span class="col-xs-12">
							<input type="radio" id="openvpn_client_config_upload" name="client_config_mode" onclick="setClientVisibility(document)" />
							<label for="openvpn_client_config_upload"><%~ UpCfgF %></label>
						</span>
					</div>
					<div class="row form-group">
						<span class="col-xs-12">
							<input type="radio" id="openvpn_client_config_manual" name="client_config_mode" onclick="setClientVisibility(document)" />
							<label for="openvpn_client_config_manual"><%~ CfgMan %></label>
						</span>
					</div>

					<div id="openvpn_client_file_controls">
						<div id="openvpn_client_file_type_container" class="row form-group">
							<label class="col-xs-5" id="openvpn_client_file_type_label" for="openvpn_client_file_type"><%~ UpFmt %>:</label>
							<span class="col-xs-7">
								<select id="openvpn_client_file_type" class="form-control" onchange="setClientVisibility(document)">
									<option value="zip"><%~ SZipF %></option>
									<option value="multi"><%~ CfgF %></option>
									<option value="single"><%~ CfgFOvpn %></option>
								</select>
							</span>
						</div>
						<div id="openvpn_client_zip_file_container" class="row form-group">
							<label class="col-xs-5" id="openvpn_client_zip_file_label" for="openvpn_client_zip_file"><%~ ZipF %>:</label>
							<span class="col-xs-7"><input type="file" id="openvpn_client_zip_file" name="openvpn_client_zip_file" /></span>
						</div>

						<div id="openvpn_client_conf_file_container" class="row form-group">
							<label class="col-xs-5" id="openvpn_client_conf_file_label" for="openvpn_client_conf_file"><%~ OCfgF %>:</label>
							<span class="col-xs-7"><input type="file" id="openvpn_client_conf_file" name="openvpn_client_conf_file" /></span>
						</div>

						<div id="openvpn_client_ca_file_container" class="row form-group">
							<label class="col-xs-5" id="openvpn_client_ca_file_label" for="openvpn_client_ca_file"><%~ CACF %>:</label>
							<span class="col-xs-7"><input type="file" id="openvpn_client_ca_file" name="openvpn_client_ca_file" /></span>
						</div>
						<div id="openvpn_client_cert_file_container" class="row form-group">
							<label class="col-xs-5" id="openvpn_client_cert_file_label" for="openvpn_client_cert_file"><%~ CCertF %>:</label>
							<span class="col-xs-7"><input type="file" id="openvpn_client_cert_file" name="openvpn_client_cert_file" /></span>
						</div>
						<div id="openvpn_client_key_file_container" class="row form-group">
							<label class="col-xs-5" id="openvpn_client_key_file_label" for="openvpn_client_key_file"><%~ CKeyF %>:</label>
							<span class="col-xs-7"><input type="file" id="openvpn_client_key_file" name="openvpn_client_key_file" /></span>
						</div>
						<div id="openvpn_client_ta_key_file_container">
							<div class="row form-group">
								<span class="col-xs-12">
									<input type='checkbox' id='openvpn_client_use_ta_key_file' name='use_ta_key_file' onclick='enableAssociatedField(this, "openvpn_client_ta_key_file", "")' />
									<label id='openvpn_client_use_ta_key_file_label' for='openvpn_client_use_ta_key_file'><%~ UseTAK %></label>
								</span>
							</div>
							<div class="row form-group">
								<label class="col-xs-5" id="openvpn_client_ta_key_file_label" for="openvpn_client_use_ta_key_file"><%~ TAKeyF %>:</label>
								<span class="col-xs-7"><input type="file" id="openvpn_client_ta_key_file" name="openvpn_client_ta_key_file" /></span>
							</div>
						</div>

						<div id="openvpn_client_auth_user_pass_container">
							<div class="row form-group">
								<span class="col-xs-12">
									<input type='checkbox' id='openvpn_client_use_auth_user_pass' name='use_auth_user_pass' onclick='enableAssociatedField(this, "openvpn_client_auth_user_pass_user", "");enableAssociatedField(this, "openvpn_client_auth_user_pass_pass","");' />
									<label id='openvpn_client_use_auth_user_pass_label' for='openvpn_client_use_auth_user_pass'><%~ UseAUP %></label>
								</span>
							</div>
							<div class="row form-group">
								<label class="col-xs-5" id="openvpn_client_auth_user_pass_user_label" for="openvpn_client_auth_user_pass_user"><%~ AUPUser %>:</label>
								<span class="col-xs-7"><input type="text" id="openvpn_client_auth_user_pass_user" name="openvpn_client_auth_user_pass_user" class="form-control" /></span>
							</div>
							<div class="row form-group">
								<label class="col-xs-5" id="openvpn_client_auth_user_pass_pass_label" for="openvpn_client_auth_user_pass_pass"><%~ AUPPass %>:</label>
								<span class="col-xs-7">
									<input type="password" id="openvpn_client_auth_user_pass_pass" name="openvpn_client_auth_user_pass_pass" class="form-control" autocomplete="off" />
									<input type="checkbox" id="show_pass" onclick="togglePass('openvpn_client_auth_user_pass_pass')" autocomplete="off">
									<label for="show_pass" id="show_pass_label"><%~ rvel %></label>
								</span>
							</div>
						</div>
					</div>

					<div id="openvpn_client_manual_controls">
						<div id='openvpn_client_remote_container' class="row form-group">
							<label class="col-xs-5" for='openvpn_client_remote' id='openvpn_client_remote_label'><%~ OSrvAddr %>:</label>
							<span class="col-xs-7"><input type='text' class="form-control" name='openvpn_client_remote' oninput="updateClientConfigTextFromControls()" id='openvpn_client_remote' size='30' /></span>
						</div>

						<div id='openvpn_client_port_container' class="row form-group">
							<label class="col-xs-5" for='openvpn_client_port' id='openvpn_client_port_label'><%~ OSrvPrt %>:</label>
							<span class="col-xs-7"><input type='text' class="form-control" name='openvpn_client_port' oninput="updateClientConfigTextFromControls();proofreadPort(this);" id='openvpn_client_port' size='30' /></span>
						</div>

						<div id='openvpn_client_protocol_container' class="row form-group">
							<label class="col-xs-5" for='openvpn_client_protocol' id='openvpn_client_protocol_label'><%~ OProto %>:</label>
							<span class="col-xs-7">
								<select class="form-control" onchange="updateClientConfigTextFromControls()" id='openvpn_client_protocol'>
									<option value='udp'>UDP</option>
									<option value='tcp'>TCP</option>
								</select>
							</span>
						</div>

						<div id='openvpn_client_cipher_container' class='row form-group'>
							<label class="col-xs-5" for='openvpn_client_cipher' id='openvpn_client_cipher_label'><%~ OCiph %>:</label>
							<span class="col-xs-7">
								<input type="checkbox" id="openvpn_client_cipher_1" value="CHACHA20-POLY1305" onchange="setClientVisibility(document);updateClientConfigTextFromControls();">
								<label for="openvpn_client_cipher_1" id="openvpn_client_cipher_1_label">Chacha20-Poly1305</label>
							</span>
							<span class="col-xs-7 col-xs-offset-5">
								<input type="checkbox" id="openvpn_client_cipher_2" value="AES-256-GCM" onchange="setClientVisibility(document);updateClientConfigTextFromControls();">
								<label for="openvpn_client_cipher_2" id="openvpn_client_cipher_2_label">AES-GCM 256bit</label>
							</span>
							<span class="col-xs-7 col-xs-offset-5">
								<input type="checkbox" id="openvpn_client_cipher_3" value="AES-128-GCM" onchange="setClientVisibility(document);updateClientConfigTextFromControls();">
								<label for="openvpn_client_cipher_3" id="openvpn_client_cipher_3_label">AES-GCM 128bit</label>
							</span>
							<span class="col-xs-7 col-xs-offset-5">
								<input type="checkbox" id="openvpn_client_cipher_4" value="AES-256-CBC" onchange="setClientVisibility(document);updateClientConfigTextFromControls();">
								<label for="openvpn_client_cipher_4" id="openvpn_client_cipher_4_label">AES-CBC 256bit</label>
							</span>
							<span class="col-xs-7 col-xs-offset-5">
								<input type="checkbox" id="openvpn_client_cipher_5" value="AES-128-CBC" onchange="setClientVisibility(document);updateClientConfigTextFromControls();">
								<label for="openvpn_client_cipher_5" id="openvpn_client_cipher_5_label">AES-CBC 128bit</label>
							</span>
						</div>

						<div id='openvpn_client_block_nonovpn_container' class="row form-group">
							<label class="col-xs-5" for='openvpn_client_block_nonovpn' id='openvpn_client_block_nonovpn_label'><%~ NOVPNT %>:</label>
							<span class="col-xs-7">
								<select class="form-control" id='openvpn_client_block_nonovpn' >
									<option value='allow'><%~ AllowNOVPNT %></option>
									<option value='block'><%~ BlockNOVPNT %></option>
								</select>
							</span>
							<span class="col-xs-12"><em><%~ DescNOVPNT %></em></span>
						</div>

						<div id="openvpn_client_conf_text_container" class="row form-group">
							<br/>
							<label class="col-xs-12" for='openvpn_client_conf_text' id='openvpn_client_conf_text_label' style="text-decoration:underline"><%~ OCfg %>:</label>
							<br/>
							<span class="col-xs-12"><em><%~ CfgUpd %></em></span>
							<br/>
							<span class="col-xs-7 col-xs-offset-5"><textarea class="form-control textarea-lg" id='openvpn_client_conf_text' name='openvpn_client_conf_text' oninput='updateClientControlsFromConfigText()'></textarea></span>
						</div>

						<div id="openvpn_client_ca_text_container" class="row form-group">
							<label class="col-xs-5" for='openvpn_client_ca_text' id='openvpn_client_ca_text_label'><%~ CACert %>:</label>
							<br/>
							<span class="col-xs-7"><textarea class="form-control textarea-lg" id='openvpn_client_ca_text' name='openvpn_client_ca_text' oninput='updateClientControlsFromConfigText()'></textarea></span>
						</div>
						<div id="openvpn_client_cert_text_container" class="row form-group">
							<label class="col-xs-5" for='openvpn_client_cert_text' id='openvpn_client_cert_text_label'><%~ CCert %>:</label>
							<br/>
							<span class="col-xs-7"><textarea class="form-control textarea-lg" id='openvpn_client_cert_text' name='openvpn_client_cert_text' oninput='updateClientControlsFromConfigText()'></textarea></span>
						</div>
						<div id="openvpn_client_key_text_container" class="row form-group">
							<label class="col-xs-5" for='openvpn_client_key_text' id='openvpn_client_key_text_label'><%~ CKey %>:</label>
							<br/>
							<span class="col-xs-7"><textarea class="form-control textarea-lg" id='openvpn_client_key_text' name='openvpn_client_key_text' oninput='updateClientControlsFromConfigText()'></textarea></span>
						</div>

						<div id="openvpn_client_ta_key_text_container">
							<div class="row form-group">
								<span class="col-xs-12">
									<input type='checkbox' id='openvpn_client_use_ta_key_text' name='use_ta_key_text' onclick='enableAssociatedField(this, "openvpn_client_ta_key_text", "");enableAssociatedField(this, "openvpn_client_ta_direction", "1");updateClientConfigTextFromControls()' />
									<label id='openvpn_client_use_ta_key_text_label' for='openvpn_client_use_ta_key_text'><%~ UseTAK %></label>
								</span>
							</div>
							<div class="row form-group">
								<label class="col-xs-5" for="openvpn_client_ta_direction"><%~ TADir %>:</label>
								<span class="col-xs-7">
									<select class="form-control" id='openvpn_client_ta_direction' name="openvpn_client_ta_direction" onchange="updateClientConfigTextFromControls()">
										<option value="1">1 (<%~ Clnt %>)</option>
										<option value="omitted"><%~ Symm %></option>
									</select>
								</span>
							</div>
							<div class="row form-group">
								<label class="col-xs-12" id="openvpn_client_ta_key_text_label" for="openvpn_client_use_ta_key_text"><%~ TAKey %>:</label>
								<span class="col-xs-7 col-xs-offset-5"><textarea class="form-control textarea-lg" id="openvpn_client_ta_key_text" name="openvpn_client_ta_key_text"></textarea></span>
							</div>
						</div>
						
						<div id="openvpn_client_auth_user_pass_text_container">
							<div class="row form-group">
								<span class="col-xs-12">
									<input type='checkbox' id='openvpn_client_use_auth_user_pass_text' name='use_auth_user_pass_text' onclick='enableAssociatedField(this, "openvpn_client_auth_user_pass_text_user", "");enableAssociatedField(this, "openvpn_client_auth_user_pass_text_pass","");' />
									<label id='openvpn_client_use_auth_user_pass_text_label' for='openvpn_client_use_auth_user_pass_text'><%~ UseAUP %></label>
								</span>
							</div>
							<div class="row form-group">
								<label class="col-xs-5" id="openvpn_client_auth_user_pass_text_user_label" for="openvpn_client_auth_user_pass_text_user"><%~ AUPUser %>:</label>
								<span class="col-xs-7"><input type="text" id="openvpn_client_auth_user_pass_text_user" name="openvpn_client_auth_user_pass_text_user" class="form-control" /></span>
							</div>
							<div class="row form-group">
								<label class="col-xs-5" id="openvpn_client_auth_user_pass_text_pass_label" for="openvpn_client_auth_user_pass_text_pass"><%~ AUPPass %>:</label>
								<span class="col-xs-7">
									<input type="password" id="openvpn_client_auth_user_pass_text_pass" name="openvpn_client_auth_user_pass_text_pass" class="form-control" autocomplete="off" />
									<input type="checkbox" id="show_text_pass" onclick="togglePass('openvpn_client_auth_user_pass_text_pass')" autocomplete="off">
									<label for="show_text_pass" id="show_text_pass_label"><%~ rvel %></label>
								</span>
							</div>
						</div>
					</div>

					<input style="display:none" type="hidden" id="net_mismatch_action" name="net_mismatch_action" value="query"></input>
					<input style="display:none" type="hidden" id="openvpn_client_commands" name="commands"></input>
					<input style="display:none" type="hidden" id="openvpn_client_hash" name="hash"></input>
				</form>

				<iframe id="client_add_target" name="client_add_target" src="#" style="display:none"></iframe>
			</div>
		</div>
	</div>
</div>

<div id="bottom_button_container" class="panel panel-default">
	<button id="save_button" class="btn btn-primary btn-lg" onclick="saveChanges()"><%~ SaveChanges %></button>
	<button id="reset_button" class="btn btn-warning btn-lg" onclick="resetData()"><%~ Reset %></button>
</div>

<div class="modal fade" tabindex="-1" role="dialog" id="openvpn_allowed_client_modal" aria-hidden="true" aria-labelledby="openvpn_allowed_client_modal_title">
	<div class="modal-dialog" role="document">
		<div class="modal-content">
			<div class="modal-header">
				<h3 id="openvpn_allowed_client_modal_title" class="panel-title"><%~ CfgCred %></h3>
			</div>
			<div class="modal-body">
				<%in templates/openvpn_allowed_client_template %>
			</div>
			<div class="modal-footer" id="openvpn_allowed_client_modal_button_container">
			</div>
		</div>
	</div>
</div>

<div class="modal fade" tabindex="-1" role="dialog" id="openvpn_server_extra_subnet_modal" aria-hidden="true" aria-labelledby="openvpn_server_extra_subnet_modal_title">
	<div class="modal-dialog" role="document">
		<div class="modal-content">
			<div class="modal-header">
				<h3 id="openvpn_server_extra_subnet_modal_title" class="panel-title"><%~ SASnetAdd %></h3>
			</div>
			<div class="modal-body">
				<%in templates/openvpn_additional_route_template %>
			</div>
			<div class="modal-footer" id="openvpn_server_extra_subnet_modal_button_container">
			</div>
		</div>
	</div>
</div>


<script>
	resetData()
</script>

<!-- Self-Contained Local Async Execution Script -->
<script>
function runCrlAndRestartOpenVpn() {
    var btn = document.getElementById("openvpn_crl_renew");
    var oldText = btn.innerHTML;
    
    btn.disabled = true;
    btn.innerHTML = "Processing...";
    
    var ajaxRequest = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP");
    
    ajaxRequest.onreadystatechange = function() {
        if (ajaxRequest.readyState == 4) {
            // Trim the response and look for SUCCESS
            if (ajaxRequest.status == 200 && ajaxRequest.responseText.trim().indexOf("SUCCESS") !== -1) {
                alert("OpenVPN CRL successfully regenerated and service restarted!");
            } else {
                alert("An error occurred while executing the script.");
            }
            btn.disabled = false;
            btn.innerHTML = oldText;
        }
    };
    
    // Post to the current page to preserve the authentication cookie
    ajaxRequest.open("POST", window.location.href, true);
    ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    
    // Trigger the engine action
    ajaxRequest.send("action=renew_crl_and_restart");
}

</script>


<%
	gargoyle_header_footer -f -s "connection" -p "openvpn"
%>


Post Reply