- Added detailed API endpoint information in SETUP-INSTRUCTIONS.md - Documented API usage with Ente CLI - Enhanced routing configuration for auth/cast/accounts apps - Updated to version 0.1.64
57 lines
1.5 KiB
Bash
Executable File
57 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
# Script to update Ente user storage using the Ente CLI
|
|
# Run this from your local machine (not inside Cloudron)
|
|
|
|
# Check if ente CLI is installed
|
|
if ! command -v ente &> /dev/null; then
|
|
echo "Ente CLI is not installed. Please install it first:"
|
|
echo ""
|
|
echo "For macOS:"
|
|
echo " brew tap ente-io/ente"
|
|
echo " brew install ente-cli"
|
|
echo ""
|
|
echo "For other systems, download from:"
|
|
echo " https://github.com/ente-io/ente/releases"
|
|
exit 1
|
|
fi
|
|
|
|
# Your Ente instance
|
|
ENTE_ENDPOINT="https://ente.due.ren"
|
|
|
|
# Function to update subscription
|
|
update_subscription() {
|
|
local admin_email="$1"
|
|
local user_email="$2"
|
|
local storage_gb="$3"
|
|
local valid_days="$4"
|
|
|
|
echo "Updating subscription for: $user_email"
|
|
echo "Storage: ${storage_gb}GB"
|
|
echo "Valid for: ${valid_days} days"
|
|
echo "Using admin account: $admin_email"
|
|
echo ""
|
|
|
|
# Run the ente CLI command
|
|
ente admin update-subscription \
|
|
--host "$ENTE_ENDPOINT" \
|
|
--admin-user "$admin_email" \
|
|
--user "$user_email" \
|
|
--storage "$storage_gb" \
|
|
--valid-for "$valid_days"
|
|
}
|
|
|
|
# Check arguments
|
|
if [ $# -lt 4 ]; then
|
|
echo "Usage: $0 <admin-email> <user-email> <storage-gb> <valid-days>"
|
|
echo ""
|
|
echo "Example:"
|
|
echo " $0 admin@due.ren andreas@due.ren 1000 365"
|
|
echo ""
|
|
echo "Make sure you're logged in to the Ente CLI first:"
|
|
echo " ente account add"
|
|
echo " API endpoint: $ENTE_ENDPOINT"
|
|
exit 1
|
|
fi
|
|
|
|
# Run the update
|
|
update_subscription "$1" "$2" "$3" "$4" |