chore: clean publish artifacts and add sources
This commit is contained in:
63
reset-admin-simple.sh
Executable file
63
reset-admin-simple.sh
Executable file
@@ -0,0 +1,63 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Simple Admin Password Reset Script
|
||||
# This creates a new admin with a simple known password
|
||||
|
||||
ADMIN_EMAIL="admin@skyartshop.com"
|
||||
NEW_PASSWORD="Admin123!"
|
||||
|
||||
echo "=========================================="
|
||||
echo "SkyArt Shop - Admin Password Reset"
|
||||
echo "=========================================="
|
||||
echo ""
|
||||
echo "Resetting password for: $ADMIN_EMAIL"
|
||||
echo "New password will be: $NEW_PASSWORD"
|
||||
echo ""
|
||||
|
||||
# Delete existing admin
|
||||
mongosh --quiet SkyArtShopDB <<EOF
|
||||
db.AdminUsers.deleteMany({Email: '$ADMIN_EMAIL'});
|
||||
print('Deleted existing admin user');
|
||||
EOF
|
||||
|
||||
# Create password hash using OpenSSL (simple method)
|
||||
SALT=$(openssl rand -base64 16)
|
||||
HASH=$(echo -n "${NEW_PASSWORD}${SALT}" | openssl dgst -sha256 -binary | base64)
|
||||
COMBINED=$(echo -n "${SALT}:${HASH}" | base64)
|
||||
|
||||
# Insert new admin
|
||||
mongosh --quiet SkyArtShopDB <<EOF
|
||||
db.AdminUsers.insertOne({
|
||||
Email: '$ADMIN_EMAIL',
|
||||
PasswordHash: '$COMBINED',
|
||||
Name: 'System Administrator',
|
||||
Role: 'MasterAdmin',
|
||||
Permissions: [
|
||||
'manage_users', 'manage_products', 'manage_orders',
|
||||
'manage_content', 'manage_settings', 'view_reports',
|
||||
'manage_finances', 'manage_inventory', 'manage_customers',
|
||||
'manage_blog', 'manage_portfolio', 'manage_pages'
|
||||
],
|
||||
IsActive: true,
|
||||
CreatedAt: new Date(),
|
||||
LastLogin: null,
|
||||
CreatedBy: 'System Reset',
|
||||
Phone: null,
|
||||
Notes: 'Password reset on ' + new Date().toISOString()
|
||||
});
|
||||
print('');
|
||||
print('✓ Admin user created successfully!');
|
||||
print('');
|
||||
EOF
|
||||
|
||||
echo ""
|
||||
echo "=========================================="
|
||||
echo "✓ Password Reset Complete!"
|
||||
echo "=========================================="
|
||||
echo ""
|
||||
echo "Login Credentials:"
|
||||
echo " Email: $ADMIN_EMAIL"
|
||||
echo " Password: $NEW_PASSWORD"
|
||||
echo ""
|
||||
echo "Login URL: https://skyarts.ddns.net/admin/login"
|
||||
echo ""
|
||||
Reference in New Issue
Block a user