Skip to content
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

Check crave.conf.sample for tamper #46

Merged
merged 3 commits into from
Aug 2, 2024
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
6 changes: 6 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ jobs:
name: Prepare for Building
runs-on: ubuntu-latest
steps:
- name: Check-out to repository
uses: actions/checkout@v4

- name: Check Credentials
run: bash scripts/env-checker.sh

- name: Set Project variables
id: proj-variables
run: |
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/selfhosted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ jobs:
name: Prepare for Building
runs-on: ubuntu-latest
steps:
- name: Check-out to repository
uses: actions/checkout@v4

- name: Check Credentials
run: bash scripts/env-checker.sh

- name: Set Project variables
id: proj-variables
run: |
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/twrp-legacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ jobs:
name: Prepare for Building
runs-on: ubuntu-latest
steps:
- name: Check-out to repository
uses: actions/checkout@v4

- name: Check Credentials
run: bash scripts/env-checker.sh

- name: Display Run Parameters # Credit to azwhikaru for this part
run: |
echo "::group::User Environment Variables"
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/twrp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ jobs:
name: Prepare for Building
runs-on: ubuntu-latest
steps:
- name: Check-out to repository
uses: actions/checkout@v4

- name: Check Credentials
run: bash scripts/env-checker.sh

- name: Display Run Parameters # Credit to azwhikaru for this part
run: |
echo "::group::User Environment Variables"
Expand Down
35 changes: 35 additions & 0 deletions scripts/env-checker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

# Check if crave.conf.sample exists
if [ ! -f "crave.conf.sample" ]; then
echo "crave.conf.sample doesn't exist!"
exit 1
fi

# Check if file name is correct
if [ -f "crave.conf" ]; then
echo "Don't change crave.conf.sample! Exiting..."
exit 1
fi

# Check if username has been altered
if ! grep -q "\"username\": \"\${CRAVE_USERNAME}\"" "crave.conf.sample"; then
echo "Don't add your username to crave.conf, use github secrets! Exiting..."
exit 1
fi

# Check if Authorization has been altered
if ! grep -q "\"Authorization\": \"\${CRAVE_TOKEN}\"" "crave.conf.sample"; then
echo "Don't add your token to crave.conf, use github secrets! Exiting..."
exit 1
fi

# Check if server is set to devspace.crave.io
if grep -q "\"server\": \"https://devspace.crave.io/api\"" "crave.conf.sample"; then
echo "Devspace.crave.io is the public instance and does not support building android!"
echo "Get a foss.crave.io account. To know more, read the docs: https://opendroid.pugzarecute.com/wiki/Crave_Devspace#getting-a-fosscraveiohttpsfosscraveio-account"
echo "Exiting..."
exit 1
fi

echo "crave.conf looks okay! Continuing..."
Loading