localfs 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- localfs-0.2.0/LICENSE +21 -0
- localfs-0.2.0/PKG-INFO +149 -0
- localfs-0.2.0/README.md +137 -0
- localfs-0.2.0/pyproject.toml +24 -0
- localfs-0.2.0/setup.cfg +4 -0
- localfs-0.2.0/src/localfs/__init__.py +0 -0
- localfs-0.2.0/src/localfs/__main__.py +3 -0
- localfs-0.2.0/src/localfs/config.py +54 -0
- localfs-0.2.0/src/localfs/main.py +1448 -0
- localfs-0.2.0/src/localfs/theme.py +174 -0
- localfs-0.2.0/src/localfs.egg-info/PKG-INFO +149 -0
- localfs-0.2.0/src/localfs.egg-info/SOURCES.txt +17 -0
- localfs-0.2.0/src/localfs.egg-info/dependency_links.txt +1 -0
- localfs-0.2.0/src/localfs.egg-info/entry_points.txt +2 -0
- localfs-0.2.0/src/localfs.egg-info/requires.txt +3 -0
- localfs-0.2.0/src/localfs.egg-info/top_level.txt +1 -0
- localfs-0.2.0/tests/test_config.py +79 -0
- localfs-0.2.0/tests/test_main.py +2241 -0
- localfs-0.2.0/tests/test_theme.py +150 -0
localfs-0.2.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 RK RIAD 585 (RK STUDIO 585)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
localfs-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: localfs
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: A simple, fast, and beautiful local file sharing service
|
|
5
|
+
Requires-Python: >=3.12
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Dist: flask>=3.0
|
|
9
|
+
Requires-Dist: rich>=13.0
|
|
10
|
+
Requires-Dist: click>=8.0
|
|
11
|
+
Dynamic: license-file
|
|
12
|
+
|
|
13
|
+
# localfs
|
|
14
|
+
|
|
15
|
+
A simple, fast, and beautiful local file sharing service built with Python and Flask. Share your media library (videos, audio, images) across your local network through a clean, modern web interface.
|
|
16
|
+
|
|
17
|
+
[](LICENSE)
|
|
18
|
+
[](https://www.python.org/)
|
|
19
|
+
[](https://github.com/astral-sh/ruff)
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Features
|
|
24
|
+
|
|
25
|
+
- Instant web access — view and download files from any device on your network
|
|
26
|
+
- Built-in video & audio player with auto-generated thumbnails
|
|
27
|
+
- Live search filtering
|
|
28
|
+
- Clean, modern UI styled with Tailwind CSS
|
|
29
|
+
- Configurable file-type filtering
|
|
30
|
+
- Optional access key for web interface security
|
|
31
|
+
- JSON API endpoint for sharing activity logs
|
|
32
|
+
|
|
33
|
+
## Quick Start
|
|
34
|
+
|
|
35
|
+
### Install from source
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
git clone https://github.com/rkriad585/localfs.git
|
|
39
|
+
cd localfs
|
|
40
|
+
pip install -e .
|
|
41
|
+
python -m localfs
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Install via script (Linux / macOS)
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
curl -fsSL https://raw.githubusercontent.com/rkriad585/localfs/main/installer.sh | sh
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Install via script (Windows PowerShell)
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
irm https://raw.githubusercontent.com/rkriad585/localfs/main/installer.ps1 | iex
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Open the URL printed in the terminal to access the web interface.
|
|
57
|
+
|
|
58
|
+
## Docker
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
docker build -t localfs .
|
|
62
|
+
docker run -p 5000:5000 -v ./media:/app/media localfs
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Or with docker compose:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
docker compose up
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Documentation
|
|
72
|
+
|
|
73
|
+
Full documentation is in the [docs/](docs/) directory:
|
|
74
|
+
|
|
75
|
+
| Guide | Description |
|
|
76
|
+
|---|---|
|
|
77
|
+
| [Setup Guide](docs/setup.md) | Installation and first run |
|
|
78
|
+
| [Usage Guide](docs/usage.md) | How to use localfs |
|
|
79
|
+
| [Configuration](docs/configuration.md) | All config options explained |
|
|
80
|
+
| [API Reference](docs/api.md) | JSON API documentation |
|
|
81
|
+
| [Development](docs/development.md) | Setting up a dev environment |
|
|
82
|
+
| [Deployment](docs/deployment.md) | Production deployment options |
|
|
83
|
+
| [Troubleshooting](docs/troubleshooting.md) | Common issues and fixes |
|
|
84
|
+
| [Architecture](docs/architecture.md) | Project architecture overview |
|
|
85
|
+
|
|
86
|
+
## Build Commands
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
make build # Build wheel and sdist
|
|
90
|
+
make install # Install in editable mode
|
|
91
|
+
make test # Run tests
|
|
92
|
+
make lint # Run linter
|
|
93
|
+
make format # Format code
|
|
94
|
+
make run # Start server
|
|
95
|
+
make clean # Remove build artifacts
|
|
96
|
+
make docker # Build Docker image
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Project Structure
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
localfs/
|
|
103
|
+
├── main.py # Application entry point and Flask routes
|
|
104
|
+
├── config.py # Configuration constants
|
|
105
|
+
├── pyproject.toml # Project metadata and dependencies
|
|
106
|
+
├── Dockerfile # Multi-stage Docker build
|
|
107
|
+
├── docker-compose.yml # Docker Compose configuration
|
|
108
|
+
├── Makefile # Build automation
|
|
109
|
+
├── build.sh / .ps1 # Cross-platform build scripts
|
|
110
|
+
├── installer.sh / .ps1 # System installer / uninstaller
|
|
111
|
+
│
|
|
112
|
+
├── data/ # Runtime data (logs, auto-created)
|
|
113
|
+
├── media/ # Place your shared files here
|
|
114
|
+
├── static/
|
|
115
|
+
│ ├── js/main.js # Search filtering logic
|
|
116
|
+
│ ├── logo.svg # Project logo
|
|
117
|
+
│ └── thumbnails/ # Auto-generated video thumbnails
|
|
118
|
+
├── templates/
|
|
119
|
+
│ ├── index.html # File grid homepage
|
|
120
|
+
│ ├── player.html # Video/audio player page
|
|
121
|
+
│ └── error.html # Error pages (401/403/404/500)
|
|
122
|
+
├── tests/
|
|
123
|
+
│ ├── conftest.py # Pytest fixtures
|
|
124
|
+
│ ├── test_config.py # Config tests
|
|
125
|
+
│ └── test_main.py # Main application tests
|
|
126
|
+
└── docs/ # Documentation
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Uninstalling
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
localfs --selfuninstall
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Uninstall via script (Linux / macOS)
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
curl -fsSL https://raw.githubusercontent.com/rkriad585/localfs/main/installer.sh | sh -s -- --selfuninstall
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Uninstall via script (Windows PowerShell)
|
|
142
|
+
|
|
143
|
+
```powershell
|
|
144
|
+
Invoke-RestMethod -Uri "https://raw.githubusercontent.com/rkriad585/localfs/main/installer.ps1" | Invoke-Expression -ArgumentList "--selfuninstall"
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## License
|
|
148
|
+
|
|
149
|
+
Distributed under the MIT License. See [LICENSE](LICENSE) for more information.
|
localfs-0.2.0/README.md
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# localfs
|
|
2
|
+
|
|
3
|
+
A simple, fast, and beautiful local file sharing service built with Python and Flask. Share your media library (videos, audio, images) across your local network through a clean, modern web interface.
|
|
4
|
+
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
[](https://www.python.org/)
|
|
7
|
+
[](https://github.com/astral-sh/ruff)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- Instant web access — view and download files from any device on your network
|
|
14
|
+
- Built-in video & audio player with auto-generated thumbnails
|
|
15
|
+
- Live search filtering
|
|
16
|
+
- Clean, modern UI styled with Tailwind CSS
|
|
17
|
+
- Configurable file-type filtering
|
|
18
|
+
- Optional access key for web interface security
|
|
19
|
+
- JSON API endpoint for sharing activity logs
|
|
20
|
+
|
|
21
|
+
## Quick Start
|
|
22
|
+
|
|
23
|
+
### Install from source
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
git clone https://github.com/rkriad585/localfs.git
|
|
27
|
+
cd localfs
|
|
28
|
+
pip install -e .
|
|
29
|
+
python -m localfs
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Install via script (Linux / macOS)
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
curl -fsSL https://raw.githubusercontent.com/rkriad585/localfs/main/installer.sh | sh
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Install via script (Windows PowerShell)
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
irm https://raw.githubusercontent.com/rkriad585/localfs/main/installer.ps1 | iex
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Open the URL printed in the terminal to access the web interface.
|
|
45
|
+
|
|
46
|
+
## Docker
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
docker build -t localfs .
|
|
50
|
+
docker run -p 5000:5000 -v ./media:/app/media localfs
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Or with docker compose:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
docker compose up
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Documentation
|
|
60
|
+
|
|
61
|
+
Full documentation is in the [docs/](docs/) directory:
|
|
62
|
+
|
|
63
|
+
| Guide | Description |
|
|
64
|
+
|---|---|
|
|
65
|
+
| [Setup Guide](docs/setup.md) | Installation and first run |
|
|
66
|
+
| [Usage Guide](docs/usage.md) | How to use localfs |
|
|
67
|
+
| [Configuration](docs/configuration.md) | All config options explained |
|
|
68
|
+
| [API Reference](docs/api.md) | JSON API documentation |
|
|
69
|
+
| [Development](docs/development.md) | Setting up a dev environment |
|
|
70
|
+
| [Deployment](docs/deployment.md) | Production deployment options |
|
|
71
|
+
| [Troubleshooting](docs/troubleshooting.md) | Common issues and fixes |
|
|
72
|
+
| [Architecture](docs/architecture.md) | Project architecture overview |
|
|
73
|
+
|
|
74
|
+
## Build Commands
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
make build # Build wheel and sdist
|
|
78
|
+
make install # Install in editable mode
|
|
79
|
+
make test # Run tests
|
|
80
|
+
make lint # Run linter
|
|
81
|
+
make format # Format code
|
|
82
|
+
make run # Start server
|
|
83
|
+
make clean # Remove build artifacts
|
|
84
|
+
make docker # Build Docker image
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Project Structure
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
localfs/
|
|
91
|
+
├── main.py # Application entry point and Flask routes
|
|
92
|
+
├── config.py # Configuration constants
|
|
93
|
+
├── pyproject.toml # Project metadata and dependencies
|
|
94
|
+
├── Dockerfile # Multi-stage Docker build
|
|
95
|
+
├── docker-compose.yml # Docker Compose configuration
|
|
96
|
+
├── Makefile # Build automation
|
|
97
|
+
├── build.sh / .ps1 # Cross-platform build scripts
|
|
98
|
+
├── installer.sh / .ps1 # System installer / uninstaller
|
|
99
|
+
│
|
|
100
|
+
├── data/ # Runtime data (logs, auto-created)
|
|
101
|
+
├── media/ # Place your shared files here
|
|
102
|
+
├── static/
|
|
103
|
+
│ ├── js/main.js # Search filtering logic
|
|
104
|
+
│ ├── logo.svg # Project logo
|
|
105
|
+
│ └── thumbnails/ # Auto-generated video thumbnails
|
|
106
|
+
├── templates/
|
|
107
|
+
│ ├── index.html # File grid homepage
|
|
108
|
+
│ ├── player.html # Video/audio player page
|
|
109
|
+
│ └── error.html # Error pages (401/403/404/500)
|
|
110
|
+
├── tests/
|
|
111
|
+
│ ├── conftest.py # Pytest fixtures
|
|
112
|
+
│ ├── test_config.py # Config tests
|
|
113
|
+
│ └── test_main.py # Main application tests
|
|
114
|
+
└── docs/ # Documentation
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Uninstalling
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
localfs --selfuninstall
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Uninstall via script (Linux / macOS)
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
curl -fsSL https://raw.githubusercontent.com/rkriad585/localfs/main/installer.sh | sh -s -- --selfuninstall
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Uninstall via script (Windows PowerShell)
|
|
130
|
+
|
|
131
|
+
```powershell
|
|
132
|
+
Invoke-RestMethod -Uri "https://raw.githubusercontent.com/rkriad585/localfs/main/installer.ps1" | Invoke-Expression -ArgumentList "--selfuninstall"
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## License
|
|
136
|
+
|
|
137
|
+
Distributed under the MIT License. See [LICENSE](LICENSE) for more information.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=64"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "localfs"
|
|
7
|
+
version = "0.2.0"
|
|
8
|
+
description = "A simple, fast, and beautiful local file sharing service"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.12"
|
|
11
|
+
dependencies = [
|
|
12
|
+
"flask>=3.0",
|
|
13
|
+
"rich>=13.0",
|
|
14
|
+
"click>=8.0",
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
[project.scripts]
|
|
18
|
+
localfs = "localfs.main:main"
|
|
19
|
+
|
|
20
|
+
[tool.setuptools.package-dir]
|
|
21
|
+
"" = "src"
|
|
22
|
+
|
|
23
|
+
[tool.setuptools.packages.find]
|
|
24
|
+
where = ["src"]
|
localfs-0.2.0/setup.cfg
ADDED
|
File without changes
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# localfs/config.py
|
|
2
|
+
|
|
3
|
+
import secrets, os
|
|
4
|
+
|
|
5
|
+
BASE_DIR = os.path.join(os.path.expanduser("~"), ".config", "neostore", "localfs")
|
|
6
|
+
|
|
7
|
+
# --- Version ---
|
|
8
|
+
try:
|
|
9
|
+
from importlib.metadata import version as _meta_version
|
|
10
|
+
VERSION = _meta_version("localfs")
|
|
11
|
+
except Exception:
|
|
12
|
+
_VERSION_FILE = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", ".version")
|
|
13
|
+
try:
|
|
14
|
+
with open(_VERSION_FILE) as _f:
|
|
15
|
+
VERSION = _f.read().strip()
|
|
16
|
+
except Exception:
|
|
17
|
+
VERSION = "0.0.0"
|
|
18
|
+
|
|
19
|
+
# --- General Settings ---
|
|
20
|
+
HOST = "0.0.0.0"
|
|
21
|
+
PORT = 5000
|
|
22
|
+
DEBUG = True
|
|
23
|
+
|
|
24
|
+
# --- Folder and File Paths ---
|
|
25
|
+
MEDIA_FOLDER = os.path.join(os.path.expanduser("~"), "Downloads")
|
|
26
|
+
MEDIA_EXTRA_DIRS = {
|
|
27
|
+
"Videos": os.path.join(os.path.expanduser("~"), "Videos"),
|
|
28
|
+
"Music": os.path.join(os.path.expanduser("~"), "Music"),
|
|
29
|
+
}
|
|
30
|
+
DATA_FOLDER = os.path.join(BASE_DIR, "data")
|
|
31
|
+
DATA_FILE = "localfs-data.json"
|
|
32
|
+
THUMBNAIL_FOLDER = os.path.join(BASE_DIR, "thumbnails")
|
|
33
|
+
|
|
34
|
+
# --- File Sharing Settings ---
|
|
35
|
+
ALLOWED_EXTENSIONS = ".mkv .mp4 .mp3 .avi .mov .webm .wmv .flv .m4v .wav .flac .aac .wma .m4a .opus .ogg .jpg .jpeg .png .gif .webp .bmp .svg"
|
|
36
|
+
|
|
37
|
+
# --- Security & API Settings ---
|
|
38
|
+
# A secure, random key for accessing the API endpoint AND the website.
|
|
39
|
+
API_KEY = secrets.token_hex(16)
|
|
40
|
+
|
|
41
|
+
# Set to True to require the API key to access the website (e.g., http://.../?key=...).
|
|
42
|
+
# Set to False to allow anyone on the network to view the website without a key.
|
|
43
|
+
WEBSITE_ACCESS_KEY_REQUIRED = True
|
|
44
|
+
|
|
45
|
+
# Flask session secret key
|
|
46
|
+
SECRET_KEY = secrets.token_hex(32)
|
|
47
|
+
|
|
48
|
+
# User management
|
|
49
|
+
USERS_FILE = os.path.join(BASE_DIR, "users.json")
|
|
50
|
+
|
|
51
|
+
# Trash / Recycle Bin
|
|
52
|
+
TRASH_FOLDER = os.path.join(BASE_DIR, "trash")
|
|
53
|
+
TRASH_TTL_DAYS = 30
|
|
54
|
+
TRASH_METADATA_FILE = "trash-metadata.json"
|