Skip to content

Commit

Permalink
changed unauth https access method
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Koch committed Mar 21, 2024
1 parent 79bf61b commit 3417ce8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
16 changes: 8 additions & 8 deletions docs/06-demopage.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ Just fill out the following form to install your instance of Red Hat Ansible Aut
<!-- TAB 1 -->
<div class="formtab">
<h3>Access Token:</h3>
<p><input type="text" placeholder="Access Token&ast;" oninput="this.className = ''" name="token" required> </p>
<p><input type="text" placeholder="Access Token&ast;" oninput="this.className = ''" name="token" id="token" required> </p>
<h3>Name:</h3>
<p><input type="text" placeholder="Nickname*" oninput="this.className = ''" name="nickname" required> </p>
<p><input type="email" placeholder="Email*" oninput="this.className = ''" name="email" required></p>
<p><input type="text" placeholder="Nickname*" oninput="this.className = ''" name="nickname" id="nickname" required> </p>
<p><input type="email" placeholder="Email*" oninput="this.className = ''" name="email" id="email" required></p>
<h3>Cloud Provider*:</h3>
<p><select name="type" id="type" oninput="this.className = ''" >
<option value="azure">Microsoft Azure</option>
Expand Down Expand Up @@ -62,15 +62,15 @@ Just fill out the following form to install your instance of Red Hat Ansible Aut
</div>
<!-- TAB 5 -->
<div class="formtab">Enter Red Hat Subscription Credentials:
<p><input type="text" placeholder="RHSM Username" oninput="this.className=''" name="rhsm_username" id="rhsm_username" required></p>
<p><input type="text" placeholder="RHSM Password" oninput="this.className=''" name="rhsm_password" id="rhsm_password" required></p>
<p><input type="text" placeholder="RHSM PoolId" oninput="this.className=''" name="rhsm_poolid" id="rhsm_poolid" required></p>
<p><input type="text" placeholder="RHSM Username*" oninput="this.className=''" name="rhsm_username" id="rhsm_username" required></p>
<p><input type="text" placeholder="RHSM Password*" oninput="this.className=''" name="rhsm_password" id="rhsm_password" required></p>
<p><input type="text" placeholder="RHSM PoolId*" oninput="this.className=''" name="rhsm_poolid" id="rhsm_poolid" required></p>
</div>
<!-- TAB 6 -->
<div class="formtab">SSH Keypair Configuration
<p><label for="controller_ansible_private_key">SSH Private Key</label>
<p><label for="controller_ansible_private_key">SSH Private Key*</label>
<input type="file" oninput="this.className=''" name="controller_ansible_private_key" id="controller_ansible_private_key" required></p>
<p><label for="controller_ansible_public_key">SSH Public Key</label>
<p><label for="controller_ansible_public_key">SSH Public Key*</label>
<input type="file" oninput="this.className=''" name="controlle_ansible_public_key" id="controller_ansible_public_key" required></p>

</div>
Expand Down
14 changes: 10 additions & 4 deletions docs/_includes/js/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function nextPrev(n) {
if (currentTab >= x.length) {
// ... the form gets submitted:
//document.getElementById("regForm").submit()
currentTab = 0;
currentTab = 1;
submit_AAP();
}
// Otherwise, display the correct tab:
Expand All @@ -95,6 +95,7 @@ function validateForm() {
}
// add all values to the formdata object
formdata[y[i].id] = y[i].value;
console.log(y[i].id + " " + formdata[y[i].id]);
}
// If the valid status is true, mark the step as finished and valid:
if (valid) {
Expand Down Expand Up @@ -157,10 +158,14 @@ function submit_AAP() {
const data = {
"extra_vars": { formdata },
};

alert("Token " + apiKey);
// disable cert check
process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = 0;
const fetch = require('node-fetch');
const https = require('https');
const httpsAgent = new https.Agent({
rejectUnauthorized: false,
});
// The following only works in CLI
// process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = 0;

const requestOptions = {
method: 'POST',
Expand All @@ -169,6 +174,7 @@ function submit_AAP() {
'Content-Type': 'application/json',
},
body: JSON.stringify(data),
agent: httpsAgent,
};

fetch(apiUrl, requestOptions)
Expand Down

0 comments on commit 3417ce8

Please sign in to comment.