Добавлено описание команд и улучшено логирование в документации. Включены команды диагностики и тестирования для проверки API и DNS, а также обновлены основные команды в руководствах.

This commit is contained in:
Dmitriy Fofanov
2025-10-30 09:18:05 +03:00
parent 87f9f2b67a
commit b3955fb1cc
5 changed files with 474 additions and 33 deletions

View File

@@ -48,16 +48,40 @@ sudo make renew
## 📋 Main Commands
| Command | Description | Limits |
|---------|-------------|--------|
| `make test-cert` | Test certificate | ✅ None |
| `make obtain` | New Let's Encrypt | ⚠️ 5/week |
| `make renew` | Renew existing | ⚠️ 5/week |
| `make run` | Auto mode | ⚠️ 5/week |
### letsencrypt-regru Commands
| Command | Description | Limits | Use Case |
|---------|-------------|--------|----------|
| `--check` | Check certificate expiration | - | Monitoring |
| `--obtain` | Obtain new certificate | ⚠️ 5/week | Initial creation |
| `--renew` | Renew existing certificate | ⚠️ 5/week | Renewal |
| `--auto` | Auto-check and renewal | ⚠️ 5/week | Cron/systemd |
| `--test-cert` | Test certificate | ✅ None | Development |
| `--test-api` | Check API reg.ru access | - | Diagnostics |
| `--test-dns` | Test DNS record creation | - | Pre-SSL check |
| `--help` | Show help | - | Help |
| `-v` | Verbose output | - | Debugging |
### Makefile Commands
| Command | Description | Equivalent |
|---------|-------------|------------|
| `make test-cert` | Test certificate | `letsencrypt-regru --test-cert` |
| `make obtain` | New Let's Encrypt | `letsencrypt-regru --obtain` |
| `make renew` | Renew existing | `letsencrypt-regru --renew` |
| `make run` | Auto mode | `letsencrypt-regru --auto` |
| `make status` | System status | - |
| `make logs` | Show logs | - |
| `make logs` | Show logs | `journalctl -u letsencrypt-regru` |
| `make check-config` | Check configuration | - |
### letsencrypt_regru.sh Commands
| Command | Description |
|---------|-------------|
| `sudo bash letsencrypt_regru.sh install` | Install application |
| `sudo bash letsencrypt_regru.sh update` | Update application |
| `sudo bash letsencrypt_regru.sh uninstall` | Uninstall application |
---
## 📝 Configuration

View File

@@ -100,7 +100,9 @@ During installation, the script will ask for:
## Using letsencrypt-regru Command
After installation, a convenient command is available:
After installation, a convenient global command with multiple functions is available:
### 🔧 Main Commands
```bash
# Check current certificate expiration
@@ -117,11 +119,59 @@ letsencrypt-regru --auto
# Create test self-signed certificate
letsencrypt-regru --test-cert
# Show help
letsencrypt-regru --help
```
### 🧪 Diagnostic and Testing Commands
```bash
# Check API access to reg.ru
# - Shows current IP address
# - Tests API connection
# - Displays account balance
letsencrypt-regru --test-api
# Test DNS TXT record creation
# - Full SSL certification process simulation
# - Creates temporary _acme-challenge TXT record
# - Waits for DNS propagation (60 seconds)
# - Verifies via public DNS servers
# - Automatically removes test record
letsencrypt-regru --test-dns
# Show help for all commands
letsencrypt-regru --help
# Enable verbose output
letsencrypt-regru --obtain -v
letsencrypt-regru --check -v
```
### ⚙️ Service Commands (internal use)
```bash
# Certbot authentication hook (used by certbot automatically)
letsencrypt-regru --auth-hook
# Certbot cleanup hook (used by certbot automatically)
letsencrypt-regru --cleanup-hook
```
### 📋 Command Reference
| Command | Description | Use Case |
|---------|-------------|----------|
| `--check` | Check certificate expiration | Regular monitoring |
| `--obtain` | Obtain new certificate from Let's Encrypt | Initial creation |
| `--renew` | Renew existing certificate | Renewal |
| `--auto` | Automatic check and renewal | For cron/systemd |
| `--test-cert` | Create test self-signed certificate | Development/testing |
| `--test-api` | Check API access to reg.ru | Connection diagnostics |
| `--test-dns` | Test DNS record creation | Pre-SSL verification |
| `--auth-hook` | Certbot hook (DNS creation) | Internal |
| `--cleanup-hook` | Certbot hook (DNS deletion) | Internal |
| `--help` | Show help | Help |
| `-v` | Verbose output | Debugging |
## Automatic Renewal
The installer configures a systemd timer for automatic checks: