Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/optimumtact/sr.ht
Private file hosting
https://github.com/optimumtact/sr.ht
filehosting flask nginx postgresql python
Last synced: 23 days ago
JSON representation
Private file hosting
- Host: GitHub
- URL: https://github.com/optimumtact/sr.ht
- Owner: optimumtact
- License: mit
- Created: 2015-11-15T04:25:03.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2024-08-08T10:38:11.000Z (3 months ago)
- Last Synced: 2024-08-08T12:12:57.569Z (3 months ago)
- Topics: filehosting, flask, nginx, postgresql, python
- Language: Python
- Homepage:
- Size: 1.78 MB
- Stars: 12
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
(fork of [sr.ht](https://github.com/SirCmpwn/sr.ht))
Private file hosting with python/nginx
## Differences from upstream
* Fixed a few instances where page redirects would take you to the local IP of the sr.ht instance, which obviously isn't connectable from outside.
* Removed most hardcoded branding and moved it to config strings.
* Switched to simplex bootstrap theme
* Some minor style fixes
* Improvements to administration with some cli scripting
* Removed the anime branding and replaced with a more sfw icon
* Being able to delete files from the web interface## Running the site
Quick overview:
**Clone the repository**Find a place you want the code to live.
$ git clone git://github.com/optimumtact/sr.ht.git
$ cd sr.ht## Deployment
This has a working docker-compose file, just install docker and docker-compose
Then copy the example env file and adjust for your needs
cp env.dev.example .env
nano .env
Soft link the production docker-compose to docker-compose.yml
ln -s docker-compose-prod.yml docker-compose.ymlThen start the project with compose
docker-compose up -dthen you can browse to localhost:5000 (by default) to access it
## Dev deployment
This has a working docker-compose file for the database, so you can install docker + docker-compose + poetry + dotenvThen copy the example env file and adjust for your needs
cp env.dev.example .env
nano .env
Soft link the dev docker-compose to docker-compose.yml
ln -s docker-compose-dev.yml docker-compose.ymlThen start the project with compose
docker-compose up -dThen run the flask developer app, with dotenv and poetry to manage the requirements
dotenv run poetry run python debug.pyIf it fails to start the first time, just run it again, the db might not have stood all the way up before the web container started
** About the production deployment **
The Docker uses python:3-slim and hivemind for process management, so it obeys the procfile standard, both gunicorn and nginx run in a single container,
as the application was originally intended for a nginx + wsgi hosting and needs to share a storage folderhttps://github.com/DarthSim/hivemind
## Becoming an admin and bootstrapping initial user
You can become an admin with the management cli script
docker-compose exec -it web bin/bash
cd /app
python manage.py user create {yourusername} {password} {emailaddress}
python manage.py admin promote {youruser}## Customization
You can customize the appearance of the site with template overrides. Create a
directory called `overrides` and copy templates from the `templates` directory
into `overrides`. Modify them as you see fit, they will be used instead of the
version from `templates`.Although I don't know why you would do this when you can just modify source