Skip to content
Snippets Groups Projects
Unverified Commit 37102f1e authored by Massimiliano Adamo's avatar Massimiliano Adamo
Browse files

use UPX

parent 5ca1ef67
No related branches found
No related tags found
No related merge requests found
...@@ -30,17 +30,17 @@ if [ $? -gt 0 ]; then ...@@ -30,17 +30,17 @@ if [ $? -gt 0 ]; then
fi fi
echo "" echo ""
#while true; do while true; do
# read -p "Do you wish to run upx against ${BIN_NAME}? (y/n) " yn read -p "Do you wish to run upx against ${BIN_NAME}? (y/n) " yn
# case $yn in case $yn in
# [Yy]*) [Yy]*)
# echo "" echo ""
# run_upx run_upx
# break break
# ;; ;;
# [Nn]*) break ;; [Nn]*) break ;;
# *) echo "Please answer yes or no." ;; *) echo "Please answer yes or no." ;;
# esac esac
#done done
echo -e "\nthe binary was compiled and it is avilable as:\n - ${GOPATH}/bin/${BIN_NAME}\n" echo -e "\nthe binary was compiled and it is avilable as:\n - ${GOPATH}/bin/${BIN_NAME}\n"
...@@ -29,6 +29,10 @@ var ( ...@@ -29,6 +29,10 @@ var (
GroupID int GroupID int
RedisBaseURL string RedisBaseURL string
VaultBaseURL string VaultBaseURL string
VaultURL string
RedisCertURL string
RedisCAURL string
RedisFullChainURL string
certificateDestination string certificateDestination string
fullchainDestination string fullchainDestination string
keyDestination string keyDestination string
...@@ -394,6 +398,7 @@ Options: ...@@ -394,6 +398,7 @@ Options:
--fullchain-destination=FULLCHAINDESTINATION Full Chain Destination[default: %v/<cert-name>_fullchain.crt] --fullchain-destination=FULLCHAINDESTINATION Full Chain Destination[default: %v/<cert-name>_fullchain.crt]
--key-destination=KEYDESTINATION Key Destination [default: %v/<cert-name>.key] --key-destination=KEYDESTINATION Key Destination [default: %v/<cert-name>.key]
--ca-destination=CADESTINATION CA Destination [default: %v/COMODO_<type>.crt] --ca-destination=CADESTINATION CA Destination [default: %v/COMODO_<type>.crt]
--wildcard The certificate is wildcard
`, CertBase, CertBase, KeyBase, CertBase) `, CertBase, CertBase, KeyBase, CertBase)
arguments, _ := docopt.Parse(usage, nil, true, appVersion, false) arguments, _ := docopt.Parse(usage, nil, true, appVersion, false)
...@@ -430,7 +435,7 @@ Options: ...@@ -430,7 +435,7 @@ Options:
VaultToken := arguments["--vault-token"].(string) VaultToken := arguments["--vault-token"].(string)
CertName := arguments["--cert-name"].(string) CertName := arguments["--cert-name"].(string)
CertNameUndercored := strings.Replace(CertName, ".", "_", -1) CertNameUnderscored := strings.Replace(CertName, ".", "_", -1)
TeamName := arguments["--team-name"].(string) TeamName := arguments["--team-name"].(string)
RedisToken := arguments["--redis-token"].(string) RedisToken := arguments["--redis-token"].(string)
Type = arguments["--type"].(string) Type = arguments["--type"].(string)
...@@ -442,10 +447,17 @@ Options: ...@@ -442,10 +447,17 @@ Options:
} }
RedisBaseURL = "https://redis.geant.org/GET" RedisBaseURL = "https://redis.geant.org/GET"
VaultBaseURL = "https://vault.geant.org/v1" VaultBaseURL = "https://vault.geant.org/v1"
VaultURL := fmt.Sprintf("%v/%v/%v/vault_%v_key", VaultBaseURL, TeamName, CertName, CertNameUndercored) if arguments["--wildcard"] == true {
RedisCertURL := fmt.Sprintf("%v/%v:%v:redis_%v_pem.txt", RedisBaseURL, TeamName, CertName, CertNameUndercored) VaultURL = fmt.Sprintf("%v/%v/common/vault_sectigo_ov_wildcard_%v_key", VaultBaseURL, TeamName, CertNameUnderscored)
RedisCAURL := fmt.Sprintf("%v/%v:%v:redis_%v_chain_pem.txt", RedisBaseURL, TeamName, CertName, CertNameUndercored) RedisCertURL = fmt.Sprintf("%v/%v:common:redis_sectigo_ov_%v_pem.txt", RedisBaseURL, TeamName, CertNameUnderscored)
RedisFullChainURL := fmt.Sprintf("%v/%v:%v:redis_%v_fullchain_pem.txt", RedisBaseURL, TeamName, CertName, CertNameUndercored) RedisCAURL = fmt.Sprintf("%v/%v:common:redis_sectigo_ov_%v_chain_pem.txt", RedisBaseURL, TeamName, CertNameUnderscored)
RedisFullChainURL = fmt.Sprintf("%v/%v:common:redis_sectigo_ov_%v_fullchain_pem.txt", RedisBaseURL, TeamName, CertNameUnderscored)
} else {
VaultURL = fmt.Sprintf("%v/%v/%v/vault_%v_key", VaultBaseURL, TeamName, CertName, CertNameUnderscored)
RedisCertURL = fmt.Sprintf("%v/%v:%v:redis_%v_pem.txt", RedisBaseURL, TeamName, CertName, CertNameUnderscored)
RedisCAURL = fmt.Sprintf("%v/%v:%v:redis_%v_chain_pem.txt", RedisBaseURL, TeamName, CertName, CertNameUnderscored)
RedisFullChainURL = fmt.Sprintf("%v/%v:%v:redis_%v_fullchain_pem.txt", RedisBaseURL, TeamName, CertName, CertNameUnderscored)
}
if arguments["--cert-destination"] == fmt.Sprintf(filepath.Join(CertBase, "<cert-name>.crt")) { if arguments["--cert-destination"] == fmt.Sprintf(filepath.Join(CertBase, "<cert-name>.crt")) {
certificateDestination = fmt.Sprintf(filepath.Join(CertBase, fmt.Sprintf("%v.crt", CertName))) certificateDestination = fmt.Sprintf(filepath.Join(CertBase, fmt.Sprintf("%v.crt", CertName)))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment