Skip to content

Commit

Permalink
Merge pull request #2638 from fatedier/dev
Browse files Browse the repository at this point in the history
bump version to v0.38.0
  • Loading branch information
fatedier authored Oct 25, 2021
2 parents 997d406 + 71489d1 commit 1437509
Show file tree
Hide file tree
Showing 53 changed files with 294 additions and 226 deletions.
6 changes: 2 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@ version: 2
jobs:
go-version-latest:
docker:
- image: circleci/golang:1.16-node
working_directory: /go/src/github.com/fatedier/frp
- image: cimg/go:1.17-node
steps:
- checkout
- run: make
- run: make alltest
go-version-last:
docker:
- image: circleci/golang:1.15-node
working_directory: /go/src/github.com/fatedier/frp
- image: cimg/go:1.16-node
steps:
- checkout
- run: make
Expand Down
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

github: [fatedier]
44 changes: 0 additions & 44 deletions .github/ISSUE_TEMPLATE/bug-report.md

This file was deleted.

77 changes: 77 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Bug report
description: Report a bug to help us improve frp

body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: textarea
id: bug-description
attributes:
label: Bug Description
description: Tell us what issues you ran into
placeholder: Include information about what you tried, what you expected to happen, and what actually happened. The more details, the better!
validations:
required: true
- type: input
id: frpc-version
attributes:
label: frpc Version
description: Include the output of `frpc -v`
validations:
required: true
- type: input
id: frps-version
attributes:
label: frps Version
description: Include the output of `frps -v`
validations:
required: true
- type: input
id: system-architecture
attributes:
label: System Architecture
description: Include which architecture you used, such as `linux/amd64`, `windows/amd64`
validations:
required: true
- type: textarea
id: config
attributes:
label: Configurations
description: Include what configurrations you used and ran into this problem
placeholder: Pay attention to hiding the token and password in your output
validations:
required: true
- type: textarea
id: log
attributes:
label: Logs
description: Prefer you providing releated error logs here
placeholder: Pay attention to hiding your personal informations
- type: textarea
id: steps-to-reproduce
attributes:
label: Steps to reproduce
description: How to reproduce it? It's important for us to find the bug
value: |
1.
2.
3.
...
- type: checkboxes
id: area
attributes:
label: Affected area
options:
- label: "Docs"
- label: "Installation"
- label: "Performance and Scalability"
- label: "Security"
- label: "User Experience"
- label: "Test and Release"
- label: "Developer Infrastructure"
- label: "Client Plugin"
- label: "Server Plugin"
- label: "Extensions"
- label: "Others"
4 changes: 0 additions & 4 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
blank_issues_enabled: false
contact_links:
- name: DOCS
url: https://github.com/fatedier/frp
about: Here you can find out how to configure frp.
22 changes: 0 additions & 22 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Feature Request
description: Suggest an idea to improve frp
title: "[Feature Request] "

body:
- type: markdown
attributes:
value: |
This is only used to request new product features.
- type: textarea
id: feature-request
attributes:
label: Describe the feature request
description: Tell us what's you want and why it should be added in frp.
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: Describe alternatives you've considered
- type: checkboxes
id: area
attributes:
label: Affected area
options:
- label: "Docs"
- label: "Installation"
- label: "Performance and Scalability"
- label: "Security"
- label: "User Experience"
- label: "Test and Release"
- label: "Developer Infrastructure"
- label: "Client Plugin"
- label: "Server Plugin"
- label: "Extensions"
- label: "Others"
2 changes: 1 addition & 1 deletion .github/workflows/build-and-push-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.17

- run: |
# https://github.com/actions/setup-go/issues/107
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.17

