Skip to content

Commit adcbb00

Browse files
author
ClaraVnk
committed
v 1.6.0 : exceptions spécifiques, sécurité SMTP, logging amélioré, type hints complets
1 parent eea97c5 commit adcbb00

7 files changed

Lines changed: 641 additions & 74 deletions

File tree

README.md

Lines changed: 111 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,32 @@
1010

1111
A suite of tools to optimize and manage your OpenStack resources, with multilingual support (FR/EN).
1212

13+
> **Version 1.6.0** - Enhanced security (encrypted SMTP passwords), improved logging with rotation, complete type hints, and better error handling!
14+
15+
## ✨ What's New in v1.6.0
16+
17+
- 🔒 **Encrypted SMTP passwords** - Passwords are now encrypted using Fernet (AES-128)
18+
- 📊 **Professional logging** - Colored console output, automatic rotation, JSON support
19+
- 📝 **Complete type hints** - Better IDE support and code quality
20+
- 🔧 **Specific exceptions** - 12 custom exceptions for better error handling
21+
- 📁 **Organized structure** - Clean separation of code and documentation
22+
1323
## 📋 Features
1424

15-
- 📊 **Metrics Collector** (`openstack_metrics_collector.py`)
16-
- Real-time Gnocchi metrics
17-
- Prometheus export
18-
- Request parallelization
19-
- Multi-project support
20-
21-
- 📈 **Resource Summary** (`openstack_summary.py`)
22-
- Instance list and details
23-
- Volumes and snapshots
24-
- Images and containers
25-
- Cost estimation (calibrated for Infomaniak pricing in EUR/CHF)
26-
- Mounted volumes tree view
27-
28-
- 👨‍💼 **Administration** (`openstack_admin.py`)
29-
- Project management
30-
- Resource overview
31-
- Operation parallelization
32-
33-
- 📧 **Weekly Notifications** (`weekly_notification_optimization.py`)
34-
- Automated email reports
35-
- Interactive SMTP configuration
36-
- Cron scheduling
25+
### Core Tools
26+
27+
- 📊 **Metrics Collector** - Real-time Gnocchi metrics with Prometheus export
28+
- 📈 **Resource Summary** - Complete overview of instances, volumes, snapshots, and costs
29+
- 👨‍💼 **Administration** - Multi-project management and resource overview
30+
- 📧 **Weekly Notifications** - Automated email reports with secure SMTP
31+
- 🔍 **Optimization** - Identify underutilized resources
32+
33+
### New in v1.6.0
34+
35+
- 🔒 **Security Module** (`src/security.py`) - Encryption/decryption for sensitive data
36+
- 📊 **Logger Module** (`src/logger.py`) - Professional logging with rotation and colors
37+
- 🔧 **Exceptions Module** (`src/exceptions.py`) - 12 specific exceptions for better error handling
38+
- 📝 **Type Hints** - Complete type annotations for better IDE support
3739

3840
## 🛠️ Installation
3941

@@ -271,15 +273,102 @@ openstack-toolbox
271273
- `send_email()`: Sends via SMTP
272274
- `setup_cron()`: Configures cron task
273275

276+
## 📁 Project Structure
277+
278+
```
279+
openstack-toolbox/
280+
├── src/ # Python source code (12 modules)
281+
└── .github/ # GitHub Actions CI/CD
282+
```
283+
284+
### Source Code (`src/`)
285+
286+
**Core Modules:**
287+
- `openstack_toolbox.py` - Main CLI
288+
- `openstack_summary.py` - Resource summary
289+
- `openstack_admin.py` - Administration tools
290+
- `openstack_metrics_collector.py` - Prometheus exporter
291+
- `openstack_optimization.py` - Resource optimization
292+
- `weekly_notification_optimization.py` - Email notifications
293+
294+
**Utility Modules (v1.6.0):**
295+
- `config.py` - Configuration management
296+
- `security.py` - Encryption/decryption ✨ NEW
297+
- `logger.py` - Logging system ✨ NEW
298+
- `exceptions.py` - Custom exceptions ✨ NEW
299+
- `utils.py` - Helper functions
300+
301+
## � Migration from v1.5.0
302+
303+
### Automatic Migration
304+
305+
- ✅ **100% backward compatible** - No action required
306+
- ✅ Existing SMTP configurations continue to work
307+
- ✅ System will prompt to re-encrypt passwords on next use
308+
309+
### Recommended Actions
310+
311+
```bash
312+
# Reconfigure SMTP to enable encryption
313+
weekly-notification
314+
```
315+
316+
### New Dependencies
317+
318+
```bash
319+
# Install the new security dependency
320+
pip install cryptography>=41.0.0
321+
```
322+
323+
### Security Improvements
324+
325+
Configuration files now have restricted permissions:
326+
- `~/.config/openstack-toolbox/smtp_config.ini` : 600 (rw-------)
327+
- `~/.config/openstack-toolbox/.encryption_key` : 600 (rw-------)
328+
329+
### Troubleshooting
330+
331+
If you encounter decryption errors:
332+
333+
```bash
334+
# Remove old configuration
335+
rm ~/.config/openstack-toolbox/smtp_config.ini
336+
rm ~/.config/openstack-toolbox/.encryption_key
337+
338+
# Reconfigure
339+
weekly-notification
340+
```
341+
342+
## 📝 Changelog
343+
344+
### [1.6.0] - 2024-11-21
345+
346+
**Added:**
347+
- 🔒 Encrypted SMTP passwords using Fernet (AES-128)
348+
- 📊 Professional logging with rotation and colors
349+
- 🔧 12 custom exceptions for better error handling
350+
- 📝 Complete type hints on all core modules
351+
- 📁 Organized project structure
352+
353+
**Security:**
354+
- Encrypted password storage
355+
- Restricted file permissions (600)
356+
- Unique encryption key per installation
357+
358+
**No breaking changes** - Full backward compatibility maintained
359+
274360
## 🤝 Contributing
275361

276362
Contributions are welcome! Feel free to:
363+
277364
1. Fork the project
278365
2. Create a branch (`git checkout -b feature/improvement`)
279366
3. Commit (`git commit -am 'Add feature'`)
280367
4. Push (`git push origin feature/improvement`)
281368
5. Open a Pull Request
282369

370+
See [docs/IMPROVEMENTS.md](docs/IMPROVEMENTS.md) for technical details.
371+
283372
## ✨ Credits
284373

285374
Special thanks to [Kevin Allioli](https://github.com/kallioli), Cloud Architect & SysAdmin, for his valuable contributions and expertise in OpenStack development.

pyproject.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "openstack-toolbox"
7-
version = "1.5.0"
7+
version = "1.6.0"
88
authors = [
99
{ name="Loutre", email="loutre@ikmail.com" },
1010
]
@@ -25,9 +25,11 @@ dependencies = [
2525
"tomli",
2626
"prometheus-client",
2727
"python-json-logger",
28-
"requests"
28+
"requests",
29+
"cryptography>=41.0.0",
2930
]
3031

32+
3133
[project.urls]
3234
Homepage = "https://github.com/ClaraVnk/openstack-toolbox"
3335
Issues = "https://github.com/ClaraVnk/openstack-toolbox/issues"

0 commit comments

Comments
 (0)