Compare commits

...

6 commits

Author SHA1 Message Date
RafayAhmad7548
402d9a5b82 key setup readme 2025-07-10 20:32:08 +05:00
RafayAhmad7548
5348221b45 slight update to readme 2025-07-10 20:14:00 +05:00
RafayAhmad7548
1705ae08cc hotfix for user setup guide 2025-07-10 20:11:23 +05:00
RafayAhmad7548
9ec4eab173 license work pls 2025-07-10 18:39:35 +05:00
RafayAhmad7548
d7c9e261c3 licnese again 2025-07-10 18:35:13 +05:00
RafayAhmad7548
ea432f6616 mit license 2025-07-10 18:34:37 +05:00
2 changed files with 33 additions and 2 deletions

9
LICENSE Normal file
View file

@ -0,0 +1,9 @@
MIT License
Copyright (c) 2025 RafayAhmad
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View file

@ -8,7 +8,7 @@ SQLite, PostgreSQL and MYSQL are supported for the database, Authentication can
# Installation # Installation
Start by downloading the tarball from the latest release from the [releases](https://forgejo.fluxgrid.pk/RafayAhmad/flux-sftp/releases), then extract the tarball as follows Start by downloading the tarball from the latest release from the [releases](https://forgejo.fluxgrid.pk/RafayAhmad/flux-sftp/releases), then extract the tarball as follows
```bash ```bash
tar -xzvf flux-sftp.tar.gz -C / sudo tar -xzvf flux-sftp.tar.gz -C /
``` ```
## Database ## Database
before you can run the server you need to setup a database, SQLite, PostgreSQL and MYSQL are supported. get a database server running or simply create a sqlite database file and configure the server as mentioned in the [configuration section](#configuration). before you can run the server you need to setup a database, SQLite, PostgreSQL and MYSQL are supported. get a database server running or simply create a sqlite database file and configure the server as mentioned in the [configuration section](#configuration).
@ -16,6 +16,28 @@ the database table should have a username field, and optionally public key and p
***Note that registering users must be done manually by inserting records into the database as of now.*** ***Note that registering users must be done manually by inserting records into the database as of now.***
## User setup
create a user named fluxsftp as follows
```bash
sudo useradd -r -s /usr/sbin/nologin fluxsftp
```
this user needs to own the jail directory, make sure to change ownership of the jail directory you have specified in the config
```bash
sudo chown -R fluxsftp:fluxsftp /srv/sftp
```
***When you register a new user make sure to create a directory for them in the jail directory and make sure it is owned by the fluxsftp user***
## Server Key
generate a key for the server as follows
```bash
sudo ssh-keygen -t ed25519 -f /etc/flux-sftp/server_key
```
also make sure that the server's private key is owned by fluxsftp
```bash
sudo chown fluxsftp:fluxsftp /etc/flux-sftp/server_key
```
## Enable and Start ## Enable and Start
after you have configured the database you can start the server as follows after you have configured the database you can start the server as follows
```bash ```bash
@ -34,7 +56,7 @@ The configuration file is located at `/etc/flux-sftp/config.toml`, here is the d
listen_address = "0.0.0.0" listen_address = "0.0.0.0"
port = 2222 port = 2222
jail_dir = "/srv/sftp" jail_dir = "/srv/sftp"
private_key_file = "~/.ssh/flux-sftp" private_key_file = "/etc/flux-sftp/server_key"
[database] [database]
driver = "sqlite" driver = "sqlite"