mirror of
https://github.com/dgtlmoon/changedetection.io.git
synced 2026-05-04 00:30:53 +00:00
Storage Backends for changedetection.io
This module provides different storage backends for changedetection.io, allowing you to store data in various systems:
- FileSystemStorage: The default storage backend that stores data on the local filesystem.
- MongoDBStorage: Stores data in a MongoDB database.
- S3Storage: Stores data in an Amazon S3 bucket.
Usage
The storage backend is automatically selected based on the datastore path provided when initializing the application:
- For filesystem storage (default):
/datastore - For MongoDB storage:
mongodb://username:password@host:port/database - For S3 storage:
s3://bucket-name/optional-prefix
Configuration
Filesystem Storage
The default storage backend. Simply specify a directory path:
changedetection.io -d /path/to/datastore
MongoDB Storage
To use MongoDB storage, specify a MongoDB connection URI:
changedetection.io -d mongodb://username:password@host:port/database
Make sure to install the required dependencies:
pip install -r requirements-storage.txt
Amazon S3 Storage
To use S3 storage, specify an S3 URI:
changedetection.io -d s3://bucket-name/optional-prefix
Make sure to:
- Install the required dependencies:
pip install -r requirements-storage.txt - Configure AWS credentials using environment variables or IAM roles:
- Set
AWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEYenvironment variables - Or use an IAM role when running on AWS EC2/ECS/EKS
- Set
Custom Storage Backends
You can create custom storage backends by:
- Subclassing the
StorageBaseabstract class instorage_base.py - Implementing all required methods
- Adding your backend to the
storage_factory.pyfile