SFS/README.md

51 lines
2.3 KiB
Markdown
Raw Permalink Normal View History

2020-11-05 14:31:31 +00:00
# SFS - Simple file system
2020-11-04 17:59:18 +00:00
2020-11-05 14:31:31 +00:00
Simple file server (web-based) to be used easily with curl. Written in python with framework flask. By default it used a simple SQLite database, but this can be adapted to your needs by editing config files.
2020-11-04 17:59:18 +00:00
2020-11-05 14:31:31 +00:00
Scripts to use with bash and curl are available in the scripts folder. You can set your default server, username and password in the header of the script.
This repository is licensed under GPL v3.
2020-11-04 17:59:18 +00:00
## Installation
2020-11-05 14:31:31 +00:00
1. Create a virtual environment `venv` (`python3 -m venv venv`)
2. Activate (`. venv/bin/activate`)
3. Install prerequisite python packages (`pip install -r requirements.txt`)
4. You will have to create a folder to store uploaded files (default is `./data`)
5. Copy files `settings.example.cfg` and `settings.example.py` to `settings.cfg` and `settings.py` and adjust parameters
6. You can start the test server with `python fs.py`
## Configuration an deployment
For deployment, see [Flask documentation](https://flask.palletsprojects.com/en/1.1.x/deploying/).
2020-11-04 17:59:18 +00:00
2020-11-05 14:31:31 +00:00
Configuration of uploading server and limitation of file size, as well as listening url for web server is configured in `settings.py`. Configuration of database is done in `settings.cfg` (use of SQLAlchemy, see corresponding documentation for advanced parameterizations).
2020-11-04 17:59:18 +00:00
## Principe
2020-11-05 14:31:31 +00:00
* `fs.py` is the core file
* `db.py` defines the database structure
* `templates` folder contains all web views to be rendered with Jinja2
* `static` folder contains scripts, css and images
2020-11-04 17:59:18 +00:00
2020-11-05 14:31:31 +00:00
If at running time, there is no user in database, a first user is created with admin
rights. The login is `admin` and password is `admin`. You have to change it before
deployment, of course !
2020-11-04 17:59:18 +00:00
## Licence
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>
Copyright (C) 2020 L. Viallon-Galinier