Skip to content

mosiur-engine/Cyberpanel-Google-Login

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sheild360 - Secure Google Login for CyberPanel

Secure Google Sign-In authentication plugin for CyberPanel admin panel, powered by Sheild360.

License CyberPanel OAuth Sheild360

Features

  • Google OAuth 2.0 - Secure sign-in with Google accounts
  • Sheild360 Branded Login Page - Modern dark theme with shield security branding
  • Email/Domain Whitelisting - Control who can access the panel
  • Animated UI - Smooth animations, floating orbs, grid overlay effects
  • Responsive Design - Works on desktop, tablet, and mobile
  • Session Management - Integrates with CyberPanel's session system
  • User Management CLI - Add/remove users via management commands
  • Easy Install/Uninstall - One-command setup and removal

Quick Start

1. Clone & Install

git clone https://github.com/mosiur-engine/Cyberpanel-Google-Login.git
cd Cyberpanel-Google-Login
sudo bash install.sh

2. Create Google OAuth Credentials

  1. Go to Google Cloud Console
  2. Create a new project (or select existing)
  3. Go to APIs & Services > Credentials
  4. Click Create Credentials > OAuth client ID
  5. Select Web application
  6. Add authorized redirect URI: https://your-domain:8090/google/callback
  7. Copy the Client ID and Client Secret

3. Configure

Edit the config file:

sudo nano /usr/local/CyberCP/googleAuth/config.json
{
    "GOOGLE_CLIENT_ID": "your-client-id.apps.googleusercontent.com",
    "GOOGLE_CLIENT_SECRET": "your-client-secret",
    "GOOGLE_REDIRECT_URI": "https://your-domain:8090/google/callback",
    "ALLOWED_EMAILS": ["admin@gmail.com"],
    "ALLOWED_DOMAINS": [],
    "ALLOW_ALL_GOOGLE_USERS": false,
    "DEFAULT_ADMIN_USER": "admin"
}

4. Access Login Page

Navigate to: https://your-domain:8090/google/

Configuration Options

Option Description Default
GOOGLE_CLIENT_ID OAuth 2.0 Client ID Required
GOOGLE_CLIENT_SECRET OAuth 2.0 Client Secret Required
GOOGLE_REDIRECT_URI OAuth callback URL Required
ALLOWED_EMAILS List of allowed email addresses []
ALLOWED_DOMAINS List of allowed email domains []
ALLOW_ALL_GOOGLE_USERS Allow any Google user to sign in false
AUTO_CREATE_ADMIN Auto-create admin user on first login false
DEFAULT_ADMIN_USER CyberPanel user to authenticate as admin

Branding Options

{
    "BRANDING": {
        "COMPANY_NAME": "Sheild360",
        "TAGLINE": "Secure Google Login for CyberPanel",
        "PRIMARY_COLOR": "#0f62fe",
        "SECONDARY_COLOR": "#0d1117",
        "ACCENT_COLOR": "#00c9ff",
        "WEBSITE_URL": "https://sheild360-app.vercel.app",
        "LOGO_URL": "",
        "FAVICON_URL": ""
    }
}

User Management

cd /usr/local/CyberCP

# List all authorized users
python manage.py google_auth_manage list

# Add a user
python manage.py google_auth_manage add --email user@gmail.com --cpuser admin

# Remove a user
python manage.py google_auth_manage remove --email user@gmail.com

# Allow an entire domain
python manage.py google_auth_manage allow-domain --domain company.com

# Show current config
python manage.py google_auth_manage show-config

URL Routes

URL Description
/google/ Login page
/google/auth Initiates Google OAuth flow
/google/callback OAuth callback handler
/google/logout Logout and redirect to login
/google/status Auth status JSON endpoint

Uninstall

cd Cyberpanel-Google-Login
sudo bash uninstall.sh

Project Structure

Cyberpanel-Google-Login/
├── config.json                  # Configuration file
├── install.sh                   # Installation script
├── uninstall.sh                 # Uninstall script
├── requirements.txt             # Python dependencies
└── googleAuth/                  # Django app
    ├── __init__.py
    ├── apps.py
    ├── google_config.py         # Configuration loader
    ├── models.py                # Database models
    ├── urls.py                  # URL routing
    ├── views.py                 # OAuth views & handlers
    ├── migrations/
    │   └── 0001_initial.py
    ├── management/
    │   └── commands/
    │       └── google_auth_manage.py
    ├── templatetags/
    │   └── google_auth_tags.py
    └── templates/
        └── googleAuth/
            └── login.html       # Sheild360 branded login page

Security

  • OAuth 2.0 state parameter for CSRF protection
  • Email/domain whitelisting to restrict access
  • Session-based authentication integrated with CyberPanel
  • Config file permissions set to 600 (root-only readable)
  • No passwords stored - authentication delegated to Google

License

MIT License - See LICENSE for details.

Links

About

Login to Cyberpanel Admin with Google Sign In

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors