Add license key gate, migrate marketing site to separate repo
- install.sh: prompt for license key as first step, validate against makeyourown.website/api/validate before any system changes - setup.sh: secondary key check (format-only if .license-key exists, server validation if missing) - Remove website/ directory — marketing site, keyserver, and deploy scripts migrated to the websites repo (git.constantprojects.xyz/ tankadmin/websites.git) for independent deployment - Update CLAUDE.md, guide.md, .gitignore to reflect migration Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
36
setup.sh
36
setup.sh
@@ -23,6 +23,42 @@ printf "\n${WHITE}════════════════════
|
||||
printf " ${BOLD}WebsiteBox Setup Wizard${RESET}\n"
|
||||
printf "${WHITE}═══════════════════════════════════════════════════════════${RESET}\n\n"
|
||||
|
||||
# --- License Key Check ---
|
||||
|
||||
if [ -f ".license-key" ]; then
|
||||
LICENSE_KEY=$(cat .license-key)
|
||||
if ! echo "$LICENSE_KEY" | grep -qE '^WBOX-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}$'; then
|
||||
printf "${RED} ✗ Invalid license key in .license-key file.${RESET}\n"
|
||||
printf "${RED} Re-run install.sh or contact support@makeyourown.website${RESET}\n"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
printf "${YELLOW} ⚠ No license key found.${RESET}\n"
|
||||
printf " Enter your WebsiteBox license key: "
|
||||
read -r LICENSE_KEY
|
||||
if ! echo "$LICENSE_KEY" | grep -qE '^WBOX-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}$'; then
|
||||
printf "${RED} ✗ Invalid key format. Expected: WBOX-XXXX-XXXX-XXXX-XXXX${RESET}\n"
|
||||
exit 1
|
||||
fi
|
||||
# Validate with server (burns the key)
|
||||
printf " Verifying license key...\n"
|
||||
VALIDATION_RESPONSE=$(curl -sf -X POST https://makeyourown.website/api/validate \
|
||||
-d "key=${LICENSE_KEY}" 2>/dev/null) || {
|
||||
printf "${RED} ✗ Could not reach the license server. Try again later.${RESET}\n"
|
||||
exit 1
|
||||
}
|
||||
if echo "$VALIDATION_RESPONSE" | grep -q '"valid": true'; then
|
||||
printf "${GREEN} ✓ License key verified and activated.${RESET}\n"
|
||||
echo "$LICENSE_KEY" > .license-key
|
||||
chmod 600 .license-key
|
||||
else
|
||||
printf "${RED} ✗ Invalid or already-used license key.${RESET}\n"
|
||||
printf "${RED} Purchase WebsiteBox at https://makeyourown.website${RESET}\n"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
echo ""
|
||||
|
||||
# --- Prerequisite Checks ---
|
||||
|
||||
check_command() {
|
||||
|
||||
Reference in New Issue
Block a user