Skip to main content

Un serveur HTTP FastAPI pour récupérer les applications installées

Project description

Watchman HTTP Server

Watchman HTTP Server est un serveur FastAPI qui expose la liste des applications installées ainsi que des informations sur le système.

Installation

Installez le package via pip :

pip install watchman_http_server

Ou depuis le code source :

git clone https://github.com/votre-repo/watchman_http_server.git
cd watchman_http_server
pip install -e .

Utilisation

Lancer le serveur avec un port et une clé API spécifiés :

watchman-http-server runserver --port 8000 --api-key "VOTRE_CLE_API"

Configuration

  • --port : Définit le port d'écoute du serveur (par défaut : 8001).
  • --api-key : Spécifie la clé API requise pour accéder aux endpoints.
  • --hour : L'heure à laquelle démarrer le serveur (0-23).
  • --minute : La minute à laquelle démarrer le serveur (0-59).
  • --day : Jour du mois (1-31), * pour chaque jour.
  • --month : Mois (1-12), * pour chaque mois.
  • --ip : Adresses IPs pour autorisées pour accéder au serveur.
  • -d : Exécuter en arrière-plan.

Endpoints

GET /apps

Retourne la liste des applications installées et les informations du système.

Headers requis

WATCHMAN-API-KEY: VOTRE_CLE_API

Exemple de réponse

{
  "system_info": {
    "hostname": "mon-pc",
    "ip": "192.168.1.10",
    "mac": "A1:B2:C3:D4:E5:F6",
    "architecture": "x86_64",
    "os": "Windows 10"
  },
  "applications": [
    {
      "name": "Google Chrome",
      "version": "99.0.4844.84",
      "vendor": "Google LLC",
      "type": "application"
    }
  ]
}

Déploiement sur un réseau local

Pour rendre le serveur accessible sur un réseau local :

  1. Lancer le serveur avec 0.0.0.0 comme hôte :

    watchman-http-server runserver --port 8000 --api-key "VOTRE_CLE_API"
    
  2. Planifier une tâche pour lancer le serveur en arrière plan avec 0.0.0.0 comme hôte :

    watchman-http-server schedule --port 8000 --api-key "VOTRE_CLE_API" --hour "heure" --minute "minute" --day "day" --month "month" --d
    
  3. Stoper le serveur en cours d'éxécution en arrière plan:

    watchman-http-server stopserver
    
  4. Assurez-vous que le port est ouvert dans le pare-feu :

    • Windows :
      netsh advfirewall firewall add rule name="Watchman" dir=in action=allow protocol=TCP localport=8000
      
    • Linux :
      sudo ufw allow 8000/tcp
      

Contributions

Les contributions sont les bienvenues ! Clonez le projet, créez une branche et proposez vos modifications via une pull request.

Licence

Ce projet est sous licence MIT.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

watchman_http_server-0.5.3.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

watchman_http_server-0.5.3-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file watchman_http_server-0.5.3.tar.gz.

File metadata

  • Download URL: watchman_http_server-0.5.3.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for watchman_http_server-0.5.3.tar.gz
Algorithm Hash digest
SHA256 3ba5cb73cccb3bdbac7236df630ffe48e87857f41723125a380f1ffd9d2a31f9
MD5 853a2830350ab5671bb55298df9c4a6f
BLAKE2b-256 2662d0ac514e3749d04bdc2ed99bceafa220e2baf0b4f6fff2fbb54e4b80843c

See more details on using hashes here.

File details

Details for the file watchman_http_server-0.5.3-py3-none-any.whl.

File metadata

File hashes

Hashes for watchman_http_server-0.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 87ee8bdfd758e4f27e3a91c5c3531c12a88b4e4f24415c5fbd8980abae501de2
MD5 11a9efb0318c589adc2f09bc4ce3c4ac
BLAKE2b-256 afa9a3dd128e0569a20cec5fd4b76ad9de98925c25ed38f22b8489e9413ceaa9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page