- run: |
# https://github.com/actions/setup-go/issues/107
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Issues go stale after 45d of inactivity. Stale issues rot after an additional 10d of inactivity and eventually close.'
stale-pr-message: 'Issues go stale after 45d of inactivity. Stale issues rot after an additional 10d of inactivity and eventually close.'
stale-issue-message: 'Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.'
stale-pr-message: 'Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.'
stale-issue-label: 'lifecycle/stale'
exempt-issue-labels: 'bug,doc,enhancement,future,proposal,question,testing,todo,easy,help wanted,assigned'
stale-pr-label: 'lifecycle/stale'
exempt-pr-labels: 'bug,doc,enhancement,future,proposal,question,testing,todo,easy,help wanted,assigned'
days-before-stale: 45
days-before-close: 10
days-before-stale: 30
days-before-close: 7
debug-only: ${{ github.event.inputs.debug-only }}
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ file:
rm -rf ./assets/frpc/static/*
cp -rf ./web/frps/dist/* ./assets/frps/static
cp -rf ./web/frpc/dist/* ./assets/frpc/static
rm -rf ./assets/frps/statik
rm -rf ./assets/frpc/statik
go generate ./assets/...

fmt:
go fmt ./...
Expand Down
11 changes: 7 additions & 4 deletions Release.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
### Fix
### New

* Plugin `https2https` not work.
* `context canceled` problem for `http_proxy` plugin when multiple requests reuse same connection.
* In some cases, frps can't get server name for `https` proxy.
* Add `/healthz` API.
* frpc support `disable_custom_tls_first_byte` .If set true, frpc will not send custom header byte.

### Improve

* Use go standard embed package instead of statik.
49 changes: 10 additions & 39 deletions assets/assets.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,15 @@

package assets

//go:generate statik -src=./frps/static -dest=./frps
//go:generate statik -src=./frpc/static -dest=./frpc
//go:generate go fmt ./frps/statik/statik.go
//go:generate go fmt ./frpc/statik/statik.go

import (
"io/ioutil"
"io/fs"
"net/http"
"os"
"path"

"github.com/rakyll/statik/fs"
)

var (
// store static files in memory by statik
// read-only filesystem created by "embed" for embedded files
content fs.FS

FileSystem http.FileSystem

// if prefix is not empty, we get file content from disk
Expand All @@ -38,40 +31,18 @@ var (

// if path is empty, load assets in memory
// or set FileSystem using disk files
func Load(path string) (err error) {
func Load(path string) {
prefixPath = path
if prefixPath != "" {
FileSystem = http.Dir(prefixPath)
return nil
} else {
FileSystem, err = fs.New()
FileSystem = http.FS(content)
}
return err
}

func ReadFile(file string) (content string, err error) {
if prefixPath == "" {
file, err := FileSystem.Open(path.Join("/", file))
if err != nil {
return content, err
}
defer file.Close()
buf, err := ioutil.ReadAll(file)
if err != nil {
return content, err
}
content = string(buf)
} else {
file, err := os.Open(path.Join(prefixPath, file))
if err != nil {
return content, err
}
defer file.Close()
buf, err := ioutil.ReadAll(file)
if err != nil {
return content, err
}
content = string(buf)
func Register(fileSystem fs.FS) {
subFs, err := fs.Sub(fileSystem, "static")
if err == nil {
content = subFs
}
return content, err
}
14 changes: 14 additions & 0 deletions assets/frpc/embed.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package frpc

import (
"embed"

"github.com/fatedier/frp/assets"
)

//go:embed static/*
var content embed.FS

func init() {
assets.Register(content)
}
10 changes: 0 additions & 10 deletions assets/frpc/statik/statik.go

This file was deleted.

14 changes: 14 additions & 0 deletions assets/frps/embed.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package frpc

import (
"embed"

"github.com/fatedier/frp/assets"
)

//go:embed static/*
var content embed.FS

func init() {
assets.Register(content)
}
10 changes: 0 additions & 10 deletions assets/frps/statik/statik.go

This file was deleted.

3 changes: 2 additions & 1 deletion client/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ func (svr *Service) RunAdminServer(address string) (err error) {
user, passwd := svr.cfg.AdminUser, svr.cfg.AdminPwd
router.Use(frpNet.NewHTTPAuthMiddleware(user, passwd).Middleware)

// api, see dashboard_api.go
// api, see admin_api.go
router.HandleFunc("/healthz", svr.healthz)
router.HandleFunc("/api/reload", svr.apiReload).Methods("GET")
router.HandleFunc("/api/status", svr.apiStatus).Methods("GET")
router.HandleFunc("/api/config", svr.apiGetConfig).Methods("GET")
Expand Down
Loading

0 comments on commit 1437509

Please sign in to comment.