Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pmalek/go_self_update_app
Self update app with simple REST API written in Go.
https://github.com/pmalek/go_self_update_app
Last synced: 6 days ago
JSON representation
Self update app with simple REST API written in Go.
- Host: GitHub
- URL: https://github.com/pmalek/go_self_update_app
- Owner: pmalek
- License: gpl-3.0
- Created: 2020-04-28T20:32:40.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-05-29T17:45:44.000Z (over 4 years ago)
- Last Synced: 2024-10-29T10:52:26.536Z (about 2 months ago)
- Language: Go
- Homepage:
- Size: 4.73 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go_self_update_app
## How to build
Adjust the `Version` constant in the `main.go` to match the one in the filename
### *nix and Mac OS
Build with:
```
go build -o server_v
```### Windows
Build with:
```
go build -o server_v.exe
```## Test
### With Docker
Assuming that we have built `server_v1` and `server_v2` we could test it
via docker like so:```
cd target/linux
docker run --rm -p 8080:8080 -v $(pwd):/app -w /app alpine ./server_v1
```## Assumptions
* Server binaries are assumed to have the following format:
* `server_v` for \*nix and Mac OS
* `server_v.exe` for Windows
* Version number is embedded in the binary with `Version` constant in `main.go`## Room for improvement
* Manage the version const and version embedded in filename better. Ideally hold
version only in one place. For the filesystem update provider we could store
version information in some metadata on the fs and embed the version information
in the server binary somehow instead of relying on using filenames.
* Locking: there's some unnecessary locking done in the handler. This is OK for PoC
but should be rethought when deployed.
* Custom javascript redirect (2s after clicking install new version) should add
some more visual indication that the update is underway and shouldn't rely on
constant time redirect but should rather periodically check if server is back up.