diff --git a/.goreleaser.yml b/.goreleaser.yml index 69bd7fd26c..a148b75f18 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -103,7 +103,7 @@ builds: archives: - format: tar.gz wrap_in_directory: false - name_template: 'skywire-v{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' + name_template: 'skywire-v{{ .Version }}-{{ .Os }}-{{ .Arch }}' checksum: name_template: 'checksums.txt' snapshot: diff --git a/CHANGELOG.md b/CHANGELOG.md index 99e8daa5a8..a82107520d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,22 +4,32 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## [Unreleased] +## 0.2.1 - 2020.04.07 + +### Changed + +- reverted port changes for `skysocks-client` + +## 0.2.0 - 2020.04.02 ### Added -- Retry logic to messaging server for messaging client. +- added `--retain-keys` flag to `skywire-cli visor gen-config` command +- added `--secret-key` flag to `skywire-cli visor gen-config` command +- added hypervisorUI frontend +- added default values for visor if certain fields of config are empty ### Fixed -- Fixed channel collision for messaging clients. +- fixed deployment route finder HTTP request +- fixed /user endpoint not working when auth is disabled ### Changed -- Improve readability of Skywire CLI output. - -## 0.1.0 - 2019.03.04 +- changed port of hypervisorUI and applications +- replaced unix sockets for app to visor communication to tcp sockets +- reverted asynchronous sending of router packets -### Added +## 0.1.0 - 2020.04.02 -- First release of the mainnet Skywire visor and apps for testing. +First release of Skywire Mainnet. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 2ef2729d01..0000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,9 +0,0 @@ -# How to help: - -Interested developers can help by running the software and using the applications to test the functionality. They can file bug -issues in case something is not working. Bug issues should include a description of the bug, steps to reproduce and should -have [Mainnet] in the title so they can be filtered more easily. We will fix bugs as soon as possible. - -As soon as the documentation is released, we will provide guides on how to help the development of Skywire, whether it is a -new transport implementation or an application developed on Skywire. Bounties will be available for completion of certain -tasks. diff --git a/cmd/hypervisor/README.md b/cmd/hypervisor/README.md index d37a25be4d..697e45c958 100644 --- a/cmd/hypervisor/README.md +++ b/cmd/hypervisor/README.md @@ -22,7 +22,7 @@ Endpoints are documented in the provided [Postman](https://www.getpostman.com/) ## Web UI -UI is served on the same port as the API (`:8000` by default). Directory to search for the build frontend is passed in the `web_dir` field of the hypervisor's config. +UI is served on the same port as the API (`:8000` by default). ### Authentication information diff --git a/mainnet_rules.md b/mainnet_rules.md index ac8c01b9f6..f284d9d209 100644 --- a/mainnet_rules.md +++ b/mainnet_rules.md @@ -55,6 +55,7 @@ Different locations are required due to the fact that we want to spread out the ## Rewards
+* During the migration period, the pool sizes of the ending Skywire testnet and the recently launched Skywire mainnet are one and the same. With that said, the generated uptime in either the Skywire test- or mainnet are being added together with respect to the 75% uptime requirement. * Eligible for rewards are only the whitelisted nodes, that **comply with the Skywire mainnet rules** and **meet the 75% uptime requirement** during the month. * The whitelist is being **updated retroactively on a monthly basis** so it is **not important** in which week you are being approved for the whitelist. * **Official Skyminers are whitelisted by default after purchase.** diff --git a/pkg/util/pathutil/util.go b/pkg/util/pathutil/util.go index 56b0487db5..d3dc14613b 100644 --- a/pkg/util/pathutil/util.go +++ b/pkg/util/pathutil/util.go @@ -5,6 +5,8 @@ import ( "io/ioutil" "os" "path/filepath" + + "github.com/SkycoinProject/skywire-mainnet/pkg/util/rename" ) const ( @@ -43,7 +45,7 @@ func AtomicWriteFile(filename string, data []byte) error { return err } - if err := os.Rename(tempFilePath, filename); err != nil { + if err := rename.Rename(tempFilePath, filename); err != nil { return err } diff --git a/pkg/util/rename/rename.go b/pkg/util/rename/rename.go new file mode 100644 index 0000000000..75d6b8e600 --- /dev/null +++ b/pkg/util/rename/rename.go @@ -0,0 +1,73 @@ +package rename + +import ( + "fmt" + "io" + "log" + "os" +) + +const crossDeviceError = "invalid cross-device link" + +// Rename renames (moves) oldPath to newPath using os.Rename. +// If paths are located on different drives or filesystems, os.Rename fails. +// In that case, Rename uses a workaround by copying oldPath to newPath and removing oldPath thereafter. +func Rename(oldPath, newPath string) error { + if err := os.Rename(oldPath, newPath); err == nil || err.Error() != crossDeviceError { + return err + } + + stat, err := os.Stat(oldPath) + if err != nil { + return fmt.Errorf("stat: %w", err) + } + + if !stat.Mode().IsRegular() { + return fmt.Errorf("is regular: %w", err) + } + + // Paths are located on different devices. + if err := move(oldPath, newPath); err != nil { + return fmt.Errorf("move: %w", err) + } + + if err := os.Chmod(newPath, stat.Mode()); err != nil { + return fmt.Errorf("chmod: %w", err) + } + + if err := os.Remove(oldPath); err != nil { + return fmt.Errorf("remove: %w", err) + } + + return nil +} + +func move(oldPath string, newPath string) error { + inputFile, err := os.Open(oldPath) // nolint:gosec + if err != nil { + return fmt.Errorf("open: %w", err) + } + + defer func() { + if err := inputFile.Close(); err != nil { + log.Printf("Failed to close file %q: %v", inputFile.Name(), err) + } + }() + + outputFile, err := os.Create(newPath) + if err != nil { + return fmt.Errorf("create: %w", err) + } + + defer func() { + if err := outputFile.Close(); err != nil { + log.Printf("Failed to close file %q: %v", outputFile.Name(), err) + } + }() + + if _, err = io.Copy(outputFile, inputFile); err != nil { + return fmt.Errorf("copy: %w", err) + } + + return nil +} diff --git a/pkg/util/updater/updater.go b/pkg/util/updater/updater.go index 9e76a742b3..275d54500f 100644 --- a/pkg/util/updater/updater.go +++ b/pkg/util/updater/updater.go @@ -24,6 +24,7 @@ import ( "github.com/SkycoinProject/skywire-mainnet/pkg/restart" "github.com/SkycoinProject/skywire-mainnet/pkg/util/buildinfo" + "github.com/SkycoinProject/skywire-mainnet/pkg/util/rename" ) const ( @@ -180,13 +181,13 @@ func (u *Updater) updateBinary(downloadedBinariesPath, basePath, binary string) } } - if err := os.Rename(currentBinaryPath, oldBinaryPath); err != nil { + if err := rename.Rename(currentBinaryPath, oldBinaryPath); err != nil { return fmt.Errorf("rename %s to %s: %w", currentBinaryPath, oldBinaryPath, err) } - if err := os.Rename(downloadedBinaryPath, currentBinaryPath); err != nil { - // Try to revert previous os.Rename - if err := os.Rename(oldBinaryPath, currentBinaryPath); err != nil { + if err := rename.Rename(downloadedBinaryPath, currentBinaryPath); err != nil { + // Try to revert previous rename. + if err := rename.Rename(oldBinaryPath, currentBinaryPath); err != nil { u.log.Errorf("Failed to rename file %q to %q: %v", oldBinaryPath, currentBinaryPath, err) } @@ -201,7 +202,7 @@ func (u *Updater) updateBinary(downloadedBinariesPath, basePath, binary string) func (u *Updater) restore(currentBinaryPath string, toBeRemoved string) { u.removeFiles(currentBinaryPath) - if err := os.Rename(toBeRemoved, currentBinaryPath); err != nil { + if err := rename.Rename(toBeRemoved, currentBinaryPath); err != nil { u.log.Errorf("Failed to rename file %q to %q: %v", toBeRemoved, currentBinaryPath, err) } } diff --git a/static/skywire-manager-src/README.md b/static/skywire-manager-src/README.md index 1666530652..cf1a4b7473 100644 --- a/static/skywire-manager-src/README.md +++ b/static/skywire-manager-src/README.md @@ -1,8 +1,6 @@ # Skywire Manager -Frontend application that allows to manage a group of Skywire nodes through a Hypervisor instance. - -Note: The software is still under heavy development and the current version is intended for public testing purposes only. +Frontend application that allows to manage a group of Skywire visors through a Hypervisor instance. ## Prerequisites @@ -38,7 +36,7 @@ change any of the source files. ## Build -Run `npm run build` to build the project. The build artifacts will be stored in the `dist/` directory. +Run `make build-ui` in the top directory of this repo to rebuild the UI. The build artifacts will be stored in the `dist/` directory. ## Translations