mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-08-05 15:35:40 +08:00
Revert "Add .git-crypt and .venv to the blacklist"
This reverts commitf51a6f54Revert "Add git-crypt unlock attempt in provision script" This reverts commitf4dac4b4Revert "ci: git-crypt: Decrypt prior to building" This reverts commitfaf52492b6. Revert "git-crypt: add collaborators" This reverts commitbc1aad6f6a.
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
# Do not edit this file. To specify the files to encrypt, create your own
|
||||
# .gitattributes file in the directory where your files are.
|
||||
* !filter !diff
|
||||
*.gpg binary
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,110 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Check if gpg is installed
|
||||
if ! command -v gpg &> /dev/null; then
|
||||
echo "gpg could not be found. Please install gpg to continue."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if git-crypt is installed
|
||||
if ! command -v git-crypt &> /dev/null; then
|
||||
# Check if /TICI file exists
|
||||
if [ -f "/TICI" ]; then
|
||||
echo "/TICI file detected. Attempting to install git-crypt..."
|
||||
sudo apt update && sudo apt install git-crypt -y
|
||||
else
|
||||
echo "git-crypt could not be found. Please install git-crypt to continue."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Attempt to unlock with git-crypt
|
||||
if git-crypt unlock &> /dev/null; then
|
||||
echo "git-crypt unlock successful. You already have access."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
|
||||
no_prompt=0
|
||||
# Attempt to retrieve name and email from git config, default to "undefined"
|
||||
name=$(git config --get user.name)
|
||||
email=$(git config --get user.email)
|
||||
name=${name:-"undefined"}
|
||||
email=${email:-"undefined"}
|
||||
passphrase=""
|
||||
|
||||
# Function to display help message
|
||||
show_help() {
|
||||
echo "Usage: $0 [options]"
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo " --name <name> Set the user's name. Default is git config user.name or 'undefined'."
|
||||
echo " --email <email> Set the user's email. Default is git config user.email or 'undefined'."
|
||||
echo " --passphrase <passphrase> Set the passphrase for the GPG key."
|
||||
echo " --no-prompt Run without interactive prompts, using defaults or provided values."
|
||||
echo " -h, --help Display this help message and exit."
|
||||
echo ""
|
||||
exit 0
|
||||
}
|
||||
|
||||
# Check for help flag before parsing other arguments
|
||||
for arg in "$@"; do
|
||||
case $arg in
|
||||
-h|--help)
|
||||
show_help
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Parse named arguments
|
||||
while [[ "$#" -gt 0 ]]; do
|
||||
case $1 in
|
||||
--name) name="$2"; shift ;;
|
||||
--email) email="$2"; shift ;;
|
||||
--passphrase) passphrase="$2"; shift ;;
|
||||
--no-prompt) no_prompt=1 ;;
|
||||
*) echo "Unknown parameter passed: $1"; exit 1 ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
# No need to prompt for missing information if no-prompt is enabled or defaults are used
|
||||
|
||||
# Set protection line based on passphrase
|
||||
if [[ -z "$passphrase" ]]; then
|
||||
protection_line="%no-protection"
|
||||
else
|
||||
protection_line="Passphrase: $passphrase"
|
||||
fi
|
||||
|
||||
# Generate and process GPG key
|
||||
GPG_OUTPUT=$(echo "
|
||||
%echo Generating a basic OpenPGP key
|
||||
Key-Type: RSA
|
||||
Key-Length: 4096
|
||||
Subkey-Type: RSA
|
||||
Subkey-Length: 4096
|
||||
Name-Real: $name
|
||||
Name-Comment: Generated from git config or default
|
||||
Name-Email: $email
|
||||
Expire-Date: 0
|
||||
$protection_line
|
||||
%commit
|
||||
%echo done
|
||||
" | gpg --batch --generate-key - 2>&1)
|
||||
|
||||
# Extract and export the key ID
|
||||
KEY_ID=$(echo "$GPG_OUTPUT" | grep -o '[0-9A-F]\{40\}' | head -n 1)
|
||||
if [ -z "$KEY_ID" ]; then
|
||||
echo "Failed to generate GPG key or extract key ID."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
INSTALL_KEY_PATH=${DIR}/keys/install_new_key_sp
|
||||
mkdir -p ${INSTALL_KEY_PATH}
|
||||
gpg --export $KEY_ID > ${INSTALL_KEY_PATH}/$KEY_ID.gpg
|
||||
git add ${INSTALL_KEY_PATH}/$KEY_ID.gpg
|
||||
git commit -m "Add new public key to install."
|
||||
git push
|
||||
|
||||
echo "Public key exported to ${INSTALL_KEY_PATH}/${KEY_ID}.gpg"
|
||||
+1
-1
@@ -147,7 +147,7 @@ build:
|
||||
when: manual
|
||||
- if: $NEW_BRANCH
|
||||
when: always
|
||||
|
||||
|
||||
check no source code sent:
|
||||
image: alpine
|
||||
stage: sanity
|
||||
|
||||
@@ -88,8 +88,6 @@ sunnypilot_blacklist = [
|
||||
"codecov.yml",
|
||||
"conftest.py",
|
||||
"poetry.lock",
|
||||
".git-crypt/",
|
||||
".venv",
|
||||
]
|
||||
|
||||
# Merge the blacklists
|
||||
|
||||
Reference in New Issue
Block a user