+
Skip to content

infinition/bjorn-detector

 
 

🧭 Bjorn Detector

Python Python3 Status License: MIT

Reddit Discord

ezgif-1-a310f5fe8f

Bjorn Detector detects Bjorn device on the local network, displays its IP address, and allows you to initiate an SSH session with a single click on Bjorn Icon. The red dot is moving around the radar while he looks for Bjorn.

📚 Table of Contents

✨ Features

  • Automatic Network Detection: Continuously checks for the device bjorn.home on the local network.
  • Interactive SSH Launcher: When bjorn.home is detected, click the Bjorn icon to automatically launch an SSH terminal connected to Bjorn’s IP address.
  • IP Display: Shows the IP address of bjorn.home upon detection.
  • Seamless Bjorn Installation: Facilitates installation of Bjorn by connecting to the device via SSH.

📌 Prerequisites

  • Python: 3.9+

  • PyQt6: 6.7.0+

    • Linux:

      sudo apt-get install -y libegl1 libpulse0

🛠️ Installation

  1. Clone the Repository:

    git clone https://github.com/infinition/bjorn-detector.git
    cd bjorn-detector
  2. Create a Virtual Environment

    python -m venv venv
  3. Activate the Virtual Environment

    On Unix or MacOS:

    source venv/bin/activate

    On Windows:

     .\venv\Scripts\activate
    • or
     powershell.exe -ExecutionPolicy Bypass -File .\venv\Scripts\Activate.ps1
  4. Upgrade pip

    python -m ensurepip
    pip install --upgrade pip
  5. Install Dependencies

    pip install -r requirements.txt
    • or if u prefer use poetry:

      pip install poetry
      poetry lock
      poetry install
      • When you're done, deactivate the environment:

        deactivate

⚙️ Configuration

Environment Variables:

Create a .env file from .env.example file in the project root directory and populate it with the following variables:

cp .env.example .env

...

# Global Config
TIMEOUT=50

# Telegram
TELEGRAM_BOT_TOKEN=your_telegram_bot_token
TELEGRAM_CHAT_ID=your_telegram_chat_id

# Discord
DISCORD_WEBHOOK_URL=your_discord_webhook_url

# SMTP
SMTP_SERVER=smtp.example.com
SMTP_PORT=587
SMTP_USERNAME=your_smtp_username
SMTP_PASSWORD=your_smtp_password
SMTP_FROM_EMAIL=from@example.com
SMTP_TO_EMAIL=to@example.com
  • Descriptions:
    • TIMEOUT: The duration in seconds the application waits before determining that the bjorn device is unreachable.
    • TELEGRAM_BOT_TOKEN: The token for your Telegram bot, which allows the application to send messages via Telegram.
    • TELEGRAM_CHAT_ID: The unique identifier for the Telegram chat where notifications will be sent.
    • DISCORD_WEBHOOK_URL: The webhook URL for your Discord channel, enabling the application to post messages to Discord.
    • SMTP_SERVER: The address of your SMTP server used for sending emails.
    • SMTP_PORT: The port number of your SMTP server (commonly 587 for TLS or 465 for SSL).
    • SMTP_USERNAME: The username for authenticating with your SMTP server.
    • SMTP_PASSWORD: The password for authenticating with your SMTP server.
    • SMTP_FROM_EMAIL: The email address that will appear as the sender of the emails.
    • SMTP_TO_EMAIL: The email address that will receive the notifications.

Note: All env vars are optionals but inclusive between prefixes [TELEGRAM_, DISCORD_, SMTP_].

🚀 Usage

🕵️ Scan for Bjorn Device

Run the main script:

python bjorn-detector.py

This will scan your network and find Bjorn device, One-Click Bjorn to start SSH session.

📟 Command-Line Arguments

You can customize the behavior using the following arguments:

  • --timeout: timeout in seconds. Must be between 10 to 300.

    python bjorn-detector.py --timeout 10
  • --identity-file, --i: Identity file used to connect device if set on install. Defaults to None.

    python bjorn-detector.py --identity-file identity-file.pem
    • Must be a Valid OpenSSH Key File
  • --log-level: Set the logging level (INFO or DEBUG).

    python bjorn-detector.py --log-level DEBUG

Headless Mode

  • --no-gui: launch detector using non-gui, non-ssh.

    python bjorn-detector.py --no-gui

📝 Example Usage

python bjorn-detector.py

📊 Logging

Logs are maintained in logs/bjorn-detector.log with rotating file handlers to prevent excessive file sizes.

Log Levels:
    INFO: General operational messages.
    DEBUG: Detailed diagnostic information.

📫 Contact

  • Report Issues: Via GitHub.

  • Guidelines:

    • Follow ethical guidelines.
    • Document reproduction steps.
    • Provide logs and context.
  • Author: infinition

  • GitHub: infinition/bjorn-detector

🌠 Stargazers

Star History Chart


📜 License

2024 - Bjorn is distributed under the MIT License. For more details, please refer to the LICENSE file included in this repository.

About

Bjorn Detector: One-Click SSH Access to Your Device in a radar style

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Contributors 2

  •  
  •  

Languages

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载