Ephor is a sleek, ephemeral pastebin service crafted for secure and transient document hosting. Engineered with RESTful principles, Ephor caters to developers and teams who need a reliable platform for temporary data exchange. Supporting both HTTP and HTTPS, Ephor stands out with its user-centric design that prioritizes ease of use and security.
- Transient File Storage: Automates the deletion of documents post a user-specified lifespan.
- Dual Protocol Support: Facilitates document hosting via HTTP or HTTPS, ensuring versatility.
- RESTful API: Streamlined API endpoints for document upload and retrieval processes.
- Activity Logging: Comprehensive logging of server actions, including document lifecycle events.
- Debugging Support: Offers a debugging mode for in-depth server operation insights.
- Directory Listing: Endpoint availability to inspect the list of present documents.
POST /upload
- Uploads a document with an optional lifespan (defaults to 120 seconds).DELETE /files/<filename>?key={UUID}
- Allows manual document deletion using a unique key.GET /files
- Enumerates all stored documents.GET /files/<filename>
- Facilitates retrieval of a specific document.GET /logs
- Accesses logs of server operations.
file
- The document to be uploaded.duration
- The active duration of the document on the server (in seconds).
- Python 3.11.6 or higher
- Flask
- SSL certificate (
cert.pem
) and key (key.pem
) for HTTPS setup.
- Ensure Python and
pip
are installed on your system. - Install Flask using
pip
:pip install flask
- Standard Mode:
python3 ephor.py
- Debug Mode (for detailed logging):
python3 ephor.py --debug
- HTTPS Mode (requires SSL certificates, enables unique filenames):
python3 ephor.py --https --unique
Utilize curl
for command-line interactions, or opt for any RESTful client like Postman.
Upload a document:
curl -X POST -F "file=@/path/to/document.txt" -F "duration=60" http://127.0.0.1:5000/upload
Retrieve a document(s):
curl -X GET http://127.0.0.1:5000/files
curl -X GET http://127.0.0.1:5000/files/document.txt
Delete a document:
curl -X DELETE http://127.0.0.1:5000/files/document.txt\?key\=72772ee2-b0f7-4a32-8f13-756640c108c7
Note: Use
curl -k
to ignore self-signed SSL warnings during local testing.
Your contributions make Ephor better! To contribute:
- Fork the repository.
- Create a new branch for your feature or fix.
- Commit your changes.
- Push to your branch.
- Submit a pull request.
We appreciate your input and are open to your ideas and feedback.