Add comprehensive API documentation to Cloudron setup instructions
- 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
This commit is contained in:
57
update-storage.sh
Executable file
57
update-storage.sh
Executable file
@@ -0,0 +1,57 @@
|
||||
#!/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"
|
Reference in New Issue
Block a user