Skip to content

Commit

Permalink
1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
anton-yurchenko committed Jan 29, 2022
1 parent 1dcd37d commit 5dc07ce
Show file tree
Hide file tree
Showing 8 changed files with 99 additions and 8 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,23 @@ jobs:
- name: Test
run: go test -v $(go list ./... | grep -v vendor | grep -v mocks) -race -coverprofile=coverage.txt -covermode=atomic

- name: Build
run: GOOS=linux GOARCH=amd64 go build -o ssh-manager
- name: Build AMD64
run: |
GOOS=linux GOARCH=amd64 go build -o ssh-manager
zip ssh-manager-linux-amd64.zip ssh-manager LICENSE.md
rm -f ssh-manager
- name: Pack
run: zip ssh-manager.zip ssh-manager LICENSE.md
- name: Build ARM64
run: |
GOOS=linux GOARCH=arm64 go build -o ssh-manager
zip ssh-manager-linux-arm64.zip ssh-manager LICENSE.md
rm -f ssh-manager
- name: Release
uses: docker://antonyurchenko/git-release:v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: ssh-manager.zip
args: |
ssh-manager-linux-amd64.zip
ssh-manager-linux-arm64.zip
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [1.1.0] - 2022-01-29
## Added
- Support ARM64 architecture

## Changed
- Updated dependencies

## [1.0.6] - 2021-07-28
## Changed
- Updated dependencies
Expand Down Expand Up @@ -35,6 +42,7 @@
## [1.0.0] - 2021-02-10
- First release

[1.1.0]: https://github.com/ReasonSoftware/ssh-manager/compare/v1.0.6...v1.1.0
[1.0.6]: https://github.com/ReasonSoftware/ssh-manager/compare/v1.0.5...v1.0.6
[1.0.5]: https://github.com/ReasonSoftware/ssh-manager/compare/v1.0.4...v1.0.5
[1.0.4]: https://github.com/ReasonSoftware/ssh-manager/compare/v1.0.3...v1.0.4
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- Only public SSH key is used, private key never leave user's workstation
- Leverage AWS IAM for service authentication
- SystemD Service
- Supports AMD64/ARM64

## Manual

Expand Down Expand Up @@ -119,8 +120,8 @@

### Installation

- Download installation script: `curl https://raw.githubusercontent.com/ReasonSoftware/ssh-manager/master/scripts/install.sh --output install.sh`
- Alternative script that relies on **crontab**: `curl https://raw.githubusercontent.com/ReasonSoftware/ssh-manager/master/scripts/install_cronjob.sh --output install.sh`
- Download installation script: `curl https://raw.githubusercontent.com/ReasonSoftware/ssh-manager/master/scripts/install.sh --output install.sh` (or `install_arm64.sh`)
- Alternative script that relies on **crontab**: `curl https://raw.githubusercontent.com/ReasonSoftware/ssh-manager/master/scripts/install_cronjob.sh --output install.sh` (or `install_cronjob_arm64.sh`)
- Execute with elevated privileges: `sudo bash install.sh`

<details><summary>:information_source: Manual Installation</summary>
Expand Down
2 changes: 1 addition & 1 deletion internal/app/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

// Version contains current application version
const Version string = "1.0.6"
const Version string = "1.1.0"

// Config represents a remote configuration
type Config struct {
Expand Down
1 change: 1 addition & 0 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ mkdir -p /var/lib/ssh-manager

wget $(curl -si https://api.github.com/repos/ReasonSoftware/ssh-manager/releases/latest | \
grep browser_download_url | \
grep linux-amd64 | \
awk -F': ' '{print $2}' | \
tr -d '"') -O /var/lib/ssh-manager/ssh-manager.zip

Expand Down
56 changes: 56 additions & 0 deletions scripts/install_arm64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/usr/bin/env bash
set -e

rm -rf /var/lib/ssh-manager
mkdir -p /var/lib/ssh-manager

wget $(curl -si https://api.github.com/repos/ReasonSoftware/ssh-manager/releases/latest | \
grep browser_download_url | \
grep linux-arm64 | \
awk -F': ' '{print $2}' | \
tr -d '"') -O /var/lib/ssh-manager/ssh-manager.zip

unzip -j /var/lib/ssh-manager/ssh-manager.zip -d /var/lib/ssh-manager
rm -f /var/lib/ssh-manager/ssh-manager.zip

SERVICE=$(cat <<-EOF
[Unit]
Description=Central SSH Management Service for AWS Linux EC2
Wants=network-online.target
After=network-online.target
[Service]
Type=oneshot
ExecStart=/var/lib/ssh-manager/ssh-manager
StandardOutput=journal
User=root
[Install]
WantedBy=multi-user.target
EOF
)

echo "$SERVICE" > /etc/systemd/system/ssh-manager.service

TIMER=$(cat <<-EOF
[Unit]
Description=Timer for Central SSH Management Service
Wants=network-online.target
After=network-online.target
[Timer]
Unit=ssh-manager.service
OnBootSec=1min
OnUnitInactiveSec=60min
Persistent=true
[Install]
WantedBy=multi-user.target
EOF
)

echo "$TIMER" > /etc/systemd/system/ssh-manager.timer

systemctl daemon-reload
systemctl enable ssh-manager.service
systemctl enable --now ssh-manager.timer
1 change: 1 addition & 0 deletions scripts/install_cronjob.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ mkdir -p /var/lib/ssh-manager

wget $(curl -si https://api.github.com/repos/ReasonSoftware/ssh-manager/releases/latest | \
grep browser_download_url | \
grep linux-amd64 | \
awk -F': ' '{print $2}' | \
tr -d '"') -O /var/lib/ssh-manager/ssh-manager.zip

Expand Down
16 changes: 16 additions & 0 deletions scripts/install_cronjob_arm64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -e

rm -rf /var/lib/ssh-manager
mkdir -p /var/lib/ssh-manager

wget $(curl -si https://api.github.com/repos/ReasonSoftware/ssh-manager/releases/latest | \
grep browser_download_url | \
grep linux-arm64 | \
awk -F': ' '{print $2}' | \
tr -d '"') -O /var/lib/ssh-manager/ssh-manager.zip

unzip -j /var/lib/ssh-manager/ssh-manager.zip -d /var/lib/ssh-manager
rm -f /var/lib/ssh-manager/ssh-manager.zip

(echo "0 * * * * bash -lc '/var/lib/ssh-manager/ssh-manager > /var/lib/ssh-manager/execution.log'") | crontab -

0 comments on commit 5dc07ce

Please sign in to comment.