Skip to content

Commit a1bdc9f

Browse files
authored
Merge pull request #73 from OpenSPP/refactor-structure-michael
[IMP] getting started deb installation and move the other section
2 parents f807c76 + 500a187 commit a1bdc9f

10 files changed

Lines changed: 590 additions & 552 deletions

File tree

docs/getting_started/installation_deb.md

Lines changed: 3 additions & 549 deletions
Large diffs are not rendered by default.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
review-status: needs-review
3+
review-date: 2025-06-04
4+
reviewer: migration-script
5+
migration-notes: "Added during 2025 documentation reorganization"
6+
---
7+
8+
# Database Management
9+
10+
This section explains how to manage your OpenSPP database, including how to reset the database, and how to back up your data before making major changes. Proper database management helps ensure data integrity and system reliability.
11+
12+
## Reset Database
13+
14+
If you need to reset your OpenSPP database (e.g., for testing or to start fresh):
15+
16+
### Option A: Via Web Interface (if list_db = True)
17+
18+
1. Navigate to `http://your-server-ip:8069/web/database/manager`
19+
3. Click the "Delete" from the right side of the Database you wanted to Delete.
20+
4. Enter the Master Password then Click the "Delete".
21+
5. Create a new database with the same name or different name
22+
23+
### Option B: Via Command Line
24+
25+
```bash
26+
# Stop OpenSPP service
27+
sudo systemctl stop openspp
28+
29+
# Drop the existing database
30+
sudo -u postgres dropdb openspp_prod
31+
32+
# Create a new empty database
33+
sudo -u postgres createdb openspp_prod
34+
35+
# Start OpenSPP service
36+
sudo systemctl start openspp
37+
38+
# Initialize the database with base modules
39+
sudo -u openspp openspp-server \
40+
--database=openspp_prod \
41+
--init=base \
42+
--stop-after-init
43+
44+
# Restart service
45+
sudo systemctl restart openspp
46+
```
47+
48+
**Warning**: Resetting the database will permanently delete all data, including:
49+
- All registrant records
50+
- Program configurations
51+
- Entitlements and payments
52+
- Uploaded documents
53+
- User accounts and settings
54+
- Custom configurations
55+
56+
## Backup Before Reset
57+
58+
Always create a backup before resetting:
59+
60+
```bash
61+
# Create backup directory
62+
sudo mkdir -p /var/backups/openspp
63+
64+
# Backup database
65+
sudo -u postgres pg_dump openspp_prod | gzip > /var/backups/openspp/db_backup_$(date +%Y%m%d_%H%M%S).sql.gz
66+
67+
# Backup filestore
68+
sudo tar -czf /var/backups/openspp/filestore_backup_$(date +%Y%m%d_%H%M%S).tar.gz /var/lib/openspp/filestore/openspp_prod
69+
```

