diff --git a/README.md b/README.md index 456861b0..eaf309a4 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ Fully featured and highly configurable SFTP server, written in Go - Support for HAProxy PROXY protocol: you can proxy and/or load balance the SFTP/SCP service without losing the information about the client's address. - [REST API](./docs/rest-api.md) for users management, backup, restore and real time reports of the active connections with possibility of forcibly closing a connection. - [Web based administration interface](./docs/web-admin.md) to easily manage users and connections. -- Easy [migration](./scripts#convert-users-from-other-stores) from Linux system user accounts. +- Easy [migration](./examples/rest-api-cli#convert-users-from-other-stores) from Linux system user accounts. - [Portable mode](./docs/portable-mode.md): a convenient way to share a single directory on demand. - Performance analysis using built-in [profiler](./docs/profiling.md). - Configuration format is at your choice: JSON, TOML, YAML, HCL, envfile are supported. diff --git a/docker/rest-api-cli/Dockerfile b/docker/rest-api-cli/Dockerfile index 65b6c1ec..f1b21ddd 100644 --- a/docker/rest-api-cli/Dockerfile +++ b/docker/rest-api-cli/Dockerfile @@ -2,7 +2,7 @@ FROM debian:latest LABEL maintainer="nicola.murino@gmail.com" RUN apt-get update && apt-get install -y curl python3-requests python3-pygments -RUN curl https://raw.githubusercontent.com/drakkan/sftpgo/master/scripts/sftpgo_api_cli.py --output /usr/bin/sftpgo_api_cli.py +RUN curl https://raw.githubusercontent.com/drakkan/sftpgo/master/examples/rest-api-cli/sftpgo_api_cli.py --output /usr/bin/sftpgo_api_cli.py ENTRYPOINT ["python3", "/usr/bin/sftpgo_api_cli.py" ] CMD [] \ No newline at end of file diff --git a/docs/account.md b/docs/account.md index 612c7549..a886e77a 100644 --- a/docs/account.md +++ b/docs/account.md @@ -61,5 +61,5 @@ These properties are stored inside the data provider. If you want to use your existing accounts, you have these options: - If your accounts are aleady stored inside a supported database, you can create a database view. Since a view is read only, you have to disable user management and quota tracking so SFTPGo will never try to write to the view -- you can import your users inside SFTPGo. Take a look at [sftpgo_api_cli.py](../scripts#convert-users-from-other-stores "SFTPGo API CLI script"), it can convert and import users from Linux system users and Pure-FTPd/ProFTPD virtual users +- you can import your users inside SFTPGo. Take a look at [sftpgo_api_cli.py](../examples/rest-api-cli#convert-users-from-other-stores "SFTPGo API CLI example"), it can convert and import users from Linux system users and Pure-FTPd/ProFTPD virtual users - you can use an external authentication program diff --git a/docs/rest-api.md b/docs/rest-api.md index 5315b7b5..903f49da 100644 --- a/docs/rest-api.md +++ b/docs/rest-api.md @@ -30,6 +30,6 @@ and, of course, you can configure the web server to use HTTPS. The OpenAPI 3 schema for the exposed API can be found inside the source tree: [openapi.yaml](../httpd/schema/openapi.yaml "OpenAPI 3 specs"). -A sample CLI client for the REST API can be found inside the source tree [scripts](../scripts "scripts") directory. +A sample CLI client for the REST API can be found inside the source tree [rest-api-cli](../examples/rest-api-cli) directory. You can also generate your own REST client in your preferred programming language, or even bash scripts, using an OpenAPI generator such as [swagger-codegen](https://github.com/swagger-api/swagger-codegen) or [OpenAPI Generator](https://openapi-generator.tech/) diff --git a/docs/service.md b/docs/service.md index b19af39f..9659a5f3 100644 --- a/docs/service.md +++ b/docs/service.md @@ -34,7 +34,7 @@ sudo systemctl status sftpgo # automatically start sftpgo on boot sudo systemctl enable sftpgo # optional, install the REST API CLI. It requires python-requests to run -sudo install -Dm755 scripts/sftpgo_api_cli.py /usr/bin/sftpgo_api_cli +sudo install -Dm755 examples/rest-api-cli/sftpgo_api_cli.py /usr/bin/sftpgo_api_cli ``` ## macOS @@ -70,7 +70,7 @@ sudo launchctl load -w /Library/LaunchDaemons/com.github.drakkan.sftpgo.plist # verify that the service is started sudo launchctl list com.github.drakkan.sftpgo # optional, install the REST API CLI. It requires python-requests to run, this python module is not installed by default -sudo cp scripts/sftpgo_api_cli.py /usr/local/opt/sftpgo/bin/ +sudo cp examples/rest-api-cli/sftpgo_api_cli.py /usr/local/opt/sftpgo/bin/ ``` ## Windows diff --git a/scripts/README.md b/examples/rest-api-cli/README.md similarity index 100% rename from scripts/README.md rename to examples/rest-api-cli/README.md diff --git a/scripts/sftpgo_api_cli.py b/examples/rest-api-cli/sftpgo_api_cli.py similarity index 100% rename from scripts/sftpgo_api_cli.py rename to examples/rest-api-cli/sftpgo_api_cli.py diff --git a/sftpgo.iss b/sftpgo.iss index 76fdd08c..3d4ebcb2 100644 --- a/sftpgo.iss +++ b/sftpgo.iss @@ -38,8 +38,7 @@ Source: "{#MyAppDir}\sftpgo.exe"; DestDir: "{app}"; Flags: ignoreversion Source: "{#MyAppDir}\sftpgo.db"; DestDir: "{commonappdata}\{#MyAppName}"; Flags: onlyifdoesntexist uninsneveruninstall Source: "{#MyAppDir}\LICENSE.txt"; DestDir: "{app}"; Flags: ignoreversion Source: "{#MyAppDir}\sftpgo.json"; DestDir: "{commonappdata}\{#MyAppName}"; Flags: onlyifdoesntexist uninsneveruninstall -Source: "{#MyAppDir}\scripts\*"; DestDir: "{app}\scripts"; Flags: ignoreversion recursesubdirs createallsubdirs -Source: "{#MyAppDir}\sql\*"; DestDir: "{app}\sql"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "{#MyAppDir}\examples\sftpgo_api_cli.exe"; DestDir: "{app}\examples"; Flags: ignoreversion recursesubdirs createallsubdirs Source: "{#MyAppDir}\templates\*"; DestDir: "{commonappdata}\{#MyAppName}\templates"; Flags: ignoreversion recursesubdirs createallsubdirs Source: "{#MyAppDir}\static\*"; DestDir: "{commonappdata}\{#MyAppName}\static"; Flags: ignoreversion recursesubdirs createallsubdirs @@ -51,8 +50,8 @@ Name: "{commonappdata}\{#MyAppName}\credentials"; Permissions: everyone-full [Icons] Name: "{group}\Web Admin"; Filename: "http://127.0.0.1:8080/web"; Name: "{group}\Service Control"; WorkingDir: "{app}"; Filename: "powershell.exe"; Parameters: "-Command ""Start-Process cmd \""/k cd {app} & {#MyAppName} service --help\"" -Verb RunAs"; Comment: "Install, start, stop, uninstall SFTPGo Service" -Name: "{group}\REST API CLI"; WorkingDir: "{app}\scripts"; Filename: "{cmd}"; Parameters: "/k sftpgo_api_cli.exe --help"; Comment: "Manage users and connections" -Name: "{group}\Documentation"; Filename: "https://github.com/drakkan/sftpgo/blob/0.9.6/README.md"; +Name: "{group}\REST API CLI"; WorkingDir: "{app}\examples"; Filename: "{cmd}"; Parameters: "/k sftpgo_api_cli.exe --help"; Comment: "Manage users and connections" +Name: "{group}\Documentation"; Filename: "https://github.com/drakkan/sftpgo/blob/master/README.md"; Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}" [Run]