diff --git a/README.md b/README.md index 5a3c9cf..56dc743 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,157 @@ -# paperless_ngx_cloudpanel +# 📄 Enhanced Paperless-ngx Installation Script +An automated installation and maintenance script for Paperless-ngx with Docker integration and CloudPanel compatibility. This script provides a robust, self-healing installation process with comprehensive error handling and health checks. + +## 🌟 Features + +- **Automated Installation**: One-command setup of Docker and Paperless-ngx +- **Smart Health Monitoring**: Continuous verification of service health +- **Automatic Recovery**: Built-in error detection and recovery procedures +- **Backup System**: Automatic backup of existing installations before modifications +- **Secure Configuration**: Properly isolated Redis and PostgreSQL containers +- **Detailed Logging**: Comprehensive logging for troubleshooting +- **CloudPanel Integration**: Ready for CloudPanel reverse proxy setup + +## 📋 Prerequisites + +- Ubuntu 22.04/24.04 server +- Root access or sudo privileges +- CloudPanel installed (for reverse proxy setup) +- Domain or subdomain pointed to your server + +## 🚀 Quick Start + +1. Clone the Script: +```bash +wget https://git.hhf.technology/hhf/paperless_ngx_cloudpane/paperless-ngx-installer.git +``` + +2. Make the script executable: +```bash +chmod +x paperless-install.sh +``` + +3. Run the installation: +```bash +sudo ./paperless-install.sh +``` + +## ⚙️ Configuration + +The script includes several configurable parameters at the top: + +```bash +INSTALL_DIR="/docker/paperless-ngx" # Installation directory +COMPOSE_FILE="${INSTALL_DIR}/docker-compose.yml" # Docker compose file location +LOG_FILE="/var/log/paperless-install.log" # Log file location +``` + +### Environment Variables + +Key environment variables in docker-compose.yml: + +```yaml +PAPERLESS_TIME_ZONE: Europe/London +PAPERLESS_OCR_LANGUAGE: eng +PAPERLESS_URL: https://your-domain.com +``` + +## 🔧 CloudPanel Setup + +After running the script, configure CloudPanel: + +1. Create new site in CloudPanel +2. Select "Reverse Proxy" type +3. Configure with: + - Domain: your-paperless-domain.com + - Reverse Proxy URL: http://localhost:8000 +4. Set up SSL certificate + +## 📝 Logging + +The script maintains detailed logs at `/var/log/paperless-install.log`. View logs with: + +```bash +tail -f /var/log/paperless-install.log +``` + +## 🛠️ Troubleshooting + +### Common Issues + +1. **Container Start Failure** +```bash +docker logs paperless-ngx-webserver-1 +docker compose restart webserver +``` + +2. **Database Connection Issues** +```bash +docker compose logs db +docker compose restart db +``` + +3. **Permission Problems** +```bash +sudo chown -R 1000:1000 /docker/paperless-ngx/consume +sudo chown -R 1000:1000 /docker/paperless-ngx/export +``` + +## 🔄 Updates + +Update Paperless-ngx: + +```bash +cd /docker/paperless-ngx +docker compose pull +docker compose down +docker compose up -d +``` + +## 🔒 Security + +The script implements several security measures: + +- Isolated Docker networks for database and Redis +- Secure default configurations +- Automatic backup before modifications +- SSL/TLS support through CloudPanel + +## 📚 Directory Structure + +``` +/docker/paperless-ngx/ +├── docker-compose.yml +├── consume/ +├── export/ +├── data/ +└── media/ +``` + +## 🤝 Contributing + +1. Fork the repository +2. Create your feature branch +2. Commit your changes +4. Push to the branch +5. Create a new Pull Request + +## 📄 License + +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. + +## 🙏 Acknowledgments + +- [Paperless-ngx Project](https://github.com/paperless-ngx/paperless-ngx) +- CloudPanel Team +- Docker Team + +## 📞 Support + +- Create an issue on the forum +- Visit the [Paperless-ngx Documentation](https://docs.paperless-ngx.com) +- Join the Paperless-ngx community on Discord + +## ⚠️ Disclaimer + +This script is provided as-is, without any warranties. Always backup your data before running installation scripts. \ No newline at end of file