Skip to content

Commit

Permalink
add README
Browse files Browse the repository at this point in the history
  • Loading branch information
nitwhiz committed Feb 2, 2024
1 parent 7f90b1a commit 8986a88
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ jobs:

- name: Set up docker buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm/v7,linux/arm64

- name: Login to GitHub Packages
uses: docker/login-action@v2
Expand All @@ -37,6 +35,7 @@ jobs:
uses: docker/build-push-action@v5
if: ${{ github.ref_type == 'tag' }}
with:
platforms: linux/amd64,linux/arm/v7,linux/arm64
context: ./
tags: "ghcr.io/${{ github.repository }}:${{ github.ref_name }}"
push: true
Expand All @@ -45,6 +44,7 @@ jobs:
uses: docker/build-push-action@v4
if: ${{ github.ref_type != 'tag' }}
with:
platforms: linux/amd64,linux/arm/v7,linux/arm64
context: ./
tags: "ghcr.io/${{ github.repository }}:latest"
push: ${{ github.ref == 'refs/heads/main' }}
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
# omnilock

A zero dependency lock manager
A zero dependency locker.

## How does it work?

This locker uses TCP connections to keep track of locks.
This way, a lock is freed as soon as the locking process ends (some way or another) or it's unlocked explicitly.

## Protocol

1. Open a TCP connection to the omnilock server
2. Send a lock command through the established connection (e.g. `lock my_lock`)
3. Read the response, it may be either `success`, `failed` or `error: something went wrong`
4. Do your things on the client side
5. Either unlock the lock explicitly: `unlock my_lock` or just let the process exit so the OS closes the connection

Note: All commands and responses end with `\n` (newline).

## Usage as docker image

Start the server with:

```shell
docker run --rm -it -p 7194:7194 ghcr.io/nitwhiz/omnilock:lastest
```

And connect to it via port 7194.

0 comments on commit 8986a88

Please sign in to comment.