Compare commits
1 Commits
3918a74963
..
py3
| Author | SHA1 | Date | |
|---|---|---|---|
| 1a99f9bb9a |
@@ -1,101 +0,0 @@
|
|||||||
# TISBackup
|
|
||||||
rpm/
|
|
||||||
deb/
|
|
||||||
.gitea/
|
|
||||||
.hadolint.yml
|
|
||||||
.pre-commit-config.yaml
|
|
||||||
README.md
|
|
||||||
compose.yml
|
|
||||||
docs/
|
|
||||||
docs-sphinx-rst/
|
|
||||||
samples/
|
|
||||||
|
|
||||||
# Git
|
|
||||||
.git
|
|
||||||
.gitignore
|
|
||||||
.gitattributes
|
|
||||||
|
|
||||||
|
|
||||||
# CI
|
|
||||||
.codeclimate.yml
|
|
||||||
.travis.yml
|
|
||||||
.taskcluster.yml
|
|
||||||
|
|
||||||
# Docker
|
|
||||||
docker-compose.yml
|
|
||||||
Dockerfile
|
|
||||||
.docker
|
|
||||||
.dockerignore
|
|
||||||
|
|
||||||
# Byte-compiled / optimized / DLL files
|
|
||||||
**/__pycache__/
|
|
||||||
**/*.py[cod]
|
|
||||||
|
|
||||||
# C extensions
|
|
||||||
*.so
|
|
||||||
|
|
||||||
# Distribution / packaging
|
|
||||||
.Python
|
|
||||||
env/
|
|
||||||
build/
|
|
||||||
develop-eggs/
|
|
||||||
dist/
|
|
||||||
downloads/
|
|
||||||
eggs/
|
|
||||||
lib/
|
|
||||||
lib64/
|
|
||||||
parts/
|
|
||||||
sdist/
|
|
||||||
var/
|
|
||||||
*.egg-info/
|
|
||||||
.installed.cfg
|
|
||||||
*.egg
|
|
||||||
|
|
||||||
# PyInstaller
|
|
||||||
# Usually these files are written by a python script from a template
|
|
||||||
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
||||||
*.manifest
|
|
||||||
*.spec
|
|
||||||
|
|
||||||
# Installer logs
|
|
||||||
pip-log.txt
|
|
||||||
pip-delete-this-directory.txt
|
|
||||||
|
|
||||||
# Unit test / coverage reports
|
|
||||||
htmlcov/
|
|
||||||
.tox/
|
|
||||||
.coverage
|
|
||||||
.cache
|
|
||||||
nosetests.xml
|
|
||||||
coverage.xml
|
|
||||||
|
|
||||||
# Translations
|
|
||||||
*.mo
|
|
||||||
*.pot
|
|
||||||
|
|
||||||
# Django stuff:
|
|
||||||
*.log
|
|
||||||
|
|
||||||
# Sphinx documentation
|
|
||||||
docs/_build/
|
|
||||||
|
|
||||||
# PyBuilder
|
|
||||||
target/
|
|
||||||
|
|
||||||
# Virtual environment
|
|
||||||
.env
|
|
||||||
.venv/
|
|
||||||
venv/
|
|
||||||
|
|
||||||
# PyCharm
|
|
||||||
.idea
|
|
||||||
|
|
||||||
# Python mode for VIM
|
|
||||||
.ropeproject
|
|
||||||
**/.ropeproject
|
|
||||||
|
|
||||||
# Vim swap files
|
|
||||||
**/*.swp
|
|
||||||
|
|
||||||
# VS Code
|
|
||||||
.vscode/
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
name: lint
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- 'master'
|
|
||||||
jobs:
|
|
||||||
docker:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: Install Python
|
|
||||||
uses: actions/setup-python@v4
|
|
||||||
with:
|
|
||||||
python-version: '3.13'
|
|
||||||
cache: 'pip' # caching pip dependencies
|
|
||||||
- run: pip install ruff
|
|
||||||
- run: |
|
|
||||||
ruff check .
|
|
||||||
# - uses: stefanzweifel/git-auto-commit-action@v4
|
|
||||||
# with:
|
|
||||||
# commit_message: 'style fixes by ruff'
|
|
||||||
@@ -2,20 +2,8 @@
|
|||||||
*.swp
|
*.swp
|
||||||
*~
|
*~
|
||||||
*.pyc
|
*.pyc
|
||||||
__pycache__/
|
|
||||||
.venv/
|
|
||||||
.ruff_cache/
|
|
||||||
.mypy_cache/
|
|
||||||
/tasks.sqlite
|
/tasks.sqlite
|
||||||
/tasks.sqlite-wal
|
/tasks.sqlite-wal
|
||||||
/srvinstallation
|
/srvinstallation
|
||||||
/tasks.sqlite-shm
|
/tasks.sqlite-shm
|
||||||
.idea
|
.idea
|
||||||
/deb/builddir
|
|
||||||
/deb/*.deb
|
|
||||||
/lib
|
|
||||||
/rpm/*.rpm
|
|
||||||
/rpm/RPMS
|
|
||||||
/rpm/BUILD
|
|
||||||
/rpm/__VERSION__
|
|
||||||
docs-sphinx-rst/build/
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
DL3008failure-threshold: warning
|
|
||||||
format: tty
|
|
||||||
ignored:
|
|
||||||
- DL3007
|
|
||||||
override:
|
|
||||||
error:
|
|
||||||
- DL3015
|
|
||||||
warning:
|
|
||||||
- DL3015
|
|
||||||
info:
|
|
||||||
- DL3008
|
|
||||||
style:
|
|
||||||
- DL3015
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
repos:
|
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
||||||
rev: v5.0.0
|
|
||||||
hooks:
|
|
||||||
- id: trailing-whitespace
|
|
||||||
- id: end-of-file-fixer
|
|
||||||
- id: check-yaml
|
|
||||||
|
|
||||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
||||||
# Ruff version.
|
|
||||||
rev: v0.8.1
|
|
||||||
hooks:
|
|
||||||
# Run the linter.
|
|
||||||
- id: ruff
|
|
||||||
# Run the formatter.
|
|
||||||
- id: ruff-format
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
3.13
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
{
|
|
||||||
// Use IntelliSense to learn about possible attributes.
|
|
||||||
// Hover to view descriptions of existing attributes.
|
|
||||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
||||||
"version": "0.2.0",
|
|
||||||
"configurations": [
|
|
||||||
{
|
|
||||||
"name": "Python: Current File",
|
|
||||||
"type": "python",
|
|
||||||
"request": "launch",
|
|
||||||
"program": "${file}",
|
|
||||||
// "args": [
|
|
||||||
// "-ldebug",
|
|
||||||
// "backup"
|
|
||||||
// ],
|
|
||||||
"args": [
|
|
||||||
"register_existing"
|
|
||||||
],
|
|
||||||
"console": "integratedTerminal"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"conventionalCommits.scopes": [
|
|
||||||
"tisbackup"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,443 +0,0 @@
|
|||||||
# TISBackup Authentication System
|
|
||||||
|
|
||||||
TISBackup provides a pluggable authentication system for securing the Flask web interface. You can choose between multiple authentication methods based on your security requirements.
|
|
||||||
|
|
||||||
## Supported Authentication Methods
|
|
||||||
|
|
||||||
1. **None** - No authentication (default, NOT recommended for production)
|
|
||||||
2. **Basic Auth** - HTTP Basic Authentication with username/password
|
|
||||||
3. **Flask-Login** - Session-based authentication with username/password
|
|
||||||
4. **OAuth2** - OAuth authentication (Google, GitHub, GitLab, or generic provider)
|
|
||||||
|
|
||||||
## Quick Start
|
|
||||||
|
|
||||||
### 1. Choose Authentication Method
|
|
||||||
|
|
||||||
Add an `[authentication]` section to `/etc/tis/tisbackup_gui.ini`:
|
|
||||||
|
|
||||||
```ini
|
|
||||||
[authentication]
|
|
||||||
type = basic
|
|
||||||
username = admin
|
|
||||||
password = $2b$12$LQv3c1yqBWVHxkd0LHAkCOYz6TtxMQJqhN8/LewY5GyYWv.5qVQK6
|
|
||||||
use_bcrypt = True
|
|
||||||
```
|
|
||||||
|
|
||||||
### 2. Install Dependencies
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# For Basic Auth
|
|
||||||
uv sync --extra auth-basic
|
|
||||||
|
|
||||||
# For Flask-Login
|
|
||||||
uv sync --extra auth-login
|
|
||||||
|
|
||||||
# For OAuth
|
|
||||||
uv sync --extra auth-oauth
|
|
||||||
|
|
||||||
# For all auth methods
|
|
||||||
uv sync --extra auth-all
|
|
||||||
```
|
|
||||||
|
|
||||||
### 3. Restart TISBackup
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker compose restart tisbackup_gui
|
|
||||||
```
|
|
||||||
|
|
||||||
## Configuration Guide
|
|
||||||
|
|
||||||
### Basic Authentication
|
|
||||||
|
|
||||||
Simple HTTP Basic Auth with username and password.
|
|
||||||
|
|
||||||
**Pros:**
|
|
||||||
- Easy to set up
|
|
||||||
- Works with all HTTP clients
|
|
||||||
- No session management needed
|
|
||||||
|
|
||||||
**Cons:**
|
|
||||||
- Credentials sent with every request
|
|
||||||
- No logout functionality
|
|
||||||
- Browser password prompt can be confusing
|
|
||||||
|
|
||||||
**Configuration:**
|
|
||||||
|
|
||||||
```ini
|
|
||||||
[authentication]
|
|
||||||
type = basic
|
|
||||||
username = admin
|
|
||||||
# Use bcrypt hash (recommended)
|
|
||||||
password = $2b$12$LQv3c1yqBWVHxkd0LHAkCOYz6TtxMQJqhN8/LewY5GyYWv.5qVQK6
|
|
||||||
use_bcrypt = True
|
|
||||||
realm = TISBackup Admin
|
|
||||||
```
|
|
||||||
|
|
||||||
**Generate bcrypt hash:**
|
|
||||||
|
|
||||||
```bash
|
|
||||||
python3 -c "import bcrypt; print(bcrypt.hashpw(b'yourpassword', bcrypt.gensalt()).decode())"
|
|
||||||
```
|
|
||||||
|
|
||||||
**Docker environment:**
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
services:
|
|
||||||
tisbackup_gui:
|
|
||||||
environment:
|
|
||||||
- TISBACKUP_SECRET_KEY=your-secret-key
|
|
||||||
# Optional: Pass credentials via env vars
|
|
||||||
# Then reference in config with ${AUTH_PASSWORD}
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Flask-Login Authentication
|
|
||||||
|
|
||||||
Session-based authentication with login page and user management.
|
|
||||||
|
|
||||||
**Pros:**
|
|
||||||
- Clean login/logout workflow
|
|
||||||
- Session-based (no credentials in each request)
|
|
||||||
- Multiple users supported
|
|
||||||
- Password hashing with bcrypt
|
|
||||||
|
|
||||||
**Cons:**
|
|
||||||
- Requires custom login page
|
|
||||||
- Session management overhead
|
|
||||||
- Cookies must be enabled
|
|
||||||
|
|
||||||
**Configuration:**
|
|
||||||
|
|
||||||
```ini
|
|
||||||
[authentication]
|
|
||||||
type = flask-login
|
|
||||||
users_file = /etc/tis/users.txt
|
|
||||||
use_bcrypt = True
|
|
||||||
login_view = login
|
|
||||||
```
|
|
||||||
|
|
||||||
**Create users file** (`/etc/tis/users.txt`):
|
|
||||||
|
|
||||||
```
|
|
||||||
admin:$2b$12$LQv3c1yqBWVHxkd0LHAkCOYz6TtxMQJqhN8/LewY5GyYWv.5qVQK6
|
|
||||||
operator:$2b$12$abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNO
|
|
||||||
viewer:$2b$12$ANOTHERBCRYPTHASHHERE1234567890ABCDEFGHIJKLMNOPQRS
|
|
||||||
```
|
|
||||||
|
|
||||||
**Generate user entry:**
|
|
||||||
|
|
||||||
```bash
|
|
||||||
USERNAME="admin"
|
|
||||||
PASSWORD="yourpassword"
|
|
||||||
HASH=$(python3 -c "import bcrypt; print(bcrypt.hashpw(b'$PASSWORD', bcrypt.gensalt()).decode())")
|
|
||||||
echo "$USERNAME:$HASH" >> /etc/tis/users.txt
|
|
||||||
```
|
|
||||||
|
|
||||||
**Permissions:**
|
|
||||||
|
|
||||||
```bash
|
|
||||||
chmod 600 /etc/tis/users.txt
|
|
||||||
chown root:root /etc/tis/users.txt
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### OAuth2 Authentication
|
|
||||||
|
|
||||||
Delegate authentication to external OAuth providers (Google, GitHub, GitLab, etc.)
|
|
||||||
|
|
||||||
**Pros:**
|
|
||||||
- No password management
|
|
||||||
- Leverage existing identity providers
|
|
||||||
- Support for SSO
|
|
||||||
- Can restrict by domain or specific users
|
|
||||||
|
|
||||||
**Cons:**
|
|
||||||
- Requires OAuth app registration
|
|
||||||
- Internet connectivity required
|
|
||||||
- More complex setup
|
|
||||||
- External dependency
|
|
||||||
|
|
||||||
#### Google OAuth
|
|
||||||
|
|
||||||
**Setup:**
|
|
||||||
|
|
||||||
1. Go to [Google Cloud Console](https://console.cloud.google.com/apis/credentials)
|
|
||||||
2. Create OAuth 2.0 Client ID
|
|
||||||
3. Add authorized redirect URI: `http://your-server:8080/oauth/callback`
|
|
||||||
4. Note the Client ID and Client Secret
|
|
||||||
|
|
||||||
**Configuration:**
|
|
||||||
|
|
||||||
```ini
|
|
||||||
[authentication]
|
|
||||||
type = oauth
|
|
||||||
provider = google
|
|
||||||
client_id = 123456789-abcdefghijklmnop.apps.googleusercontent.com
|
|
||||||
client_secret = GOCSPX-your-client-secret-here
|
|
||||||
redirect_uri = http://your-server:8080/oauth/callback
|
|
||||||
|
|
||||||
# Restrict to specific domain(s)
|
|
||||||
authorized_domains = example.com,mycompany.com
|
|
||||||
|
|
||||||
# Or restrict to specific users
|
|
||||||
authorized_users = admin@example.com,backup-admin@example.com
|
|
||||||
```
|
|
||||||
|
|
||||||
#### GitHub OAuth
|
|
||||||
|
|
||||||
**Setup:**
|
|
||||||
|
|
||||||
1. Go to GitHub Settings > Developer settings > [OAuth Apps](https://github.com/settings/developers)
|
|
||||||
2. Register a new application
|
|
||||||
3. Set Authorization callback URL: `http://your-server:8080/oauth/callback`
|
|
||||||
4. Note the Client ID and Client Secret
|
|
||||||
|
|
||||||
**Configuration:**
|
|
||||||
|
|
||||||
```ini
|
|
||||||
[authentication]
|
|
||||||
type = oauth
|
|
||||||
provider = github
|
|
||||||
client_id = your-github-client-id
|
|
||||||
client_secret = your-github-client-secret
|
|
||||||
redirect_uri = http://your-server:8080/oauth/callback
|
|
||||||
authorized_users = admin@example.com,devops@example.com
|
|
||||||
```
|
|
||||||
|
|
||||||
#### GitLab OAuth
|
|
||||||
|
|
||||||
**Setup:**
|
|
||||||
|
|
||||||
1. Go to GitLab User Settings > [Applications](https://gitlab.com/-/profile/applications)
|
|
||||||
2. Create application with scopes: `read_user`, `email`
|
|
||||||
3. Set Redirect URI: `http://your-server:8080/oauth/callback`
|
|
||||||
4. Note the Application ID and Secret
|
|
||||||
|
|
||||||
**Configuration:**
|
|
||||||
|
|
||||||
```ini
|
|
||||||
[authentication]
|
|
||||||
type = oauth
|
|
||||||
provider = gitlab
|
|
||||||
client_id = your-gitlab-application-id
|
|
||||||
client_secret = your-gitlab-secret
|
|
||||||
redirect_uri = http://your-server:8080/oauth/callback
|
|
||||||
authorized_domains = example.com
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Generic OAuth Provider
|
|
||||||
|
|
||||||
For custom OAuth providers:
|
|
||||||
|
|
||||||
```ini
|
|
||||||
[authentication]
|
|
||||||
type = oauth
|
|
||||||
provider = generic
|
|
||||||
client_id = your-client-id
|
|
||||||
client_secret = your-client-secret
|
|
||||||
redirect_uri = http://your-server:8080/oauth/callback
|
|
||||||
|
|
||||||
# Custom endpoints
|
|
||||||
authorization_endpoint = https://auth.example.com/oauth/authorize
|
|
||||||
token_endpoint = https://auth.example.com/oauth/token
|
|
||||||
userinfo_endpoint = https://auth.example.com/oauth/userinfo
|
|
||||||
scopes = openid,email,profile
|
|
||||||
|
|
||||||
# Authorization rules
|
|
||||||
authorized_domains = example.com
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Security Best Practices
|
|
||||||
|
|
||||||
### 1. Use HTTPS in Production
|
|
||||||
|
|
||||||
Always use a reverse proxy with TLS:
|
|
||||||
|
|
||||||
```nginx
|
|
||||||
server {
|
|
||||||
listen 443 ssl http2;
|
|
||||||
server_name tisbackup.example.com;
|
|
||||||
|
|
||||||
ssl_certificate /etc/letsencrypt/live/tisbackup.example.com/fullchain.pem;
|
|
||||||
ssl_certificate_key /etc/letsencrypt/live/tisbackup.example.com/privkey.pem;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
proxy_pass http://localhost:8080/;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Proto https;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### 2. Set Strong Flask Secret Key
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Generate secret
|
|
||||||
python3 -c "import secrets; print(secrets.token_hex(32))"
|
|
||||||
|
|
||||||
# Set in environment
|
|
||||||
export TISBACKUP_SECRET_KEY=your-generated-secret-key
|
|
||||||
```
|
|
||||||
|
|
||||||
### 3. Protect Configuration Files
|
|
||||||
|
|
||||||
```bash
|
|
||||||
chmod 600 /etc/tis/tisbackup_gui.ini
|
|
||||||
chmod 600 /etc/tis/users.txt # if using Flask-Login
|
|
||||||
chown root:root /etc/tis/*.ini
|
|
||||||
```
|
|
||||||
|
|
||||||
### 4. Use Environment Variables for Secrets
|
|
||||||
|
|
||||||
Instead of hardcoding secrets in config files:
|
|
||||||
|
|
||||||
```ini
|
|
||||||
[authentication]
|
|
||||||
type = oauth
|
|
||||||
client_id = ${OAUTH_CLIENT_ID}
|
|
||||||
client_secret = ${OAUTH_CLIENT_SECRET}
|
|
||||||
```
|
|
||||||
|
|
||||||
Then set in Docker Compose:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
services:
|
|
||||||
tisbackup_gui:
|
|
||||||
environment:
|
|
||||||
- OAUTH_CLIENT_ID=your-client-id
|
|
||||||
- OAUTH_CLIENT_SECRET=your-client-secret
|
|
||||||
- TISBACKUP_SECRET_KEY=your-secret-key
|
|
||||||
```
|
|
||||||
|
|
||||||
### 5. Regularly Rotate Credentials
|
|
||||||
|
|
||||||
- Change passwords/secrets every 90 days
|
|
||||||
- Rotate OAuth client secrets annually
|
|
||||||
- Review authorized users/domains regularly
|
|
||||||
|
|
||||||
### 6. Monitor Authentication Logs
|
|
||||||
|
|
||||||
Check logs for failed authentication attempts:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker logs tisbackup_gui | grep -i "auth"
|
|
||||||
```
|
|
||||||
|
|
||||||
## Troubleshooting
|
|
||||||
|
|
||||||
### Basic Auth Not Working
|
|
||||||
|
|
||||||
1. **Check bcrypt installation:**
|
|
||||||
```bash
|
|
||||||
uv sync --extra auth-basic
|
|
||||||
```
|
|
||||||
|
|
||||||
2. **Verify password hash:**
|
|
||||||
```bash
|
|
||||||
python3 -c "import bcrypt; print(bcrypt.checkpw(b'yourpassword', b'$2b$12$your-hash'))"
|
|
||||||
```
|
|
||||||
|
|
||||||
3. **Check browser credentials:**
|
|
||||||
- Clear browser cache
|
|
||||||
- Try incognito/private mode
|
|
||||||
|
|
||||||
### Flask-Login Issues
|
|
||||||
|
|
||||||
1. **Users file not found:**
|
|
||||||
```bash
|
|
||||||
ls -la /etc/tis/users.txt
|
|
||||||
chmod 600 /etc/tis/users.txt
|
|
||||||
```
|
|
||||||
|
|
||||||
2. **Module not found:**
|
|
||||||
```bash
|
|
||||||
uv sync --extra auth-login
|
|
||||||
```
|
|
||||||
|
|
||||||
3. **Session problems:**
|
|
||||||
- Check `TISBACKUP_SECRET_KEY` is set
|
|
||||||
- Ensure cookies are enabled
|
|
||||||
|
|
||||||
### OAuth Problems
|
|
||||||
|
|
||||||
1. **Redirect URI mismatch:**
|
|
||||||
- Ensure redirect URI in config matches OAuth app settings exactly
|
|
||||||
- Check for http vs https mismatch
|
|
||||||
|
|
||||||
2. **Unauthorized domain/user:**
|
|
||||||
- Verify email matches `authorized_users` or domain matches `authorized_domains`
|
|
||||||
- Check OAuth provider returns email in user info
|
|
||||||
|
|
||||||
3. **Module not found:**
|
|
||||||
```bash
|
|
||||||
uv sync --extra auth-oauth
|
|
||||||
```
|
|
||||||
|
|
||||||
4. **Token errors:**
|
|
||||||
- Verify client ID and secret are correct
|
|
||||||
- Check OAuth app is enabled
|
|
||||||
- Ensure scopes are correct
|
|
||||||
|
|
||||||
## API Access with Authentication
|
|
||||||
|
|
||||||
### Basic Auth
|
|
||||||
|
|
||||||
```bash
|
|
||||||
curl -u admin:password http://localhost:8080/api/backups
|
|
||||||
```
|
|
||||||
|
|
||||||
### OAuth (with access token)
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Not recommended for API access - use service account or API keys instead
|
|
||||||
```
|
|
||||||
|
|
||||||
### Recommendation for API Access
|
|
||||||
|
|
||||||
For programmatic API access, use Basic Auth with a dedicated API user:
|
|
||||||
|
|
||||||
```ini
|
|
||||||
[authentication]
|
|
||||||
type = basic
|
|
||||||
username = api-user
|
|
||||||
password = $2b$12$...
|
|
||||||
```
|
|
||||||
|
|
||||||
Or implement API key authentication separately for API endpoints.
|
|
||||||
|
|
||||||
## Migration Guide
|
|
||||||
|
|
||||||
### From No Auth to Basic Auth
|
|
||||||
|
|
||||||
1. Add authentication section to config
|
|
||||||
2. Install bcrypt: `uv sync --extra auth-basic`
|
|
||||||
3. Restart service
|
|
||||||
4. Update client scripts with credentials
|
|
||||||
|
|
||||||
### From Basic Auth to OAuth
|
|
||||||
|
|
||||||
1. Register OAuth application
|
|
||||||
2. Update configuration
|
|
||||||
3. Install dependencies: `uv sync --extra auth-oauth`
|
|
||||||
4. Test OAuth login flow
|
|
||||||
5. Update redirect URI if needed
|
|
||||||
|
|
||||||
### From Flask-Login to OAuth
|
|
||||||
|
|
||||||
1. Register OAuth application
|
|
||||||
2. Map user emails to OAuth provider
|
|
||||||
3. Update configuration
|
|
||||||
4. Test migration with test users first
|
|
||||||
|
|
||||||
## Support
|
|
||||||
|
|
||||||
For issues or questions:
|
|
||||||
- Check logs: `docker logs tisbackup_gui`
|
|
||||||
- Review configuration syntax
|
|
||||||
- Verify dependencies are installed
|
|
||||||
- See [SECURITY_IMPROVEMENTS.md](../SECURITY_IMPROVEMENTS.md) for security context
|
|
||||||
@@ -1,156 +0,0 @@
|
|||||||
# CLAUDE.md
|
|
||||||
|
|
||||||
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
||||||
|
|
||||||
## Project Overview
|
|
||||||
|
|
||||||
TISBackup is a server-side backup orchestration system written in Python. It executes scheduled backups of various data sources (databases, files, VMs) from remote Linux and Windows systems. The project consists of:
|
|
||||||
|
|
||||||
- A CLI tool ([tisbackup.py](tisbackup.py)) for executing backups, cleanup, and monitoring
|
|
||||||
- A Flask web GUI ([tisbackup_gui.py](tisbackup_gui.py)) for managing backups
|
|
||||||
- A pluggable backup driver architecture in [libtisbackup/](libtisbackup/)
|
|
||||||
- Task queue system using Huey with Redis ([tasks.py](tasks.py), [config.py](config.py))
|
|
||||||
- Docker-based deployment with cron scheduling
|
|
||||||
|
|
||||||
## Development Commands
|
|
||||||
|
|
||||||
### Dependency Management
|
|
||||||
```bash
|
|
||||||
# Install dependencies (uses uv)
|
|
||||||
uv sync --locked
|
|
||||||
|
|
||||||
# Update dependencies
|
|
||||||
uv lock
|
|
||||||
```
|
|
||||||
|
|
||||||
### Linting
|
|
||||||
```bash
|
|
||||||
# Run ruff linter
|
|
||||||
ruff check .
|
|
||||||
|
|
||||||
# Auto-fix linting issues
|
|
||||||
ruff check --fix .
|
|
||||||
```
|
|
||||||
|
|
||||||
### Running the Application
|
|
||||||
|
|
||||||
**Web GUI (development):**
|
|
||||||
```bash
|
|
||||||
python3 tisbackup_gui.py
|
|
||||||
# Runs on port 8080, requires config at /etc/tis/tisbackup_gui.ini
|
|
||||||
```
|
|
||||||
|
|
||||||
**CLI Commands:**
|
|
||||||
```bash
|
|
||||||
# Run backups
|
|
||||||
python3 tisbackup.py -c /etc/tis/tisbackup-config.ini backup
|
|
||||||
|
|
||||||
# Run specific backup section
|
|
||||||
python3 tisbackup.py -c /etc/tis/tisbackup-config.ini -s section_name backup
|
|
||||||
|
|
||||||
# Cleanup old backups
|
|
||||||
python3 tisbackup.py -c /etc/tis/tisbackup-config.ini cleanup
|
|
||||||
|
|
||||||
# Check backup status (for Nagios)
|
|
||||||
python3 tisbackup.py -c /etc/tis/tisbackup-config.ini checknagios
|
|
||||||
|
|
||||||
# List available backup drivers
|
|
||||||
python3 tisbackup.py listdrivers
|
|
||||||
```
|
|
||||||
|
|
||||||
### Docker
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Build image
|
|
||||||
docker build . -t tisbackup:latest
|
|
||||||
|
|
||||||
# Run via docker compose (see README.md for full setup)
|
|
||||||
docker compose up -d
|
|
||||||
```
|
|
||||||
|
|
||||||
## Architecture
|
|
||||||
|
|
||||||
### Core Components
|
|
||||||
|
|
||||||
**Main Entry Points:**
|
|
||||||
- [tisbackup.py](tisbackup.py) - CLI application with argument parsing and action routing (backup, cleanup, checknagios, etc.)
|
|
||||||
- [tisbackup_gui.py](tisbackup_gui.py) - Flask web application providing UI for backup management and status monitoring
|
|
||||||
- [tasks.py](tasks.py) - Huey task definitions for async operations (export_backup)
|
|
||||||
|
|
||||||
**Backup Driver System:**
|
|
||||||
|
|
||||||
All backup logic is implemented via driver classes in [libtisbackup/](libtisbackup/):
|
|
||||||
|
|
||||||
- Base class: `backup_generic` in [common.py](libtisbackup/common.py:565) (abstract)
|
|
||||||
- Each driver inherits from `backup_generic` and implements specific backup logic
|
|
||||||
- Drivers are registered via the `register_driver()` decorator function
|
|
||||||
- Configuration is read from INI files using the `read_config()` method
|
|
||||||
|
|
||||||
**Available Drivers:**
|
|
||||||
- `backup_rsync` / `backup_rsync_ssh` - File-based backups via rsync
|
|
||||||
- `backup_rsync_btrfs` / `backup_rsync__btrfs_ssh` - Btrfs snapshot-based backups
|
|
||||||
- `backup_mysql` - MySQL database dumps
|
|
||||||
- `backup_pgsql` - PostgreSQL database dumps
|
|
||||||
- `backup_oracle` - Oracle database backups
|
|
||||||
- `backup_sqlserver` - SQL Server backups
|
|
||||||
- `backup_samba4` - Samba4 AD backups
|
|
||||||
- `backup_xva` / `backup_xcp_metadata` - XenServer VM backups
|
|
||||||
- `backup_vmdk` - VMware VMDK backups
|
|
||||||
- `backup_switch` - Network switch configuration backups
|
|
||||||
- `backup_null` - No-op driver for testing
|
|
||||||
|
|
||||||
**State Management:**
|
|
||||||
- SQLite database tracks backup history, status, and statistics
|
|
||||||
- `BackupStat` class in [common.py](libtisbackup/common.py) handles DB operations
|
|
||||||
- Database location: `{backup_base_dir}/log/tisbackup.sqlite`
|
|
||||||
|
|
||||||
### Configuration
|
|
||||||
|
|
||||||
Two separate INI configuration files:
|
|
||||||
|
|
||||||
1. **tisbackup-config.ini** - Backup definitions
|
|
||||||
- `[global]` section with defaults (backup_base_dir, backup_retention_time, maximum_backup_age)
|
|
||||||
- One section per backup job with driver type and parameters
|
|
||||||
|
|
||||||
2. **tisbackup_gui.ini** - GUI settings
|
|
||||||
- Points to tisbackup-config.ini location(s)
|
|
||||||
- Defines admin email, base directories
|
|
||||||
|
|
||||||
### Task Queue
|
|
||||||
|
|
||||||
- Uses Huey (Redis-backed) for async job processing
|
|
||||||
- Currently implements `run_export_backup` for exporting backups to external storage
|
|
||||||
- Task state tracked in tasks.sqlite
|
|
||||||
|
|
||||||
### Docker Deployment
|
|
||||||
|
|
||||||
Two-container architecture:
|
|
||||||
- **tisbackup_gui**: Runs Flask web interface
|
|
||||||
- **tisbackup_cron**: Runs scheduled backups via cron (executes [backup.sh](backup.sh) at 03:59 daily)
|
|
||||||
|
|
||||||
## Code Style
|
|
||||||
|
|
||||||
- Line length: 140 characters (configured in pyproject.toml)
|
|
||||||
- Ruff ignores: F401, F403, F405, E402, E701, E722, E741
|
|
||||||
- Python 3.13+ required
|
|
||||||
|
|
||||||
## Important Patterns
|
|
||||||
|
|
||||||
**Adding a new backup driver:**
|
|
||||||
1. Create `backup_<type>.py` in [libtisbackup/](libtisbackup/)
|
|
||||||
2. Inherit from `backup_generic`
|
|
||||||
3. Set class attributes: `type`, `required_params`, `optional_params`
|
|
||||||
4. Implement abstract methods: `do_backup()`, `cleanup()`, `checknagios()`
|
|
||||||
5. Register with `register_driver(backup_<type>)`
|
|
||||||
6. Import in [tisbackup.py](tisbackup.py)
|
|
||||||
|
|
||||||
**SSH Operations:**
|
|
||||||
- Uses paramiko for SSH connections
|
|
||||||
- Supports both RSA and DSA keys
|
|
||||||
- Private key path specified per backup section via `private_key` parameter
|
|
||||||
- Pre/post-exec hooks run remote commands via SSH
|
|
||||||
|
|
||||||
**Path Handling:**
|
|
||||||
- Module imports use sys.path manipulation to include lib/ and libtisbackup/
|
|
||||||
- All backup drivers expect absolute paths for backup_dir
|
|
||||||
- Backup directory structure: `{backup_base_dir}/{section_name}/{timestamp}/`
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
FROM python:3.13-slim
|
|
||||||
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
|
|
||||||
|
|
||||||
WORKDIR /opt/tisbackup
|
|
||||||
|
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
|
||||||
COPY . /opt/tisbackup
|
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
|
||||||
ENV UV_PROJECT_ENVIRONMENT=/usr/local
|
|
||||||
ENV UV_PYTHON_DOWNLOADS=never
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get upgrade -y \
|
|
||||||
&& apt-get install --no-install-recommends -y rsync ssh cron \
|
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
|
||||||
&& uv sync --locked --no-dev --no-install-project \
|
|
||||||
&& rm -f /bin/uv /bin/uvx \
|
|
||||||
&& mkdir -p /var/spool/cron/crontabs \
|
|
||||||
&& echo '59 03 * * * root /bin/bash /opt/tisbackup/backup.sh' > /etc/crontab \
|
|
||||||
&& echo '' >> /etc/crontab \
|
|
||||||
&& crontab /etc/crontab
|
|
||||||
|
|
||||||
EXPOSE 8080
|
|
||||||
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
|
||||||
CMD ["/usr/local/bin/python3.13","/opt/tisbackup/tisbackup_gui.py"]
|
|
||||||
@@ -1,483 +1,16 @@
|
|||||||
# TISBackup
|
tisbackup
|
||||||
|
=========
|
||||||
|
|
||||||
A comprehensive server-side backup orchestration system for managing automated backups of databases, files, and virtual machines across remote Linux and Windows systems.
|
Le script tisbackup se base sur un fichier de configuration .ini. Cf le fichier d'exemple pour le format
|
||||||
|
|
||||||
[](https://www.gnu.org/licenses/gpl-3.0)
|
Pour lancer le backup, lancer la commande
|
||||||
[](https://www.python.org/downloads/)
|
./tisbackup.py -c fichierconf.ini
|
||||||
|
|
||||||
## Overview
|
Pour lancer une section particulière du fichier .ini
|
||||||
|
./tisbackup.py -c fichierconf.ini -s section_choisi
|
||||||
|
|
||||||
TISBackup is a Python-based backup solution that provides:
|
Pour mettre le mode debug
|
||||||
|
./tisbackup.py -c fichierconf.ini -l debug
|
||||||
|
|
||||||
- **Pluggable backup drivers** for different data sources (databases, files, VMs)
|
|
||||||
- **Web-based management interface** for monitoring and controlling backups
|
|
||||||
- **CLI tool** for automation and scripting
|
|
||||||
- **Automated scheduling** via cron
|
|
||||||
- **Backup retention management** with configurable policies
|
|
||||||
- **Status monitoring** with Nagios integration
|
|
||||||
- **Docker deployment** for easy setup and isolation
|
|
||||||
|
|
||||||
### Supported Backup Types
|
Pour plus d'informations aller voir le site : http://dev.tranquil.it/
|
||||||
|
|
||||||
| Type | Description | Driver |
|
|
||||||
|------|-------------|--------|
|
|
||||||
| **Files & Directories** | rsync-based file backups | `rsync+ssh` |
|
|
||||||
| **Btrfs Snapshots** | Snapshot-based incremental backups | `rsync+btrfs+ssh` |
|
|
||||||
| **MySQL** | Database dumps via SSH | `mysql+ssh` |
|
|
||||||
| **PostgreSQL** | Database dumps via SSH | `pgsql+ssh` |
|
|
||||||
| **SQL Server** | SQL Server backups | `sqlserver+ssh` |
|
|
||||||
| **Oracle** | Oracle database backups | `oracle+ssh` |
|
|
||||||
| **Samba4 AD** | Active Directory backups | `samba4` |
|
|
||||||
| **XenServer VMs** | XVA exports and metadata | `xen-xva`, `xcp-dump-metadata` |
|
|
||||||
| **VMware** | VMDK backups | `vmdk` |
|
|
||||||
| **Network Devices** | Switch configuration backups | `switch` |
|
|
||||||
|
|
||||||
## Quick Start
|
|
||||||
|
|
||||||
### Prerequisites
|
|
||||||
|
|
||||||
- Docker and Docker Compose
|
|
||||||
- SSH access to remote servers
|
|
||||||
- Ed25519, ECDSA, or RSA SSH keys (DSA not supported)
|
|
||||||
|
|
||||||
### Installation
|
|
||||||
|
|
||||||
1. **Clone the repository:**
|
|
||||||
```bash
|
|
||||||
git clone https://github.com/tranquilit/TISbackup.git
|
|
||||||
cd TISbackup
|
|
||||||
```
|
|
||||||
|
|
||||||
2. **Build the Docker image:**
|
|
||||||
```bash
|
|
||||||
docker build . -t tisbackup:latest
|
|
||||||
```
|
|
||||||
|
|
||||||
3. **Create directory structure:**
|
|
||||||
```bash
|
|
||||||
mkdir -p /var/tisbackup/{backup/log,config,ssh}
|
|
||||||
```
|
|
||||||
|
|
||||||
Expected structure:
|
|
||||||
```
|
|
||||||
/var/tisbackup/
|
|
||||||
├── backup/ # Backup storage location
|
|
||||||
│ └── log/ # SQLite database and logs
|
|
||||||
├── config/ # Configuration files
|
|
||||||
│ ├── tisbackup-config.ini
|
|
||||||
│ └── tisbackup_gui.ini
|
|
||||||
├── ssh/ # SSH keys
|
|
||||||
│ ├── id_ed25519 # Private key (Ed25519 recommended)
|
|
||||||
│ └── id_ed25519.pub # Public key
|
|
||||||
└── compose.yaml # Docker Compose configuration
|
|
||||||
```
|
|
||||||
|
|
||||||
4. **Generate SSH keys:**
|
|
||||||
```bash
|
|
||||||
# Ed25519 (recommended - most secure and modern)
|
|
||||||
ssh-keygen -t ed25519 -f /var/tisbackup/ssh/id_ed25519 -C "tisbackup@yourserver"
|
|
||||||
|
|
||||||
# Or ECDSA (also secure)
|
|
||||||
ssh-keygen -t ecdsa -b 521 -f /var/tisbackup/ssh/id_ecdsa -C "tisbackup@yourserver"
|
|
||||||
|
|
||||||
# Or RSA (legacy support, minimum 4096 bits)
|
|
||||||
ssh-keygen -t rsa -b 4096 -f /var/tisbackup/ssh/id_rsa -C "tisbackup@yourserver"
|
|
||||||
```
|
|
||||||
|
|
||||||
⚠️ **Note:** DSA keys are no longer supported due to security vulnerabilities.
|
|
||||||
|
|
||||||
5. **Deploy public key to remote servers:**
|
|
||||||
```bash
|
|
||||||
ssh-copy-id -i /var/tisbackup/ssh/id_ed25519.pub root@remote-server
|
|
||||||
```
|
|
||||||
|
|
||||||
6. **Generate Flask secret key:**
|
|
||||||
```bash
|
|
||||||
python3 -c "import secrets; print(secrets.token_hex(32))"
|
|
||||||
```
|
|
||||||
Save this key for the next step.
|
|
||||||
|
|
||||||
7. **Create Docker Compose configuration:**
|
|
||||||
```yaml
|
|
||||||
# /var/tisbackup/compose.yaml
|
|
||||||
services:
|
|
||||||
tisbackup_gui:
|
|
||||||
container_name: tisbackup_gui
|
|
||||||
image: "tisbackup:latest"
|
|
||||||
volumes:
|
|
||||||
- ./config/:/etc/tis/
|
|
||||||
- ./backup/:/backup/
|
|
||||||
- /etc/timezone:/etc/timezone:ro
|
|
||||||
- /etc/localtime:/etc/localtime:ro
|
|
||||||
environment:
|
|
||||||
# SECURITY: Use the secret key you generated above
|
|
||||||
- TISBACKUP_SECRET_KEY=your-secret-key-here
|
|
||||||
restart: unless-stopped
|
|
||||||
ports:
|
|
||||||
- 9980:8080
|
|
||||||
|
|
||||||
tisbackup_cron:
|
|
||||||
container_name: tisbackup_cron
|
|
||||||
image: "tisbackup:latest"
|
|
||||||
volumes:
|
|
||||||
- ./config/:/etc/tis/
|
|
||||||
- ./ssh/:/config_ssh/
|
|
||||||
- ./backup/:/backup/
|
|
||||||
- /etc/timezone:/etc/timezone:ro
|
|
||||||
- /etc/localtime:/etc/localtime:ro
|
|
||||||
restart: always
|
|
||||||
command: "/bin/bash /opt/tisbackup/cron.sh"
|
|
||||||
```
|
|
||||||
|
|
||||||
8. **Configure backups:**
|
|
||||||
|
|
||||||
Create `/var/tisbackup/config/tisbackup-config.ini`:
|
|
||||||
```ini
|
|
||||||
[global]
|
|
||||||
backup_base_dir = /backup/
|
|
||||||
# Backup retention in days
|
|
||||||
backup_retention_time = 90
|
|
||||||
# Maximum backup age for Nagios checks (hours)
|
|
||||||
maximum_backup_age = 30
|
|
||||||
|
|
||||||
# Example: File backup via rsync
|
|
||||||
[webserver-files]
|
|
||||||
type = rsync+ssh
|
|
||||||
server_name = webserver.example.com
|
|
||||||
remote_dir = /var/www/
|
|
||||||
compression = True
|
|
||||||
exclude_list = "/var/www/cache/**","/var/www/temp/**"
|
|
||||||
private_key = /config_ssh/id_ed25519
|
|
||||||
ssh_port = 22
|
|
||||||
|
|
||||||
# Example: MySQL database backup
|
|
||||||
[database-mysql]
|
|
||||||
type = mysql+ssh
|
|
||||||
server_name = db.example.com
|
|
||||||
db_name = production_db
|
|
||||||
db_user = backup_user
|
|
||||||
db_passwd = backup_password
|
|
||||||
private_key = /config_ssh/id_ed25519
|
|
||||||
ssh_port = 22
|
|
||||||
```
|
|
||||||
|
|
||||||
Create `/var/tisbackup/config/tisbackup_gui.ini`:
|
|
||||||
```ini
|
|
||||||
[general]
|
|
||||||
config_tisbackup = /etc/tis/tisbackup-config.ini
|
|
||||||
sections =
|
|
||||||
ADMIN_EMAIL = admin@example.com
|
|
||||||
base_config_dir = /etc/tis/
|
|
||||||
backup_base_dir = /backup/
|
|
||||||
```
|
|
||||||
|
|
||||||
9. **Start services:**
|
|
||||||
```bash
|
|
||||||
cd /var/tisbackup
|
|
||||||
docker compose up -d
|
|
||||||
```
|
|
||||||
|
|
||||||
10. **Access web interface:**
|
|
||||||
```
|
|
||||||
http://localhost:9980
|
|
||||||
```
|
|
||||||
|
|
||||||
## Configuration
|
|
||||||
|
|
||||||
### Backup Types Configuration
|
|
||||||
|
|
||||||
#### File Backups (rsync+ssh)
|
|
||||||
```ini
|
|
||||||
[backup-name]
|
|
||||||
type = rsync+ssh
|
|
||||||
server_name = hostname.example.com
|
|
||||||
remote_dir = /path/to/backup/
|
|
||||||
compression = True
|
|
||||||
exclude_list = "/path/exclude1/**","/path/exclude2/**"
|
|
||||||
private_key = /config_ssh/id_ed25519
|
|
||||||
ssh_port = 22
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Btrfs Snapshots (rsync+btrfs+ssh)
|
|
||||||
```ini
|
|
||||||
[backup-name]
|
|
||||||
type = rsync+btrfs+ssh
|
|
||||||
server_name = hostname.example.com
|
|
||||||
remote_dir = /mnt/btrfs/data/
|
|
||||||
compression = True
|
|
||||||
private_key = /config_ssh/id_ed25519
|
|
||||||
ssh_port = 22
|
|
||||||
```
|
|
||||||
|
|
||||||
#### MySQL Database (mysql+ssh)
|
|
||||||
```ini
|
|
||||||
[backup-name]
|
|
||||||
type = mysql+ssh
|
|
||||||
server_name = hostname.example.com
|
|
||||||
db_name = database_name
|
|
||||||
db_user = backup_user
|
|
||||||
db_passwd = backup_password
|
|
||||||
private_key = /config_ssh/id_ed25519
|
|
||||||
ssh_port = 22
|
|
||||||
```
|
|
||||||
|
|
||||||
#### PostgreSQL Database (pgsql+ssh)
|
|
||||||
```ini
|
|
||||||
[backup-name]
|
|
||||||
type = pgsql+ssh
|
|
||||||
server_name = hostname.example.com
|
|
||||||
db_name = database_name
|
|
||||||
private_key = /config_ssh/id_ed25519
|
|
||||||
ssh_port = 22
|
|
||||||
```
|
|
||||||
|
|
||||||
#### XenServer VM (xen-xva)
|
|
||||||
```ini
|
|
||||||
[backup-name]
|
|
||||||
type = xen-xva
|
|
||||||
server_name = vm-name
|
|
||||||
xcphost = xenserver.example.com
|
|
||||||
password_file = /etc/tis/xen-password
|
|
||||||
private_key = /config_ssh/id_ed25519
|
|
||||||
```
|
|
||||||
|
|
||||||
### Pre/Post Execution Hooks
|
|
||||||
|
|
||||||
You can execute commands before and after backups:
|
|
||||||
|
|
||||||
```ini
|
|
||||||
[backup-name]
|
|
||||||
type = rsync+ssh
|
|
||||||
server_name = hostname.example.com
|
|
||||||
remote_dir = /data/
|
|
||||||
private_key = /config_ssh/id_ed25519
|
|
||||||
preexec = systemctl stop application
|
|
||||||
postexec = systemctl start application
|
|
||||||
remote_user = root
|
|
||||||
ssh_port = 22
|
|
||||||
```
|
|
||||||
|
|
||||||
## CLI Usage
|
|
||||||
|
|
||||||
### Running Backups
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Run all backups
|
|
||||||
docker exec tisbackup_cron python3 /opt/tisbackup/tisbackup.py backup
|
|
||||||
|
|
||||||
# Run specific backup
|
|
||||||
docker exec tisbackup_cron python3 /opt/tisbackup/tisbackup.py -s backup-name backup
|
|
||||||
|
|
||||||
# Dry run
|
|
||||||
docker exec tisbackup_cron python3 /opt/tisbackup/tisbackup.py -d backup
|
|
||||||
```
|
|
||||||
|
|
||||||
### Cleanup Old Backups
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Remove backups older than retention period
|
|
||||||
docker exec tisbackup_cron python3 /opt/tisbackup/tisbackup.py cleanup
|
|
||||||
```
|
|
||||||
|
|
||||||
### Nagios Monitoring
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Check backup status
|
|
||||||
docker exec tisbackup_cron python3 /opt/tisbackup/tisbackup.py checknagios
|
|
||||||
|
|
||||||
# Check specific backup
|
|
||||||
docker exec tisbackup_cron python3 /opt/tisbackup/tisbackup.py -s backup-name checknagios
|
|
||||||
```
|
|
||||||
|
|
||||||
### List Available Drivers
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker exec tisbackup_cron python3 /opt/tisbackup/tisbackup.py listdrivers
|
|
||||||
```
|
|
||||||
|
|
||||||
### Backup Statistics
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Dump statistics for last 20 backups
|
|
||||||
docker exec tisbackup_cron python3 /opt/tisbackup/tisbackup.py dumpstat
|
|
||||||
|
|
||||||
# Specify number of backups
|
|
||||||
docker exec tisbackup_cron python3 /opt/tisbackup/tisbackup.py -n 50 dumpstat
|
|
||||||
```
|
|
||||||
|
|
||||||
## Development
|
|
||||||
|
|
||||||
### Prerequisites
|
|
||||||
|
|
||||||
- Python 3.13+
|
|
||||||
- uv (Python package manager)
|
|
||||||
|
|
||||||
### Setup Development Environment
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Install dependencies
|
|
||||||
uv sync --locked
|
|
||||||
|
|
||||||
# Run linter
|
|
||||||
uv run ruff check .
|
|
||||||
|
|
||||||
# Auto-fix linting issues
|
|
||||||
uv run ruff check --fix .
|
|
||||||
```
|
|
||||||
|
|
||||||
### Running Locally
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Run web GUI (requires config at /etc/tis/tisbackup_gui.ini)
|
|
||||||
python3 tisbackup_gui.py
|
|
||||||
|
|
||||||
# Run CLI
|
|
||||||
python3 tisbackup.py -c /etc/tis/tisbackup-config.ini backup
|
|
||||||
```
|
|
||||||
|
|
||||||
## Security
|
|
||||||
|
|
||||||
TISBackup implements several security best practices:
|
|
||||||
|
|
||||||
### SSH Key Security
|
|
||||||
|
|
||||||
- **Ed25519 keys are recommended** (most secure, modern algorithm)
|
|
||||||
- ECDSA and RSA keys are supported
|
|
||||||
- **DSA keys are explicitly not supported** (deprecated, insecure)
|
|
||||||
- Key algorithm priority: Ed25519 → ECDSA → RSA
|
|
||||||
|
|
||||||
### Flask Session Security
|
|
||||||
|
|
||||||
- Secret key loaded from `TISBACKUP_SECRET_KEY` environment variable
|
|
||||||
- Falls back to cryptographically secure random key if not set
|
|
||||||
- No hardcoded secrets in source code
|
|
||||||
|
|
||||||
### Command Execution Safety
|
|
||||||
|
|
||||||
- All system commands use `subprocess.run()` with list arguments
|
|
||||||
- Input validation for device paths and partition names
|
|
||||||
- Timeout protection on all subprocess calls
|
|
||||||
- No use of `shell=True` in new code
|
|
||||||
|
|
||||||
### Best Practices
|
|
||||||
|
|
||||||
1. **Use Ed25519 keys** for all SSH connections
|
|
||||||
2. **Set unique Flask secret key** via environment variable
|
|
||||||
3. **Use reverse proxy** (nginx) with TLS for web interface
|
|
||||||
4. **Restrict network access** to backup server
|
|
||||||
5. **Regular security updates** of base Docker image
|
|
||||||
6. **Monitor backup logs** for suspicious activity
|
|
||||||
|
|
||||||
## Reverse Proxy Setup
|
|
||||||
|
|
||||||
Example nginx configuration for HTTPS access:
|
|
||||||
|
|
||||||
```nginx
|
|
||||||
server {
|
|
||||||
listen 443 ssl http2;
|
|
||||||
server_name tisbackup.example.com;
|
|
||||||
|
|
||||||
ssl_certificate /etc/letsencrypt/live/tisbackup.example.com/fullchain.pem;
|
|
||||||
ssl_certificate_key /etc/letsencrypt/live/tisbackup.example.com/privkey.pem;
|
|
||||||
|
|
||||||
# Security headers
|
|
||||||
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
|
||||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
||||||
add_header X-Content-Type-Options "nosniff" always;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_pass http://localhost:9980/;
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection "upgrade";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Architecture
|
|
||||||
|
|
||||||
TISBackup uses a modular driver-based architecture:
|
|
||||||
|
|
||||||
- **Core CLI** ([tisbackup.py](tisbackup.py)): Backup orchestration and scheduling
|
|
||||||
- **Web GUI** ([tisbackup_gui.py](tisbackup_gui.py)): Flask-based management interface
|
|
||||||
- **Backup Drivers** ([libtisbackup/](libtisbackup/)): Pluggable modules for different backup types
|
|
||||||
- **Task Queue** ([tasks.py](tasks.py), [config.py](config.py)): Async job processing with Huey
|
|
||||||
- **State Database**: SQLite for tracking backup history and statistics
|
|
||||||
|
|
||||||
Each backup type is implemented as a driver class inheriting from `backup_generic`, allowing easy extension for new backup sources.
|
|
||||||
|
|
||||||
## Troubleshooting
|
|
||||||
|
|
||||||
### Backups Not Running
|
|
||||||
|
|
||||||
1. Check cron logs:
|
|
||||||
```bash
|
|
||||||
docker logs tisbackup_cron
|
|
||||||
```
|
|
||||||
|
|
||||||
2. Verify SSH connectivity:
|
|
||||||
```bash
|
|
||||||
docker exec tisbackup_cron ssh -i /config_ssh/id_ed25519 root@remote-server
|
|
||||||
```
|
|
||||||
|
|
||||||
3. Check backup configuration:
|
|
||||||
```bash
|
|
||||||
docker exec tisbackup_cron python3 /opt/tisbackup/tisbackup.py -c /etc/tis/tisbackup-config.ini -d backup
|
|
||||||
```
|
|
||||||
|
|
||||||
### Web Interface Not Accessible
|
|
||||||
|
|
||||||
1. Check GUI container logs:
|
|
||||||
```bash
|
|
||||||
docker logs tisbackup_gui
|
|
||||||
```
|
|
||||||
|
|
||||||
2. Verify port mapping:
|
|
||||||
```bash
|
|
||||||
docker ps | grep tisbackup_gui
|
|
||||||
```
|
|
||||||
|
|
||||||
3. Check configuration:
|
|
||||||
```bash
|
|
||||||
docker exec tisbackup_gui cat /etc/tis/tisbackup_gui.ini
|
|
||||||
```
|
|
||||||
|
|
||||||
### Permission Errors
|
|
||||||
|
|
||||||
Ensure proper file permissions:
|
|
||||||
```bash
|
|
||||||
chmod 600 /var/tisbackup/ssh/id_ed25519
|
|
||||||
chmod 644 /var/tisbackup/ssh/id_ed25519.pub
|
|
||||||
chown -R root:root /var/tisbackup/
|
|
||||||
```
|
|
||||||
|
|
||||||
## Contributing
|
|
||||||
|
|
||||||
Contributions are welcome! Please:
|
|
||||||
|
|
||||||
1. Fork the repository
|
|
||||||
2. Create a feature branch
|
|
||||||
3. Follow the existing code style (use `ruff` for linting)
|
|
||||||
4. Add tests if applicable
|
|
||||||
5. Submit a pull request
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
TISBackup is licensed under the GNU General Public License v3.0 (GPLv3).
|
|
||||||
|
|
||||||
See [LICENSE](LICENSE) for the full license text.
|
|
||||||
|
|
||||||
## Support & Documentation
|
|
||||||
|
|
||||||
- **Documentation**: [https://tisbackup.readthedocs.io](https://tisbackup.readthedocs.io/en/latest/index.html)
|
|
||||||
- **Issues**: [GitHub Issues](https://github.com/tranquilit/TISbackup/issues)
|
|
||||||
- **Original Author**: [Tranquil IT](https://www.tranquil.it)
|
|
||||||
|
|
||||||
## Credits
|
|
||||||
|
|
||||||
Developed by Tranquil IT for system administrators managing backup infrastructure.
|
|
||||||
|
|
||||||
Security improvements and modernization contributed by the community.
|
|
||||||
|
|||||||
@@ -1,272 +0,0 @@
|
|||||||
# Security and Code Quality Improvements
|
|
||||||
|
|
||||||
This document summarizes the security and code quality improvements made to TISBackup.
|
|
||||||
|
|
||||||
## Completed Improvements (High Priority)
|
|
||||||
|
|
||||||
### 1. Replaced `os.popen()` with `subprocess.run()`
|
|
||||||
**Files Modified:** [tisbackup_gui.py](tisbackup_gui.py)
|
|
||||||
|
|
||||||
**Changes:**
|
|
||||||
- Replaced deprecated `os.popen()` calls with modern `subprocess.run()`
|
|
||||||
- All subprocess calls now use list arguments instead of shell strings
|
|
||||||
- Added timeout protection (5-30 seconds depending on operation)
|
|
||||||
- Proper error handling with try/except blocks
|
|
||||||
|
|
||||||
**Before:**
|
|
||||||
```python
|
|
||||||
for line in os.popen("udevadm info -q env -n %s" % name):
|
|
||||||
# Process output
|
|
||||||
```
|
|
||||||
|
|
||||||
**After:**
|
|
||||||
```python
|
|
||||||
result = subprocess.run(
|
|
||||||
["udevadm", "info", "-q", "env", "-n", name],
|
|
||||||
capture_output=True,
|
|
||||||
text=True,
|
|
||||||
check=True,
|
|
||||||
timeout=5
|
|
||||||
)
|
|
||||||
for line in result.stdout.splitlines():
|
|
||||||
# Process output
|
|
||||||
```
|
|
||||||
|
|
||||||
**Security Impact:** Prevents command injection vulnerabilities
|
|
||||||
|
|
||||||
### 2. Replaced `os.system()` with `subprocess.run()`
|
|
||||||
**Files Modified:** [tasks.py](tasks.py), [libtisbackup/backup_xva.py](libtisbackup/backup_xva.py)
|
|
||||||
|
|
||||||
**Changes:**
|
|
||||||
- [tasks.py:37](tasks.py#L37): Changed `os.system("/bin/umount %s")` to `subprocess.run(["/bin/umount", mount_point])`
|
|
||||||
- [backup_xva.py:199](libtisbackup/backup_xva.py#L199): Changed `os.system('tar tf "%s"')` to `subprocess.run(["tar", "tf", filename_temp])`
|
|
||||||
- Added proper error handling and logging
|
|
||||||
|
|
||||||
**Security Impact:** Eliminates command injection risk from potentially user-controlled mount points and filenames
|
|
||||||
|
|
||||||
### 3. Added Input Validation
|
|
||||||
**Files Modified:** [tisbackup_gui.py](tisbackup_gui.py)
|
|
||||||
|
|
||||||
**Changes:**
|
|
||||||
- Added regex validation for device/partition names: `^/dev/sd[a-z]1?$`
|
|
||||||
- Validates partition names before using in mount/unmount operations
|
|
||||||
- Prevents path traversal and command injection attacks
|
|
||||||
|
|
||||||
**Example:**
|
|
||||||
```python
|
|
||||||
# Validate partition name to prevent command injection
|
|
||||||
if not re.match(r"^/dev/sd[a-z]1$", partition):
|
|
||||||
continue
|
|
||||||
```
|
|
||||||
|
|
||||||
**Security Impact:** Prevents malicious input from reaching system commands
|
|
||||||
|
|
||||||
### 4. Fixed File Operations with Context Managers
|
|
||||||
**Files Modified:** [tisbackup_gui.py](tisbackup_gui.py)
|
|
||||||
|
|
||||||
**Before:**
|
|
||||||
```python
|
|
||||||
line = open(elem).readline()
|
|
||||||
```
|
|
||||||
|
|
||||||
**After:**
|
|
||||||
```python
|
|
||||||
with open(elem) as f:
|
|
||||||
line = f.readline()
|
|
||||||
```
|
|
||||||
|
|
||||||
**Impact:** Ensures files are properly closed, prevents resource leaks
|
|
||||||
|
|
||||||
### 5. Improved `run_command()` Function
|
|
||||||
**Files Modified:** [tisbackup_gui.py:415-453](tisbackup_gui.py#L415)
|
|
||||||
|
|
||||||
**Changes:**
|
|
||||||
- Now accepts list arguments for safe command execution
|
|
||||||
- Backward compatible with string commands (marked as legacy)
|
|
||||||
- Added timeout protection (30 seconds)
|
|
||||||
- Better error handling and reporting
|
|
||||||
|
|
||||||
**Security Impact:** Provides safe command execution interface while maintaining backward compatibility
|
|
||||||
|
|
||||||
### 6. Removed Wildcard Import
|
|
||||||
**Files Modified:** [tisbackup_gui.py](tisbackup_gui.py)
|
|
||||||
|
|
||||||
**Before:**
|
|
||||||
```python
|
|
||||||
from shutil import *
|
|
||||||
```
|
|
||||||
|
|
||||||
**After:**
|
|
||||||
```python
|
|
||||||
import shutil
|
|
||||||
import subprocess
|
|
||||||
```
|
|
||||||
|
|
||||||
**Impact:** Cleaner namespace, easier to track dependencies
|
|
||||||
|
|
||||||
### 7. Fixed Hardcoded Secret Key
|
|
||||||
**Files Modified:** [tisbackup_gui.py:67-79](tisbackup_gui.py#L67), [README.md](README.md)
|
|
||||||
|
|
||||||
**Before:**
|
|
||||||
```python
|
|
||||||
app.secret_key = "fsiqefiuqsefARZ4Zfesfe34234dfzefzfe"
|
|
||||||
```
|
|
||||||
|
|
||||||
**After:**
|
|
||||||
```python
|
|
||||||
SECRET_KEY = os.environ.get("TISBACKUP_SECRET_KEY")
|
|
||||||
if not SECRET_KEY:
|
|
||||||
import secrets
|
|
||||||
SECRET_KEY = secrets.token_hex(32)
|
|
||||||
logging.warning(
|
|
||||||
"TISBACKUP_SECRET_KEY environment variable not set. "
|
|
||||||
"Using a randomly generated secret key. "
|
|
||||||
"Sessions will not persist across application restarts. "
|
|
||||||
"Set TISBACKUP_SECRET_KEY environment variable for production use."
|
|
||||||
)
|
|
||||||
app.secret_key = SECRET_KEY
|
|
||||||
```
|
|
||||||
|
|
||||||
**Changes:**
|
|
||||||
- Reads secret key from `TISBACKUP_SECRET_KEY` environment variable
|
|
||||||
- Falls back to cryptographically secure random key if not set
|
|
||||||
- Logs warning when using random key (sessions won't persist across restarts)
|
|
||||||
- Uses Python's `secrets` module for cryptographically strong random generation
|
|
||||||
- Updated README.md with setup instructions
|
|
||||||
|
|
||||||
**Setup Instructions:**
|
|
||||||
```bash
|
|
||||||
# Generate a secure secret key
|
|
||||||
python3 -c "import secrets; print(secrets.token_hex(32))"
|
|
||||||
|
|
||||||
# Set in Docker Compose (compose.yml)
|
|
||||||
environment:
|
|
||||||
- TISBACKUP_SECRET_KEY=your-generated-key-here
|
|
||||||
|
|
||||||
# Or export in shell
|
|
||||||
export TISBACKUP_SECRET_KEY=your-generated-key-here
|
|
||||||
```
|
|
||||||
|
|
||||||
**Security Impact:** Eliminates hardcoded secret in source code, prevents session hijacking and CSRF attacks
|
|
||||||
|
|
||||||
### 8. Modernized SSH Key Algorithm Support
|
|
||||||
**Files Modified:** [libtisbackup/common.py](libtisbackup/common.py#L140), all backup drivers, [README.md](README.md)
|
|
||||||
|
|
||||||
**Before:**
|
|
||||||
```python
|
|
||||||
try:
|
|
||||||
mykey = paramiko.RSAKey.from_private_key_file(self.private_key)
|
|
||||||
except paramiko.SSHException:
|
|
||||||
mykey = paramiko.DSSKey.from_private_key_file(self.private_key)
|
|
||||||
```
|
|
||||||
|
|
||||||
**After:**
|
|
||||||
```python
|
|
||||||
def load_ssh_private_key(private_key_path):
|
|
||||||
"""Load SSH private key with modern algorithm support.
|
|
||||||
|
|
||||||
Tries to load the key in order of preference:
|
|
||||||
1. Ed25519 (most secure, modern)
|
|
||||||
2. ECDSA (secure, widely supported)
|
|
||||||
3. RSA (legacy, still secure with sufficient key size)
|
|
||||||
|
|
||||||
DSA is not supported as it's deprecated and insecure.
|
|
||||||
"""
|
|
||||||
key_types = [
|
|
||||||
("Ed25519", paramiko.Ed25519Key),
|
|
||||||
("ECDSA", paramiko.ECDSAKey),
|
|
||||||
("RSA", paramiko.RSAKey),
|
|
||||||
]
|
|
||||||
|
|
||||||
for key_name, key_class in key_types:
|
|
||||||
try:
|
|
||||||
return key_class.from_private_key_file(private_key_path)
|
|
||||||
except paramiko.SSHException:
|
|
||||||
continue
|
|
||||||
|
|
||||||
raise paramiko.SSHException(
|
|
||||||
f"Unable to load private key. "
|
|
||||||
f"Supported formats: Ed25519 (recommended), ECDSA, RSA. "
|
|
||||||
f"DSA keys are no longer supported."
|
|
||||||
)
|
|
||||||
```
|
|
||||||
|
|
||||||
**Changes:**
|
|
||||||
- Created centralized `load_ssh_private_key()` helper function
|
|
||||||
- Updated all SSH key loading locations across codebase:
|
|
||||||
- [common.py](libtisbackup/common.py): `do_preexec`, `do_postexec`, `run_remote_command`
|
|
||||||
- [backup_mysql.py](libtisbackup/backup_mysql.py)
|
|
||||||
- [backup_pgsql.py](libtisbackup/backup_pgsql.py)
|
|
||||||
- [backup_sqlserver.py](libtisbackup/backup_sqlserver.py)
|
|
||||||
- [backup_oracle.py](libtisbackup/backup_oracle.py)
|
|
||||||
- [backup_samba4.py](libtisbackup/backup_samba4.py)
|
|
||||||
- Removed deprecated DSA key support
|
|
||||||
- Added Ed25519 as preferred algorithm
|
|
||||||
- Added ECDSA as second choice
|
|
||||||
- RSA remains supported for compatibility
|
|
||||||
- Clear error message indicating DSA is no longer supported
|
|
||||||
- Updated README.md with key generation instructions
|
|
||||||
|
|
||||||
**SSH Key Generation:**
|
|
||||||
```bash
|
|
||||||
# Ed25519 (recommended)
|
|
||||||
ssh-keygen -t ed25519 -f ./ssh/id_ed25519 -C "tisbackup"
|
|
||||||
|
|
||||||
# ECDSA (also secure)
|
|
||||||
ssh-keygen -t ecdsa -b 521 -f ./ssh/id_ecdsa
|
|
||||||
|
|
||||||
# RSA (legacy, minimum 4096 bits)
|
|
||||||
ssh-keygen -t rsa -b 4096 -f ./ssh/id_rsa
|
|
||||||
```
|
|
||||||
|
|
||||||
**Security Impact:**
|
|
||||||
- Eliminates support for vulnerable DSA algorithm (1024-bit limit, FIPS deprecated)
|
|
||||||
- Prioritizes Ed25519 (fast, secure, resistant to timing attacks)
|
|
||||||
- Supports ECDSA as secure alternative
|
|
||||||
- Maintains RSA compatibility for legacy systems
|
|
||||||
- Clear migration path for users with old keys
|
|
||||||
|
|
||||||
## Remaining Security Issues (Critical - Not Fixed)
|
|
||||||
|
|
||||||
### 1. **No Authentication on Flask Routes**
|
|
||||||
All routes are publicly accessible without authentication.
|
|
||||||
|
|
||||||
**Recommendation:** Implement Flask-Login or similar authentication
|
|
||||||
|
|
||||||
### 2. **Insecure SSH Host Key Policy** ([libtisbackup/common.py:649](libtisbackup/common.py#L649))
|
|
||||||
```python
|
|
||||||
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
||||||
```
|
|
||||||
**Recommendation:** Use proper host key verification with known_hosts
|
|
||||||
|
|
||||||
### 3. **Command Injection in Legacy Code**
|
|
||||||
Multiple files still use `subprocess.call(shell_string, shell=True)` and `subprocess.Popen(..., shell=True)`:
|
|
||||||
- [libtisbackup/common.py:128](libtisbackup/common.py#L128)
|
|
||||||
- [libtisbackup/common.py:883](libtisbackup/common.py#L883)
|
|
||||||
- [libtisbackup/common.py:986](libtisbackup/common.py#L986)
|
|
||||||
- [libtisbackup/backup_rsync.py:176](libtisbackup/backup_rsync.py#L176)
|
|
||||||
- [libtisbackup/backup_rsync_btrfs.py](libtisbackup/backup_rsync_btrfs.py) (multiple locations)
|
|
||||||
|
|
||||||
**Recommendation:** Refactor to use list arguments without shell=True
|
|
||||||
|
|
||||||
## Code Quality Issues Remaining
|
|
||||||
|
|
||||||
1. **Global State Management** - Use Flask application context instead
|
|
||||||
2. **Wildcard imports from common** - `from libtisbackup.common import *`
|
|
||||||
3. **Configuration loaded at module level** - Should use application factory pattern
|
|
||||||
4. **Duplicated code** - `read_config()` and `read_all_configs()` share significant logic
|
|
||||||
|
|
||||||
## Testing Recommendations
|
|
||||||
|
|
||||||
Before deploying these changes:
|
|
||||||
1. Test USB disk detection and mounting functionality
|
|
||||||
2. Test backup export operations
|
|
||||||
3. Verify XVA backup tar validation
|
|
||||||
4. Test error handling for invalid device names
|
|
||||||
5. Verify backward compatibility with existing configurations
|
|
||||||
|
|
||||||
## Migration Notes
|
|
||||||
|
|
||||||
All changes are backward compatible. The `run_command()` function accepts both:
|
|
||||||
- New format: `run_command(["/bin/command", "arg1", "arg2"])`
|
|
||||||
- Legacy format: `run_command("/bin/command arg1 arg2")` (less secure, marked for deprecation)
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -x
|
|
||||||
echo "Starting cleanup job for TIS Backup"
|
|
||||||
/usr/local/bin/python3.13 /opt/tisbackup/tisbackup.py backup
|
|
||||||
/usr/local/bin/python3.13 /opt/tisbackup/tisbackup.py cleanup
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
services:
|
|
||||||
tisbackup_gui:
|
|
||||||
container_name: tisbackup_gui
|
|
||||||
image: "tisbackup:latest"
|
|
||||||
build: .
|
|
||||||
volumes:
|
|
||||||
- ./config/:/etc/tis/
|
|
||||||
- ./backup/:/backup/
|
|
||||||
- /etc/timezone:/etc/timezone:ro
|
|
||||||
- /etc/localtime:/etc/localtime:ro
|
|
||||||
restart: unless-stopped
|
|
||||||
ports:
|
|
||||||
- 9980:8080
|
|
||||||
deploy:
|
|
||||||
resources:
|
|
||||||
limits:
|
|
||||||
cpus: 0.50
|
|
||||||
memory: 512M
|
|
||||||
reservations:
|
|
||||||
cpus: 0.25
|
|
||||||
memory: 128M
|
|
||||||
tisbackup_cron:
|
|
||||||
container_name: tisbackup_cron
|
|
||||||
image: "tisbackup:latest"
|
|
||||||
build: .
|
|
||||||
volumes:
|
|
||||||
- ./config/:/etc/tis/
|
|
||||||
- ./ssh/:/config_ssh/
|
|
||||||
- ./backup/:/backup/
|
|
||||||
- /etc/timezone:/etc/timezone:ro
|
|
||||||
- /etc/localtime:/etc/localtime:ro
|
|
||||||
restart: always
|
|
||||||
command: "/bin/bash /opt/tisbackup/cron.sh"
|
|
||||||
deploy:
|
|
||||||
resources:
|
|
||||||
limits:
|
|
||||||
cpus: 0.50
|
|
||||||
memory: 512M
|
|
||||||
reservations:
|
|
||||||
cpus: 0.25
|
|
||||||
memory: 128M
|
|
||||||
@@ -1,9 +1,10 @@
|
|||||||
import os
|
import os,sys
|
||||||
import sys
|
from huey.backends.sqlite_backend import SqliteQueue,SqliteDataStore
|
||||||
|
from huey.api import Huey, create_task
|
||||||
|
|
||||||
from huey.contrib.sql_huey import SqlHuey
|
|
||||||
from huey.storage import SqliteStorage
|
|
||||||
|
|
||||||
tisbackup_root_dir = os.path.abspath(os.path.join(os.path.dirname(__file__)))
|
tisbackup_root_dir = os.path.abspath(os.path.join(os.path.dirname(__file__)))
|
||||||
tasks_db = os.path.join(tisbackup_root_dir,"tasks.sqlite")
|
tasks_db = os.path.join(tisbackup_root_dir,"tasks.sqlite")
|
||||||
huey = SqlHuey(name="tisbackups", filename=tasks_db, always_eager=False, storage_class=SqliteStorage)
|
queue = SqliteQueue('tisbackups',tasks_db)
|
||||||
|
result_store = SqliteDataStore('tisbackups',tasks_db)
|
||||||
|
huey = Huey(queue,result_store,always_eager=False)
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -x
|
|
||||||
echo "Starting cron job for TIS Backup"
|
|
||||||
cron -f -l 2
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
## tisbackup for python3
|
|
||||||
|
|
||||||
### Install
|
|
||||||
|
|
||||||
Once the deb package is created, one can use it to install tisbackup on a debian machine. The command is:
|
|
||||||
```
|
|
||||||
apt install ./tis-tisbackup-1-2-0.170-deb11.deb
|
|
||||||
```
|
|
||||||
Note that the version numbers might be different depending on the system you used to build the package.
|
|
||||||
|
|
||||||
Then create a directory where to backup the files from your machines. The default is ```/backup```.
|
|
||||||
This can be changed in the configuration file ```/etc/tis/tisback-config.ini```. Usually this
|
|
||||||
directory is mounted from a shared ressource on a NAS with great capacity.
|
|
||||||
|
|
||||||
Configure your backup jobs:
|
|
||||||
```
|
|
||||||
cd /etc/tis
|
|
||||||
cp tisbackup-config.ini.sample tisbackup-config.ini
|
|
||||||
vi tisbackup-config.ini
|
|
||||||
```
|
|
||||||
|
|
||||||
After this, one have to generate the public and private certificates, as root:
|
|
||||||
```
|
|
||||||
cd
|
|
||||||
ssh-keygen -t rsa -b 2048
|
|
||||||
```
|
|
||||||
(press enter for each step)
|
|
||||||
|
|
||||||
Then propagate the public certificate on the machines targetted for backup:
|
|
||||||
```
|
|
||||||
ssh-copy-id -i /root/.ssh/id_rsa.pub root@machine1
|
|
||||||
ssh-copy-id -i /root/.ssh/id_rsa.pub root@machine2
|
|
||||||
```
|
|
||||||
etc.
|
|
||||||
|
|
||||||
|
|
||||||
Eventually modify ```/etc/cron.d/tisbackup``` for your needs.
|
|
||||||
|
|
||||||
Finalize the installation with:
|
|
||||||
```
|
|
||||||
tisbackup -d backup
|
|
||||||
systemctl start tisbackup_gui
|
|
||||||
systemctl start tisbackup_huey
|
|
||||||
```
|
|
||||||
|
|
||||||
You can then see the result in your browser: ```http://backup-server-name:8080```
|
|
||||||
|
|
||||||
The documentation for tisbackup is here: [tisbackup doc](https://tisbackup.readthedocs.io/en/latest/index.html)
|
|
||||||
|
|
||||||
### Uninstall
|
|
||||||
```
|
|
||||||
dpkg --force-all --purge tis-tisbackup
|
|
||||||
apt autoremove
|
|
||||||
```
|
|
||||||
@@ -1,9 +1,10 @@
|
|||||||
Package: tis-tisbackup
|
Package: tis-tisbackup
|
||||||
Version: 1-__VERSION__
|
Version: VERSION
|
||||||
Section: base
|
Section: base
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Depends: unzip, ssh, rsync, python3-paramiko, python3-pyvmomi, python3-pexpect, python3-flask,python3-simplejson, python3-pip
|
Depends: unzip, ssh, rsync, python-paramiko, python-pyvmomi, python-pexpect, python-flask,python-simplejson
|
||||||
Maintainer: Tranquil-IT <technique@tranquil.it>
|
Maintainer: Tranquil-IT-Systems <admin@tranquil-it-systems.fr>
|
||||||
Description: TISBackup backup management
|
Description: TISBackup backup management
|
||||||
Homepage: https://www.tranquil.it
|
Homepage: http://www.tranquil-it-systems.fr
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
VERSION=`git rev-list HEAD --count`
|
||||||
VERSION_DEB=$(cat /etc/debian_version | cut -d "." -f 1)
|
|
||||||
VERSION_SHORT=$(cat ../tisbackup.py | grep "__version__" | cut -d "=" -f 2 | sed 's/"//g')
|
|
||||||
GIT_COUNT=`git rev-list HEAD --count`
|
|
||||||
VERSION="${VERSION_SHORT}.${GIT_COUNT}-deb${VERSION_DEB}"
|
|
||||||
|
|
||||||
rm -f *.deb
|
rm -f *.deb
|
||||||
rm -Rf builddir
|
rm -Rf builddir
|
||||||
@@ -11,24 +7,24 @@ mkdir builddir
|
|||||||
mkdir builddir/DEBIAN
|
mkdir builddir/DEBIAN
|
||||||
cp ./control ./builddir/DEBIAN
|
cp ./control ./builddir/DEBIAN
|
||||||
cp ./postinst ./builddir/DEBIAN
|
cp ./postinst ./builddir/DEBIAN
|
||||||
cp ./prerm ./builddir/DEBIAN
|
|
||||||
cp ./postrm ./builddir/DEBIAN
|
|
||||||
|
|
||||||
sed "s/__VERSION__/$VERSION/" -i ./builddir/DEBIAN/control
|
sed "s/VERSION/$VERSION/" -i ./builddir/DEBIAN/control
|
||||||
|
|
||||||
mkdir -p ./builddir/opt/tisbackup/
|
mkdir -p builddir/opt/tisbackup/
|
||||||
mkdir -p ./builddir/usr/lib/systemd/system/
|
mkdir -p ./builddir/usr/lib/systemd/system/
|
||||||
mkdir -p ./builddir/etc/tis
|
mkdir -p ./builddir/etc/tis
|
||||||
mkdir -p ./builddir/etc/cron.d/
|
mkdir -p ./builddir/etc/cron.d/
|
||||||
|
|
||||||
pip3 install -r ../requirements.txt -t ./builddir/opt/tisbackup/lib
|
rsync -aP --exclude="rpm" --exclude=".git" --exclude=deb ../ ./builddir/opt/tisbackup
|
||||||
|
|
||||||
rsync -aP --exclude "deb/" --exclude "doc/" --exclude "rpm/" --exclude ".git" ../ ./builddir/opt/tisbackup
|
|
||||||
rsync -aP ../scripts/tisbackup_gui.service ./builddir/usr/lib/systemd/system/
|
rsync -aP ../scripts/tisbackup_gui.service ./builddir/usr/lib/systemd/system/
|
||||||
rsync -aP ../scripts/tisbackup_huey.service ./builddir/usr/lib/systemd/system/
|
rsync -aP ../scripts/tisbackup_huey.service ./builddir/usr/lib/systemd/system/
|
||||||
|
rsync -aP ../samples/tisbackup.cron ./builddir/etc/cron.d/tisbackup
|
||||||
rsync -aP ../samples/tisbackup_gui.ini ./builddir/etc/tis
|
rsync -aP ../samples/tisbackup_gui.ini ./builddir/etc/tis
|
||||||
rsync -aP ../samples/tisbackup-config.ini.sample ./builddir/etc/tis/tisbackup-config.ini.sample
|
rsync -aP ../samples/tisbackup-config.ini.sample ./builddir/etc/tis/tisbackup-config.ini.sample
|
||||||
|
rsync -aP ../lib/huey/bin/huey_consumer.py ./builddir/opt/tisbackup/
|
||||||
|
|
||||||
|
chmod 755 /opt/tisbackup/tisbackup.py
|
||||||
|
|
||||||
|
dpkg-deb --build builddir tis-tisbackup-${VERSION}.deb
|
||||||
|
|
||||||
chmod 755 ./builddir/opt/tisbackup/tisbackup.py
|
|
||||||
|
|
||||||
dpkg-deb --build builddir tis-tisbackup-1-${VERSION}.deb
|
|
||||||
|
|||||||
@@ -1,17 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
pip3 install huey==0.4.9
|
|
||||||
pip3 install redis
|
|
||||||
|
|
||||||
systemctl enable tisbackup_huey
|
systemctl enable tisbackup_huey
|
||||||
systemctl enable tisbackup_gui
|
systemctl enable tisbackup_gui
|
||||||
|
|
||||||
if [ ! -f /usr/bin/tisbackup ]; then
|
if [ ! -f /usr/bin/tisbackup ]; then
|
||||||
ln -s /opt/tisbackup/tisbackup.py /usr/bin/tisbackup
|
ln -s /opt/tisbackup/tisbackup.py /usr/bin/tisbackup
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f /etc/cron.d/tisbackup ]; then
|
|
||||||
cp /opt/tisbackup/samples/tisbackup.cron /etc/cron.d/tisbackup
|
|
||||||
fi
|
|
||||||
|
|
||||||
find /opt/tisbackup -name "*.pyc" -exec rm -rf {} \;
|
|
||||||
python3 -m compileall /opt/tisbackup/
|
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
systemctl stop tisbackup_huey
|
|
||||||
systemctl stop tisbackup_gui
|
|
||||||
systemctl disable tisbackup_huey
|
|
||||||
systemctl disable tisbackup_gui
|
|
||||||
|
|
||||||
rm -rf /opt/tisbackup
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
find /opt/tisbackup/ -name *.pyc -exec rm -f {} \;
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
build/doctrees
|
|
||||||
@@ -1,277 +0,0 @@
|
|||||||
# Makefile for Sphinx documentation
|
|
||||||
#
|
|
||||||
|
|
||||||
# You can set these variables from the command line.
|
|
||||||
SPHINXOPTS =
|
|
||||||
SPHINXBUILD = python3 -msphinx
|
|
||||||
PAPER =
|
|
||||||
BUILDDIR = build
|
|
||||||
|
|
||||||
# Internal variables.
|
|
||||||
PAPEROPT_a4 = -D latex_paper_size=a4
|
|
||||||
PAPEROPT_letter = -D latex_paper_size=letter
|
|
||||||
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
|
|
||||||
# the i18n builder cannot share the environment and doctrees with the others
|
|
||||||
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
|
|
||||||
|
|
||||||
.PHONY: help
|
|
||||||
help:
|
|
||||||
@echo "Please use \`make <target>' where <target> is one of"
|
|
||||||
@echo " html to make standalone HTML files"
|
|
||||||
@echo " dirhtml to make HTML files named index.html in directories"
|
|
||||||
@echo " singlehtml to make a single large HTML file"
|
|
||||||
@echo " pickle to make pickle files"
|
|
||||||
@echo " json to make JSON files"
|
|
||||||
@echo " htmlhelp to make HTML files and a HTML help project"
|
|
||||||
@echo " qthelp to make HTML files and a qthelp project"
|
|
||||||
@echo " applehelp to make an Apple Help Book"
|
|
||||||
@echo " devhelp to make HTML files and a Devhelp project"
|
|
||||||
@echo " epub to make an epub"
|
|
||||||
@echo " epub3 to make an epub3"
|
|
||||||
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
|
|
||||||
@echo " latexpdf to make LaTeX files and run them through pdflatex"
|
|
||||||
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
|
|
||||||
@echo " text to make text files"
|
|
||||||
@echo " man to make manual pages"
|
|
||||||
@echo " texinfo to make Texinfo files"
|
|
||||||
@echo " info to make Texinfo files and run them through makeinfo"
|
|
||||||
@echo " gettext to make PO message catalogs"
|
|
||||||
@echo " changes to make an overview of all changed/added/deprecated items"
|
|
||||||
@echo " xml to make Docutils-native XML files"
|
|
||||||
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
|
|
||||||
@echo " linkcheck to check all external links for integrity"
|
|
||||||
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
|
|
||||||
@echo " coverage to run coverage check of the documentation (if enabled)"
|
|
||||||
@echo " dummy to check syntax errors of document sources"
|
|
||||||
|
|
||||||
.PHONY: clean
|
|
||||||
clean:
|
|
||||||
rm -rf $(BUILDDIR)/*
|
|
||||||
|
|
||||||
.PHONY: html
|
|
||||||
html:
|
|
||||||
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
|
|
||||||
@echo
|
|
||||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
|
|
||||||
|
|
||||||
|
|
||||||
.PHONY: htmlen
|
|
||||||
htmlen:
|
|
||||||
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/en/doc
|
|
||||||
@echo
|
|
||||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/en/doc."
|
|
||||||
|
|
||||||
.PHONY: htmlfr
|
|
||||||
htmlfr:
|
|
||||||
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/fr/doc
|
|
||||||
@echo
|
|
||||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/fr/doc."
|
|
||||||
|
|
||||||
|
|
||||||
.PHONY: dirhtml
|
|
||||||
dirhtml:
|
|
||||||
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
|
|
||||||
@echo
|
|
||||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
|
|
||||||
|
|
||||||
.PHONY: singlehtml
|
|
||||||
singlehtml:
|
|
||||||
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
|
|
||||||
@echo
|
|
||||||
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
|
|
||||||
|
|
||||||
.PHONY: pickle
|
|
||||||
pickle:
|
|
||||||
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
|
|
||||||
@echo
|
|
||||||
@echo "Build finished; now you can process the pickle files."
|
|
||||||
|
|
||||||
.PHONY: json
|
|
||||||
json:
|
|
||||||
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
|
|
||||||
@echo
|
|
||||||
@echo "Build finished; now you can process the JSON files."
|
|
||||||
|
|
||||||
.PHONY: htmlhelp
|
|
||||||
htmlhelp:
|
|
||||||
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
|
|
||||||
@echo
|
|
||||||
@echo "Build finished; now you can run HTML Help Workshop with the" \
|
|
||||||
".hhp project file in $(BUILDDIR)/htmlhelp."
|
|
||||||
|
|
||||||
.PHONY: qthelp
|
|
||||||
qthelp:
|
|
||||||
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
|
|
||||||
@echo
|
|
||||||
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
|
|
||||||
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
|
|
||||||
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/WAPT.qhcp"
|
|
||||||
@echo "To view the help file:"
|
|
||||||
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/WAPT.qhc"
|
|
||||||
|
|
||||||
.PHONY: applehelp
|
|
||||||
applehelp:
|
|
||||||
$(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
|
|
||||||
@echo
|
|
||||||
@echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
|
|
||||||
@echo "N.B. You won't be able to view it unless you put it in" \
|
|
||||||
"~/Library/Documentation/Help or install it in your application" \
|
|
||||||
"bundle."
|
|
||||||
|
|
||||||
.PHONY: devhelp
|
|
||||||
devhelp:
|
|
||||||
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
|
|
||||||
@echo
|
|
||||||
@echo "Build finished."
|
|
||||||
@echo "To view the help file:"
|
|
||||||
@echo "# mkdir -p $$HOME/.local/share/devhelp/WAPT"
|
|
||||||
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/WAPT"
|
|
||||||
@echo "# devhelp"
|
|
||||||
|
|
||||||
.PHONY: epub
|
|
||||||
epub:
|
|
||||||
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
|
|
||||||
@echo
|
|
||||||
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
|
|
||||||
|
|
||||||
|
|
||||||
.PHONY: epub_en
|
|
||||||
epub_en:
|
|
||||||
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/en/epub
|
|
||||||
@echo
|
|
||||||
@echo "Build finished. The EN epub file is in $(BUILDDIR)/en/epub."
|
|
||||||
|
|
||||||
|
|
||||||
.PHONY: epub_fr
|
|
||||||
epub_fr:
|
|
||||||
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/fr/epub
|
|
||||||
@echo
|
|
||||||
@echo "Build finished. The FR epub file is in $(BUILDDIR)/fr/epub."
|
|
||||||
|
|
||||||
|
|
||||||
.PHONY: epub3
|
|
||||||
epub3:
|
|
||||||
$(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3
|
|
||||||
@echo
|
|
||||||
@echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3."
|
|
||||||
|
|
||||||
|
|
||||||
.PHONY: latex
|
|
||||||
latex:
|
|
||||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
|
||||||
@echo
|
|
||||||
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
|
|
||||||
@echo "Run \`make' in that directory to run these through (pdf)latex" \
|
|
||||||
"(use \`make latexpdf' here to do that automatically)."
|
|
||||||
|
|
||||||
.PHONY: latexpdf
|
|
||||||
latexpdf:
|
|
||||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
|
||||||
@echo "Running LaTeX files through pdflatex..."
|
|
||||||
$(MAKE) -C $(BUILDDIR)/latex all-pdf
|
|
||||||
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
|
||||||
|
|
||||||
|
|
||||||
.PHONY: latexpdf_en
|
|
||||||
latexpdf_en:
|
|
||||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/en/latex
|
|
||||||
@echo "Running LaTeX files through pdflatex..."
|
|
||||||
$(MAKE) -C $(BUILDDIR)/en/latex all-pdf -i
|
|
||||||
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/en/latex."
|
|
||||||
|
|
||||||
.PHONY: latexpdf_fr
|
|
||||||
latexpdf_fr:
|
|
||||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/fr/latex
|
|
||||||
@echo "Running LaTeX files through pdflatex..."
|
|
||||||
$(MAKE) -C $(BUILDDIR)/fr/latex all-pdf -i
|
|
||||||
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/fr/latex."
|
|
||||||
|
|
||||||
|
|
||||||
.PHONY: latexpdfja
|
|
||||||
latexpdfja:
|
|
||||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
|
||||||
@echo "Running LaTeX files through platex and dvipdfmx..."
|
|
||||||
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
|
|
||||||
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
|
||||||
|
|
||||||
.PHONY: text
|
|
||||||
text:
|
|
||||||
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
|
|
||||||
@echo
|
|
||||||
@echo "Build finished. The text files are in $(BUILDDIR)/text."
|
|
||||||
|
|
||||||
.PHONY: man
|
|
||||||
man:
|
|
||||||
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
|
|
||||||
@echo
|
|
||||||
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
|
|
||||||
|
|
||||||
.PHONY: texinfo
|
|
||||||
texinfo:
|
|
||||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
|
||||||
@echo
|
|
||||||
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
|
|
||||||
@echo "Run \`make' in that directory to run these through makeinfo" \
|
|
||||||
"(use \`make info' here to do that automatically)."
|
|
||||||
|
|
||||||
.PHONY: info
|
|
||||||
info:
|
|
||||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
|
||||||
@echo "Running Texinfo files through makeinfo..."
|
|
||||||
make -C $(BUILDDIR)/texinfo info
|
|
||||||
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
|
|
||||||
|
|
||||||
.PHONY: gettext
|
|
||||||
gettext:
|
|
||||||
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
|
|
||||||
@echo
|
|
||||||
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
|
|
||||||
|
|
||||||
.PHONY: changes
|
|
||||||
changes:
|
|
||||||
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
|
|
||||||
@echo
|
|
||||||
@echo "The overview file is in $(BUILDDIR)/changes."
|
|
||||||
|
|
||||||
.PHONY: linkcheck
|
|
||||||
linkcheck:
|
|
||||||
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
|
|
||||||
@echo
|
|
||||||
@echo "Link check complete; look for any errors in the above output " \
|
|
||||||
"or in $(BUILDDIR)/linkcheck/output.txt."
|
|
||||||
|
|
||||||
.PHONY: doctest
|
|
||||||
doctest:
|
|
||||||
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
|
|
||||||
@echo "Testing of doctests in the sources finished, look at the " \
|
|
||||||
"results in $(BUILDDIR)/doctest/output.txt."
|
|
||||||
|
|
||||||
.PHONY: coverage
|
|
||||||
coverage:
|
|
||||||
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
|
|
||||||
@echo "Testing of coverage in the sources finished, look at the " \
|
|
||||||
"results in $(BUILDDIR)/coverage/python.txt."
|
|
||||||
|
|
||||||
.PHONY: xml
|
|
||||||
xml:
|
|
||||||
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
|
|
||||||
@echo
|
|
||||||
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
|
|
||||||
|
|
||||||
.PHONY: pseudoxml
|
|
||||||
pseudoxml:
|
|
||||||
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
|
|
||||||
@echo
|
|
||||||
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
|
|
||||||
|
|
||||||
.PHONY: dummy
|
|
||||||
dummy:
|
|
||||||
$(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/dummy
|
|
||||||
@echo
|
|
||||||
@echo "Build finished. Dummy builder generates no files."
|
|
||||||
|
|
||||||
.PHONY: slide
|
|
||||||
slide:
|
|
||||||
$(SPHINXBUILD) -b html slide $(BUILDDIR)/slide
|
|
||||||
@echo
|
|
||||||
@echo "Build finished. slide builder files are in $(BUILDDIR)/slide."
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
set -e
|
|
||||||
|
|
||||||
export http_proxy=http://srvproxy:8080
|
|
||||||
export https_proxy=http://srvproxy:8080
|
|
||||||
|
|
||||||
echo "clean"
|
|
||||||
make clean
|
|
||||||
|
|
||||||
rm -Rf ./build/
|
|
||||||
|
|
||||||
make clean
|
|
||||||
|
|
||||||
echo "make html English"
|
|
||||||
make htmlen
|
|
||||||
|
|
||||||
cp ./robots.txt build/en/doc
|
|
||||||
mkdir ./build/en/doc/.well-known
|
|
||||||
cp security.txt ./build/en/doc/.well-known
|
|
||||||
touch ./build/en/doc/.nojekyll
|
|
||||||
mv ./build/en/doc/ ../html
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
docutils
|
|
||||||
sphinx==3.0.3
|
|
||||||
sphinx_rtd_theme
|
|
||||||
sphinxjp.themes.revealjs
|
|
||||||
sphinx-intl
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
.wy-nav-content {
|
|
||||||
max-width: 1050px
|
|
||||||
}
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
/* @import url('../fonts/Noto-Sans.woff2'); */
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Noto Sans';
|
|
||||||
src: url('../fonts/Noto-Sans.woff2') format('woff2'),
|
|
||||||
|
|
||||||
/* The ribbons */
|
|
||||||
|
|
||||||
.corner-ribbon{
|
|
||||||
width: 200px;
|
|
||||||
background: #e43;
|
|
||||||
position: absolute;
|
|
||||||
top: 25px;
|
|
||||||
left: -50px;
|
|
||||||
text-align: center;
|
|
||||||
line-height: 50px;
|
|
||||||
letter-spacing: 1px;
|
|
||||||
color: #f0f0f0;
|
|
||||||
transform: rotate(-45deg);
|
|
||||||
-webkit-transform: rotate(-45deg);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Custom styles */
|
|
||||||
|
|
||||||
.corner-ribbon.sticky{
|
|
||||||
position: fixed;
|
|
||||||
}
|
|
||||||
|
|
||||||
.corner-ribbon.shadow{
|
|
||||||
box-shadow: 0 0 3px rgba(0,0,0,.3);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Different positions */
|
|
||||||
|
|
||||||
.corner-ribbon.top-left{
|
|
||||||
top: 25px;
|
|
||||||
left: -50px;
|
|
||||||
transform: rotate(-45deg);
|
|
||||||
-webkit-transform: rotate(-45deg);
|
|
||||||
}
|
|
||||||
|
|
||||||
.corner-ribbon.top-right{
|
|
||||||
top: 25px;
|
|
||||||
right: -50px;
|
|
||||||
left: auto;
|
|
||||||
transform: rotate(45deg);
|
|
||||||
-webkit-transform: rotate(45deg);
|
|
||||||
}
|
|
||||||
|
|
||||||
.corner-ribbon.bottom-left{
|
|
||||||
top: auto;
|
|
||||||
bottom: 25px;
|
|
||||||
left: -50px;
|
|
||||||
transform: rotate(45deg);
|
|
||||||
-webkit-transform: rotate(45deg);
|
|
||||||
}
|
|
||||||
|
|
||||||
.corner-ribbon.bottom-right{
|
|
||||||
top: auto;
|
|
||||||
right: -50px;
|
|
||||||
bottom: 25px;
|
|
||||||
left: auto;
|
|
||||||
transform: rotate(-45deg);
|
|
||||||
-webkit-transform: rotate(-45deg);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Colors */
|
|
||||||
|
|
||||||
.corner-ribbon.white{background: #f0f0f0; color: #555;}
|
|
||||||
.corner-ribbon.black{background: #333;}
|
|
||||||
.corner-ribbon.grey{background: #999;}
|
|
||||||
.corner-ribbon.blue{background: #39d;}
|
|
||||||
.corner-ribbon.green{background: #2c7;}
|
|
||||||
.corner-ribbon.turquoise{background: #1b9;}
|
|
||||||
.corner-ribbon.purple{background: #95b;}
|
|
||||||
.corner-ribbon.red{background: #e43;}
|
|
||||||
.corner-ribbon.orange{background: #e82;}
|
|
||||||
.corner-ribbon.yellow{background: #ec0;}
|
|
||||||
|
Before Width: | Height: | Size: 4.4 KiB |
@@ -1,13 +0,0 @@
|
|||||||
/* override table width restrictions */
|
|
||||||
@media screen and (min-width: 767px) {
|
|
||||||
|
|
||||||
.wy-table-responsive table td {
|
|
||||||
/* !important prevents the common CSS stylesheets from overriding
|
|
||||||
* this as on RTD they are loaded after this stylesheet */
|
|
||||||
white-space: normal !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.wy-table-responsive {
|
|
||||||
overflow: visible !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
{% extends "!layout.html" %}
|
|
||||||
|
|
||||||
{% block footer %}
|
|
||||||
{{ super() }}
|
|
||||||
|
|
||||||
<!-- Global site tag (gtag.js) - Google Analytics -->
|
|
||||||
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-89790248-2"></script>
|
|
||||||
<script>
|
|
||||||
window.dataLayer = window.dataLayer || [];
|
|
||||||
function gtag(){dataLayer.push(arguments);}
|
|
||||||
gtag('js', new Date());
|
|
||||||
|
|
||||||
gtag('config', 'UA-89790248-2');
|
|
||||||
</script>
|
|
||||||
|
|
||||||
{% endblock %}
|
|
||||||
@@ -1,372 +0,0 @@
|
|||||||
.. Reminder for header structure:
|
|
||||||
Level 1: ====================
|
|
||||||
Level 2: --------------------
|
|
||||||
Level 3: ++++++++++++++++++++
|
|
||||||
Level 4: """"""""""""""""""""
|
|
||||||
Level 5: ^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
.. meta::
|
|
||||||
:description: Configuring authentication for TISBackup web interface
|
|
||||||
:keywords: Documentation, TISBackup, authentication, security, OAuth, Flask-Login
|
|
||||||
|
|
||||||
Authentication Configuration
|
|
||||||
============================
|
|
||||||
|
|
||||||
.. _authentication_configuration:
|
|
||||||
|
|
||||||
TISBackup provides a pluggable authentication system for the Flask web interface,
|
|
||||||
supporting multiple authentication methods to suit different deployment scenarios.
|
|
||||||
|
|
||||||
Overview
|
|
||||||
--------
|
|
||||||
|
|
||||||
The authentication system supports three authentication providers:
|
|
||||||
|
|
||||||
* **Basic Authentication** - Simple HTTP Basic Auth (default)
|
|
||||||
* **Flask-Login** - Session-based authentication with user management
|
|
||||||
* **OAuth2** - Integration with external identity providers
|
|
||||||
|
|
||||||
By default, TISBackup uses Basic Authentication. You can configure the authentication
|
|
||||||
method in the :file:`/etc/tis/tisbackup_gui.ini` configuration file.
|
|
||||||
|
|
||||||
Basic Authentication
|
|
||||||
--------------------
|
|
||||||
|
|
||||||
HTTP Basic Authentication is the simplest method and is enabled by default.
|
|
||||||
|
|
||||||
Configuration via Environment Variables
|
|
||||||
+++++++++++++++++++++++++++++++++++++++
|
|
||||||
|
|
||||||
Set the following environment variables:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
export TISBACKUP_AUTH_USERNAME="admin"
|
|
||||||
export TISBACKUP_AUTH_PASSWORD="your-secure-password"
|
|
||||||
|
|
||||||
Configuration via INI File
|
|
||||||
++++++++++++++++++++++++++
|
|
||||||
|
|
||||||
Create or edit :file:`/etc/tis/tisbackup_gui.ini`:
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
[authentication]
|
|
||||||
type=basic
|
|
||||||
username=admin
|
|
||||||
password=your-password
|
|
||||||
use_bcrypt=False
|
|
||||||
realm=TISBackup
|
|
||||||
|
|
||||||
Using Bcrypt Password Hashes (Recommended)
|
|
||||||
+++++++++++++++++++++++++++++++++++++++++++
|
|
||||||
|
|
||||||
For improved security, use bcrypt-hashed passwords:
|
|
||||||
|
|
||||||
1. Install bcrypt support:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
uv pip install bcrypt
|
|
||||||
|
|
||||||
2. Generate a password hash:
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
import bcrypt
|
|
||||||
password = b"your-password"
|
|
||||||
hash = bcrypt.hashpw(password, bcrypt.gensalt())
|
|
||||||
print(hash.decode())
|
|
||||||
|
|
||||||
3. Update configuration:
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
[authentication]
|
|
||||||
type=basic
|
|
||||||
username=admin
|
|
||||||
password_hash=$2b$12$LQv3c1yqBWVHxkd0LHAkCOYz6TtxMQJqhN8/LewY5eSZL9fJQp.Ym
|
|
||||||
use_bcrypt=True
|
|
||||||
realm=TISBackup
|
|
||||||
|
|
||||||
Flask-Login Authentication
|
|
||||||
---------------------------
|
|
||||||
|
|
||||||
Session-based authentication with user management and login pages.
|
|
||||||
|
|
||||||
Installation
|
|
||||||
++++++++++++
|
|
||||||
|
|
||||||
Install Flask-Login support:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
uv pip install flask-login bcrypt
|
|
||||||
|
|
||||||
Configuration
|
|
||||||
+++++++++++++
|
|
||||||
|
|
||||||
Create :file:`/etc/tis/tisbackup_gui.ini`:
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
[authentication]
|
|
||||||
type=flask-login
|
|
||||||
user_file=/etc/tis/tisbackup_users.txt
|
|
||||||
secret_key=<generate-random-secret-key>
|
|
||||||
session_timeout=3600
|
|
||||||
|
|
||||||
Generate a secret key:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
python3 -c "import secrets; print(secrets.token_hex(32))"
|
|
||||||
|
|
||||||
User File Format
|
|
||||||
++++++++++++++++
|
|
||||||
|
|
||||||
Create a user file at :file:`/etc/tis/tisbackup_users.txt`:
|
|
||||||
|
|
||||||
.. code-block:: text
|
|
||||||
|
|
||||||
admin:$2b$12$LQv3c1yqBWVHxkd0LHAkCOYz6TtxMQJqhN8/LewY5eSZL9fJQp.Ym
|
|
||||||
user1:$2b$12$KPOvd2wqZWVIxje1MIBlDPZy7UuyNRKriQ9/MfxZ6fTaM9gKRq.Wm
|
|
||||||
|
|
||||||
Each line is: ``username:bcrypt_password_hash``
|
|
||||||
|
|
||||||
Managing Users
|
|
||||||
++++++++++++++
|
|
||||||
|
|
||||||
Add a new user:
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
import bcrypt
|
|
||||||
|
|
||||||
username = "newuser"
|
|
||||||
password = b"secure-password"
|
|
||||||
hash = bcrypt.hashpw(password, bcrypt.gensalt()).decode()
|
|
||||||
|
|
||||||
with open("/etc/tis/tisbackup_users.txt", "a") as f:
|
|
||||||
f.write(f"{username}:{hash}\n")
|
|
||||||
|
|
||||||
Ensure proper permissions:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
chmod 600 /etc/tis/tisbackup_users.txt
|
|
||||||
chown root:root /etc/tis/tisbackup_users.txt
|
|
||||||
|
|
||||||
OAuth2 Authentication
|
|
||||||
---------------------
|
|
||||||
|
|
||||||
Integrate with external OAuth2 identity providers like Google, GitHub, or GitLab.
|
|
||||||
|
|
||||||
Installation
|
|
||||||
++++++++++++
|
|
||||||
|
|
||||||
Install OAuth support:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
uv pip install authlib requests
|
|
||||||
|
|
||||||
Google OAuth
|
|
||||||
++++++++++++
|
|
||||||
|
|
||||||
1. Create OAuth credentials in Google Cloud Console
|
|
||||||
2. Configure TISBackup:
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
[authentication]
|
|
||||||
type=oauth
|
|
||||||
provider=google
|
|
||||||
client_id=<your-client-id>.apps.googleusercontent.com
|
|
||||||
client_secret=<your-client-secret>
|
|
||||||
redirect_uri=https://backup.example.com/callback
|
|
||||||
allowed_domains=example.com
|
|
||||||
|
|
||||||
GitHub OAuth
|
|
||||||
++++++++++++
|
|
||||||
|
|
||||||
1. Create OAuth App in GitHub Settings
|
|
||||||
2. Configure TISBackup:
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
[authentication]
|
|
||||||
type=oauth
|
|
||||||
provider=github
|
|
||||||
client_id=<your-client-id>
|
|
||||||
client_secret=<your-client-secret>
|
|
||||||
redirect_uri=https://backup.example.com/callback
|
|
||||||
allowed_users=user1,user2,user3
|
|
||||||
|
|
||||||
GitLab OAuth
|
|
||||||
++++++++++++
|
|
||||||
|
|
||||||
1. Create OAuth application in GitLab
|
|
||||||
2. Configure TISBackup:
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
[authentication]
|
|
||||||
type=oauth
|
|
||||||
provider=gitlab
|
|
||||||
client_id=<your-client-id>
|
|
||||||
client_secret=<your-client-secret>
|
|
||||||
redirect_uri=https://backup.example.com/callback
|
|
||||||
gitlab_url=https://gitlab.example.com
|
|
||||||
|
|
||||||
Generic OAuth Provider
|
|
||||||
++++++++++++++++++++++
|
|
||||||
|
|
||||||
For custom OAuth providers:
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
[authentication]
|
|
||||||
type=oauth
|
|
||||||
provider=generic
|
|
||||||
client_id=<your-client-id>
|
|
||||||
client_secret=<your-client-secret>
|
|
||||||
redirect_uri=https://backup.example.com/callback
|
|
||||||
authorize_url=https://provider.example.com/oauth/authorize
|
|
||||||
token_url=https://provider.example.com/oauth/token
|
|
||||||
userinfo_url=https://provider.example.com/oauth/userinfo
|
|
||||||
|
|
||||||
Advanced Configuration
|
|
||||||
----------------------
|
|
||||||
|
|
||||||
Multiple Authentication Methods
|
|
||||||
++++++++++++++++++++++++++++++++
|
|
||||||
|
|
||||||
You can only use one authentication method at a time. To switch methods,
|
|
||||||
update the ``type`` parameter in the configuration file and restart
|
|
||||||
the TISBackup GUI service.
|
|
||||||
|
|
||||||
Disabling Authentication (Not Recommended)
|
|
||||||
++++++++++++++++++++++++++++++++++++++++++
|
|
||||||
|
|
||||||
.. warning::
|
|
||||||
|
|
||||||
Disabling authentication is **not recommended** for production environments.
|
|
||||||
Only use this for testing or when the web interface is protected by other means
|
|
||||||
(e.g., VPN, firewall rules).
|
|
||||||
|
|
||||||
To disable authentication:
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
[authentication]
|
|
||||||
type=none
|
|
||||||
|
|
||||||
Custom Realm
|
|
||||||
++++++++++++
|
|
||||||
|
|
||||||
For Basic Authentication, customize the authentication realm:
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
[authentication]
|
|
||||||
type=basic
|
|
||||||
realm=My Company Backup System
|
|
||||||
|
|
||||||
Session Timeout
|
|
||||||
+++++++++++++++
|
|
||||||
|
|
||||||
For Flask-Login and OAuth, configure session timeout (in seconds):
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
[authentication]
|
|
||||||
type=flask-login
|
|
||||||
session_timeout=7200 # 2 hours
|
|
||||||
|
|
||||||
Troubleshooting
|
|
||||||
---------------
|
|
||||||
|
|
||||||
Authentication Not Working
|
|
||||||
++++++++++++++++++++++++++
|
|
||||||
|
|
||||||
Check the logs for authentication errors:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
journalctl -u tisbackup_gui -n 100
|
|
||||||
|
|
||||||
Verify configuration file syntax:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
python3 -c "from configparser import ConfigParser; cp = ConfigParser(); cp.read('/etc/tis/tisbackup_gui.ini'); print('OK')"
|
|
||||||
|
|
||||||
Random Password Generated
|
|
||||||
++++++++++++++++++++++++++
|
|
||||||
|
|
||||||
If you see a warning about a generated password in the logs:
|
|
||||||
|
|
||||||
.. code-block:: text
|
|
||||||
|
|
||||||
WARNING: Generated temporary password for 'admin': abc123xyz
|
|
||||||
|
|
||||||
This means no password was configured. Set ``TISBACKUP_AUTH_PASSWORD`` environment
|
|
||||||
variable or add an ``[authentication]`` section to the configuration file.
|
|
||||||
|
|
||||||
OAuth Callback Error
|
|
||||||
++++++++++++++++++++
|
|
||||||
|
|
||||||
Ensure the redirect URI in your OAuth provider configuration **exactly matches**
|
|
||||||
the ``redirect_uri`` parameter in the TISBackup configuration.
|
|
||||||
|
|
||||||
The redirect URI should be: ``https://your-domain.com/callback``
|
|
||||||
|
|
||||||
User File Not Found
|
|
||||||
+++++++++++++++++++
|
|
||||||
|
|
||||||
For Flask-Login authentication, ensure the user file exists and has proper permissions:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
ls -l /etc/tis/tisbackup_users.txt
|
|
||||||
# Should show: -rw------- 1 root root ...
|
|
||||||
|
|
||||||
Security Recommendations
|
|
||||||
------------------------
|
|
||||||
|
|
||||||
1. **Use HTTPS**: Always use HTTPS in production (configure via reverse proxy)
|
|
||||||
2. **Strong Passwords**: Use long, random passwords or password hashes
|
|
||||||
3. **Restrict Access**: Use firewall rules to limit access to trusted networks
|
|
||||||
4. **Regular Updates**: Keep authentication dependencies updated
|
|
||||||
5. **Monitor Logs**: Regularly check logs for failed authentication attempts
|
|
||||||
6. **Session Security**: Use short session timeouts for sensitive environments
|
|
||||||
|
|
||||||
For more security best practices, see the **Security Best Practices** section of the documentation.
|
|
||||||
|
|
||||||
Migration Guide
|
|
||||||
---------------
|
|
||||||
|
|
||||||
From No Authentication
|
|
||||||
++++++++++++++++++++++
|
|
||||||
|
|
||||||
If upgrading from a version without authentication:
|
|
||||||
|
|
||||||
1. Add authentication configuration as described above
|
|
||||||
2. Restart the TISBackup GUI service
|
|
||||||
3. Update any automated tools to include authentication credentials
|
|
||||||
|
|
||||||
From Basic to OAuth
|
|
||||||
+++++++++++++++++++
|
|
||||||
|
|
||||||
1. Set up OAuth provider configuration
|
|
||||||
2. Update ``type=oauth`` in configuration file
|
|
||||||
3. Install required dependencies: ``uv pip install authlib requests``
|
|
||||||
4. Restart the service
|
|
||||||
5. Test login with OAuth provider
|
|
||||||
|
|
||||||
Additional Resources
|
|
||||||
--------------------
|
|
||||||
|
|
||||||
For comprehensive authentication setup examples and troubleshooting,
|
|
||||||
see the :file:`AUTHENTICATION.md` file in the TISBackup repository root.
|
|
||||||
@@ -1,458 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
#
|
|
||||||
# TISBackup documentation build configuration file, created by
|
|
||||||
# sphinx-quickstart on Wed Nov 30 14:29:50 2016.
|
|
||||||
#
|
|
||||||
# This file is execfile()d with the current directory set to its
|
|
||||||
# containing dir.
|
|
||||||
#
|
|
||||||
# Note that not all possible configuration values are present in this
|
|
||||||
# autogenerated file.
|
|
||||||
#
|
|
||||||
# All configuration values have a default; values that are commented out
|
|
||||||
# serve to show the default.
|
|
||||||
|
|
||||||
# If extensions (or modules to document with autodoc) are in another directory,
|
|
||||||
# add these directories to sys.path here. If the directory is relative to the
|
|
||||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
|
||||||
#
|
|
||||||
# import os
|
|
||||||
# import sys
|
|
||||||
# sys.path.insert(0, os.path.abspath('.'))
|
|
||||||
|
|
||||||
# -- General configuration ------------------------------------------------
|
|
||||||
|
|
||||||
# If your documentation needs a minimal Sphinx version, state it here.
|
|
||||||
#
|
|
||||||
# needs_sphinx = '1.0'
|
|
||||||
|
|
||||||
# Add any Sphinx extension module names here, as strings. They can be
|
|
||||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
|
||||||
# ones.
|
|
||||||
extensions = [
|
|
||||||
"sphinx.ext.doctest",
|
|
||||||
"sphinx.ext.intersphinx",
|
|
||||||
"sphinx.ext.todo",
|
|
||||||
"sphinx.ext.viewcode",
|
|
||||||
"sphinx.ext.githubpages",
|
|
||||||
"sphinx_tabs.tabs",
|
|
||||||
]
|
|
||||||
|
|
||||||
# Add any paths that contain templates here, relative to this directory.
|
|
||||||
templates_path = ["_templates"]
|
|
||||||
|
|
||||||
# The suffix(es) of source filenames.
|
|
||||||
# You can specify multiple suffix as a list of string:
|
|
||||||
#
|
|
||||||
# source_suffix = ['.rst', '.md']
|
|
||||||
source_suffix = ".rst"
|
|
||||||
|
|
||||||
# The encoding of source files.
|
|
||||||
#
|
|
||||||
# source_encoding = 'utf-8-sig'
|
|
||||||
|
|
||||||
# The master toctree document.
|
|
||||||
master_doc = "index"
|
|
||||||
|
|
||||||
# General information about the project.
|
|
||||||
project = "TISBackup"
|
|
||||||
copyright = "2020, Tranquil IT"
|
|
||||||
author = "Tranquil IT"
|
|
||||||
|
|
||||||
# The version info for the project you're documenting, acts as replacement for
|
|
||||||
# |version| and |release|, also used in various other places throughout the
|
|
||||||
# built documents.
|
|
||||||
#
|
|
||||||
# The short X.Y version.
|
|
||||||
version = "1.8"
|
|
||||||
# The full version, including alpha/beta/rc tags.
|
|
||||||
release = "1.8.2"
|
|
||||||
|
|
||||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
|
||||||
# for a list of supported languages.
|
|
||||||
#
|
|
||||||
# This is also used if you do content translation via gettext catalogs.
|
|
||||||
# Usually you set "language" from the command line for these cases.
|
|
||||||
language = "en"
|
|
||||||
locale_dirs = ["locale/"]
|
|
||||||
gettext_compact = False
|
|
||||||
|
|
||||||
# There are two options for replacing |today|: either, you set today to some
|
|
||||||
# non-false value, then it is used:
|
|
||||||
#
|
|
||||||
# today = ''
|
|
||||||
#
|
|
||||||
# Else, today_fmt is used as the format for a strftime call.
|
|
||||||
#
|
|
||||||
# today_fmt = '%B %d, %Y'
|
|
||||||
|
|
||||||
# List of patterns, relative to source directory, that match files and
|
|
||||||
# directories to ignore when looking for source files.
|
|
||||||
# This patterns also effect to html_static_path and html_extra_path
|
|
||||||
exclude_patterns = []
|
|
||||||
|
|
||||||
# The reST default role (used for this markup: `text`) to use for all
|
|
||||||
# documents.
|
|
||||||
#
|
|
||||||
# default_role = None
|
|
||||||
|
|
||||||
# If true, '()' will be appended to :func: etc. cross-reference text.
|
|
||||||
#
|
|
||||||
# add_function_parentheses = True
|
|
||||||
|
|
||||||
# If true, the current module name will be prepended to all description
|
|
||||||
# unit titles (such as .. function::).
|
|
||||||
#
|
|
||||||
# add_module_names = True
|
|
||||||
|
|
||||||
# If true, sectionauthor and moduleauthor directives will be shown in the
|
|
||||||
# output. They are ignored by default.
|
|
||||||
#
|
|
||||||
# show_authors = False
|
|
||||||
|
|
||||||
# The name of the Pygments (syntax highlighting) style to use.
|
|
||||||
pygments_style = "sphinx"
|
|
||||||
|
|
||||||
# A list of ignored prefixes for module index sorting.
|
|
||||||
# modindex_common_prefix = []
|
|
||||||
|
|
||||||
# If true, keep warnings as "system message" paragraphs in the built documents.
|
|
||||||
# keep_warnings = False
|
|
||||||
|
|
||||||
# If true, `todo` and `todoList` produce output, else they produce nothing.
|
|
||||||
todo_include_todos = True
|
|
||||||
|
|
||||||
|
|
||||||
# -- Options for HTML output ----------------------------------------------
|
|
||||||
|
|
||||||
html_theme = "alabaster"
|
|
||||||
html_theme_path = []
|
|
||||||
html_favicon = "_static/favicon.ico"
|
|
||||||
|
|
||||||
|
|
||||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
|
||||||
# a list of builtin themes.
|
|
||||||
#
|
|
||||||
# html_theme = 'alabaster'
|
|
||||||
|
|
||||||
# Theme options are theme-specific and customize the look and feel of a theme
|
|
||||||
# further. For a list of options available for each theme, see the
|
|
||||||
# documentation.
|
|
||||||
#
|
|
||||||
# html_theme_options = {}
|
|
||||||
|
|
||||||
# Add any paths that contain custom themes here, relative to this directory.
|
|
||||||
# html_theme_path = []
|
|
||||||
|
|
||||||
# The name for this set of Sphinx documents.
|
|
||||||
# "<project> v<release> documentation" by default.
|
|
||||||
#
|
|
||||||
# html_title = 'TISBackup v1.0'
|
|
||||||
|
|
||||||
# A shorter title for the navigation bar. Default is the same as html_title.
|
|
||||||
#
|
|
||||||
# html_short_title = None
|
|
||||||
|
|
||||||
# The name of an image file (relative to this directory) to place at the top
|
|
||||||
# of the sidebar.
|
|
||||||
#
|
|
||||||
# html_logo = None
|
|
||||||
|
|
||||||
# The name of an image file (relative to this directory) to use as a favicon of
|
|
||||||
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
|
||||||
# pixels large.
|
|
||||||
#
|
|
||||||
# html_favicon = None
|
|
||||||
|
|
||||||
# Add any paths that contain custom static files (such as style sheets) here,
|
|
||||||
# relative to this directory. They are copied after the builtin static files,
|
|
||||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
|
||||||
html_static_path = ["_static"]
|
|
||||||
|
|
||||||
# Add any extra paths that contain custom files (such as robots.txt or
|
|
||||||
# .htaccess) here, relative to this directory. These files are copied
|
|
||||||
# directly to the root of the documentation.
|
|
||||||
#
|
|
||||||
# html_extra_path = []
|
|
||||||
|
|
||||||
# If not None, a 'Last updated on:' timestamp is inserted at every page
|
|
||||||
# bottom, using the given strftime format.
|
|
||||||
# The empty string is equivalent to '%b %d, %Y'.
|
|
||||||
#
|
|
||||||
# html_last_updated_fmt = None
|
|
||||||
|
|
||||||
# If true, SmartyPants will be used to convert quotes and dashes to
|
|
||||||
# typographically correct entities.
|
|
||||||
#
|
|
||||||
# html_use_smartypants = True
|
|
||||||
|
|
||||||
# Custom sidebar templates, maps document names to template names.
|
|
||||||
#
|
|
||||||
# html_sidebars = {}
|
|
||||||
|
|
||||||
# Additional templates that should be rendered to pages, maps page names to
|
|
||||||
# template names.
|
|
||||||
#
|
|
||||||
# html_additional_pages = {}
|
|
||||||
|
|
||||||
# If false, no module index is generated.
|
|
||||||
#
|
|
||||||
# html_domain_indices = True
|
|
||||||
|
|
||||||
# If false, no index is generated.
|
|
||||||
#
|
|
||||||
# html_use_index = True
|
|
||||||
|
|
||||||
# If true, the index is split into individual pages for each letter.
|
|
||||||
#
|
|
||||||
# html_split_index = False
|
|
||||||
|
|
||||||
# If true, links to the reST sources are added to the pages.
|
|
||||||
#
|
|
||||||
# html_show_sourcelink = True
|
|
||||||
|
|
||||||
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
|
|
||||||
#
|
|
||||||
# html_show_sphinx = True
|
|
||||||
|
|
||||||
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
|
|
||||||
#
|
|
||||||
# html_show_copyright = True
|
|
||||||
|
|
||||||
# If true, an OpenSearch description file will be output, and all pages will
|
|
||||||
# contain a <link> tag referring to it. The value of this option must be the
|
|
||||||
# base URL from which the finished HTML is served.
|
|
||||||
#
|
|
||||||
# html_use_opensearch = ''
|
|
||||||
|
|
||||||
# This is the file name suffix for HTML files (e.g. ".xhtml").
|
|
||||||
# html_file_suffix = None
|
|
||||||
|
|
||||||
# Language to be used for generating the HTML full-text search index.
|
|
||||||
# Sphinx supports the following languages:
|
|
||||||
# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
|
|
||||||
# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr', 'zh'
|
|
||||||
#
|
|
||||||
# html_search_language = 'en'
|
|
||||||
|
|
||||||
# A dictionary with options for the search language support, empty by default.
|
|
||||||
# 'ja' uses this config value.
|
|
||||||
# 'zh' user can custom change `jieba` dictionary path.
|
|
||||||
#
|
|
||||||
# html_search_options = {'type': 'default'}
|
|
||||||
|
|
||||||
# The name of a javascript file (relative to the configuration directory) that
|
|
||||||
# implements a search results scorer. If empty, the default will be used.
|
|
||||||
#
|
|
||||||
# html_search_scorer = 'scorer.js'
|
|
||||||
|
|
||||||
# Output file base name for HTML help builder.
|
|
||||||
htmlhelp_basename = "tisbackupdoc"
|
|
||||||
|
|
||||||
# -- Linkcheck -------------------
|
|
||||||
# make linkcheck
|
|
||||||
# URL patterns to ignore
|
|
||||||
|
|
||||||
linkcheck_ignore = [r"http.*://.*mydomain.lan.*", r"http.*://.*host_fqdn.*", r"http://user:pwd@host_fqdn:port"]
|
|
||||||
|
|
||||||
|
|
||||||
# -- Options for LaTeX output ---------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
# diff -r a/report.cls b/report.cls
|
|
||||||
# 71a72,74
|
|
||||||
# > \DeclareOption{lulupaper}
|
|
||||||
# > {\setlength\paperheight {23.39cm}%
|
|
||||||
# > \setlength\paperwidth {15.59cm}}
|
|
||||||
|
|
||||||
latex_elements = {
|
|
||||||
# The paper size ('letterpaper' or 'a4paper').
|
|
||||||
#
|
|
||||||
# 'papersize': 'letterpaper',
|
|
||||||
"papersize": "lulupaper",
|
|
||||||
# The font size ('10pt', '11pt' or '12pt').
|
|
||||||
#
|
|
||||||
"pointsize": "9pt",
|
|
||||||
# Additional stuff for the LaTeX preamble.
|
|
||||||
#
|
|
||||||
"preamble": r"\batchmode",
|
|
||||||
# Latex figure (float) alignment
|
|
||||||
#
|
|
||||||
# 'figure_align': 'htbp',
|
|
||||||
"sphinxsetup": "hmargin={1.5cm,1.5cm}, vmargin={3cm,3cm}, marginpar=1cm",
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# Grouping the document tree into LaTeX files. List of tuples
|
|
||||||
# (source start file, target name, title,
|
|
||||||
# author, documentclass [howto, manual, or own class]).
|
|
||||||
latex_documents = [
|
|
||||||
(master_doc, "tisbackup.tex", "TISBackup Documentation", "Tranquil IT", "manual"),
|
|
||||||
]
|
|
||||||
|
|
||||||
# The name of an image file (relative to this directory) to place at the top of
|
|
||||||
# the title page.
|
|
||||||
#
|
|
||||||
# latex_logo = None
|
|
||||||
|
|
||||||
# For "manual" documents, if this is true, then toplevel headings are parts,
|
|
||||||
# not chapters.
|
|
||||||
#
|
|
||||||
# latex_use_parts = False
|
|
||||||
|
|
||||||
# If true, show page references after internal links.
|
|
||||||
#
|
|
||||||
# latex_show_pagerefs = False
|
|
||||||
|
|
||||||
# If true, show URL addresses after external links.
|
|
||||||
#
|
|
||||||
# latex_show_urls = False
|
|
||||||
|
|
||||||
# Documents to append as an appendix to all manuals.
|
|
||||||
#
|
|
||||||
# latex_appendices = []
|
|
||||||
|
|
||||||
# It false, will not define \strong, \code, itleref, \crossref ... but only
|
|
||||||
# \sphinxstrong, ..., \sphinxtitleref, ... To help avoid clash with user added
|
|
||||||
# packages.
|
|
||||||
#
|
|
||||||
# latex_keep_old_macro_names = True
|
|
||||||
|
|
||||||
# If false, no module index is generated.
|
|
||||||
#
|
|
||||||
# latex_domain_indices = True
|
|
||||||
|
|
||||||
|
|
||||||
# -- Options for manual page output ---------------------------------------
|
|
||||||
|
|
||||||
# One entry per manual page. List of tuples
|
|
||||||
# (source start file, name, description, authors, manual section).
|
|
||||||
man_pages = [(master_doc, "tisbackup", "TISBackup Documentation", [author], 1)]
|
|
||||||
|
|
||||||
# If true, show URL addresses after external links.
|
|
||||||
#
|
|
||||||
# man_show_urls = False
|
|
||||||
|
|
||||||
|
|
||||||
# -- Options for Texinfo output -------------------------------------------
|
|
||||||
|
|
||||||
# Grouping the document tree into Texinfo files. List of tuples
|
|
||||||
# (source start file, target name, title, author,
|
|
||||||
# dir menu entry, description, category)
|
|
||||||
texinfo_documents = [
|
|
||||||
(
|
|
||||||
master_doc,
|
|
||||||
"tisbackup",
|
|
||||||
"TISBackup Documentation",
|
|
||||||
author,
|
|
||||||
"Tranquil IT",
|
|
||||||
'The objective of TISbackup is to benefit from file backups and centralized alert feedback on "reasonable" data volumes.',
|
|
||||||
"Miscellaneous",
|
|
||||||
),
|
|
||||||
]
|
|
||||||
|
|
||||||
# Documents to append as an appendix to all manuals.
|
|
||||||
#
|
|
||||||
# texinfo_appendices = []
|
|
||||||
|
|
||||||
# If false, no module index is generated.
|
|
||||||
#
|
|
||||||
# texinfo_domain_indices = True
|
|
||||||
|
|
||||||
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
|
||||||
#
|
|
||||||
# texinfo_show_urls = 'footnote'
|
|
||||||
|
|
||||||
# If true, do not generate a @detailmenu in the "Top" node's menu.
|
|
||||||
#
|
|
||||||
# texinfo_no_detailmenu = False
|
|
||||||
|
|
||||||
|
|
||||||
# Example configuration for intersphinx: refer to the Python standard library.
|
|
||||||
intersphinx_mapping = {
|
|
||||||
"python": ("https://docs.python.org/3", None),
|
|
||||||
}
|
|
||||||
|
|
||||||
# -- Options for Epub output ----------------------------------------------
|
|
||||||
|
|
||||||
# Bibliographic Dublin Core info.
|
|
||||||
epub_title = project
|
|
||||||
epub_author = author
|
|
||||||
epub_publisher = author
|
|
||||||
epub_copyright = copyright
|
|
||||||
|
|
||||||
# The basename for the epub file. It defaults to the project name.
|
|
||||||
# epub_basename = project
|
|
||||||
|
|
||||||
# The HTML theme for the epub output. Since the default themes are not
|
|
||||||
# optimized for small screen space, using the same theme for HTML and epub
|
|
||||||
# output is usually not wise. This defaults to 'epub', a theme designed to save
|
|
||||||
# visual space.
|
|
||||||
#
|
|
||||||
# epub_theme = 'epub'
|
|
||||||
|
|
||||||
# The language of the text. It defaults to the language option
|
|
||||||
# or 'en' if the language is not set.
|
|
||||||
#
|
|
||||||
# epub_language = ''
|
|
||||||
|
|
||||||
# The scheme of the identifier. Typical schemes are ISBN or URL.
|
|
||||||
# epub_scheme = ''
|
|
||||||
|
|
||||||
# The unique identifier of the text. This can be a ISBN number
|
|
||||||
# or the project homepage.
|
|
||||||
#
|
|
||||||
# epub_identifier = ''
|
|
||||||
|
|
||||||
# A unique identification for the text.
|
|
||||||
#
|
|
||||||
# epub_uid = ''
|
|
||||||
|
|
||||||
# A tuple containing the cover image and cover page html template filenames.
|
|
||||||
#
|
|
||||||
# epub_cover = ()
|
|
||||||
|
|
||||||
# A sequence of (type, uri, title) tuples for the guide element of content.opf.
|
|
||||||
#
|
|
||||||
# epub_guide = ()
|
|
||||||
|
|
||||||
# HTML files that should be inserted before the pages created by sphinx.
|
|
||||||
# The format is a list of tuples containing the path and title.
|
|
||||||
#
|
|
||||||
# epub_pre_files = []
|
|
||||||
|
|
||||||
# HTML files that should be inserted after the pages created by sphinx.
|
|
||||||
# The format is a list of tuples containing the path and title.
|
|
||||||
#
|
|
||||||
# epub_post_files = []
|
|
||||||
|
|
||||||
# A list of files that should not be packed into the epub file.
|
|
||||||
epub_exclude_files = ["search.html"]
|
|
||||||
|
|
||||||
# The depth of the table of contents in toc.ncx.
|
|
||||||
#
|
|
||||||
# epub_tocdepth = 3
|
|
||||||
|
|
||||||
# Allow duplicate toc entries.
|
|
||||||
#
|
|
||||||
# epub_tocdup = True
|
|
||||||
|
|
||||||
# Choose between 'default' and 'includehidden'.
|
|
||||||
#
|
|
||||||
# epub_tocscope = 'default'
|
|
||||||
|
|
||||||
# Fix unsupported image types using the Pillow.
|
|
||||||
#
|
|
||||||
# epub_fix_images = False
|
|
||||||
|
|
||||||
# Scale large images.
|
|
||||||
#
|
|
||||||
# epub_max_image_width = 0
|
|
||||||
|
|
||||||
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
|
||||||
#
|
|
||||||
# epub_show_urls = 'inline'
|
|
||||||
|
|
||||||
# If false, no index is generated.
|
|
||||||
#
|
|
||||||
# epub_use_index = True
|
|
||||||
@@ -1,313 +0,0 @@
|
|||||||
.. Reminder for header structure:
|
|
||||||
Level 1: ====================
|
|
||||||
Level 2: --------------------
|
|
||||||
Level 3: ++++++++++++++++++++
|
|
||||||
Level 4: """"""""""""""""""""
|
|
||||||
Level 5: ^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
.. meta::
|
|
||||||
:description: Configuring the backup jobs
|
|
||||||
:keywords: Documentation, TISBackup, configuration, backup jobs
|
|
||||||
|
|
||||||
.. |clap| image:: tisbackup-resources/clapping-hands-microsoft.png
|
|
||||||
:scale: 50%
|
|
||||||
:alt: Clapping hands
|
|
||||||
|
|
||||||
Configuring the backup jobs
|
|
||||||
===========================
|
|
||||||
|
|
||||||
.. _configuring_backup_jobs:
|
|
||||||
|
|
||||||
The configuration of the backups is done in an :mimetype:`.ini` file,
|
|
||||||
by default :file:`/etc/tis/tisbackup-config.ini`:
|
|
||||||
|
|
||||||
* a global section where general parameters are specified;
|
|
||||||
|
|
||||||
* then for each backup a section will be created;
|
|
||||||
|
|
||||||
[global] section
|
|
||||||
----------------
|
|
||||||
|
|
||||||
Here are the mandatory parameters of the global section.
|
|
||||||
|
|
||||||
* the beginning of the global section starts with:
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
[global]
|
|
||||||
|
|
||||||
* specify directory where to store backups:
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
backup_base_dir = /backup/data/
|
|
||||||
|
|
||||||
* define the maximum age of the backups (variable used by the cleanup function):
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
backup_retention_time=140
|
|
||||||
|
|
||||||
* define the maximum time in hours between each backup.
|
|
||||||
When this time is exceeded, then :program:`checknagios` goes critical:
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
maximum_backup_age=30
|
|
||||||
|
|
||||||
Another non-mandatory parameter allows to define the rsync compression level:
|
|
||||||
``compression_level=7``.
|
|
||||||
|
|
||||||
Backup types
|
|
||||||
------------
|
|
||||||
|
|
||||||
.. note:: to test with a Windows box
|
|
||||||
|
|
||||||
Globally, the backups are done through an SSH connection and the steps are:
|
|
||||||
|
|
||||||
* creating the **section** in the configuration file;
|
|
||||||
|
|
||||||
* installing ssh on the Linux client;
|
|
||||||
|
|
||||||
* making an ssh key exchange between the tisbackup server
|
|
||||||
and the client to back up;
|
|
||||||
|
|
||||||
Here are the different types of backup possible with :program:`tisbackup`.
|
|
||||||
|
|
||||||
Backing up a MySQL database
|
|
||||||
+++++++++++++++++++++++++++
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
[srvintranet_mysql_mediawiki]
|
|
||||||
type=mysql+ssh
|
|
||||||
server_name=srvintranet
|
|
||||||
private_key=/root/.ssh/id_ed25519
|
|
||||||
db_name=mediawiki
|
|
||||||
db_user=user
|
|
||||||
db_passwd=password
|
|
||||||
|
|
||||||
Mandatory parameters:
|
|
||||||
|
|
||||||
* ``[srvintranet_mysql_mediawiki]``: name of the section starts
|
|
||||||
with the name you give to it;
|
|
||||||
|
|
||||||
* ``type``: specifies the backup type for the Mysql database dump;
|
|
||||||
|
|
||||||
* ``server_name``: defines the server to be backed up
|
|
||||||
by its DNS name or IP address;
|
|
||||||
|
|
||||||
* ``private_key``: defines the name of the private key to be used
|
|
||||||
to connect to the client;
|
|
||||||
|
|
||||||
* ``db_name``: defines the name of the database to dump;
|
|
||||||
|
|
||||||
* ``db_user``: defines the name of a user with the right to dump on the basis of;
|
|
||||||
|
|
||||||
* ``db_passwd``: defines the user's password;
|
|
||||||
|
|
||||||
Backing up a PostgreSQL database
|
|
||||||
++++++++++++++++++++++++++++++++
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
[srvasterisk-pgsql]
|
|
||||||
type=pgsql+ssh
|
|
||||||
server_name=srvasterisk
|
|
||||||
private_key=/root/.ssh/id_rsa
|
|
||||||
db_name=asterisk
|
|
||||||
|
|
||||||
Mandatory parameters:
|
|
||||||
|
|
||||||
* ``[srvasterisk-pgsql]``: name of the section starts
|
|
||||||
with the name you give to it;
|
|
||||||
|
|
||||||
* ``type``: specifies the backup type for the Mysql database dump;
|
|
||||||
|
|
||||||
* ``server_name``: defines the server to be backed up
|
|
||||||
by its DNS name or IP address;
|
|
||||||
|
|
||||||
* ``private_key``: defines the name of the private key to be used
|
|
||||||
to connect to the client;
|
|
||||||
|
|
||||||
* ``db_name``: defines the name of the database to dump;
|
|
||||||
|
|
||||||
Backing up a file server
|
|
||||||
++++++++++++++++++++++++
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
[srvfiles-home]
|
|
||||||
type=rsync+ssh
|
|
||||||
server_name=srvfiles
|
|
||||||
remote_dir=/home
|
|
||||||
private_key=/root/.ssh/id_ed25519
|
|
||||||
exclude_list=".mozilla",".thunderbird",".x2go","*.avi"
|
|
||||||
bwlimit = 100
|
|
||||||
|
|
||||||
Mandatory parameters:
|
|
||||||
|
|
||||||
* ``[srvfiles-home]``: name of the section starts
|
|
||||||
with the name you give to it;
|
|
||||||
|
|
||||||
* ``type``: specifies the backup type for the Mysql database dump;
|
|
||||||
|
|
||||||
* ``server_name``: defines the server to be backed up
|
|
||||||
by its DNS name or IP address;
|
|
||||||
|
|
||||||
* ``remote_dir``: defines the folder on the remote host to backup;
|
|
||||||
|
|
||||||
* ``private_key``: defines the name of the private key to be used
|
|
||||||
to connect to the client;
|
|
||||||
|
|
||||||
.. attention::
|
|
||||||
|
|
||||||
In case of Windows client, specificities are to be expected:
|
|
||||||
|
|
||||||
By default we use the root user for backups, for windows we will use
|
|
||||||
the Administrator account (pay attention to the sensitive box).
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
remote_user=Administrator
|
|
||||||
|
|
||||||
Through :program:`cygwin`, the directory to be backed up will always start
|
|
||||||
with :file:`/cygdrive`, so it must be specified
|
|
||||||
in the ``remote_dir`` parameter.
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
remote_dir=/cygdrive/c/WINDOWS/
|
|
||||||
|
|
||||||
.. hint::
|
|
||||||
|
|
||||||
Other non-mandatory parameters can be used. The ``listdrivers`` option
|
|
||||||
allows you to see them. The two most frequently used parameters are:
|
|
||||||
|
|
||||||
* ``exclude_list``: defines the files to be excluded from the backup;
|
|
||||||
|
|
||||||
* ``bwlimit``: defines the maximum speed of the backup;
|
|
||||||
|
|
||||||
Backing up a XenCenter virtual machine
|
|
||||||
++++++++++++++++++++++++++++++++++++++
|
|
||||||
|
|
||||||
On local storage
|
|
||||||
""""""""""""""""
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
[wsmanage]
|
|
||||||
type=xen-xva
|
|
||||||
xcphost=srvxen1
|
|
||||||
server_name=wsmanage
|
|
||||||
password_file=/root/xen_passwd
|
|
||||||
backup_retention_time=2
|
|
||||||
halt_vm=True
|
|
||||||
enable_https=False
|
|
||||||
|
|
||||||
Mandatory parameters:
|
|
||||||
|
|
||||||
* ``[wsmanage]``: name of the section starts
|
|
||||||
with the name you give to it;
|
|
||||||
|
|
||||||
* ``type``: specifies the backup type for the Mysql database dump;
|
|
||||||
|
|
||||||
* ``xcphost``: defines the XCP server where the VM is found by its DNS name or IP;
|
|
||||||
|
|
||||||
* ``server_name``: defines the server to be backed up
|
|
||||||
by its DNS name or IP address;
|
|
||||||
|
|
||||||
* ``password_file``: defines a file where are stored the user and the password
|
|
||||||
to be used for exporting the :mimetype:`.xva` file;
|
|
||||||
|
|
||||||
* ``backup_retention_time``: defines the maximum number of exports
|
|
||||||
for the virtual machine;
|
|
||||||
|
|
||||||
* ``halt_vm``: **True** = stop the virtual machine then export,
|
|
||||||
**False** = snapshot the virtual machine then export the :file:`xva`
|
|
||||||
without stopping the virtual machine;
|
|
||||||
|
|
||||||
* ``enable_https``: activate or deactivate https protocol for transfer;
|
|
||||||
|
|
||||||
On remote storage
|
|
||||||
"""""""""""""""""
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
[srvads-copy]
|
|
||||||
type=copy-vm-xcp
|
|
||||||
server_name=srvxen1
|
|
||||||
vm_name=srvads
|
|
||||||
storage_name=iscsi-sr1
|
|
||||||
password_file=/root/xen_passwd
|
|
||||||
network_name=test-dcardon
|
|
||||||
max_copies=3
|
|
||||||
|
|
||||||
Mandatory parameters:
|
|
||||||
|
|
||||||
* ``[srvads-copy]``: name of the section starts
|
|
||||||
with the name you give to it;
|
|
||||||
|
|
||||||
* ``type``: specifies the backup type for the Mysql database dump;
|
|
||||||
|
|
||||||
* ``server_name``: defines the server to be backed up
|
|
||||||
by its DNS name or IP address;
|
|
||||||
|
|
||||||
* ``vm_name``: defines the virtual machine to be backed up
|
|
||||||
(its name-label in XCP);
|
|
||||||
|
|
||||||
* ``storage_name``: defines the storage to where to copy the virtual machine
|
|
||||||
(its name-label in XCP);
|
|
||||||
|
|
||||||
* ``password_file``: defines a file where are stored the user and the password
|
|
||||||
to be used for exporting the :mimetype:`.xva` file;
|
|
||||||
|
|
||||||
* ``network_name``: defines the network to which to copy the VM
|
|
||||||
(its name-label in XCP);
|
|
||||||
|
|
||||||
* ``max_copies``: maximum number of exports for the virtual machine;
|
|
||||||
|
|
||||||
XenCenter metadata
|
|
||||||
""""""""""""""""""
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
[srvxen1-metadata]
|
|
||||||
type=xcp-dump-metadata
|
|
||||||
server_name=srvxen1
|
|
||||||
password_file=/root/xen_passwd
|
|
||||||
|
|
||||||
Mandatory parameters:
|
|
||||||
|
|
||||||
* ``[srvxen1-metadata]``: name of the section starts
|
|
||||||
with the name you give to it;
|
|
||||||
|
|
||||||
* ``type``: specifies the backup type for the Mysql database dump;
|
|
||||||
|
|
||||||
* ``server_name``: defines the server to be backed up
|
|
||||||
by its DNS name or IP address;
|
|
||||||
|
|
||||||
* ``password_file``: defines a file where are stored the user and the password
|
|
||||||
to be used for exporting the :mimetype:`.xva` file;
|
|
||||||
|
|
||||||
.. attention::
|
|
||||||
|
|
||||||
For maximum security put the password file in the root directory
|
|
||||||
with read-write access only for it.
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
vi /root/xen_passwd
|
|
||||||
|
|
||||||
example of the content of the file:
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
user
|
|
||||||
password
|
|
||||||
|
|
||||||
implementation of restricted rights
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
chmod 600 /root/xen_passwd
|
|
||||||
@@ -1,114 +0,0 @@
|
|||||||
.. Reminder for header structure:
|
|
||||||
Level 1: ====================
|
|
||||||
Level 2: --------------------
|
|
||||||
Level 3: ++++++++++++++++++++
|
|
||||||
Level 4: """"""""""""""""""""
|
|
||||||
Level 5: ^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
.. meta::
|
|
||||||
:description: TISBackup Documentation
|
|
||||||
:keywords: Documentation, TISBackup, introduction, welcome page, Welcome
|
|
||||||
|
|
||||||
.. |date| date::
|
|
||||||
|
|
||||||
.. figure:: tisbackup-resources/tisbackup_logo.png
|
|
||||||
:align: center
|
|
||||||
:scale: 100%
|
|
||||||
:alt: TISBackup Logo
|
|
||||||
|
|
||||||
Presenting TISBackup
|
|
||||||
====================
|
|
||||||
|
|
||||||
The objective of TISbackup is to benefit from file backups
|
|
||||||
and centralized alert feedback on "reasonable" data volumes
|
|
||||||
(of the order of a few TB).
|
|
||||||
|
|
||||||
TISBackup allows:
|
|
||||||
|
|
||||||
* to know if a recent backup exists;
|
|
||||||
|
|
||||||
* to keep a history with deduplication at the file level (no duplicate backups);
|
|
||||||
|
|
||||||
* to have an immediate view of the contents of a server or a server area
|
|
||||||
for data restoration ;
|
|
||||||
|
|
||||||
* to export the last backup to an external media in order to transfer
|
|
||||||
it to a secure location;
|
|
||||||
|
|
||||||
* to configure the backup cycle with a simple
|
|
||||||
and readable :mimetype:`.ini` file;
|
|
||||||
|
|
||||||
* to work with a module mechanism to extend the type of backups
|
|
||||||
(https, rsync, postgres, mysql,) of virtual machines;
|
|
||||||
|
|
||||||
Satisfying these needs stems from the need for a tool
|
|
||||||
to manage a vast pool of machines each hosting a multitude
|
|
||||||
of different software or services (different editors,
|
|
||||||
different hardware platforms and operating environments, etc.).
|
|
||||||
Finally, as the backup procedures of a publisher changed without any warning,
|
|
||||||
the remote backup mechanisms were regularly broken, which caused us some scares
|
|
||||||
with the mechanisms we were using before.
|
|
||||||
|
|
||||||
Overview of existing solutions
|
|
||||||
------------------------------
|
|
||||||
|
|
||||||
Different open source solutions exist but did not meet our specifications.
|
|
||||||
|
|
||||||
Baccula
|
|
||||||
+++++++
|
|
||||||
|
|
||||||
:program:`Baccula` is a high-performance solution for full backups on tape
|
|
||||||
and removable media. However, a restore can take a long time
|
|
||||||
and the storage of a history can be voluminous.
|
|
||||||
The backup is saved on a file system that is not readable by a Windows system.
|
|
||||||
An uninitiated "backup manager" will not be able to check the contents
|
|
||||||
of his backup from home.
|
|
||||||
|
|
||||||
r-snapshot
|
|
||||||
++++++++++
|
|
||||||
|
|
||||||
:program:`r-snapshot` almost corresponds to the specifications
|
|
||||||
but is complex to configure and any necessary modification
|
|
||||||
would have been difficult to develop as an overlay of the existing one:
|
|
||||||
|
|
||||||
* the backups are organized by date then by zone which is the opposite
|
|
||||||
of what was desired;
|
|
||||||
|
|
||||||
* it is not possible to configure different backup frequencies
|
|
||||||
according to the criticality levels of the servers;
|
|
||||||
|
|
||||||
* finally, the deletion of obsolete backups is done in the same process
|
|
||||||
as the backups, which can be very long and can be problematic
|
|
||||||
if there is a problem during the backup.
|
|
||||||
|
|
||||||
**... and now TISbackup ...**
|
|
||||||
|
|
||||||
.. toctree::
|
|
||||||
:maxdepth: 2
|
|
||||||
:caption: Presenting TISBackup
|
|
||||||
|
|
||||||
presenting_tisbackup.rst
|
|
||||||
installing_tisbackup.rst
|
|
||||||
configuring_tisbackup.rst
|
|
||||||
using_tisbackup.rst
|
|
||||||
|
|
||||||
.. toctree::
|
|
||||||
:maxdepth: 2
|
|
||||||
:caption: Security & Authentication
|
|
||||||
|
|
||||||
security.rst
|
|
||||||
authentication.rst
|
|
||||||
|
|
||||||
.. toctree::
|
|
||||||
:maxdepth: 1
|
|
||||||
:caption: Appendix
|
|
||||||
|
|
||||||
tranquil-it-contacts.rst
|
|
||||||
screenshots.rst
|
|
||||||
|
|
||||||
Indices and tables
|
|
||||||
==================
|
|
||||||
|
|
||||||
* :ref:`genindex`
|
|
||||||
|
|
||||||
* :ref:`search`
|
|
||||||
@@ -1,296 +0,0 @@
|
|||||||
.. Reminder for header structure:
|
|
||||||
Level 1: ====================
|
|
||||||
Level 2: --------------------
|
|
||||||
Level 3: ++++++++++++++++++++
|
|
||||||
Level 4: """"""""""""""""""""
|
|
||||||
Level 5: ^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
.. meta::
|
|
||||||
:description: Installing and configuring TISBackup
|
|
||||||
:keywords: Documentation, TISBackup, installation, configuration
|
|
||||||
|
|
||||||
.. |clap| image:: tisbackup-resources/clapping-hands-microsoft.png
|
|
||||||
:scale: 50%
|
|
||||||
:alt: Clapping hands
|
|
||||||
|
|
||||||
Installing and configuring TISBackup on Debian
|
|
||||||
==============================================
|
|
||||||
|
|
||||||
.. _base_debian_server_install:
|
|
||||||
|
|
||||||
Setting up the GNU/Linux Debian server
|
|
||||||
--------------------------------------
|
|
||||||
|
|
||||||
In order to install a fresh Debian Linux 11 *Bullseye* (physical or virtual)
|
|
||||||
without graphical interface, please refer to the
|
|
||||||
`Debian GNU/Linux Installation Guide <https://www.debian.org/releases/bullseye/amd64/>`_.
|
|
||||||
|
|
||||||
Configuring network parameters
|
|
||||||
++++++++++++++++++++++++++++++
|
|
||||||
|
|
||||||
.. include:: tisbackup-resources/linux-server-naming.txt
|
|
||||||
|
|
||||||
Configuring the name of the Debian server
|
|
||||||
+++++++++++++++++++++++++++++++++++++++++
|
|
||||||
|
|
||||||
.. hint::
|
|
||||||
|
|
||||||
The short name of the future TISBackup server must not be longer
|
|
||||||
than **15 characters** (the limit is due to *sAMAccountName* restriction
|
|
||||||
in Active Directory).
|
|
||||||
|
|
||||||
The name of the TISBackup server must be a :abbr:`FQDN (Fully Qualified Domain Name)`,
|
|
||||||
that is to say it has both the server name and the DNS suffix.
|
|
||||||
|
|
||||||
* modify the :file:`/etc/hostname` file and write the FQDN of the server;
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
# /etc/hostname of the TISBackup server
|
|
||||||
srvbackup.mydomain.lan
|
|
||||||
|
|
||||||
* configure the :file:`/etc/hosts` file, be sure to put both the FQDN
|
|
||||||
and the short name of the server;
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
# /etc/hosts of the server
|
|
||||||
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
|
|
||||||
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
|
|
||||||
10.0.0.10 srvbackup.mydomain.lan srvbackup
|
|
||||||
|
|
||||||
.. hint::
|
|
||||||
|
|
||||||
* on the line defining the DNS server IP address, be sure to have the IP
|
|
||||||
of the server (not 127.0.0.1), then the FQDN, then the short name;
|
|
||||||
|
|
||||||
* do not change the line with *localhost*;
|
|
||||||
|
|
||||||
Configuring the IP address of the Debian server
|
|
||||||
+++++++++++++++++++++++++++++++++++++++++++++++
|
|
||||||
|
|
||||||
* configure the IP address of the Debian Server
|
|
||||||
in the :file:`/etc/network/interfaces`;
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
# /etc/network/interfaces of the Debian server
|
|
||||||
auto eth0
|
|
||||||
iface eth0 inet static
|
|
||||||
address 10.0.0.10
|
|
||||||
netmask 255.255.255.0
|
|
||||||
gateway 10.0.0.254
|
|
||||||
|
|
||||||
* apply the network configuration by rebooting the machine
|
|
||||||
with a :code:`reboot`;
|
|
||||||
|
|
||||||
* if it has not already been done, create the DNS entry for the Server
|
|
||||||
in the Organization's Active Directory;
|
|
||||||
|
|
||||||
* after reboot, configure the system language in English in order to have
|
|
||||||
non-localized logs for easier searching of common errors;
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
apt install locales-all
|
|
||||||
localectl set-locale LANG=en_US.UTF-8
|
|
||||||
localectl status
|
|
||||||
|
|
||||||
* check that the machine clock is on time (with NTP installed);
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
dpkg -l | grep ntp
|
|
||||||
service ntp status
|
|
||||||
date
|
|
||||||
|
|
||||||
.. hint::
|
|
||||||
|
|
||||||
If the NTP package is not installed.
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
apt install ntp
|
|
||||||
systemctl enable ntp
|
|
||||||
systemctl start ntp
|
|
||||||
|
|
||||||
* update and upgrade your Debian;
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
apt update
|
|
||||||
apt upgrade -y
|
|
||||||
|
|
||||||
* install systemd;
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
apt install systemd
|
|
||||||
|
|
||||||
* restart the Debian server;
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
reboot
|
|
||||||
|
|
||||||
|clap| The Debian server is now ready. You may now go on to the next step
|
|
||||||
and :ref:`install TISBackup on your Debian<install_tisbackup_debian>`.
|
|
||||||
|
|
||||||
.. _install_tisbackup_debian:
|
|
||||||
|
|
||||||
Installing the TISBackup server
|
|
||||||
+++++++++++++++++++++++++++++++
|
|
||||||
|
|
||||||
From Tranquil IT's repository
|
|
||||||
"""""""""""""""""""""""""""""
|
|
||||||
|
|
||||||
The easiest way is to install the package from Tranquil IT repository :
|
|
||||||
|
|
||||||
.. tabs::
|
|
||||||
|
|
||||||
.. code-tab:: bash On CentOS8 and derivate
|
|
||||||
|
|
||||||
wget https://srvinstallation.tranquil.it/tisbackup/tis-tisbackup-162-1.el8.x86_64.rpm -O tis-tisbackup.rpm
|
|
||||||
yum install -y tis-tisbackup.rpm
|
|
||||||
|
|
||||||
.. code-tab:: bash On CentOS7
|
|
||||||
|
|
||||||
wget https://srvinstallation.tranquil.it/tisbackup/tis-tisbackup-162-1.el7.x86_64.rpm -O tis-tisbackup.rpm
|
|
||||||
yum install -y tis-tisbackup.rpm
|
|
||||||
|
|
||||||
.. code-tab:: bash On Debian 11
|
|
||||||
|
|
||||||
wget https://srvinstallation.tranquil.it/tisbackup/tis-tisbackup-1-2.0.163-deb11.deb -O tis-tisbackup.deb
|
|
||||||
apt install unzip python3-paramiko python3-pyvmomi python3-pexpect python3-flask python3-simplejson python3-pip
|
|
||||||
dpkg -i tis-tisbackup.deb
|
|
||||||
|
|
||||||
|
|
||||||
From sources
|
|
||||||
""""""""""""
|
|
||||||
|
|
||||||
* install the required dependencies:
|
|
||||||
|
|
||||||
.. tabs::
|
|
||||||
|
|
||||||
.. code-tab:: bash On CentOS8 and derivate
|
|
||||||
|
|
||||||
unzip, ssh, rsync, python3-paramiko, python3-pyvmomi, python3-pexpect, python3-flask,python3-simplejson, python3-pip
|
|
||||||
|
|
||||||
.. code-tab:: bash On CentOS7 and derivate
|
|
||||||
|
|
||||||
unzip rsync python3-paramiko python3-pyvmomi nfs-utils python3-flask python3-simplejson autofs python3-pexpect
|
|
||||||
|
|
||||||
.. code-tab:: bash on Debian 11
|
|
||||||
|
|
||||||
unzip rsync python36-paramiko python3-pyvmomi nfs-utils python3-flask python3-simplejson autofs pexpect
|
|
||||||
|
|
||||||
* retrieve the git sources from https://github.com/tranquilit/TISbackup
|
|
||||||
and place them in the :file:`/opt` folder on your server:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
cd /opt/
|
|
||||||
wget --no-check-certificate https://github.com/tranquilit/TISbackup/archive/master.zip
|
|
||||||
unzip master.zip
|
|
||||||
mv TISbackup-master tisbackup
|
|
||||||
pip3 install huey iniparse -t /opt/tisbackup/lib
|
|
||||||
chmod 755 /opt/tisbackup/tisbackup.py
|
|
||||||
ln -sb /opt/tisbackup/tisbackup.py /usr/local/bin/tisbackup
|
|
||||||
|
|
||||||
* the :command:`tisbackup` command must return all *tisbackup* actions
|
|
||||||
directly to you. For more information on the actions
|
|
||||||
go to :ref:`the section on using TISBackup<using_tisbackup>`;
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
[root@srvbackup.mydomain.lan tisbackup]# tisbackup
|
|
||||||
ERROR : You must provide one action to perform
|
|
||||||
Usage: tisbackup -c configfile action
|
|
||||||
|
|
||||||
TIS Files Backup system.
|
|
||||||
|
|
||||||
action is either :
|
|
||||||
backup : launch all backups or a specific one if -s option is used
|
|
||||||
cleanup : removed backups older than retention period
|
|
||||||
checknagios : check all or a specific backup against max_backup_age parameter
|
|
||||||
dumpstat : dump the content of database for the last 20 backups
|
|
||||||
retryfailed : try to relaunch the last failed backups
|
|
||||||
listdrivers : list available backup types and parameters for config inifile
|
|
||||||
exportbackup : copy lastest OK backups from local to location defined by --exportdir parameter
|
|
||||||
register_existing : scan backup directories and add missing backups to database
|
|
||||||
|
|
||||||
Configuring TISBackup
|
|
||||||
+++++++++++++++++++++
|
|
||||||
|
|
||||||
* create the directory for TISBackup configuration files:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
mkdir /etc/tis/
|
|
||||||
|
|
||||||
* in the directory :file:`/opt/tisbackup/samples/`, you will find the files
|
|
||||||
:file:`config.ini.sample` and :file:`tisbackup-config.ini`
|
|
||||||
which you can use as examples. Copy one of these two files
|
|
||||||
into the :file:`/etc/tis` directory and we will describe in the next section
|
|
||||||
how to customize this files;
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
cp /opt/tisbackup/samples/tisbackup-config.ini.sample /etc/tis/tisbackup-config.ini
|
|
||||||
|
|
||||||
Launching the backup scheduled task
|
|
||||||
+++++++++++++++++++++++++++++++++++
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
cp /opt/tisbackup/samples/tisbackup.cron /etc/cron.d/tisbackup
|
|
||||||
|
|
||||||
* modify the :file:`/etc/cron.d/tisbackup` file to indicate when to launch
|
|
||||||
the task;
|
|
||||||
|
|
||||||
Generating the public and private certificates
|
|
||||||
++++++++++++++++++++++++++++++++++++++++++++++
|
|
||||||
|
|
||||||
* as root, generate an Ed25519 SSH key (modern and secure algorithm):
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
ssh-keygen -t ed25519 -C "tisbackup@$(hostname)"
|
|
||||||
|
|
||||||
* press :kbd:`Enter` for each one of the steps;
|
|
||||||
|
|
||||||
.. note::
|
|
||||||
|
|
||||||
TISBackup supports Ed25519, ECDSA, and RSA key algorithms (in order of preference).
|
|
||||||
DSA keys are no longer supported for security reasons. If you need RSA for compatibility,
|
|
||||||
use at least 4096 bits:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
ssh-keygen -t rsa -b 4096 -C "tisbackup@$(hostname)"
|
|
||||||
|
|
||||||
|clap| You may now go on to the next step
|
|
||||||
and :ref:`configure the backup jobs for your TISBackup<configuring_backup_jobs>`.
|
|
||||||
|
|
||||||
Setting up the graphical user interface for the TISBackup server
|
|
||||||
----------------------------------------------------------------
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
cp /opt/tisbackup/samples/tisbackup_gui.ini /etc/tis/
|
|
||||||
cp /opt/tisbackup/scripts/tisbackup_gui /etc/init.d/tisbackup_gui
|
|
||||||
cp /opt/tisbackup/scripts/tisbackup_huey /etc/init.d/tisbackup_huey
|
|
||||||
chmod +x /etc/init.d/tisbackup_gui
|
|
||||||
chmod +x /etc/init.d/tisbackup_huey
|
|
||||||
update-rc.d tisbackup_huey defaults
|
|
||||||
update-rc.d tisbackup_gui defaults
|
|
||||||
|
|
||||||
You can now access your interface through the url
|
|
||||||
of your TISBackup server on port 8080.
|
|
||||||
|
|
||||||
.. figure:: tisbackup-resources/tisbackup_gui.png
|
|
||||||
:align: center
|
|
||||||
:scale: 100%
|
|
||||||
:alt: TISBackup Web interface
|
|
||||||
|
|
||||||
TISBackup Web interface
|
|
||||||
@@ -1,137 +0,0 @@
|
|||||||
.. Reminder for header structure:
|
|
||||||
Level 1: ====================
|
|
||||||
Level 2: --------------------
|
|
||||||
Level 3: ++++++++++++++++++++
|
|
||||||
Level 4: """"""""""""""""""""
|
|
||||||
Level 5: ^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
.. meta::
|
|
||||||
:description: Technical background for TISBackup
|
|
||||||
:keywords: Documentation, TISBackup, technical background
|
|
||||||
|
|
||||||
.. |clap| image:: tisbackup-resources/clapping-hands-microsoft.png
|
|
||||||
:scale: 50%
|
|
||||||
:alt: Clapping hands
|
|
||||||
|
|
||||||
.. |date| date::
|
|
||||||
|
|
||||||
Technical background for TISBackup
|
|
||||||
==================================
|
|
||||||
|
|
||||||
The deduplication of this solution is based on the hardlinks
|
|
||||||
of ext3/4 file systems used for storing backup files.
|
|
||||||
|
|
||||||
The backup server must run :program:`rsync` in server mode,
|
|
||||||
and the workstations to be backed up must be equipped with :program:`rsync`
|
|
||||||
and :program:`ssh` (usually basic on machines running GNU/Linux,
|
|
||||||
with :program:`cygwin` (or another tool like :program:`cwrsync`)
|
|
||||||
for machines running MS Windows).
|
|
||||||
|
|
||||||
tisbackup
|
|
||||||
---------
|
|
||||||
|
|
||||||
:program:`tisbackup` is a python script that the backup server runs
|
|
||||||
at regular intervals. The configuration file :file:`tisbackup.ini` contains
|
|
||||||
the details of the tasks to be executed.
|
|
||||||
|
|
||||||
:program:`tisbackup` has different options for its execution,
|
|
||||||
available in the :command:`tisbackup --help` command,
|
|
||||||
the main ones being the following:
|
|
||||||
|
|
||||||
* :command:`backup`: executes all scheduled backups;
|
|
||||||
|
|
||||||
* :command:`cleanup`: examines the backups and deletes those
|
|
||||||
that are older than the defined maximum retention time ;
|
|
||||||
|
|
||||||
* :command:`checknagios`: returns the content that can be viewed by nagios ;
|
|
||||||
|
|
||||||
* :command:`retryfailed`: redoes the backups that previously failed;
|
|
||||||
|
|
||||||
* :command:`exportbackup`: exports the last valid backups
|
|
||||||
to the specified location (remote, external media, ...);
|
|
||||||
|
|
||||||
* :command:`register_existing`: scans the backups that have been made
|
|
||||||
and adds the missing ones to the database;
|
|
||||||
|
|
||||||
tisbackup.ini
|
|
||||||
-------------
|
|
||||||
|
|
||||||
:file:`tisbackup.ini` defines the backups to be executed and supervised.
|
|
||||||
It is written with a simple formalism.
|
|
||||||
|
|
||||||
The different types of backups are:
|
|
||||||
|
|
||||||
* ``rsync``: the backup of a directory by rsync using the rsync protocol;
|
|
||||||
|
|
||||||
* ``rsync+ssh``: the backup of a directory by rsync with the ssh protocol;
|
|
||||||
|
|
||||||
* ``mysql+ssh``: saving a mysql database in a gzipped sql file,
|
|
||||||
with the ssh protocol;
|
|
||||||
|
|
||||||
* ``pgsql+ssh``: the backup of a postgresql database in a gzipped sql file,
|
|
||||||
with the ssh protocol;
|
|
||||||
|
|
||||||
* ``xen-xva``: the backup of a virtual machine running on an XCP server
|
|
||||||
as an XVA file;
|
|
||||||
|
|
||||||
* ``xen-meta-data``: the backup of XCP metadata from a virtualization server;
|
|
||||||
|
|
||||||
* ``switch``: the backup of switches;
|
|
||||||
|
|
||||||
* ``null``: null backup of a server that does not require a backup but for which
|
|
||||||
it is known to be taken into account (Nagios supervision);
|
|
||||||
|
|
||||||
The first part of the :file:`tisbackup.ini` file,
|
|
||||||
starting with the ``[Global]`` tag, determines:
|
|
||||||
|
|
||||||
* the path to the folder where the backups will be stored;
|
|
||||||
|
|
||||||
* the maximum retention time of a backup (in days);
|
|
||||||
|
|
||||||
* the maximum delay before triggering a nagios critical message (in hours);
|
|
||||||
|
|
||||||
* possibly the limit of usable bandwidth;
|
|
||||||
|
|
||||||
The rest of the file lists the different backups to be made,
|
|
||||||
with specific parameters for each type of backup:
|
|
||||||
|
|
||||||
* name of the directory in the backup;
|
|
||||||
|
|
||||||
* backup type;
|
|
||||||
|
|
||||||
* server name;
|
|
||||||
|
|
||||||
* directory (in case of a directory backup);
|
|
||||||
|
|
||||||
* directories to be excluded (idem);
|
|
||||||
|
|
||||||
* location of the ssh key to be used (private key on the backup server);
|
|
||||||
|
|
||||||
* name of the database (in case of mysql or postgresql database backup);
|
|
||||||
|
|
||||||
* ssh port number to use;
|
|
||||||
|
|
||||||
* database user and password (in case of mysql or postgresql database backup);
|
|
||||||
|
|
||||||
tisbackup.sql
|
|
||||||
-------------
|
|
||||||
|
|
||||||
:file:`tisbackup.sql` is the :program:`sqlite` database available
|
|
||||||
on the backup server, in which the backup information of each
|
|
||||||
of the backed up areas is stored. It is used in particular to gather
|
|
||||||
the information necessary for Nagios.
|
|
||||||
|
|
||||||
TISbackup GUI
|
|
||||||
-------------
|
|
||||||
|
|
||||||
Also developed in python, TISbackup GUI is a graphical interface
|
|
||||||
that allows you to:
|
|
||||||
|
|
||||||
* visualize the last backups;
|
|
||||||
|
|
||||||
* export a backup to a USB media;
|
|
||||||
|
|
||||||
* visualize the backups to be made;
|
|
||||||
|
|
||||||
|clap| You may now go on to the next step
|
|
||||||
and :ref:`install TISBackup on your Debian<base_debian_server_install>`.
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
.. Reminder for header structure:
|
|
||||||
Level 1: ====================
|
|
||||||
Level 2: --------------------
|
|
||||||
Level 3: ++++++++++++++++++++
|
|
||||||
Level 4: """"""""""""""""""""
|
|
||||||
Level 5: ^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
.. meta::
|
|
||||||
:description: Screenshots of TISBackup
|
|
||||||
:keywords: Documentation, TISBackup, screenshots
|
|
||||||
|
|
||||||
.. |clap| image:: tisbackup-resources/clapping-hands-microsoft.png
|
|
||||||
:scale: 50%
|
|
||||||
:alt: Clapping hands
|
|
||||||
|
|
||||||
Screenshots of TISBackup
|
|
||||||
========================
|
|
||||||
|
|
||||||
.. _tisbackup_screenshots:
|
|
||||||
|
|
||||||
.. figure:: tisbackup-resources/tisbackup_gui.png
|
|
||||||
:align: center
|
|
||||||
:scale: 100%
|
|
||||||
:alt: TISBackup Web interface
|
|
||||||
|
|
||||||
TISBackup Web interface
|
|
||||||
|
|
||||||
.. figure:: tisbackup-resources/tisbackup_hdd_export.png
|
|
||||||
:align: center
|
|
||||||
:scale: 100%
|
|
||||||
:alt: Exporting a backup to an external USB HDD
|
|
||||||
|
|
||||||
Exporting a backup to an external USB HDD
|
|
||||||
|
|
||||||
.. figure:: tisbackup-resources/tisbackup_hdd_export_status.png
|
|
||||||
:align: center
|
|
||||||
:scale: 100%
|
|
||||||
:alt: Status of exported backups
|
|
||||||
|
|
||||||
Status of exported backups
|
|
||||||
|
|
||||||
.. figure:: tisbackup-resources/tisbackup_backup_list.png
|
|
||||||
:align: center
|
|
||||||
:scale: 20%
|
|
||||||
:alt: Overview of current backups
|
|
||||||
|
|
||||||
Overview of current backups
|
|
||||||
|
|
||||||
.. figure:: tisbackup-resources/tisbackup_successful_backups.png
|
|
||||||
:align: center
|
|
||||||
:scale: 20%
|
|
||||||
:alt: Overview of successful backups
|
|
||||||
|
|
||||||
Overview of successful backups
|
|
||||||
|
|
||||||
.. figure:: tisbackup-resources/tisbackup_searching_backups.png
|
|
||||||
:align: center
|
|
||||||
:scale: 100%
|
|
||||||
:alt: Searching for past backups
|
|
||||||
|
|
||||||
Searching for past backups
|
|
||||||
|
|
||||||
.. figure:: tisbackup-resources/tisbackup_action_menu.png
|
|
||||||
:align: center
|
|
||||||
:scale: 20%
|
|
||||||
:alt: TISBackup action menu
|
|
||||||
|
|
||||||
TISBackup action menu
|
|
||||||
@@ -1,288 +0,0 @@
|
|||||||
.. Reminder for header structure:
|
|
||||||
Level 1: ====================
|
|
||||||
Level 2: --------------------
|
|
||||||
Level 3: ++++++++++++++++++++
|
|
||||||
Level 4: """"""""""""""""""""
|
|
||||||
Level 5: ^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
.. meta::
|
|
||||||
:description: Security best practices for TISBackup
|
|
||||||
:keywords: Documentation, TISBackup, security, best practices, authentication
|
|
||||||
|
|
||||||
Security Best Practices
|
|
||||||
=======================
|
|
||||||
|
|
||||||
.. _security_best_practices:
|
|
||||||
|
|
||||||
TISBackup has been designed with security in mind. This section outlines
|
|
||||||
the security features and best practices for deploying and maintaining
|
|
||||||
a secure backup infrastructure.
|
|
||||||
|
|
||||||
SSH Key Algorithm Support
|
|
||||||
--------------------------
|
|
||||||
|
|
||||||
Modern SSH Key Algorithms
|
|
||||||
+++++++++++++++++++++++++
|
|
||||||
|
|
||||||
TISBackup supports modern SSH key algorithms with the following priority:
|
|
||||||
|
|
||||||
1. **Ed25519** (recommended) - Modern, fast, and secure
|
|
||||||
2. **ECDSA** - Elliptic curve cryptography
|
|
||||||
3. **RSA** - Traditional algorithm (use 4096 bits minimum)
|
|
||||||
|
|
||||||
.. warning::
|
|
||||||
|
|
||||||
DSA keys are **no longer supported** due to known security vulnerabilities.
|
|
||||||
If you are using DSA keys, you must migrate to Ed25519, ECDSA, or RSA.
|
|
||||||
|
|
||||||
Generating Secure SSH Keys
|
|
||||||
+++++++++++++++++++++++++++
|
|
||||||
|
|
||||||
For new installations, generate an Ed25519 key:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
ssh-keygen -t ed25519 -C "tisbackup@$(hostname)"
|
|
||||||
|
|
||||||
For compatibility with older systems that don't support Ed25519, use RSA with 4096 bits:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
ssh-keygen -t rsa -b 4096 -C "tisbackup@$(hostname)"
|
|
||||||
|
|
||||||
Migrating from DSA Keys
|
|
||||||
++++++++++++++++++++++++
|
|
||||||
|
|
||||||
If you have existing backup configurations using DSA keys:
|
|
||||||
|
|
||||||
1. Generate a new Ed25519 key on the backup server
|
|
||||||
2. Copy the new public key to all backup clients
|
|
||||||
3. Update the ``private_key`` parameter in all backup sections
|
|
||||||
4. Test the backups to ensure they work with the new key
|
|
||||||
5. Remove the old DSA keys from both server and clients
|
|
||||||
|
|
||||||
Flask Web Interface Security
|
|
||||||
-----------------------------
|
|
||||||
|
|
||||||
Authentication
|
|
||||||
++++++++++++++
|
|
||||||
|
|
||||||
The Flask web interface now requires authentication by default.
|
|
||||||
TISBackup supports multiple authentication methods:
|
|
||||||
|
|
||||||
Basic Authentication (Default)
|
|
||||||
"""""""""""""""""""""""""""""""
|
|
||||||
|
|
||||||
By default, TISBackup uses HTTP Basic Authentication. Configure it via
|
|
||||||
environment variables or the configuration file.
|
|
||||||
|
|
||||||
**Environment variables:**
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
export TISBACKUP_AUTH_USERNAME="admin"
|
|
||||||
export TISBACKUP_AUTH_PASSWORD="your-secure-password"
|
|
||||||
|
|
||||||
**Configuration file** (:file:`/etc/tis/tisbackup_gui.ini`):
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
[authentication]
|
|
||||||
type=basic
|
|
||||||
username=admin
|
|
||||||
# Bcrypt hash of password (recommended)
|
|
||||||
password_hash=$2b$12$LQv3c1yqBWVHxkd0LHAkCOYz6TtxMQJqhN8/LewY5eSZL9fJQp.Ym
|
|
||||||
use_bcrypt=True
|
|
||||||
realm=TISBackup
|
|
||||||
|
|
||||||
.. warning::
|
|
||||||
|
|
||||||
If no password is configured, TISBackup will generate a random password
|
|
||||||
and display it in the logs. This is not suitable for production use.
|
|
||||||
|
|
||||||
Session-Based Authentication (Flask-Login)
|
|
||||||
"""""""""""""""""""""""""""""""""""""""""""
|
|
||||||
|
|
||||||
For more advanced deployments, you can use Flask-Login with a user file:
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
[authentication]
|
|
||||||
type=flask-login
|
|
||||||
user_file=/etc/tis/tisbackup_users.txt
|
|
||||||
secret_key=<random-secret-key>
|
|
||||||
|
|
||||||
OAuth2 Authentication
|
|
||||||
""""""""""""""""""""""
|
|
||||||
|
|
||||||
For enterprise deployments, OAuth2 is supported with providers like Google,
|
|
||||||
GitHub, and GitLab:
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
[authentication]
|
|
||||||
type=oauth
|
|
||||||
provider=google
|
|
||||||
client_id=<your-client-id>
|
|
||||||
client_secret=<your-client-secret>
|
|
||||||
redirect_uri=http://backup.example.com:8080/callback
|
|
||||||
allowed_domains=example.com
|
|
||||||
|
|
||||||
See :file:`AUTHENTICATION.md` in the repository root for detailed
|
|
||||||
authentication configuration.
|
|
||||||
|
|
||||||
Secret Key Configuration
|
|
||||||
+++++++++++++++++++++++++
|
|
||||||
|
|
||||||
The Flask application requires a secret key for session security.
|
|
||||||
|
|
||||||
**Never use the default hardcoded key in production!**
|
|
||||||
|
|
||||||
Configure via environment variable:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
export TISBACKUP_SECRET_KEY="your-random-secret-key-here"
|
|
||||||
|
|
||||||
Or in :file:`/etc/tis/tisbackup_gui.ini`:
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
[global]
|
|
||||||
secret_key=your-random-secret-key-here
|
|
||||||
|
|
||||||
Generate a secure random key:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
python3 -c "import secrets; print(secrets.token_hex(32))"
|
|
||||||
|
|
||||||
SSL/TLS Configuration
|
|
||||||
+++++++++++++++++++++
|
|
||||||
|
|
||||||
For production deployments, always use HTTPS. Place the Flask application
|
|
||||||
behind a reverse proxy like Nginx or Apache:
|
|
||||||
|
|
||||||
**Nginx example:**
|
|
||||||
|
|
||||||
.. code-block:: nginx
|
|
||||||
|
|
||||||
server {
|
|
||||||
listen 443 ssl http2;
|
|
||||||
server_name backup.example.com;
|
|
||||||
|
|
||||||
ssl_certificate /etc/ssl/certs/backup.crt;
|
|
||||||
ssl_certificate_key /etc/ssl/private/backup.key;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
proxy_pass http://127.0.0.1:8080;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Database and Backup Security
|
|
||||||
-----------------------------
|
|
||||||
|
|
||||||
File Permissions
|
|
||||||
++++++++++++++++
|
|
||||||
|
|
||||||
Ensure proper file permissions on sensitive files:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
# Configuration files
|
|
||||||
chmod 600 /etc/tis/tisbackup-config.ini
|
|
||||||
chmod 600 /etc/tis/tisbackup_gui.ini
|
|
||||||
|
|
||||||
# SSH keys
|
|
||||||
chmod 600 /root/.ssh/id_ed25519
|
|
||||||
chmod 644 /root/.ssh/id_ed25519.pub
|
|
||||||
|
|
||||||
# Password files (for XenServer, etc.)
|
|
||||||
chmod 600 /root/xen_passwd
|
|
||||||
|
|
||||||
# Backup directory
|
|
||||||
chown -R root:root /backup/data
|
|
||||||
chmod 750 /backup/data
|
|
||||||
|
|
||||||
Credential Storage
|
|
||||||
++++++++++++++++++
|
|
||||||
|
|
||||||
For database credentials and other secrets:
|
|
||||||
|
|
||||||
* Use strong, unique passwords for each service
|
|
||||||
* Store credentials in configuration files with restricted permissions
|
|
||||||
* Consider using a secrets management system for sensitive deployments
|
|
||||||
* Rotate credentials regularly
|
|
||||||
|
|
||||||
Network Security
|
|
||||||
++++++++++++++++
|
|
||||||
|
|
||||||
* Restrict SSH access to the backup server IP address
|
|
||||||
* Use firewall rules to limit access to the web interface
|
|
||||||
* Consider VPN access for remote backup management
|
|
||||||
* Enable fail2ban or similar tools to prevent brute-force attacks
|
|
||||||
|
|
||||||
Security Monitoring
|
|
||||||
-------------------
|
|
||||||
|
|
||||||
Log Monitoring
|
|
||||||
++++++++++++++
|
|
||||||
|
|
||||||
Regularly review TISBackup logs for:
|
|
||||||
|
|
||||||
* Failed authentication attempts
|
|
||||||
* Backup failures or timeouts
|
|
||||||
* Unusual activity patterns
|
|
||||||
* SSH connection errors
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
# View recent backup logs
|
|
||||||
journalctl -u tisbackup_gui -n 100
|
|
||||||
|
|
||||||
# Monitor for authentication failures
|
|
||||||
grep "authentication failed" /var/log/tisbackup/*.log
|
|
||||||
|
|
||||||
Backup Verification
|
|
||||||
+++++++++++++++++++
|
|
||||||
|
|
||||||
* Regularly test backup restoration
|
|
||||||
* Verify backup integrity using checksums
|
|
||||||
* Monitor backup sizes for unexpected changes
|
|
||||||
* Set up Nagios checks for backup freshness
|
|
||||||
|
|
||||||
Security Updates
|
|
||||||
++++++++++++++++
|
|
||||||
|
|
||||||
* Keep TISBackup updated to the latest version
|
|
||||||
* Apply security patches to the host operating system
|
|
||||||
* Update Python dependencies regularly:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
uv sync --upgrade
|
|
||||||
|
|
||||||
Additional Security Recommendations
|
|
||||||
------------------------------------
|
|
||||||
|
|
||||||
1. **Principle of Least Privilege**: Create dedicated service accounts
|
|
||||||
for backups rather than using root when possible
|
|
||||||
|
|
||||||
2. **Network Segmentation**: Place the backup server in a dedicated
|
|
||||||
network segment with restricted access
|
|
||||||
|
|
||||||
3. **Backup Encryption**: Consider encrypting backups at rest,
|
|
||||||
especially for sensitive data
|
|
||||||
|
|
||||||
4. **Off-site Storage**: Maintain encrypted off-site backups
|
|
||||||
for disaster recovery
|
|
||||||
|
|
||||||
5. **Access Auditing**: Maintain logs of who accesses backups
|
|
||||||
and when they are restored
|
|
||||||
|
|
||||||
6. **Incident Response**: Have a documented procedure for responding
|
|
||||||
to security incidents involving the backup infrastructure
|
|
||||||
|
Before Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 105 KiB |
|
Before Width: | Height: | Size: 11 KiB |
@@ -1,22 +0,0 @@
|
|||||||
.. Reminder for header structure:
|
|
||||||
Niveau 1: ====================
|
|
||||||
Niveau 2: --------------------
|
|
||||||
Niveau 3: ++++++++++++++++++++
|
|
||||||
Niveau 4: """"""""""""""""""""
|
|
||||||
Niveau 5: ^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
The different parameters presented below are not specific to TISBackup;
|
|
||||||
you may adapt them as required for your environment.
|
|
||||||
|
|
||||||
Modify the following files in order to get a proper named
|
|
||||||
:abbr:`FQDN (Fully Qualified Domain Name)` and network addressing strategy.
|
|
||||||
|
|
||||||
In the following example:
|
|
||||||
|
|
||||||
* the FQDN name is *srvbackup.mydomain.lan*;
|
|
||||||
|
|
||||||
* the short-name of the TISBackup Server is *srvbackup*;
|
|
||||||
|
|
||||||
* the :abbr:`DNS (Domain Name Service)` suffix is *mydomain.lan*;
|
|
||||||
|
|
||||||
* the IP address is *10.0.0.10/24*;
|
|
||||||
|
Before Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 162 KiB |
|
Before Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 69 KiB |
|
Before Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 224 KiB |
|
Before Width: | Height: | Size: 184 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 112 KiB |
@@ -1,19 +0,0 @@
|
|||||||
.. Reminder for header structure:
|
|
||||||
Level 1: ====================
|
|
||||||
Level 2: --------------------
|
|
||||||
Level 3: ++++++++++++++++++++
|
|
||||||
Level 4: """"""""""""""""""""
|
|
||||||
Level 5: ^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
.. meta::
|
|
||||||
:description: Contacting Tranquil IT
|
|
||||||
:keywords: TISBackup, documentation, website, editor,
|
|
||||||
Twitter, official website
|
|
||||||
|
|
||||||
.. _contact_tranquil_it:
|
|
||||||
|
|
||||||
Contacting Tranquil IT
|
|
||||||
======================
|
|
||||||
|
|
||||||
* Tranquil IT: https://www.tranquil.it/
|
|
||||||
* Twitter: https://twitter.com/tranquil_it
|
|
||||||
@@ -1,143 +0,0 @@
|
|||||||
.. Reminder for header structure:
|
|
||||||
Level 1: ====================
|
|
||||||
Level 2: --------------------
|
|
||||||
Level 3: ++++++++++++++++++++
|
|
||||||
Level 4: """"""""""""""""""""
|
|
||||||
Level 5: ^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
.. meta::
|
|
||||||
:description: Using TISBackup
|
|
||||||
:keywords: Documentation, TISBackup, usage, options, exporting
|
|
||||||
|
|
||||||
.. |clap| image:: tisbackup-resources/clapping-hands-microsoft.png
|
|
||||||
:scale: 50%
|
|
||||||
:alt: Clapping hands
|
|
||||||
|
|
||||||
Using TISBackup
|
|
||||||
===============
|
|
||||||
|
|
||||||
.. _using_tisbackup:
|
|
||||||
|
|
||||||
As seen in the :ref:`section on installing TISbackup<install_tisbackup_debian>`,
|
|
||||||
once the TISBackup installation is up and running,
|
|
||||||
we have the choice of these actions:
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
backup: launch all backups or a specific one if -s option is used
|
|
||||||
cleanup: removed backups older than retension period
|
|
||||||
checknagios: check all or a specific backup against max_backup_age parameter
|
|
||||||
dumpstat: dump the content of database for the last 20 backups
|
|
||||||
retryfailed: try to relaunch the last failed backups
|
|
||||||
listdrivers: list available backup types and parameters for config inifile
|
|
||||||
exportbackup: copy lastest OK backups from local to location defned by --exportdir parameter
|
|
||||||
register_existing: scan backup directories and add missing backups to database
|
|
||||||
|
|
||||||
The 3 following options can be used with any tisbackup action.
|
|
||||||
|
|
||||||
* the ``-c`` *config_file* option allows to specify a backup file,
|
|
||||||
by default :file:`/etc/tis/tisbackup-config.ini` is used:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
tisbackup backup -c /etc/toto/test-config.ini
|
|
||||||
|
|
||||||
* the ``-s`` *section_name* option allows to launch only the action
|
|
||||||
on the specified section:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
tisbackup backup -s section_name
|
|
||||||
|
|
||||||
* the ``-d`` option allows you to simulate an action in order
|
|
||||||
to see the commands launched by it.
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
tisbackup backup -d
|
|
||||||
|
|
||||||
* :command:`backup` launches a backup action:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
tisbackup backup
|
|
||||||
|
|
||||||
* :command:`cleanup` removes backups older than the time specified
|
|
||||||
in the ``backup_retention_time`` parameter of the configuration file:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
tisbackup cleanup
|
|
||||||
|
|
||||||
* :command:`checknagios` allows the backup information to be uploaded
|
|
||||||
to the nagios monitoring server:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
tisbackup checknagios
|
|
||||||
|
|
||||||
* :command:`dumpstat` displays all information about the last 20 backups
|
|
||||||
in tabular format:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
tisbackup dumpstat
|
|
||||||
|
|
||||||
* :command:`retryfailed` restarts only the backup of the failed sections:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
tisbackup retryfailed
|
|
||||||
|
|
||||||
* :command:`listdrivers` lists all the possible types of backups
|
|
||||||
and their parameters:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
tisbackup listdrivers
|
|
||||||
|
|
||||||
* :command:`exportbackup` copies the last good backup
|
|
||||||
to a directory, you must use the ``--exportdir`` option to specify
|
|
||||||
or copy the export:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
tisbackup exportbackup --exportdir example_directory
|
|
||||||
|
|
||||||
* :command:`register_existing` checks the backup directory and saves information
|
|
||||||
from previous backups to tisbackup in the database;
|
|
||||||
|
|
||||||
Exporting backups
|
|
||||||
-----------------
|
|
||||||
|
|
||||||
With this procedure, you will be able to export your backups
|
|
||||||
on USB Hard Disk Drives for your off-line backup needs.
|
|
||||||
|
|
||||||
The partition of your HDD must be **ext4** formated and labeled *tisbackup*.
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
fdisk /dev/xvdc
|
|
||||||
Command (m for help): n
|
|
||||||
Select (default p): p
|
|
||||||
Partition number (1-4, default 1): 1
|
|
||||||
"Enter"
|
|
||||||
"Enter"
|
|
||||||
Command (m for help): w
|
|
||||||
|
|
||||||
mkfs.ext4 /dev/xvdc1
|
|
||||||
e2label /dev/xvdc1 tisbackup
|
|
||||||
|
|
||||||
.. figure:: tisbackup-resources/tisbackup_hdd_export.png
|
|
||||||
:align: center
|
|
||||||
:scale: 100%
|
|
||||||
:alt: Exporting a backup to an external USB HDD
|
|
||||||
|
|
||||||
Exporting a backup to an external USB HDD
|
|
||||||
|
|
||||||
.. figure:: tisbackup-resources/tisbackup_hdd_export_status.png
|
|
||||||
:align: center
|
|
||||||
:scale: 100%
|
|
||||||
:alt: Status of exported backups
|
|
||||||
|
|
||||||
Status of exported backups
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
# Sphinx build info version 1
|
|
||||||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
|
|
||||||
config: d8c47fd2a1bfccdede0821297ff221bc
|
|
||||||
tags: 645f666f9bcd5a90fca523b33c5a78b7
|
|
||||||
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 162 KiB |
|
Before Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 69 KiB |
|
Before Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 224 KiB |
|
Before Width: | Height: | Size: 184 KiB |
@@ -1,313 +0,0 @@
|
|||||||
.. Reminder for header structure:
|
|
||||||
Level 1: ====================
|
|
||||||
Level 2: --------------------
|
|
||||||
Level 3: ++++++++++++++++++++
|
|
||||||
Level 4: """"""""""""""""""""
|
|
||||||
Level 5: ^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
.. meta::
|
|
||||||
:description: Configuring the backup jobs
|
|
||||||
:keywords: Documentation, TISBackup, configuration, backup jobs
|
|
||||||
|
|
||||||
.. |clap| image:: tisbackup-resources/clapping-hands-microsoft.png
|
|
||||||
:scale: 50%
|
|
||||||
:alt: Clapping hands
|
|
||||||
|
|
||||||
Configuring the backup jobs
|
|
||||||
===========================
|
|
||||||
|
|
||||||
.. _configuring_backup_jobs:
|
|
||||||
|
|
||||||
The configuration of the backups is done in an :mimetype:`.ini` file,
|
|
||||||
by default :file:`/etc/tis/tisbackup-config.ini`:
|
|
||||||
|
|
||||||
* a global section where general parameters are specified;
|
|
||||||
|
|
||||||
* then for each backup a section will be created;
|
|
||||||
|
|
||||||
[global] section
|
|
||||||
----------------
|
|
||||||
|
|
||||||
Here are the mandatory parameters of the global section.
|
|
||||||
|
|
||||||
* the beginning of the global section starts with:
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
[global]
|
|
||||||
|
|
||||||
* specify directory where to store backups:
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
backup_base_dir = /backup/data/
|
|
||||||
|
|
||||||
* define the maximum age of the backups (variable used by the cleanup function):
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
backup_retention_time=140
|
|
||||||
|
|
||||||
* define the maximum time in hours between each backup.
|
|
||||||
When this time is exceeded, then :program:`checknagios` goes critical:
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
maximum_backup_age=30
|
|
||||||
|
|
||||||
Another non-mandatory parameter allows to define the rsync compression level:
|
|
||||||
``compression_level=7``.
|
|
||||||
|
|
||||||
Backup types
|
|
||||||
------------
|
|
||||||
|
|
||||||
.. note:: to test with a Windows box
|
|
||||||
|
|
||||||
Globally, the backups are done through an SSH connection and the steps are:
|
|
||||||
|
|
||||||
* creating the **section** in the configuration file;
|
|
||||||
|
|
||||||
* installing ssh on the Linux client;
|
|
||||||
|
|
||||||
* making an ssh key exchange between the tisbackup server
|
|
||||||
and the client to back up;
|
|
||||||
|
|
||||||
Here are the different types of backup possible with :program:`tisbackup`.
|
|
||||||
|
|
||||||
Backing up a MySQL database
|
|
||||||
+++++++++++++++++++++++++++
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
[srvintranet_mysql_mediawiki]
|
|
||||||
type=mysql+ssh
|
|
||||||
server_name=srvintranet
|
|
||||||
private_key=/root/.ssh/id_dsa
|
|
||||||
db_name=mediawiki
|
|
||||||
db_user=user
|
|
||||||
db_passwd=password
|
|
||||||
|
|
||||||
Mandatory parameters:
|
|
||||||
|
|
||||||
* ``[srvintranet_mysql_mediawiki]``: name of the section starts
|
|
||||||
with the name you give to it;
|
|
||||||
|
|
||||||
* ``type``: specifies the backup type for the Mysql database dump;
|
|
||||||
|
|
||||||
* ``server_name``: defines the server to be backed up
|
|
||||||
by its DNS name or IP address;
|
|
||||||
|
|
||||||
* ``private_key``: defines the name of the private key to be used
|
|
||||||
to connect to the client;
|
|
||||||
|
|
||||||
* ``db_name``: defines the name of the database to dump;
|
|
||||||
|
|
||||||
* ``db_user``: defines the name of a user with the right to dump on the basis of;
|
|
||||||
|
|
||||||
* ``db_passwd``: defines the user's password;
|
|
||||||
|
|
||||||
Backing up a PostgreSQL database
|
|
||||||
++++++++++++++++++++++++++++++++
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
[srvasterisk-pgsql]
|
|
||||||
type=pgsql+ssh
|
|
||||||
server_name=srvasterisk
|
|
||||||
private_key=/root/.ssh/id_rsa
|
|
||||||
db_name=asterisk
|
|
||||||
|
|
||||||
Mandatory parameters:
|
|
||||||
|
|
||||||
* ``[srvasterisk-pgsql]``: name of the section starts
|
|
||||||
with the name you give to it;
|
|
||||||
|
|
||||||
* ``type``: specifies the backup type for the Mysql database dump;
|
|
||||||
|
|
||||||
* ``server_name``: defines the server to be backed up
|
|
||||||
by its DNS name or IP address;
|
|
||||||
|
|
||||||
* ``private_key``: defines the name of the private key to be used
|
|
||||||
to connect to the client;
|
|
||||||
|
|
||||||
* ``db_name``: defines the name of the database to dump;
|
|
||||||
|
|
||||||
Backing up a file server
|
|
||||||
++++++++++++++++++++++++
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
[srvfiles-home]
|
|
||||||
type=rsync+ssh
|
|
||||||
server_name=srvfiles
|
|
||||||
remote_dir=/home
|
|
||||||
private_key=/root/.ssh/id_dsa
|
|
||||||
exclude_list=".mozilla",".thunderbird",".x2go","*.avi"
|
|
||||||
bwlimit = 100
|
|
||||||
|
|
||||||
Mandatory parameters:
|
|
||||||
|
|
||||||
* ``[srvfiles-home]``: name of the section starts
|
|
||||||
with the name you give to it;
|
|
||||||
|
|
||||||
* ``type``: specifies the backup type for the Mysql database dump;
|
|
||||||
|
|
||||||
* ``server_name``: defines the server to be backed up
|
|
||||||
by its DNS name or IP address;
|
|
||||||
|
|
||||||
* ``remote_dir``: defines the folder on the remote host to backup;
|
|
||||||
|
|
||||||
* ``private_key``: defines the name of the private key to be used
|
|
||||||
to connect to the client;
|
|
||||||
|
|
||||||
.. attention::
|
|
||||||
|
|
||||||
In case of Windows client, specificities are to be expected:
|
|
||||||
|
|
||||||
By default we use the root user for backups, for windows we will use
|
|
||||||
the Administrator account (pay attention to the sensitive box).
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
remote_user=Administrator
|
|
||||||
|
|
||||||
Through :program:`cygwin`, the directory to be backed up will always start
|
|
||||||
with :file:`/cygdrive`, so it must be specified
|
|
||||||
in the ``remote_dir`` parameter.
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
remote_dir=/cygdrive/c/WINDOWS/
|
|
||||||
|
|
||||||
.. hint::
|
|
||||||
|
|
||||||
Other non-mandatory parameters can be used. The ``listdrivers`` option
|
|
||||||
allows you to see them. The two most frequently used parameters are:
|
|
||||||
|
|
||||||
* ``exclude_list``: defines the files to be excluded from the backup;
|
|
||||||
|
|
||||||
* ``bwlimit``: defines the maximum speed of the backup;
|
|
||||||
|
|
||||||
Backing up a XenCenter virtual machine
|
|
||||||
++++++++++++++++++++++++++++++++++++++
|
|
||||||
|
|
||||||
On local storage
|
|
||||||
""""""""""""""""
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
[wsmanage]
|
|
||||||
type=xen-xva
|
|
||||||
xcphost=srvxen1
|
|
||||||
server_name=wsmanage
|
|
||||||
password_file=/root/xen_passwd
|
|
||||||
backup_retention_time=2
|
|
||||||
halt_vm=True
|
|
||||||
enable_https=False
|
|
||||||
|
|
||||||
Mandatory parameters:
|
|
||||||
|
|
||||||
* ``[wsmanage]``: name of the section starts
|
|
||||||
with the name you give to it;
|
|
||||||
|
|
||||||
* ``type``: specifies the backup type for the Mysql database dump;
|
|
||||||
|
|
||||||
* ``xcphost``: defines the XCP server where the VM is found by its DNS name or IP;
|
|
||||||
|
|
||||||
* ``server_name``: defines the server to be backed up
|
|
||||||
by its DNS name or IP address;
|
|
||||||
|
|
||||||
* ``password_file``: defines a file where are stored the user and the password
|
|
||||||
to be used for exporting the :mimetype:`.xva` file;
|
|
||||||
|
|
||||||
* ``backup_retention_time``: defines the maximum number of exports
|
|
||||||
for the virtual machine;
|
|
||||||
|
|
||||||
* ``halt_vm``: **True** = stop the virtual machine then export,
|
|
||||||
**False** = snapshot the virtual machine then export the :file:`xva`
|
|
||||||
without stopping the virtual machine;
|
|
||||||
|
|
||||||
* ``enable_https``: activate or deactivate https protocol for transfer;
|
|
||||||
|
|
||||||
On remote storage
|
|
||||||
"""""""""""""""""
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
[srvads-copy]
|
|
||||||
type=copy-vm-xcp
|
|
||||||
server_name=srvxen1
|
|
||||||
vm_name=srvads
|
|
||||||
storage_name=iscsi-sr1
|
|
||||||
password_file=/root/xen_passwd
|
|
||||||
network_name=test-dcardon
|
|
||||||
max_copies=3
|
|
||||||
|
|
||||||
Mandatory parameters:
|
|
||||||
|
|
||||||
* ``[srvads-copy]``: name of the section starts
|
|
||||||
with the name you give to it;
|
|
||||||
|
|
||||||
* ``type``: specifies the backup type for the Mysql database dump;
|
|
||||||
|
|
||||||
* ``server_name``: defines the server to be backed up
|
|
||||||
by its DNS name or IP address;
|
|
||||||
|
|
||||||
* ``vm_name``: defines the virtual machine to be backed up
|
|
||||||
(its name-label in XCP);
|
|
||||||
|
|
||||||
* ``storage_name``: defines the storage to where to copy the virtual machine
|
|
||||||
(its name-label in XCP);
|
|
||||||
|
|
||||||
* ``password_file``: defines a file where are stored the user and the password
|
|
||||||
to be used for exporting the :mimetype:`.xva` file;
|
|
||||||
|
|
||||||
* ``network_name``: defines the network to which to copy the VM
|
|
||||||
(its name-label in XCP);
|
|
||||||
|
|
||||||
* ``max_copies``: maximum number of exports for the virtual machine;
|
|
||||||
|
|
||||||
XenCenter metadata
|
|
||||||
""""""""""""""""""
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
[srvxen1-metadata]
|
|
||||||
type=xcp-dump-metadata
|
|
||||||
server_name=srvxen1
|
|
||||||
password_file=/root/xen_passwd
|
|
||||||
|
|
||||||
Mandatory parameters:
|
|
||||||
|
|
||||||
* ``[srvxen1-metadata]``: name of the section starts
|
|
||||||
with the name you give to it;
|
|
||||||
|
|
||||||
* ``type``: specifies the backup type for the Mysql database dump;
|
|
||||||
|
|
||||||
* ``server_name``: defines the server to be backed up
|
|
||||||
by its DNS name or IP address;
|
|
||||||
|
|
||||||
* ``password_file``: defines a file where are stored the user and the password
|
|
||||||
to be used for exporting the :mimetype:`.xva` file;
|
|
||||||
|
|
||||||
.. attention::
|
|
||||||
|
|
||||||
For maximum security put the password file in the root directory
|
|
||||||
with read-write access only for it.
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
vi /root/xen_passwd
|
|
||||||
|
|
||||||
example of the content of the file:
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
user
|
|
||||||
password
|
|
||||||
|
|
||||||
implementation of restricted rights
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
chmod 600 /root/xen_passwd
|
|
||||||
@@ -1,107 +0,0 @@
|
|||||||
.. Reminder for header structure:
|
|
||||||
Level 1: ====================
|
|
||||||
Level 2: --------------------
|
|
||||||
Level 3: ++++++++++++++++++++
|
|
||||||
Level 4: """"""""""""""""""""
|
|
||||||
Level 5: ^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
.. meta::
|
|
||||||
:description: TISBackup Documentation
|
|
||||||
:keywords: Documentation, TISBackup, introduction, welcome page, Welcome
|
|
||||||
|
|
||||||
.. |date| date::
|
|
||||||
|
|
||||||
.. figure:: tisbackup-resources/tisbackup_logo.png
|
|
||||||
:align: center
|
|
||||||
:scale: 100%
|
|
||||||
:alt: TISBackup Logo
|
|
||||||
|
|
||||||
Presenting TISBackup
|
|
||||||
====================
|
|
||||||
|
|
||||||
The objective of TISbackup is to benefit from file backups
|
|
||||||
and centralized alert feedback on "reasonable" data volumes
|
|
||||||
(of the order of a few TB).
|
|
||||||
|
|
||||||
TISBackup allows:
|
|
||||||
|
|
||||||
* to know if a recent backup exists;
|
|
||||||
|
|
||||||
* to keep a history with deduplication at the file level (no duplicate backups);
|
|
||||||
|
|
||||||
* to have an immediate view of the contents of a server or a server area
|
|
||||||
for data restoration ;
|
|
||||||
|
|
||||||
* to export the last backup to an external media in order to transfer
|
|
||||||
it to a secure location;
|
|
||||||
|
|
||||||
* to configure the backup cycle with a simple
|
|
||||||
and readable :mimetype:`.ini` file;
|
|
||||||
|
|
||||||
* to work with a module mechanism to extend the type of backups
|
|
||||||
(https, rsync, postgres, mysql,) of virtual machines;
|
|
||||||
|
|
||||||
Satisfying these needs stems from the need for a tool
|
|
||||||
to manage a vast pool of machines each hosting a multitude
|
|
||||||
of different software or services (different editors,
|
|
||||||
different hardware platforms and operating environments, etc.).
|
|
||||||
Finally, as the backup procedures of a publisher changed without any warning,
|
|
||||||
the remote backup mechanisms were regularly broken, which caused us some scares
|
|
||||||
with the mechanisms we were using before.
|
|
||||||
|
|
||||||
Overview of existing solutions
|
|
||||||
------------------------------
|
|
||||||
|
|
||||||
Different open source solutions exist but did not meet our specifications.
|
|
||||||
|
|
||||||
Baccula
|
|
||||||
+++++++
|
|
||||||
|
|
||||||
:program:`Baccula` is a high-performance solution for full backups on tape
|
|
||||||
and removable media. However, a restore can take a long time
|
|
||||||
and the storage of a history can be voluminous.
|
|
||||||
The backup is saved on a file system that is not readable by a Windows system.
|
|
||||||
An uninitiated "backup manager" will not be able to check the contents
|
|
||||||
of his backup from home.
|
|
||||||
|
|
||||||
r-snapshot
|
|
||||||
++++++++++
|
|
||||||
|
|
||||||
:program:`r-snapshot` almost corresponds to the specifications
|
|
||||||
but is complex to configure and any necessary modification
|
|
||||||
would have been difficult to develop as an overlay of the existing one:
|
|
||||||
|
|
||||||
* the backups are organized by date then by zone which is the opposite
|
|
||||||
of what was desired;
|
|
||||||
|
|
||||||
* it is not possible to configure different backup frequencies
|
|
||||||
according to the criticality levels of the servers;
|
|
||||||
|
|
||||||
* finally, the deletion of obsolete backups is done in the same process
|
|
||||||
as the backups, which can be very long and can be problematic
|
|
||||||
if there is a problem during the backup.
|
|
||||||
|
|
||||||
**... and now TISbackup ...**
|
|
||||||
|
|
||||||
.. toctree::
|
|
||||||
:maxdepth: 2
|
|
||||||
:caption: Presenting TISBackup
|
|
||||||
|
|
||||||
presenting_tisbackup.rst
|
|
||||||
installing_tisbackup.rst
|
|
||||||
configuring_tisbackup.rst
|
|
||||||
using_tisbackup.rst
|
|
||||||
|
|
||||||
.. toctree::
|
|
||||||
:maxdepth: 1
|
|
||||||
:caption: Appendix
|
|
||||||
|
|
||||||
tranquil-it-contacts.rst
|
|
||||||
screenshots.rst
|
|
||||||
|
|
||||||
Indices and tables
|
|
||||||
==================
|
|
||||||
|
|
||||||
* :ref:`genindex`
|
|
||||||
|
|
||||||
* :ref:`search`
|
|
||||||
@@ -1,286 +0,0 @@
|
|||||||
.. Reminder for header structure:
|
|
||||||
Level 1: ====================
|
|
||||||
Level 2: --------------------
|
|
||||||
Level 3: ++++++++++++++++++++
|
|
||||||
Level 4: """"""""""""""""""""
|
|
||||||
Level 5: ^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
.. meta::
|
|
||||||
:description: Installing and configuring TISBackup
|
|
||||||
:keywords: Documentation, TISBackup, installation, configuration
|
|
||||||
|
|
||||||
.. |clap| image:: tisbackup-resources/clapping-hands-microsoft.png
|
|
||||||
:scale: 50%
|
|
||||||
:alt: Clapping hands
|
|
||||||
|
|
||||||
Installing and configuring TISBackup on Debian
|
|
||||||
==============================================
|
|
||||||
|
|
||||||
.. _base_debian_server_install:
|
|
||||||
|
|
||||||
Setting up the GNU/Linux Debian server
|
|
||||||
--------------------------------------
|
|
||||||
|
|
||||||
In order to install a fresh Debian Linux 11 *Bullseye* (physical or virtual)
|
|
||||||
without graphical interface, please refer to the
|
|
||||||
`Debian GNU/Linux Installation Guide <https://www.debian.org/releases/bullseye/amd64/>`_.
|
|
||||||
|
|
||||||
Configuring network parameters
|
|
||||||
++++++++++++++++++++++++++++++
|
|
||||||
|
|
||||||
.. include:: tisbackup-resources/linux-server-naming.txt
|
|
||||||
|
|
||||||
Configuring the name of the Debian server
|
|
||||||
+++++++++++++++++++++++++++++++++++++++++
|
|
||||||
|
|
||||||
.. hint::
|
|
||||||
|
|
||||||
The short name of the future TISBackup server must not be longer
|
|
||||||
than **15 characters** (the limit is due to *sAMAccountName* restriction
|
|
||||||
in Active Directory).
|
|
||||||
|
|
||||||
The name of the TISBackup server must be a :abbr:`FQDN (Fully Qualified Domain Name)`,
|
|
||||||
that is to say it has both the server name and the DNS suffix.
|
|
||||||
|
|
||||||
* modify the :file:`/etc/hostname` file and write the FQDN of the server;
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
# /etc/hostname of the TISBackup server
|
|
||||||
srvbackup.mydomain.lan
|
|
||||||
|
|
||||||
* configure the :file:`/etc/hosts` file, be sure to put both the FQDN
|
|
||||||
and the short name of the server;
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
# /etc/hosts of the server
|
|
||||||
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
|
|
||||||
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
|
|
||||||
10.0.0.10 srvbackup.mydomain.lan srvbackup
|
|
||||||
|
|
||||||
.. hint::
|
|
||||||
|
|
||||||
* on the line defining the DNS server IP address, be sure to have the IP
|
|
||||||
of the server (not 127.0.0.1), then the FQDN, then the short name;
|
|
||||||
|
|
||||||
* do not change the line with *localhost*;
|
|
||||||
|
|
||||||
Configuring the IP address of the Debian server
|
|
||||||
+++++++++++++++++++++++++++++++++++++++++++++++
|
|
||||||
|
|
||||||
* configure the IP address of the Debian Server
|
|
||||||
in the :file:`/etc/network/interfaces`;
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
# /etc/network/interfaces of the Debian server
|
|
||||||
auto eth0
|
|
||||||
iface eth0 inet static
|
|
||||||
address 10.0.0.10
|
|
||||||
netmask 255.255.255.0
|
|
||||||
gateway 10.0.0.254
|
|
||||||
|
|
||||||
* apply the network configuration by rebooting the machine
|
|
||||||
with a :code:`reboot`;
|
|
||||||
|
|
||||||
* if it has not already been done, create the DNS entry for the Server
|
|
||||||
in the Organization's Active Directory;
|
|
||||||
|
|
||||||
* after reboot, configure the system language in English in order to have
|
|
||||||
non-localized logs for easier searching of common errors;
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
apt install locales-all
|
|
||||||
localectl set-locale LANG=en_US.UTF-8
|
|
||||||
localectl status
|
|
||||||
|
|
||||||
* check that the machine clock is on time (with NTP installed);
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
dpkg -l | grep ntp
|
|
||||||
service ntp status
|
|
||||||
date
|
|
||||||
|
|
||||||
.. hint::
|
|
||||||
|
|
||||||
If the NTP package is not installed.
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
apt install ntp
|
|
||||||
systemctl enable ntp
|
|
||||||
systemctl start ntp
|
|
||||||
|
|
||||||
* update and upgrade your Debian;
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
apt update
|
|
||||||
apt upgrade -y
|
|
||||||
|
|
||||||
* install systemd;
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
apt install systemd
|
|
||||||
|
|
||||||
* restart the Debian server;
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
reboot
|
|
||||||
|
|
||||||
|clap| The Debian server is now ready. You may now go on to the next step
|
|
||||||
and :ref:`install TISBackup on your Debian<install_tisbackup_debian>`.
|
|
||||||
|
|
||||||
.. _install_tisbackup_debian:
|
|
||||||
|
|
||||||
Installing the TISBackup server
|
|
||||||
+++++++++++++++++++++++++++++++
|
|
||||||
|
|
||||||
From Tranquil IT's repository
|
|
||||||
"""""""""""""""""""""""""""""
|
|
||||||
|
|
||||||
The easiest way is to install the package from Tranquil IT repository :
|
|
||||||
|
|
||||||
.. tabs::
|
|
||||||
|
|
||||||
.. code-tab:: bash On CentOS8 and derivate
|
|
||||||
|
|
||||||
wget https://srvinstallation.tranquil.it/tisbackup/tis-tisbackup-162-1.el8.x86_64.rpm -O tis-tisbackup.rpm
|
|
||||||
yum install -y tis-tisbackup.rpm
|
|
||||||
|
|
||||||
.. code-tab:: bash On CentOS7
|
|
||||||
|
|
||||||
wget https://srvinstallation.tranquil.it/tisbackup/tis-tisbackup-162-1.el7.x86_64.rpm -O tis-tisbackup.rpm
|
|
||||||
yum install -y tis-tisbackup.rpm
|
|
||||||
|
|
||||||
.. code-tab:: bash On Debian 11
|
|
||||||
|
|
||||||
wget https://srvinstallation.tranquil.it/tisbackup/tis-tisbackup-1-2.0.163-deb11.deb -O tis-tisbackup.deb
|
|
||||||
apt install unzip python3-paramiko python3-pyvmomi python3-pexpect python3-flask python3-simplejson python3-pip
|
|
||||||
dpkg -i tis-tisbackup.deb
|
|
||||||
|
|
||||||
|
|
||||||
From sources
|
|
||||||
""""""""""""
|
|
||||||
|
|
||||||
* install the required dependencies:
|
|
||||||
|
|
||||||
.. tabs::
|
|
||||||
|
|
||||||
.. code-tab:: bash On CentOS8 and derivate
|
|
||||||
|
|
||||||
unzip, ssh, rsync, python3-paramiko, python3-pyvmomi, python3-pexpect, python3-flask,python3-simplejson, python3-pip
|
|
||||||
|
|
||||||
.. code-tab:: bash On CentOS7 and derivate
|
|
||||||
|
|
||||||
unzip rsync python3-paramiko python3-pyvmomi nfs-utils python3-flask python3-simplejson autofs python3-pexpect
|
|
||||||
|
|
||||||
.. code-tab:: bash on Debian 11
|
|
||||||
|
|
||||||
unzip rsync python36-paramiko python3-pyvmomi nfs-utils python3-flask python3-simplejson autofs pexpect
|
|
||||||
|
|
||||||
* retrieve the git sources from https://github.com/tranquilit/TISbackup
|
|
||||||
and place them in the :file:`/opt` folder on your server:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
cd /opt/
|
|
||||||
wget --no-check-certificate https://github.com/tranquilit/TISbackup/archive/master.zip
|
|
||||||
unzip master.zip
|
|
||||||
mv TISbackup-master tisbackup
|
|
||||||
pip3 install huey iniparse -t /opt/tisbackup/lib
|
|
||||||
chmod 755 /opt/tisbackup/tisbackup.py
|
|
||||||
ln -sb /opt/tisbackup/tisbackup.py /usr/local/bin/tisbackup
|
|
||||||
|
|
||||||
* the :command:`tisbackup` command must return all *tisbackup* actions
|
|
||||||
directly to you. For more information on the actions
|
|
||||||
go to :ref:`the section on using TISBackup<using_tisbackup>`;
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
[root@srvbackup.mydomain.lan tisbackup]# tisbackup
|
|
||||||
ERROR : You must provide one action to perform
|
|
||||||
Usage: tisbackup -c configfile action
|
|
||||||
|
|
||||||
TIS Files Backup system.
|
|
||||||
|
|
||||||
action is either :
|
|
||||||
backup : launch all backups or a specific one if -s option is used
|
|
||||||
cleanup : removed backups older than retention period
|
|
||||||
checknagios : check all or a specific backup against max_backup_age parameter
|
|
||||||
dumpstat : dump the content of database for the last 20 backups
|
|
||||||
retryfailed : try to relaunch the last failed backups
|
|
||||||
listdrivers : list available backup types and parameters for config inifile
|
|
||||||
exportbackup : copy lastest OK backups from local to location defined by --exportdir parameter
|
|
||||||
register_existing : scan backup directories and add missing backups to database
|
|
||||||
|
|
||||||
Configuring TISBackup
|
|
||||||
+++++++++++++++++++++
|
|
||||||
|
|
||||||
* create the directory for TISBackup configuration files:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
mkdir /etc/tis/
|
|
||||||
|
|
||||||
* in the directory :file:`/opt/tisbackup/samples/`, you will find the files
|
|
||||||
:file:`config.ini.sample` and :file:`tisbackup-config.ini`
|
|
||||||
which you can use as examples. Copy one of these two files
|
|
||||||
into the :file:`/etc/tis` directory and we will describe in the next section
|
|
||||||
how to customize this files;
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
cp /opt/tisbackup/samples/tisbackup-config.ini.sample /etc/tis/tisbackup-config.ini
|
|
||||||
|
|
||||||
Launching the backup scheduled task
|
|
||||||
+++++++++++++++++++++++++++++++++++
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
cp /opt/tisbackup/samples/tisbackup.cron /etc/cron.d/tisbackup
|
|
||||||
|
|
||||||
* modify the :file:`/etc/cron.d/tisbackup` file to indicate when to launch
|
|
||||||
the task;
|
|
||||||
|
|
||||||
Generating the public and private certificates
|
|
||||||
++++++++++++++++++++++++++++++++++++++++++++++
|
|
||||||
|
|
||||||
* as root:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
ssh-keygen -t rsa -b 2048
|
|
||||||
|
|
||||||
* press :kbd:`Enter` for each one of the steps;
|
|
||||||
|
|
||||||
|clap| You may now go on to the next step
|
|
||||||
and :ref:`configure the backup jobs for your TISBackup<configuring_backup_jobs>`.
|
|
||||||
|
|
||||||
Setting up the graphical user interface for the TISBackup server
|
|
||||||
----------------------------------------------------------------
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
cp /opt/tisbackup/samples/tisbackup_gui.ini /etc/tis/
|
|
||||||
cp /opt/tisbackup/scripts/tisbackup_gui /etc/init.d/tisbackup_gui
|
|
||||||
cp /opt/tisbackup/scripts/tisbackup_huey /etc/init.d/tisbackup_huey
|
|
||||||
chmod +x /etc/init.d/tisbackup_gui
|
|
||||||
chmod +x /etc/init.d/tisbackup_huey
|
|
||||||
update-rc.d tisbackup_huey defaults
|
|
||||||
update-rc.d tisbackup_gui defaults
|
|
||||||
|
|
||||||
You can now access your interface through the url
|
|
||||||
of your TISBackup server on port 8080.
|
|
||||||
|
|
||||||
.. figure:: tisbackup-resources/tisbackup_gui.png
|
|
||||||
:align: center
|
|
||||||
:scale: 100%
|
|
||||||
:alt: TISBackup Web interface
|
|
||||||
|
|
||||||
TISBackup Web interface
|
|
||||||
@@ -1,137 +0,0 @@
|
|||||||
.. Reminder for header structure:
|
|
||||||
Level 1: ====================
|
|
||||||
Level 2: --------------------
|
|
||||||
Level 3: ++++++++++++++++++++
|
|
||||||
Level 4: """"""""""""""""""""
|
|
||||||
Level 5: ^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
.. meta::
|
|
||||||
:description: Technical background for TISBackup
|
|
||||||
:keywords: Documentation, TISBackup, technical background
|
|
||||||
|
|
||||||
.. |clap| image:: tisbackup-resources/clapping-hands-microsoft.png
|
|
||||||
:scale: 50%
|
|
||||||
:alt: Clapping hands
|
|
||||||
|
|
||||||
.. |date| date::
|
|
||||||
|
|
||||||
Technical background for TISBackup
|
|
||||||
==================================
|
|
||||||
|
|
||||||
The deduplication of this solution is based on the hardlinks
|
|
||||||
of ext3/4 file systems used for storing backup files.
|
|
||||||
|
|
||||||
The backup server must run :program:`rsync` in server mode,
|
|
||||||
and the workstations to be backed up must be equipped with :program:`rsync`
|
|
||||||
and :program:`ssh` (usually basic on machines running GNU/Linux,
|
|
||||||
with :program:`cygwin` (or another tool like :program:`cwrsync`)
|
|
||||||
for machines running MS Windows).
|
|
||||||
|
|
||||||
tisbackup
|
|
||||||
---------
|
|
||||||
|
|
||||||
:program:`tisbackup` is a python script that the backup server runs
|
|
||||||
at regular intervals. The configuration file :file:`tisbackup.ini` contains
|
|
||||||
the details of the tasks to be executed.
|
|
||||||
|
|
||||||
:program:`tisbackup` has different options for its execution,
|
|
||||||
available in the :command:`tisbackup --help` command,
|
|
||||||
the main ones being the following:
|
|
||||||
|
|
||||||
* :command:`backup`: executes all scheduled backups;
|
|
||||||
|
|
||||||
* :command:`cleanup`: examines the backups and deletes those
|
|
||||||
that are older than the defined maximum retention time ;
|
|
||||||
|
|
||||||
* :command:`checknagios`: returns the content that can be viewed by nagios ;
|
|
||||||
|
|
||||||
* :command:`retryfailed`: redoes the backups that previously failed;
|
|
||||||
|
|
||||||
* :command:`exportbackup`: exports the last valid backups
|
|
||||||
to the specified location (remote, external media, ...);
|
|
||||||
|
|
||||||
* :command:`register_existing`: scans the backups that have been made
|
|
||||||
and adds the missing ones to the database;
|
|
||||||
|
|
||||||
tisbackup.ini
|
|
||||||
-------------
|
|
||||||
|
|
||||||
:file:`tisbackup.ini` defines the backups to be executed and supervised.
|
|
||||||
It is written with a simple formalism.
|
|
||||||
|
|
||||||
The different types of backups are:
|
|
||||||
|
|
||||||
* ``rsync``: the backup of a directory by rsync using the rsync protocol;
|
|
||||||
|
|
||||||
* ``rsync+ssh``: the backup of a directory by rsync with the ssh protocol;
|
|
||||||
|
|
||||||
* ``mysql+ssh``: saving a mysql database in a gzipped sql file,
|
|
||||||
with the ssh protocol;
|
|
||||||
|
|
||||||
* ``pgsql+ssh``: the backup of a postgresql database in a gzipped sql file,
|
|
||||||
with the ssh protocol;
|
|
||||||
|
|
||||||
* ``xen-xva``: the backup of a virtual machine running on an XCP server
|
|
||||||
as an XVA file;
|
|
||||||
|
|
||||||
* ``xen-meta-data``: the backup of XCP metadata from a virtualization server;
|
|
||||||
|
|
||||||
* ``switch``: the backup of switches;
|
|
||||||
|
|
||||||
* ``null``: null backup of a server that does not require a backup but for which
|
|
||||||
it is known to be taken into account (Nagios supervision);
|
|
||||||
|
|
||||||
The first part of the :file:`tisbackup.ini` file,
|
|
||||||
starting with the ``[Global]`` tag, determines:
|
|
||||||
|
|
||||||
* the path to the folder where the backups will be stored;
|
|
||||||
|
|
||||||
* the maximum retention time of a backup (in days);
|
|
||||||
|
|
||||||
* the maximum delay before triggering a nagios critical message (in hours);
|
|
||||||
|
|
||||||
* possibly the limit of usable bandwidth;
|
|
||||||
|
|
||||||
The rest of the file lists the different backups to be made,
|
|
||||||
with specific parameters for each type of backup:
|
|
||||||
|
|
||||||
* name of the directory in the backup;
|
|
||||||
|
|
||||||
* backup type;
|
|
||||||
|
|
||||||
* server name;
|
|
||||||
|
|
||||||
* directory (in case of a directory backup);
|
|
||||||
|
|
||||||
* directories to be excluded (idem);
|
|
||||||
|
|
||||||
* location of the ssh key to be used (private key on the backup server);
|
|
||||||
|
|
||||||
* name of the database (in case of mysql or postgresql database backup);
|
|
||||||
|
|
||||||
* ssh port number to use;
|
|
||||||
|
|
||||||
* database user and password (in case of mysql or postgresql database backup);
|
|
||||||
|
|
||||||
tisbackup.sql
|
|
||||||
-------------
|
|
||||||
|
|
||||||
:file:`tisbackup.sql` is the :program:`sqlite` database available
|
|
||||||
on the backup server, in which the backup information of each
|
|
||||||
of the backed up areas is stored. It is used in particular to gather
|
|
||||||
the information necessary for Nagios.
|
|
||||||
|
|
||||||
TISbackup GUI
|
|
||||||
-------------
|
|
||||||
|
|
||||||
Also developed in python, TISbackup GUI is a graphical interface
|
|
||||||
that allows you to:
|
|
||||||
|
|
||||||
* visualize the last backups;
|
|
||||||
|
|
||||||
* export a backup to a USB media;
|
|
||||||
|
|
||||||
* visualize the backups to be made;
|
|
||||||
|
|
||||||
|clap| You may now go on to the next step
|
|
||||||
and :ref:`install TISBackup on your Debian<base_debian_server_install>`.
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
.. Reminder for header structure:
|
|
||||||
Level 1: ====================
|
|
||||||
Level 2: --------------------
|
|
||||||
Level 3: ++++++++++++++++++++
|
|
||||||
Level 4: """"""""""""""""""""
|
|
||||||
Level 5: ^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
.. meta::
|
|
||||||
:description: Screenshots of TISBackup
|
|
||||||
:keywords: Documentation, TISBackup, screenshots
|
|
||||||
|
|
||||||
.. |clap| image:: tisbackup-resources/clapping-hands-microsoft.png
|
|
||||||
:scale: 50%
|
|
||||||
:alt: Clapping hands
|
|
||||||
|
|
||||||
Screenshots of TISBackup
|
|
||||||
========================
|
|
||||||
|
|
||||||
.. _tisbackup_screenshots:
|
|
||||||
|
|
||||||
.. figure:: tisbackup-resources/tisbackup_gui.png
|
|
||||||
:align: center
|
|
||||||
:scale: 100%
|
|
||||||
:alt: TISBackup Web interface
|
|
||||||
|
|
||||||
TISBackup Web interface
|
|
||||||
|
|
||||||
.. figure:: tisbackup-resources/tisbackup_hdd_export.png
|
|
||||||
:align: center
|
|
||||||
:scale: 100%
|
|
||||||
:alt: Exporting a backup to an external USB HDD
|
|
||||||
|
|
||||||
Exporting a backup to an external USB HDD
|
|
||||||
|
|
||||||
.. figure:: tisbackup-resources/tisbackup_hdd_export_status.png
|
|
||||||
:align: center
|
|
||||||
:scale: 100%
|
|
||||||
:alt: Status of exported backups
|
|
||||||
|
|
||||||
Status of exported backups
|
|
||||||
|
|
||||||
.. figure:: tisbackup-resources/tisbackup_backup_list.png
|
|
||||||
:align: center
|
|
||||||
:scale: 20%
|
|
||||||
:alt: Overview of current backups
|
|
||||||
|
|
||||||
Overview of current backups
|
|
||||||
|
|
||||||
.. figure:: tisbackup-resources/tisbackup_successful_backups.png
|
|
||||||
:align: center
|
|
||||||
:scale: 20%
|
|
||||||
:alt: Overview of successful backups
|
|
||||||
|
|
||||||
Overview of successful backups
|
|
||||||
|
|
||||||
.. figure:: tisbackup-resources/tisbackup_searching_backups.png
|
|
||||||
:align: center
|
|
||||||
:scale: 100%
|
|
||||||
:alt: Searching for past backups
|
|
||||||
|
|
||||||
Searching for past backups
|
|
||||||
|
|
||||||
.. figure:: tisbackup-resources/tisbackup_action_menu.png
|
|
||||||
:align: center
|
|
||||||
:scale: 20%
|
|
||||||
:alt: TISBackup action menu
|
|
||||||
|
|
||||||
TISBackup action menu
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
.. Reminder for header structure:
|
|
||||||
Level 1: ====================
|
|
||||||
Level 2: --------------------
|
|
||||||
Level 3: ++++++++++++++++++++
|
|
||||||
Level 4: """"""""""""""""""""
|
|
||||||
Level 5: ^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
.. meta::
|
|
||||||
:description: Contacting Tranquil IT
|
|
||||||
:keywords: TISBackup, documentation, website, editor,
|
|
||||||
Twitter, official website
|
|
||||||
|
|
||||||
.. _contact_tranquil_it:
|
|
||||||
|
|
||||||
Contacting Tranquil IT
|
|
||||||
======================
|
|
||||||
|
|
||||||
* Tranquil IT: https://www.tranquil.it/
|
|
||||||
* Twitter: https://twitter.com/tranquil_it
|
|
||||||
@@ -1,143 +0,0 @@
|
|||||||
.. Reminder for header structure:
|
|
||||||
Level 1: ====================
|
|
||||||
Level 2: --------------------
|
|
||||||
Level 3: ++++++++++++++++++++
|
|
||||||
Level 4: """"""""""""""""""""
|
|
||||||
Level 5: ^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
.. meta::
|
|
||||||
:description: Using TISBackup
|
|
||||||
:keywords: Documentation, TISBackup, usage, options, exporting
|
|
||||||
|
|
||||||
.. |clap| image:: tisbackup-resources/clapping-hands-microsoft.png
|
|
||||||
:scale: 50%
|
|
||||||
:alt: Clapping hands
|
|
||||||
|
|
||||||
Using TISBackup
|
|
||||||
===============
|
|
||||||
|
|
||||||
.. _using_tisbackup:
|
|
||||||
|
|
||||||
As seen in the :ref:`section on installing TISbackup<install_tisbackup_debian>`,
|
|
||||||
once the TISBackup installation is up and running,
|
|
||||||
we have the choice of these actions:
|
|
||||||
|
|
||||||
.. code-block:: ini
|
|
||||||
|
|
||||||
backup: launch all backups or a specific one if -s option is used
|
|
||||||
cleanup: removed backups older than retension period
|
|
||||||
checknagios: check all or a specific backup against max_backup_age parameter
|
|
||||||
dumpstat: dump the content of database for the last 20 backups
|
|
||||||
retryfailed: try to relaunch the last failed backups
|
|
||||||
listdrivers: list available backup types and parameters for config inifile
|
|
||||||
exportbackup: copy lastest OK backups from local to location defned by --exportdir parameter
|
|
||||||
register_existing: scan backup directories and add missing backups to database
|
|
||||||
|
|
||||||
The 3 following options can be used with any tisbackup action.
|
|
||||||
|
|
||||||
* the ``-c`` *config_file* option allows to specify a backup file,
|
|
||||||
by default :file:`/etc/tis/tisbackup-config.ini` is used:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
tisbackup backup -c /etc/toto/test-config.ini
|
|
||||||
|
|
||||||
* the ``-s`` *section_name* option allows to launch only the action
|
|
||||||
on the specified section:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
tisbackup backup -s section_name
|
|
||||||
|
|
||||||
* the ``-d`` option allows you to simulate an action in order
|
|
||||||
to see the commands launched by it.
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
tisbackup backup -d
|
|
||||||
|
|
||||||
* :command:`backup` launches a backup action:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
tisbackup backup
|
|
||||||
|
|
||||||
* :command:`cleanup` removes backups older than the time specified
|
|
||||||
in the ``backup_retention_time`` parameter of the configuration file:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
tisbackup cleanup
|
|
||||||
|
|
||||||
* :command:`checknagios` allows the backup information to be uploaded
|
|
||||||
to the nagios monitoring server:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
tisbackup checknagios
|
|
||||||
|
|
||||||
* :command:`dumpstat` displays all information about the last 20 backups
|
|
||||||
in tabular format:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
tisbackup dumpstat
|
|
||||||
|
|
||||||
* :command:`retryfailed` restarts only the backup of the failed sections:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
tisbackup retryfailed
|
|
||||||
|
|
||||||
* :command:`listdrivers` lists all the possible types of backups
|
|
||||||
and their parameters:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
tisbackup listdrivers
|
|
||||||
|
|
||||||
* :command:`exportbackup` copies the last good backup
|
|
||||||
to a directory, you must use the ``--exportdir`` option to specify
|
|
||||||
or copy the export:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
tisbackup exportbackup --exportdir example_directory
|
|
||||||
|
|
||||||
* :command:`register_existing` checks the backup directory and saves information
|
|
||||||
from previous backups to tisbackup in the database;
|
|
||||||
|
|
||||||
Exporting backups
|
|
||||||
-----------------
|
|
||||||
|
|
||||||
With this procedure, you will be able to export your backups
|
|
||||||
on USB Hard Disk Drives for your off-line backup needs.
|
|
||||||
|
|
||||||
The partition of your HDD must be **ext4** formated and labeled *tisbackup*.
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
fdisk /dev/xvdc
|
|
||||||
Command (m for help): n
|
|
||||||
Select (default p): p
|
|
||||||
Partition number (1-4, default 1): 1
|
|
||||||
"Enter"
|
|
||||||
"Enter"
|
|
||||||
Command (m for help): w
|
|
||||||
|
|
||||||
mkfs.ext4 /dev/xvdc1
|
|
||||||
e2label /dev/xvdc1 tisbackup
|
|
||||||
|
|
||||||
.. figure:: tisbackup-resources/tisbackup_hdd_export.png
|
|
||||||
:align: center
|
|
||||||
:scale: 100%
|
|
||||||
:alt: Exporting a backup to an external USB HDD
|
|
||||||
|
|
||||||
Exporting a backup to an external USB HDD
|
|
||||||
|
|
||||||
.. figure:: tisbackup-resources/tisbackup_hdd_export_status.png
|
|
||||||
:align: center
|
|
||||||
:scale: 100%
|
|
||||||
:alt: Status of exported backups
|
|
||||||
|
|
||||||
Status of exported backups
|
|
||||||
@@ -1,768 +0,0 @@
|
|||||||
/*
|
|
||||||
* basic.css
|
|
||||||
* ~~~~~~~~~
|
|
||||||
*
|
|
||||||
* Sphinx stylesheet -- basic theme.
|
|
||||||
*
|
|
||||||
* :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
|
|
||||||
* :license: BSD, see LICENSE for details.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* -- main layout ----------------------------------------------------------- */
|
|
||||||
|
|
||||||
div.clearer {
|
|
||||||
clear: both;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- relbar ---------------------------------------------------------------- */
|
|
||||||
|
|
||||||
div.related {
|
|
||||||
width: 100%;
|
|
||||||
font-size: 90%;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.related h3 {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.related ul {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0 0 0 10px;
|
|
||||||
list-style: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.related li {
|
|
||||||
display: inline;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.related li.right {
|
|
||||||
float: right;
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- sidebar --------------------------------------------------------------- */
|
|
||||||
|
|
||||||
div.sphinxsidebarwrapper {
|
|
||||||
padding: 10px 5px 0 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.sphinxsidebar {
|
|
||||||
float: left;
|
|
||||||
width: 230px;
|
|
||||||
margin-left: -100%;
|
|
||||||
font-size: 90%;
|
|
||||||
word-wrap: break-word;
|
|
||||||
overflow-wrap : break-word;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.sphinxsidebar ul {
|
|
||||||
list-style: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.sphinxsidebar ul ul,
|
|
||||||
div.sphinxsidebar ul.want-points {
|
|
||||||
margin-left: 20px;
|
|
||||||
list-style: square;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.sphinxsidebar ul ul {
|
|
||||||
margin-top: 0;
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.sphinxsidebar form {
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.sphinxsidebar input {
|
|
||||||
border: 1px solid #98dbcc;
|
|
||||||
font-family: sans-serif;
|
|
||||||
font-size: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.sphinxsidebar #searchbox form.search {
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.sphinxsidebar #searchbox input[type="text"] {
|
|
||||||
float: left;
|
|
||||||
width: 80%;
|
|
||||||
padding: 0.25em;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.sphinxsidebar #searchbox input[type="submit"] {
|
|
||||||
float: left;
|
|
||||||
width: 20%;
|
|
||||||
border-left: none;
|
|
||||||
padding: 0.25em;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
img {
|
|
||||||
border: 0;
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- search page ----------------------------------------------------------- */
|
|
||||||
|
|
||||||
ul.search {
|
|
||||||
margin: 10px 0 0 20px;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
ul.search li {
|
|
||||||
padding: 5px 0 5px 20px;
|
|
||||||
background-image: url(file.png);
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
background-position: 0 7px;
|
|
||||||
}
|
|
||||||
|
|
||||||
ul.search li a {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
ul.search li div.context {
|
|
||||||
color: #888;
|
|
||||||
margin: 2px 0 0 30px;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
ul.keywordmatches li.goodmatch a {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- index page ------------------------------------------------------------ */
|
|
||||||
|
|
||||||
table.contentstable {
|
|
||||||
width: 90%;
|
|
||||||
margin-left: auto;
|
|
||||||
margin-right: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.contentstable p.biglink {
|
|
||||||
line-height: 150%;
|
|
||||||
}
|
|
||||||
|
|
||||||
a.biglink {
|
|
||||||
font-size: 1.3em;
|
|
||||||
}
|
|
||||||
|
|
||||||
span.linkdescr {
|
|
||||||
font-style: italic;
|
|
||||||
padding-top: 5px;
|
|
||||||
font-size: 90%;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- general index --------------------------------------------------------- */
|
|
||||||
|
|
||||||
table.indextable {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.indextable td {
|
|
||||||
text-align: left;
|
|
||||||
vertical-align: top;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.indextable ul {
|
|
||||||
margin-top: 0;
|
|
||||||
margin-bottom: 0;
|
|
||||||
list-style-type: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.indextable > tbody > tr > td > ul {
|
|
||||||
padding-left: 0em;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.indextable tr.pcap {
|
|
||||||
height: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.indextable tr.cap {
|
|
||||||
margin-top: 10px;
|
|
||||||
background-color: #f2f2f2;
|
|
||||||
}
|
|
||||||
|
|
||||||
img.toggler {
|
|
||||||
margin-right: 3px;
|
|
||||||
margin-top: 3px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.modindex-jumpbox {
|
|
||||||
border-top: 1px solid #ddd;
|
|
||||||
border-bottom: 1px solid #ddd;
|
|
||||||
margin: 1em 0 1em 0;
|
|
||||||
padding: 0.4em;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.genindex-jumpbox {
|
|
||||||
border-top: 1px solid #ddd;
|
|
||||||
border-bottom: 1px solid #ddd;
|
|
||||||
margin: 1em 0 1em 0;
|
|
||||||
padding: 0.4em;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- domain module index --------------------------------------------------- */
|
|
||||||
|
|
||||||
table.modindextable td {
|
|
||||||
padding: 2px;
|
|
||||||
border-collapse: collapse;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- general body styles --------------------------------------------------- */
|
|
||||||
|
|
||||||
div.body {
|
|
||||||
min-width: 450px;
|
|
||||||
max-width: 800px;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.body p, div.body dd, div.body li, div.body blockquote {
|
|
||||||
-moz-hyphens: auto;
|
|
||||||
-ms-hyphens: auto;
|
|
||||||
-webkit-hyphens: auto;
|
|
||||||
hyphens: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
a.headerlink {
|
|
||||||
visibility: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
a.brackets:before,
|
|
||||||
span.brackets > a:before{
|
|
||||||
content: "[";
|
|
||||||
}
|
|
||||||
|
|
||||||
a.brackets:after,
|
|
||||||
span.brackets > a:after {
|
|
||||||
content: "]";
|
|
||||||
}
|
|
||||||
|
|
||||||
h1:hover > a.headerlink,
|
|
||||||
h2:hover > a.headerlink,
|
|
||||||
h3:hover > a.headerlink,
|
|
||||||
h4:hover > a.headerlink,
|
|
||||||
h5:hover > a.headerlink,
|
|
||||||
h6:hover > a.headerlink,
|
|
||||||
dt:hover > a.headerlink,
|
|
||||||
caption:hover > a.headerlink,
|
|
||||||
p.caption:hover > a.headerlink,
|
|
||||||
div.code-block-caption:hover > a.headerlink {
|
|
||||||
visibility: visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.body p.caption {
|
|
||||||
text-align: inherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.body td {
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.first {
|
|
||||||
margin-top: 0 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
p.rubric {
|
|
||||||
margin-top: 30px;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
img.align-left, .figure.align-left, object.align-left {
|
|
||||||
clear: left;
|
|
||||||
float: left;
|
|
||||||
margin-right: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
img.align-right, .figure.align-right, object.align-right {
|
|
||||||
clear: right;
|
|
||||||
float: right;
|
|
||||||
margin-left: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
img.align-center, .figure.align-center, object.align-center {
|
|
||||||
display: block;
|
|
||||||
margin-left: auto;
|
|
||||||
margin-right: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
img.align-default, .figure.align-default {
|
|
||||||
display: block;
|
|
||||||
margin-left: auto;
|
|
||||||
margin-right: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.align-left {
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.align-center {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.align-default {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.align-right {
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- sidebars -------------------------------------------------------------- */
|
|
||||||
|
|
||||||
div.sidebar {
|
|
||||||
margin: 0 0 0.5em 1em;
|
|
||||||
border: 1px solid #ddb;
|
|
||||||
padding: 7px 7px 0 7px;
|
|
||||||
background-color: #ffe;
|
|
||||||
width: 40%;
|
|
||||||
float: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
p.sidebar-title {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- topics ---------------------------------------------------------------- */
|
|
||||||
|
|
||||||
div.topic {
|
|
||||||
border: 1px solid #ccc;
|
|
||||||
padding: 7px 7px 0 7px;
|
|
||||||
margin: 10px 0 10px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
p.topic-title {
|
|
||||||
font-size: 1.1em;
|
|
||||||
font-weight: bold;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- admonitions ----------------------------------------------------------- */
|
|
||||||
|
|
||||||
div.admonition {
|
|
||||||
margin-top: 10px;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
padding: 7px;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.admonition dt {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.admonition dl {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
p.admonition-title {
|
|
||||||
margin: 0px 10px 5px 0px;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.body p.centered {
|
|
||||||
text-align: center;
|
|
||||||
margin-top: 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- tables ---------------------------------------------------------------- */
|
|
||||||
|
|
||||||
table.docutils {
|
|
||||||
border: 0;
|
|
||||||
border-collapse: collapse;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.align-center {
|
|
||||||
margin-left: auto;
|
|
||||||
margin-right: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.align-default {
|
|
||||||
margin-left: auto;
|
|
||||||
margin-right: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
table caption span.caption-number {
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
|
|
||||||
table caption span.caption-text {
|
|
||||||
}
|
|
||||||
|
|
||||||
table.docutils td, table.docutils th {
|
|
||||||
padding: 1px 8px 1px 5px;
|
|
||||||
border-top: 0;
|
|
||||||
border-left: 0;
|
|
||||||
border-right: 0;
|
|
||||||
border-bottom: 1px solid #aaa;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.footnote td, table.footnote th {
|
|
||||||
border: 0 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
th {
|
|
||||||
text-align: left;
|
|
||||||
padding-right: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.citation {
|
|
||||||
border-left: solid 1px gray;
|
|
||||||
margin-left: 1px;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.citation td {
|
|
||||||
border-bottom: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
th > p:first-child,
|
|
||||||
td > p:first-child {
|
|
||||||
margin-top: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
th > p:last-child,
|
|
||||||
td > p:last-child {
|
|
||||||
margin-bottom: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- figures --------------------------------------------------------------- */
|
|
||||||
|
|
||||||
div.figure {
|
|
||||||
margin: 0.5em;
|
|
||||||
padding: 0.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.figure p.caption {
|
|
||||||
padding: 0.3em;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.figure p.caption span.caption-number {
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.figure p.caption span.caption-text {
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- field list styles ----------------------------------------------------- */
|
|
||||||
|
|
||||||
table.field-list td, table.field-list th {
|
|
||||||
border: 0 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.field-list ul {
|
|
||||||
margin: 0;
|
|
||||||
padding-left: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.field-list p {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.field-name {
|
|
||||||
-moz-hyphens: manual;
|
|
||||||
-ms-hyphens: manual;
|
|
||||||
-webkit-hyphens: manual;
|
|
||||||
hyphens: manual;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- hlist styles ---------------------------------------------------------- */
|
|
||||||
|
|
||||||
table.hlist td {
|
|
||||||
vertical-align: top;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* -- other body styles ----------------------------------------------------- */
|
|
||||||
|
|
||||||
ol.arabic {
|
|
||||||
list-style: decimal;
|
|
||||||
}
|
|
||||||
|
|
||||||
ol.loweralpha {
|
|
||||||
list-style: lower-alpha;
|
|
||||||
}
|
|
||||||
|
|
||||||
ol.upperalpha {
|
|
||||||
list-style: upper-alpha;
|
|
||||||
}
|
|
||||||
|
|
||||||
ol.lowerroman {
|
|
||||||
list-style: lower-roman;
|
|
||||||
}
|
|
||||||
|
|
||||||
ol.upperroman {
|
|
||||||
list-style: upper-roman;
|
|
||||||
}
|
|
||||||
|
|
||||||
li > p:first-child {
|
|
||||||
margin-top: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
li > p:last-child {
|
|
||||||
margin-bottom: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
dl.footnote > dt,
|
|
||||||
dl.citation > dt {
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
dl.footnote > dd,
|
|
||||||
dl.citation > dd {
|
|
||||||
margin-bottom: 0em;
|
|
||||||
}
|
|
||||||
|
|
||||||
dl.footnote > dd:after,
|
|
||||||
dl.citation > dd:after {
|
|
||||||
content: "";
|
|
||||||
clear: both;
|
|
||||||
}
|
|
||||||
|
|
||||||
dl.field-list {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: fit-content(30%) auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
dl.field-list > dt {
|
|
||||||
font-weight: bold;
|
|
||||||
word-break: break-word;
|
|
||||||
padding-left: 0.5em;
|
|
||||||
padding-right: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
dl.field-list > dt:after {
|
|
||||||
content: ":";
|
|
||||||
}
|
|
||||||
|
|
||||||
dl.field-list > dd {
|
|
||||||
padding-left: 0.5em;
|
|
||||||
margin-top: 0em;
|
|
||||||
margin-left: 0em;
|
|
||||||
margin-bottom: 0em;
|
|
||||||
}
|
|
||||||
|
|
||||||
dl {
|
|
||||||
margin-bottom: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
dd > p:first-child {
|
|
||||||
margin-top: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
dd ul, dd table {
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
dd {
|
|
||||||
margin-top: 3px;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
margin-left: 30px;
|
|
||||||
}
|
|
||||||
|
|
||||||
dt:target, span.highlighted {
|
|
||||||
background-color: #fbe54e;
|
|
||||||
}
|
|
||||||
|
|
||||||
rect.highlighted {
|
|
||||||
fill: #fbe54e;
|
|
||||||
}
|
|
||||||
|
|
||||||
dl.glossary dt {
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 1.1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.optional {
|
|
||||||
font-size: 1.3em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sig-paren {
|
|
||||||
font-size: larger;
|
|
||||||
}
|
|
||||||
|
|
||||||
.versionmodified {
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
|
|
||||||
.system-message {
|
|
||||||
background-color: #fda;
|
|
||||||
padding: 5px;
|
|
||||||
border: 3px solid red;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footnote:target {
|
|
||||||
background-color: #ffa;
|
|
||||||
}
|
|
||||||
|
|
||||||
.line-block {
|
|
||||||
display: block;
|
|
||||||
margin-top: 1em;
|
|
||||||
margin-bottom: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.line-block .line-block {
|
|
||||||
margin-top: 0;
|
|
||||||
margin-bottom: 0;
|
|
||||||
margin-left: 1.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.guilabel, .menuselection {
|
|
||||||
font-family: sans-serif;
|
|
||||||
}
|
|
||||||
|
|
||||||
.accelerator {
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
|
|
||||||
.classifier {
|
|
||||||
font-style: oblique;
|
|
||||||
}
|
|
||||||
|
|
||||||
.classifier:before {
|
|
||||||
font-style: normal;
|
|
||||||
margin: 0.5em;
|
|
||||||
content: ":";
|
|
||||||
}
|
|
||||||
|
|
||||||
abbr, acronym {
|
|
||||||
border-bottom: dotted 1px;
|
|
||||||
cursor: help;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- code displays --------------------------------------------------------- */
|
|
||||||
|
|
||||||
pre {
|
|
||||||
overflow: auto;
|
|
||||||
overflow-y: hidden; /* fixes display issues on Chrome browsers */
|
|
||||||
}
|
|
||||||
|
|
||||||
span.pre {
|
|
||||||
-moz-hyphens: none;
|
|
||||||
-ms-hyphens: none;
|
|
||||||
-webkit-hyphens: none;
|
|
||||||
hyphens: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
td.linenos pre {
|
|
||||||
padding: 5px 0px;
|
|
||||||
border: 0;
|
|
||||||
background-color: transparent;
|
|
||||||
color: #aaa;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.highlighttable {
|
|
||||||
margin-left: 0.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.highlighttable td {
|
|
||||||
padding: 0 0.5em 0 0.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.code-block-caption {
|
|
||||||
padding: 2px 5px;
|
|
||||||
font-size: small;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.code-block-caption code {
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.code-block-caption + div > div.highlight > pre {
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.doctest > div.highlight span.gp { /* gp: Generic.Prompt */
|
|
||||||
user-select: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.code-block-caption span.caption-number {
|
|
||||||
padding: 0.1em 0.3em;
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.code-block-caption span.caption-text {
|
|
||||||
}
|
|
||||||
|
|
||||||
div.literal-block-wrapper {
|
|
||||||
padding: 1em 1em 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.literal-block-wrapper div.highlight {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
code.descname {
|
|
||||||
background-color: transparent;
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 1.2em;
|
|
||||||
}
|
|
||||||
|
|
||||||
code.descclassname {
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
code.xref, a code {
|
|
||||||
background-color: transparent;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 code, h2 code, h3 code, h4 code, h5 code, h6 code {
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
.viewcode-link {
|
|
||||||
float: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.viewcode-back {
|
|
||||||
float: right;
|
|
||||||
font-family: sans-serif;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.viewcode-block:target {
|
|
||||||
margin: -1px -10px;
|
|
||||||
padding: 0 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- math display ---------------------------------------------------------- */
|
|
||||||
|
|
||||||
img.math {
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.body div.math p {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
span.eqno {
|
|
||||||
float: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
span.eqno a.headerlink {
|
|
||||||
position: relative;
|
|
||||||
left: 0px;
|
|
||||||
z-index: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.math:hover a.headerlink {
|
|
||||||
visibility: visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -- printout stylesheet --------------------------------------------------- */
|
|
||||||
|
|
||||||
@media print {
|
|
||||||
div.document,
|
|
||||||
div.documentwrapper,
|
|
||||||
div.bodywrapper {
|
|
||||||
margin: 0 !important;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.sphinxsidebar,
|
|
||||||
div.related,
|
|
||||||
div.footer,
|
|
||||||
#top-link {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
.fa:before{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:after,.clearfix:before{display:table;content:""}.clearfix:after{clear:both}@font-face{font-family:FontAwesome;font-style:normal;font-weight:400;src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713?#iefix) format("embedded-opentype"),url(fonts/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e) format("woff2"),url(fonts/fontawesome-webfont.woff?fee66e712a8a08eef5805a46892932ad) format("woff"),url(fonts/fontawesome-webfont.ttf?b06871f281fee6b241d60582ae9369b9) format("truetype"),url(fonts/fontawesome-webfont.svg?912ec66d7572ff821749319396470bde#FontAwesome) format("svg")}.fa:before{font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1}.fa:before,a .fa{text-decoration:inherit}.fa:before,a .fa,li .fa{display:inline-block}li .fa-large:before{width:1.875em}ul.fas{list-style-type:none;margin-left:2em;text-indent:-.8em}ul.fas li .fa{width:.8em}ul.fas li .fa-large:before{vertical-align:baseline}.fa-book:before,.icon-book:before{content:"\f02d"}.fa-caret-down:before,.icon-caret-down:before{content:"\f0d7"}.fa-caret-up:before,.icon-caret-up:before{content:"\f0d8"}.fa-caret-left:before,.icon-caret-left:before{content:"\f0d9"}.fa-caret-right:before,.icon-caret-right:before{content:"\f0da"}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;z-index:400}.rst-versions a{color:#2980b9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27ae60}.rst-versions .rst-current-version:after{clear:both;content:"";display:block}.rst-versions .rst-current-version .fa{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#e74c3c;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#f1c40f;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:grey;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:1px solid #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none;line-height:30px}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge>.rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width:768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
.wy-nav-content {
|
|
||||||
max-width: 1050px
|
|
||||||
}
|
|
||||||
|
Before Width: | Height: | Size: 433 KiB |