docs/user_guide/administration/index.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,9 @@ import_areas
3838
inventory_configuration
3939
email_gateway
4040
hardware_integration
41+
database_management
42+
monitoring_maintenance
43+
security_tuning
44+
troubleshooting
45+
uninstalling
4146
```
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
review-status: needs-review
3+
review-date: 2025-06-04
4+
reviewer: migration-script
5+
migration-notes: "Added during 2025 documentation reorganization"
6+
---
7+
8+
# Monitoring and Maintenance
9+
10+
This section provides basic instructions for monitoring your OpenSPP system, viewing logs, managing services, and performing updates. Regular monitoring and maintenance help keep your system running smoothly and securely.
11+
12+
## View Logs
13+
14+
```bash
15+
# Real-time service logs
16+
sudo journalctl -u openspp -f
17+
18+
# Application logs
19+
sudo tail -f /var/log/openspp/openspp.log
20+
21+
# PostgreSQL logs
22+
sudo tail -f /var/log/postgresql/postgresql-*.log
23+
```
24+
25+
## Service Management
26+
27+
```bash
28+
# Restart service
29+
sudo systemctl restart openspp
30+
31+
# Stop service
32+
sudo systemctl stop openspp
33+
34+
# Start service
35+
sudo systemctl start openspp
36+
37+
# Reload configuration without restart
38+
sudo systemctl reload openspp
39+
```
40+
41+
## Update OpenSPP
42+
43+
When a new version is available:
44+
45+
```bash
46+
# Update package list
47+
sudo apt-get update
48+
49+
# Check for OpenSPP updates
50+
apt list --upgradable | grep openspp
51+
52+
# Stop service before upgrade
53+
sudo systemctl stop openspp
54+
55+
# Backup current installation
56+
sudo tar -czf /var/backups/openspp-backup-$(date +%Y%m%d).tar.gz /opt/openspp /etc/openspp
57+
58+
# Upgrade OpenSPP
59+
sudo apt-get upgrade openspp
60+
61+
# Start service
62+
sudo systemctl start openspp
63+
64+
# Update modules via web interface
65+
```
66+
67+
## Alternative: Manual Update
68+
69+
If updating manually:
70+
71+
```bash
72+
# Download new package from Nexus
73+
wget https://builds.acn.fr/repository/apt-openspp/pool/main/o/openspp/openspp_X.X.X_amd64.deb
74+
75+
# Stop service
76+
sudo systemctl stop openspp
77+
78+
# Backup current installation
79+
sudo tar -czf /var/backups/openspp-backup-$(date +%Y%m%d).tar.gz /opt/openspp /etc/openspp
80+
81+
# Install new version
82+
sudo dpkg -i openspp_X.X.X_amd64.deb
83+
84+
# Start service
85+
sudo systemctl start openspp
86+
```
Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
---
2+
review-status: needs-review
3+
review-date: 2025-06-04
4+
reviewer: migration-script
5+
migration-notes: "Added during 2025 documentation reorganization"
6+
---
7+
8+
# Security Recommendations and Performance Tuning
9+
10+
This guide provides essential recommendations for securing your OpenSPP instance and tuning its performance for production environments. It covers database security, firewall setup, SSL/TLS configuration with Nginx, and implementing regular backups. Additionally, it offers tips on performance tuning, including adjusting worker processes, memory limits, and PostgreSQL settings to handle high-load scenarios.
11+
12+
## Security Recommendations
13+
14+
### 1. Database Security Configuration
15+
16+
After initial setup and database creation, it's strongly recommended to:
17+
18+
```bash
19+
# Edit the configuration
20+
sudo nano /etc/openspp/odoo.conf
21+
22+
# Set list_db to False for production
23+
list_db = False
24+
25+
# Restart the service
26+
sudo systemctl restart openspp
27+
```
28+
29+
**Why disable list_db in production:**
30+
- Prevents unauthorized users from seeing database names
31+
- Disables database creation/deletion via web interface
32+
- Reduces attack surface by hiding database management interface
33+
- Forces direct database URL access (e.g., `http://server:8069/web?db=openspp_prod`)
34+
35+
**When to keep list_db = True:**
36+
- Development environments
37+
- Testing environments
38+
- Initial setup phase
39+
- When multiple databases need frequent management
40+
41+
### 2. Firewall Configuration
42+
43+
```bash
44+
# Install UFW firewall
45+
sudo apt-get install -y ufw
46+
47+
# Allow SSH (adjust port if needed)
48+
sudo ufw allow 22/tcp
49+
50+
# Allow OpenSPP web interface
51+
sudo ufw allow 8069/tcp
52+
53+
# Allow OpenSPP longpolling (if using real-time features)
54+
sudo ufw allow 8072/tcp
55+
56+
# Enable firewall
57+
sudo ufw enable
58+
```
59+
60+
### 3. SSL/TLS with Nginx (Recommended for Production)
61+
62+
```bash
63+
# Install Nginx
64+
sudo apt-get install -y nginx certbot python3-certbot-nginx
65+
66+
# Create Nginx configuration
67+
sudo nano /etc/nginx/sites-available/openspp
68+
```
69+
70+
Add this configuration:
71+
```nginx
72+
server {
73+
listen 80;
74+
server_name your-domain.com;
75+
76+
# Redirect HTTP to HTTPS
77+
return 301 https://$server_name$request_uri;
78+
}
79+
80+
server {
81+
listen 443 ssl http2;
82+
server_name your-domain.com;
83+
84+
# SSL certificates (will be added by certbot)
85+
# ssl_certificate /etc/letsencrypt/live/your-domain.com/fullchain.pem;
86+
# ssl_certificate_key /etc/letsencrypt/live/your-domain.com/privkey.pem;
87+
88+
# Proxy settings
89+
proxy_read_timeout 720s;
90+
proxy_connect_timeout 720s;
91+
proxy_send_timeout 720s;
92+
93+
# Add headers
94+
proxy_set_header Host $host;
95+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
96+
proxy_set_header X-Forwarded-Proto $scheme;
97+
proxy_set_header X-Real-IP $remote_addr;
98+
99+
# Redirect requests to OpenSPP
100+
location / {
101+
proxy_redirect off;
102+
proxy_pass http://127.0.0.1:8069;
103+
}
104+
105+
# Longpolling
106+
location /longpolling {
107+
proxy_pass http://127.0.0.1:8072;
108+
}
109+
110+
# Static files
111+
location ~* /web/static/ {
112+
proxy_cache_valid 200 90m;
113+
proxy_buffering on;
114+
expires 864000;
115+
proxy_pass http://127.0.0.1:8069;
116+
}
117+
}
118+
```
119+
120+
Enable the site and get SSL certificate:
121+
```bash
122+
# Enable the site
123+
sudo ln -s /etc/nginx/sites-available/openspp /etc/nginx/sites-enabled/
124+
sudo nginx -t
125+
sudo systemctl reload nginx
126+
127+
# Get SSL certificate
128+
sudo certbot --nginx -d your-domain.com
129+
```
130+
131+
### 4. Regular Backups
132+
133+
Create a backup script:
134+
135+
```bash
136+
sudo nano /usr/local/bin/openspp-backup.sh
137+
```
138+
139+
```bash
140+
#!/bin/bash
141+
BACKUP_DIR="/var/backups/openspp"
142+
DATE=$(date +%Y%m%d_%H%M%S)
143+
DB_NAME="openspp_prod"
144+
145+
# Create backup directory
146+
mkdir -p $BACKUP_DIR
147+
148+
# Backup database
149+
sudo -u postgres pg_dump $DB_NAME | gzip > $BACKUP_DIR/db_${DB_NAME}_${DATE}.sql.gz
150+
151+
# Backup filestore
152+
tar -czf $BACKUP_DIR/filestore_${DATE}.tar.gz /var/lib/openspp/
153+
154+
# Keep only last 30 days of backups
155+
find $BACKUP_DIR -type f -mtime +30 -delete
156+
157+
echo "Backup completed: $DATE"
158+
```
159+
160+
Make it executable and schedule:
161+
```bash
162+
sudo chmod +x /usr/local/bin/openspp-backup.sh
163+
164+
# Add to crontab (daily at 2 AM)
165+
echo "0 2 * * * /usr/local/bin/openspp-backup.sh" | sudo crontab -
166+
```
167+
168+
## Performance Tuning
169+
170+
For production environments with high load:
171+
172+
1. **Increase workers** (1 worker per CPU core, minimum 2 for queue_job):
173+
```ini
174+
workers = 8 # For 8-core server
175+
server_wide_modules = base,web,queue_job # Required
176+
```
177+
178+
**Note**: Never set `workers = 0` in production as this disables queue_job async processing.
179+
180+
2. **Adjust memory limits** based on available RAM:
181+
```ini
182+
limit_memory_hard = 8589934592 # 8GB
183+
limit_memory_soft = 6442450944 # 6GB
184+
```
185+
186+
3. **PostgreSQL tuning**:
187+
```bash
188+
sudo nano /etc/postgresql/16/main/postgresql.conf
189+
```
190+
191+
Adjust:
192+
```ini
193+
shared_buffers = 2GB
194+
effective_cache_size = 6GB
195+
maintenance_work_mem = 512MB
196+
checkpoint_completion_target = 0.9
197+
wal_buffers = 16MB
198+
default_statistics_target = 100
199+
random_page_cost = 1.1
200+
```
201+
202+
4. **Enable caching** with Redis (optional):
203+
```bash
204+
sudo apt-get install -y redis-server
205+
# Configure in odoo.conf if your OpenSPP version supports it
206+
```

0 commit comments

Comments
 (0)