Skip to content

Commit

Permalink
add ci and update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
nomionz committed Jan 31, 2024
1 parent 29b44ac commit ca6c151
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 10 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/build_push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Build and Publish Release

on:
push:
tags:
- '*'

env:
ARTIFACT_NAME: "fsenc"

jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 'stable'

- name: Build project
shell: bash
run: |
if [ "${{ matrix.os }}" = "windows-latest" ]; then
go build -o ${{ env.ARTIFACT_NAME }}.exe
else
go build -o ${{ env.ARTIFACT_NAME }}
fi
- name: Install 7zip (Windows)
if: matrix.os == 'windows-latest'
run: |
choco install 7zip
- name: Archive production artifacts
shell: bash
run: |
if [ "${{ matrix.os }}" = "windows-latest" ]; then
7z a ${{ env.ARTIFACT_NAME }}.zip ./${{ env.ARTIFACT_NAME }}.exe
else
tar -czvf ${{ env.ARTIFACT_NAME }}.tar.gz ./${{ env.ARTIFACT_NAME }}
fi
- name: Upload production artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-artifact
retention-days: 1
path: |
${{ env.ARTIFACT_NAME }}${{ matrix.os == 'windows-latest' && '.zip' || '.tar.gz' }}
- run: ls -R

release:
needs: build
runs-on: ubuntu-latest

steps:
- name: Download all artifacts
uses: actions/download-artifact@v4

- run: ls -R

- name: Upload Artifacts to Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: './*-artifact/*'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22 changes: 13 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
# fs-enc
CLI tool to encrypt and decrypt files with passphrase
# FSENC
FSENC is a lightweight, command-line interface tool designed for encrypting and decrypting files using a passphrase. It's an ideal solution for those who need to secure individual files containing sensitive information without the overhead of encrypting their entire filesystem.

## Why?
### Download from [Releases](https://github.com/nomionz/test/releases/)

One of my use cases is to encrypt files stored in the **home** directory that may contain sensitive information.
## Why FSENC?

I don't need to encrypt the whole file system, just a couple of files.
- Selective Encryption: Perfect for encrypting specific files in your home directory or any other location, ensuring sensitive information is kept private.
- Ease of Use: A straightforward CLI tool, making file encryption and decryption as simple as a single command.
- Security: Uses robust encryption algorithms to secure your files, safeguarding them against unauthorized access.

## Usage

## Encrypt
## Encrypting a File
To encrypt a file, use the enc command followed by the file path and a passphrase of your choice:
```bash
fs-enc enc <filepath> <passphrase>
fsenc enc <filepath> <passphrase>
```

## Decrypt
## Decrypting a File
To decrypt an encrypted file, use the dec command followed by the file path and the correct passphrase:
```bash
fs-enc dec <filepath> <passphrase>
fsenc dec <filepath> <passphrase>
```
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/nomionz/fs-enc

go 1.21.2
go 1.21

require golang.org/x/crypto v0.18.0

Expand Down

0 comments on commit ca6c151

Please sign in to comment.