Modern ERP Reports Application with microservices architecture Tech Stack: - Backend: FastAPI + python-oracledb (Oracle DB integration) - Frontend: Vue.js 3 + PrimeVue + Vite - Telegram Bot: python-telegram-bot + SQLite - Infrastructure: Shared database pool, JWT authentication, SSH tunnel Features: - FastAPI backend with async Oracle connection pool - Vue.js 3 responsive frontend with PrimeVue components - Telegram bot alternative interface - Microservices architecture with shared components - Complete deployment support (Linux Docker + Windows IIS) - Comprehensive testing (Playwright E2E + pytest) Repository Structure: - reports-app/ - Main application (backend, frontend, telegram-bot) - shared/ - Shared components (database pool, auth, utils) - deployment/ - Deployment scripts (Linux & Windows) - docs/ - Project documentation - security/ - Security scanning and git hooks
170 lines
5.6 KiB
Markdown
170 lines
5.6 KiB
Markdown
# 🔐 SSH Setup Instructions pentru ROA2WEB
|
|
|
|
Instrucțiuni pentru configurarea tunelului SSH din WSL către serverul Oracle.
|
|
|
|
## 📋 Pași de Setup
|
|
|
|
### 1. 🔑 Generarea cheii SSH
|
|
|
|
**Dacă nu ai cheia SSH generată, creează-o astfel:**
|
|
|
|
```bash
|
|
# Generează cheia SSH (RSA 4096-bit)
|
|
ssh-keygen -t rsa -b 4096 -f ~/.ssh/roa_oracle_server -N "" -C "roa2web-wsl-$(whoami)@$(hostname)"
|
|
|
|
# Verifică că s-a creat
|
|
ls -la ~/.ssh/roa_oracle_server*
|
|
```
|
|
|
|
**Output așteptat:**
|
|
```
|
|
Generating public/private rsa key pair.
|
|
Your identification has been saved in /home/user/.ssh/roa_oracle_server
|
|
Your public key has been saved in /home/user/.ssh/roa_oracle_server.pub
|
|
```
|
|
|
|
**Cheia SSH existentă este în: `~/.ssh/roa_oracle_server`**
|
|
|
|
**Pentru a afișa cheia PUBLICĂ:**
|
|
```bash
|
|
cat ~/.ssh/roa_oracle_server.pub
|
|
```
|
|
|
|
**Cheia PUBLICĂ pentru server:**
|
|
```
|
|
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCcRM+WWxoBqCSpaTo+vNCrvCLx1UFmKqqSh6smS4c/lh1Hkku+oiq65iUHwRMu5X9jDXSGUR1Fmig+OgIhoTnT4Hd3v4Fe2zienOFiJ/AZOTE+pgxpwmIrkScGTSv7ZSp4xFcXsFwho8W/Li0P0kyB+kGs2tFYaQM192E5Gx9qjlPGSM55fdksElRXKIrRHE4ARjt5+kMt4WFgUXpVNqhHQFEcz/oW6sC0OkufTbzQ+MHefBIlMNUlNHRxbHc3C6CTuMmzMM847y6rmQlDyScX0tizDhUnQ1UgA3ZyICJp9CVF4weAM6ihZhNTFi7drXiCEihUVLNU+EuEpWdWeVNebqBqlkJT0KXR3IgEQ3zKYKuAmICFO056WI3eKcJWuWEFNDrSYsxo+HydAbqBSqEprJFCUSU90175ngnpY4WoH7CFUbCnGjxEnRXUjUktaCdqYhH0ZjGHSGujK+KGPVxvBi1h7BjE33SEH6PAVZBYmdpGDri69n6H+v6dhaW26scFcc6ldrOcbaRsX7q4M8gFIwotAu6jTuid8FensF/j9yQRDkcOS8OWXHr5z2lZTCSDPik83p8mvvEZ/R7dP60ldwz2INX8rbCxi5frEdijqrwZCq9D2tzUJJgG8h3KUKfd3QfThCyq6AdE9X2+EnmU1yP2SJsolgM7euuDBH0/qQ== roa2web-wsl-marius@Mihai-HXG0G
|
|
```
|
|
|
|
### 2. 📤 Instalarea cheii pe Bitvise SSH Server
|
|
|
|
**🔴 IMPORTANT: Serverul folosește Bitvise SSH Server pe Windows**
|
|
|
|
Consultă **`BITVISE_SSH_SETUP.md`** pentru instrucțiuni detaliate!
|
|
|
|
**Pași rapid:**
|
|
1. Deschide **Bitvise SSH Server Control Panel**
|
|
2. Mergi la **Users tab** → selectează/creează utilizatorul
|
|
3. În **User Properties** → **Authentication** → setează **Public key authentication**
|
|
4. În **Public Keys** → **Import/Add** → paste cheia publică:
|
|
|
|
```
|
|
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCcRM+WWxoBqCSpaTo+vNCrvCLx1UFmKqqSh6smS4c/lh1Hkku+oiq65iUHwRMu5X9jDXSGUR1Fmig+OgIhoTnT4Hd3v4Fe2zienOFiJ/AZOTE+pgxpwmIrkScGTSv7ZSp4xFcXsFwho8W/Li0P0kyB+kGs2tFYaQM192E5Gx9qjlPGSM55fdksElRXKIrRHE4ARjt5+kMt4WFgUXpVNqhHQFEcz/oW6sC0OkufTbzQ+MHefBIlMNUlNHRxbHc3C6CTuMmzMM847y6rmQlDyScX0tizDhUnQ1UgA3ZyICJp9CVF4weAM6ihZhNTFi7drXiCEihUVLNU+EuEpWdWeVNebqBqlkJT0KXR3IgEQ3zKYKuAmICFO056WI3eKcJWuWEFNDrSYsxo+HydAbqBSqEprJFCUSU90175ngnpY4WoH7CFUbCnGjxEnRXUjUktaCdqYhH0ZjGHSGujK+KGPVxvBi1h7BjE33SEH6PAVZBYmdpGDri69n6H+v6dhaW26scFcc6ldrOcbaRsX7q4M8gFIwotAu6jTuid8FensF/j9yQRDkcOS8OWXHr5z2lZTCSDPik83p8mvvEZ/R7dP60ldwz2INX8rbCxi5frEdijqrwZCq9D2tzUJJgG8h3KUKfd3QfThCyq6AdE9X2+EnmU1yP2SJsolgM7euuDBH0/qQ== roa2web-wsl-marius@Mihai-HXG0G
|
|
```
|
|
|
|
5. **OK** → **Apply Configuration** → **Restart SSH Server** dacă necesar
|
|
|
|
### 3. ⚙️ Configurarea username-ului
|
|
|
|
**✅ IMPORTANT**: Folosește utilizatorul `roa2web` care are port forwarding activat în Bitvise!
|
|
|
|
**În WSL, editează scriptul SSH:**
|
|
|
|
```bash
|
|
nano /mnt/d/PROIECTE/roa-flask/ssh_tunnel.sh
|
|
```
|
|
|
|
**Actualizează linia:**
|
|
```bash
|
|
SSH_USER="roa2web" # Utilizator cu port forwarding activat
|
|
```
|
|
|
|
**💡 Notă**: Utilizatorul `roa2web` poate să nu aibă shell access, dar poate face port forwarding.
|
|
|
|
### 4. 🚀 Testarea setup-ului
|
|
|
|
```bash
|
|
cd /mnt/d/PROIECTE/roa-flask/roa2web
|
|
|
|
# Afișează ajutorul
|
|
./ssh_tunnel.sh help
|
|
|
|
# Testează și pornește tunelul
|
|
./ssh_tunnel.sh start
|
|
|
|
# Verifică statusul
|
|
./ssh_tunnel.sh status
|
|
```
|
|
|
|
## 🔧 Comenzi utile
|
|
|
|
### Gestionarea tunelului SSH:
|
|
```bash
|
|
# Pornește tunelul
|
|
./ssh_tunnel.sh start
|
|
|
|
# Oprește tunelul
|
|
./ssh_tunnel.sh stop
|
|
|
|
# Verifică statusul
|
|
./ssh_tunnel.sh status
|
|
|
|
# Repornește tunelul
|
|
./ssh_tunnel.sh restart
|
|
```
|
|
|
|
### Testarea pool-ului Oracle:
|
|
```bash
|
|
# Cu tunelul SSH activ
|
|
cd /mnt/d/PROIECTE/roa-flask/roa2web
|
|
source venv/bin/activate
|
|
python shared/database/test_pool.py
|
|
```
|
|
|
|
## 🔍 Troubleshooting
|
|
|
|
### ❌ "Permission denied (publickey)"
|
|
- Verifică că cheia publică este corect instalată pe server
|
|
- Verifică permisiunile: `chmod 600 ~/.ssh/authorized_keys`
|
|
- Verifică că SSH_USER este corect în script
|
|
|
|
### ❌ "Connection refused" sau "Connection timed out"
|
|
- Verifică că serverul SSH este accesibil: `telnet 83.103.197.79 22122`
|
|
- Verifică că portul 22122 nu este blocat de firewall
|
|
|
|
### ❌ "Port 1521 not responding"
|
|
- Normal dacă Oracle listener nu este pornit pe server
|
|
- Tunelul SSH poate fi OK, dar Oracle nu răspunde
|
|
|
|
### ❌ Oracle connection errors
|
|
- Verifică că tunelul SSH este activ: `./ssh_tunnel.sh status`
|
|
- Verifică că configurația Oracle din `.env` este corectă
|
|
- Testează manual: `telnet 127.0.0.1 1521`
|
|
|
|
## 📊 Output așteptat
|
|
|
|
### SSH Tunnel Start:
|
|
```
|
|
================================
|
|
ROA2WEB SSH Tunnel Manager
|
|
================================
|
|
🔄 Starting SSH tunnel...
|
|
Server: 83.103.197.79:22122
|
|
Local: 127.0.0.1:1521
|
|
Remote: localhost:1521
|
|
|
|
🔍 Testing SSH connectivity...
|
|
✅ SSH connectivity OK
|
|
|
|
🚀 Creating SSH tunnel...
|
|
✅ SSH tunnel started successfully (PID: 12345)
|
|
🔍 Testing tunnel connectivity...
|
|
✅ Tunnel is working! Port 1521 is accessible
|
|
```
|
|
|
|
### Oracle Pool Test:
|
|
```
|
|
🚀 ROA2WEB Oracle Pool Test - 2025-07-30 16:00:00
|
|
==================================================
|
|
🔄 Testing Oracle connection pool...
|
|
📊 Initializing Oracle pool...
|
|
✅ Pool initialized successfully
|
|
🔍 Testing database connection...
|
|
✅ Simple query successful: (1,)
|
|
...
|
|
🎉 ALL TESTS PASSED!
|
|
✅ Oracle pool is fully functional and ready for production!
|
|
```
|
|
|
|
---
|
|
|
|
*Instrucțiuni SSH pentru ROA2WEB Development Environment* 🔐 |