Skip to content

bugfix: initialize variables in edit methods and update repository settings #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,5 @@ dmypy.json
.DS_Store?
._*
.Spotlight-V100
.Trashes
.Trashes
/.idea
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Jamf Automation and Webhook Assistant ("JAWA") Version 3.1.0
# Jamf Automation and Webhook Assistant ("JAWA") Version 3.1.1

<p align="center"> <img src="https://github.com/jamf/JAWA/blob/master/static/img/jawa_icon.png" width="384"/> </p>
<p align="center"> <img src="https://github.com/jamf/JAWA/blob/main/static/img/jawa_icon.png" width="384"/> </p>


JAWA allows an IT Administrator to focus on providing the best end user experience through automation.
Expand Down Expand Up @@ -58,7 +58,7 @@ Refer to the "JAWA Administrators Guide" in the [current release](https://github
4. Download and run the JAWA installer:

```bash
curl -O https://raw.githubusercontent.com/jamf/JAWA/master/bin/installer.sh && sudo bash ./installer.sh
curl -O https://raw.githubusercontent.com/jamf/JAWA/main/bin/installer.sh && sudo bash ./installer.sh
```

5. After the installation is complete, go to your FQDN (e.g., https://jawa.company.com) in your web browser to continue with the web-based setup.
Expand All @@ -84,6 +84,10 @@ When scripting for webhooks, verify JSON structure sent from source:

Find JAWA releases [here.](https://github.com/jamf/JAWA/releases)

### JAWA v3.1.1 release
- Bugfix
- Resolved #49
- Repository Maintenance

### JAWA v3.1.0 release
- New features
Expand Down
6 changes: 3 additions & 3 deletions bin/installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ readme() {
| \`--' | / _____ \ \ /\ / / _____ \
\______/ /__/ \__\ \__/ \__/ /__/ \__\

v3.1.0
v3.1.1


Welcome to the Jamf Automation and Webhook Assistant, we hope it provides the solution you are looking for.
Expand Down Expand Up @@ -925,7 +925,7 @@ currentDir=$(pwd)
installDir=/usr/local
timenow=$(date +%m-%d-%y_%T)

#branch="master" # Default branch name if no arguments are provided
#branch="main" # Default branch name if no arguments are provided
while [[ $# -gt 0 ]]; do
key="$1"
Expand All @@ -945,7 +945,7 @@ done
# If no branch argument was provided, default to "develop"
if [ -z "$branch" ]; then
branch="master"
branch="main"
fi

Expand Down
2 changes: 1 addition & 1 deletion templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ <h1 class="d-flex justify-content-center">{% if app_name %}{{ app_name }}{% else
<input class="btn btn-jawa" type=submit value=Login>
</div>
</p>
<p class="text-center">Please read the <a href="https://github.com/jamf/jawa/blob/master/README.md"
<p class="text-center">Please read the <a href="https://github.com/jamf/jawa/blob/main/README.md"
target="_blank">documentation</a> prior to using JAWA!</p>

</form>
Expand Down
2 changes: 1 addition & 1 deletion templates/setup/setup.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<h1 class="d-flex justify-content-center">Server Setup</h1>

<label class="text-center justify-content-center">
Please read the <a href="https://github.com/jamf/JAWA/blob/master/README.md" style="color:#3c6aa7;"
Please read the <a href="https://github.com/jamf/JAWA/blob/main/README.md" style="color:#3c6aa7;"
target="_blank">documentation</a> prior to using JAWA.

</label>
Expand Down
2 changes: 1 addition & 1 deletion templates/shared/_layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
</div>
<div class="stat">
<div style="justify-content: right;">
<div class="text-sm-right ">v3.1.0
<div class="text-sm-right ">v3.1.1
</div>
</div>
</div>
Expand Down
4 changes: 4 additions & 0 deletions views/custom_webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ def edit_webhook():
if not check_for_name:
logthis.info(f"JAWA is not aware of any custom webhook named {name}")
return redirect(url_for('custom_webhook.custom_webhook'))

extra_notice = None
custom_header = None

if request.method == 'POST':
button_choice = request.form.get('button_choice')
if button_choice == 'Delete':
Expand Down
2 changes: 1 addition & 1 deletion views/home_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def login():
resp = requests.get(
session['url'] + '/JSSResource/activationcode',
headers={'Accept': 'application/json', "Authorization": f"Bearer {session.get('token')}",
'User-Agent': 'JAWA%20v3.1.0b'},
'User-Agent': 'JAWA%20v3.1.1'},
verify=verify_ssl)

resp.raise_for_status()
Expand Down
10 changes: 8 additions & 2 deletions views/jamf_webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def jamf_pro_new():
webhook_response = requests.post(full_url,
headers={'Content-Type': 'application/xml',
"Authorization": f"Bearer {session['token']}",
'User-Agent': 'JAWA%20v3.1.0b'}, data=data,
'User-Agent': 'JAWA%20v3.1.1'}, data=data,
verify=verify_ssl)
logthis.info(f"[{webhook_response.status_code}] {webhook_response.text}")
if webhook_response.status_code == 409:
Expand Down Expand Up @@ -306,6 +306,12 @@ def jamf_pro_edit():
if not check_for_name:
logthis.info(f"Webhook '{name}' not in json")
return redirect(url_for('jamf_pro_webhooks.jamf_webhook'))

extra_notice = None
custom_header = None
smart_group_notice = None
smart_group_instructions = None

webhook_info = [each_webhook for each_webhook in webhooks_json if each_webhook['name'] == name]
if request.method == 'POST':
button_choice = request.form.get('button_choice')
Expand Down Expand Up @@ -449,7 +455,7 @@ def jamf_pro_edit():
webhook_response = requests.put(full_url,
headers={'Content-Type': 'application/xml',
"Authorization": f"Bearer {session['token']}",
'User-Agent': 'JAWA%20v3.1.0b'}, data=data,
'User-Agent': 'JAWA%20v3.1.1'}, data=data,
verify=verify_ssl)
except:
error_message = f"The request could not be sent to your Jamf Pro server," \
Expand Down
2 changes: 1 addition & 1 deletion views/webhook_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def delete_webhook():
webhook_response = requests.put(full_url,
headers={'Content-Type': 'application/xml',
"Authorization": f"Bearer {session['token']}",
'User-Agent': 'JAWA%20v3.1.0b'},
'User-Agent': 'JAWA%20v3.1.1'},
data=data)
elif each_webhook['tag'] == 'okta':
try:
Expand Down