Browse Source

move REST API CLI in examples directory

Signed-off-by: Nicola Murino <[email protected]>
Nicola Murino 5 years ago
parent
commit
7ae8b2cdeb

+ 1 - 1
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.

+ 1 - 1
docker/rest-api-cli/Dockerfile

@@ -2,7 +2,7 @@ FROM debian:latest
 LABEL maintainer="[email protected]"
 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 []

+ 1 - 1
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

+ 1 - 1
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/)

+ 2 - 2
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

+ 0 - 0
scripts/README.md → examples/rest-api-cli/README.md


+ 0 - 0
scripts/sftpgo_api_cli.py → examples/rest-api-cli/sftpgo_api_cli.py


+ 3 - 4
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]