🚀 Flask web application for managing BiznetGio NEO Object Storage with S3-compatible API. Upload, view, and delete files with ease. Features SSL handling, auto bucket creation, and responsive UI.
https://neobject.classy.id
|
|
||
|---|---|---|
| templates | ||
| .env.example | ||
| README.md | ||
| app.py | ||
| php_neo_wrapper.php | ||
| pure_php_neo.php | ||
| requirements.txt | ||
README.md
Flask NEO Object Storage Manager
🚀 A modern Flask web application for managing BiznetGio NEO Object Storage with S3-compatible API.
✨ Features
- 📁 File Upload & Management - Upload files with drag & drop support
- 🖼️ Image Preview - Preview uploaded images directly in browser
- 🗑️ File Deletion - Delete files with confirmation
- 🔗 Direct Links - Copy direct URLs to clipboard
- 🛡️ SSL Handling - Automatic SSL certificate handling for development
- 🪣 Auto Bucket Creation - Automatically creates buckets if they don't exist
- 📱 Responsive UI - Bootstrap-based responsive interface
- 🔧 Easy Configuration - Environment variable based setup
🚀 Quick Start
Prerequisites
- Python 3.8+
- BiznetGio NEO Object Storage account
- Access Key & Secret Key from NEO Portal
Installation
-
Clone the repository
git clone https://git.classy.id/andri/flask-neo-object-storage.git cd flask-neo-object-storage -
Create virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate -
Install dependencies
pip install -r requirements.txt -
Configure environment variables
cp .env.example .env # Edit .env with your NEO credentials -
Run the application
python app.py -
Open browser
http://localhost:7600
⚙️ Configuration
Create a .env file with your NEO Object Storage credentials:
NEO_ACCESS_KEY=your_access_key_here
NEO_SECRET_KEY=your_secret_key_here
NEO_ENDPOINT=https://nos.wjv-1.neo.id
NEO_BUCKET=my-unique-bucket-name
NEO_USE_SSL=false
Getting NEO Credentials
- Login to BiznetGio Portal
- Navigate to NEO Object Storage
- Create a new bucket or use existing one
- Copy your Access Key and Secret Key
📁 Project Structure
flask-neo-object-storage/
├── app.py # Main Flask application
├── requirements.txt # Python dependencies
├── .env.example # Environment variables template
├── .env # Your environment variables (gitignored)
├── templates/ # HTML templates
│ ├── base.html
│ ├── index.html
│ ├── upload.html
│ └── files.html
└── README.md
🛠️ API Endpoints
| Method | Endpoint | Description |
|---|---|---|
GET |
/ |
Home page |
GET/POST |
/upload |
Upload files |
GET |
/files |
View all files |
POST |
/api/upload |
AJAX file upload |
POST |
/api/delete |
Delete file |
GET |
/api/files |
List files JSON |
GET |
/test-connection |
Test NEO connection |
GET |
/setup-bucket |
Create bucket |
🐛 Troubleshooting
SSL Certificate Issues
If you encounter SSL certificate errors:
NEO_USE_SSL=false
NEO_ENDPOINT=http://nos.wjv-1.neo.id
Bucket Not Found Error
- Make sure bucket name is unique globally
- Create bucket manually in NEO Portal
- Use
/setup-bucketendpoint to auto-create
Access Denied Error
- Verify your Access Key and Secret Key
- Check bucket permissions in NEO Portal
- Ensure bucket policy allows public read
🚀 Deployment
Production Deployment
-
Use production WSGI server
pip install gunicorn gunicorn -w 4 -b 0.0.0.0:8000 app:app -
Enable SSL in production
NEO_USE_SSL=true -
Use reverse proxy (Nginx)
server { listen 80; server_name yourdomain.com; location / { proxy_pass http://127.0.0.1:8000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } }
Docker Deployment
FROM python:3.9-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
EXPOSE 7600
CMD ["python", "app.py"]
🤝 Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- BiznetGio for NEO Object Storage service
- Flask web framework
- Bootstrap for UI components
- Boto3 for AWS S3 compatible API
📞 Support
- 📧 Email: kontak@classy.id
Made with ❤️ in Indonesia
Dengan setup ini, kamu bisa menggunakan Flask app sebagai microservice untuk handle object storage, sementara aplikasi utama tetap menggunakan PHP!