Skip to content

Commit

Permalink
Merge pull request #52 from anikitenko/staging
Browse files Browse the repository at this point in the history
Release 1.0.0
  • Loading branch information
anikitenko authored Jun 26, 2018
2 parents e19e16a + b31f749 commit 6199266
Show file tree
Hide file tree
Showing 37 changed files with 1,118 additions and 206 deletions.
7 changes: 7 additions & 0 deletions .github/ISSUE_TEMPLATE/custom.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: Custom issue template
about: Describe this issue template's purpose here.

---


17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ run/vendor/*/
node_modules/
log/
cypress/videos/
cypress/screenshots/
cypress/screenshots/
docs/
run/run.exe
9 changes: 8 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,23 @@ before_install: if [[ `npm -v` != 5.7* ]]; then npm i -g npm@5; fi
install:
- go get -v github.com/revel/cmd/revel
- go get -v github.com/kardianos/govendor
- go get -v github.com/swaggo/swag/cmd/swag
- npm ci
- govendor sync
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
sed -i '' "s/\/\/ @version 1.0.0/\/\/ @version $TRAVIS_TAG/" app/controllers/api_v1.go
else
sed -i "s/\/\/ @version 1.0.0/\/\/ @version $TRAVIS_TAG/g" app/controllers/api_v1.go
fi
- swag init -g api_v1.go -d app/controllers

before_script:
- revel run github.com/anikitenko/mini-sftp-client &

script:
- "$(npm bin)/cypress run --record"
- kill $(jobs -p) || true
- go build -o ./run/run.tmp ./run
- |
if [[ "$TRAVIS_OS_NAME" == "osx" && "$TRAVIS_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-.+)?$ ]]; then
echo "Will be releasing!"
Expand Down
16 changes: 16 additions & 0 deletions API_REFERENCE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Mini sFTP client API

### API was created using Swagger

In order to see detailed reference you should navigate
to http://127.0.0.1:9000/api/v1

API has the following endpoints:
* PUT /connect
* DELETE /disconnect/{id}
* GET /download/{id}
* GET /getConnections
* GET /getLocalHomeDirectory
* GET /getLocalPathCompletion
* GET /getRemoteHomeDirectory/{id}
* GET /getRemotePathCompletion/{id}
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [v1.0.0](#v100)
Features:
* Added API support (see [reference](https://github.com/anikitenko/mini-sftp-client/blob/master/API_REFERENCE.md))

Fixes:
* Various bug fixes

## [v1.0.0-RC4](#v100-rc4)
Features:
* Added docker support
Expand Down
17 changes: 17 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## How to contribute to sFTP client

#### **Did you find a bug?**

Okay then, open a new issue and select template "Bug"

#### **Did you find a security issue?**

Please open a new issue with information about how to reproduce it

#### **Did you write a patch that fixes a bug?**

* Open a new GitHub pull request with the patch.
* Please fill in template about new pull request

#### **Other information**
* Branches master & staging are protected against writes without pull requests
38 changes: 21 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
[![Build Status](https://travis-ci.org/anikitenko/mini-sftp-client.svg?branch=staging)](https://travis-ci.org/anikitenko/mini-sftp-client)
[![CodeFactor](https://www.codefactor.io/repository/github/anikitenko/mini-sftp-client/badge)](https://www.codefactor.io/repository/github/anikitenko/mini-sftp-client)

This is a mini web based sFTP client written on Go using Revel Framework
This is a mini web based sFTP client written on Go
using Revel Framework with API support

## Quick Start

Expand All @@ -23,12 +24,25 @@ and pickup the latest version for your OS
- [x] Nothing to install: unzip and run. Use different tabs for different connections
- [x] Runs on Linux, OS X, Windows
- [x] Run client for all interfaces and access client from mobile device and manage files
- [x] Run client on your file server (possible Linux based, Windows, OS X) and access from your desktop or mobile
- [x] Run client on your file server (possible Linux based, Windows, OS X) and manage files from your desktop
- [x] Access client from your mobile and manage files on your desktop
- [x] API support ([reference](https://github.com/anikitenko/mini-sftp-client/blob/staging/API_REFERENCE.md))
- [x] Docker support ([see below](#want-to-run-as-a-docker-image))

## Security
Trying to access client from public network (not from localhost) is only possible with pin code. Pin code is shown in the top right corner of the page and in client logs. Pin code is generated each time you start the client and is stored in memory.

### Want to run as a docker image?
#### Run from Docker hub:

docker pull anikitenko/mini-sftp-client
docker run -p <local port>:9000 --rm anikitenko/mini-sftp-client

Tags:
* latest: staging branch
* stable: master branch
* vx.x.x: tags in repository

#### Build from sources:

Get mini sftp client:
Expand All @@ -42,16 +56,6 @@ Build:
Run:

docker run -p <local port>:9000 --rm mini-sftp-client

#### Run from Docker hub:

docker pull anikitenko/mini-sftp-client
docker run --rm anikitenko/mini-sftp-client

Tags:
* latest: staging branch
* stable: master branch
* vx.x.x: tags in repository

### Run client from sources

Expand Down Expand Up @@ -82,7 +86,7 @@ Run client:

Once you navigate to http://127.0.0.1:9000 you should see the following screen:

![first screen](https://github.com/anikitenko/mini-sftp-client/blob/master/doc-images/first-screen.png)
![first screen](https://github.com/anikitenko/mini-sftp-client/raw/staging/doc-images/first-screen.png)

##### Notes:
* If you are able to authenticate without password on your server, you may ignore that field
Expand All @@ -94,7 +98,7 @@ you will be able to distinguish different connections

##### Establishing connection:

![connecting](https://github.com/anikitenko/mini-sftp-client/blob/master/doc-images/connecting.png)
![connecting](https://github.com/anikitenko/mini-sftp-client/raw/staging/doc-images/connecting.png)

##### Notes:
* After you successfully established connection, client will try to detect home directories no matter what is your local OS
Expand All @@ -103,17 +107,17 @@ you will be able to distinguish different connections
for another, input data remains and button to ReConnect also remains,
so silly click on it will cause all data to load from your another server

![like double tab](https://github.com/anikitenko/mini-sftp-client/blob/master/doc-images/like-double-tab.gif)
![like double tab](https://github.com/anikitenko/mini-sftp-client/raw/staging/doc-images/like-double-tab.gif)


![like double tab local](https://github.com/anikitenko/mini-sftp-client/blob/master/doc-images/like-double-tab-local.gif)
![like double tab local](https://github.com/anikitenko/mini-sftp-client/raw/staging/doc-images/like-double-tab-local.gif)

##### Notes:
* "Like double tab" works on Windows, OS X and Linux OS

##### Downloading files and using search:

![download and search](https://github.com/anikitenko/mini-sftp-client/blob/master/doc-images/download-search.gif)
![download and search](https://github.com/anikitenko/mini-sftp-client/raw/staging/doc-images/download-search.gif)

##### Notes:
* Search works the same for remote files as for local
Expand Down
23 changes: 23 additions & 0 deletions app/controllers/api_v1.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package controllers

import (
"github.com/revel/revel"
)

type ApiV1 struct {
*revel.Controller
}

// @title Mini sFTP client API
// @version 1.0.0
// @description This API was created to automate your work with sFTP client

// @license.name MIT
// @license.url https://github.com/anikitenko/mini-sftp-client/blob/staging/LICENSE

// @host 127.0.0.1:9000
// @BasePath /api/v1

func (c ApiV1) Help() revel.Result {
return c.Redirect("/api/v1/index.html")
}
24 changes: 24 additions & 0 deletions app/controllers/api_v1_DELETE.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package controllers

import "github.com/revel/revel"

// @Summary Disconnect
// @Description remove stored connection
// @ID disconnect
// @Accept json
// @Produce json
// @Param id path string true "Connection ID"
// @Success 200 {object} controllers.GeneralResponse "Success"
// @Failure 403 {string} string "Not authorized!"
// @Router /disconnect/{id} [delete]
func (c ApiV1) Disconnect(id string) revel.Result {
if _, ok := ApiConnections[id]; !ok {
response := CompileJSONResult(false, "Connection does not exist!")
return c.RenderJSON(response)
}

delete(ApiConnections, id)

response := CompileJSONResult(true, "")
return c.RenderJSON(response)
}
Loading

0 comments on commit 6199266

Please sign in to comment.