Skip to content

Commit

Permalink
dockerhub image and readme improved
Browse files Browse the repository at this point in the history
  • Loading branch information
r7wx committed Apr 30, 2022
1 parent c59f727 commit 042e62d
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 7 deletions.
125 changes: 120 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,145 @@

<img src="assets/screenshot.png" />

Easy Gate is a simple web application built in Go and React that acts as the home page for your self-hosted infrastructure. Services and notes are parsed from a JSON file in real-time (without restarting the application). Services and notes can be assigned to one or more groups to show items only to specific users (based on their connecting IP addresses).
<p align="justify">
Easy Gate is a simple web application built in Go and React that acts as the home page for your self-hosted infrastructure. Services and notes are parsed from a JSON file in real-time (without restarting the application). Services and notes can be assigned to one or more groups to show items only to specific users (based on their IP addresses).
</p>

## Deployment

<p align="justify">
Easy Gate can be deployed on any server that supports Docker. If your infrastructure is running behind a configured nginx instance, it is recommended to read the **Docker Compose (with nginx)** section.
</p>

### Docker

<p align="justify">
You can deploy an instance of easy-gate by using docker:
</p>

```bash
todo
docker run -d --name=easy-gate \
-p 8080:8080 \
-v /path/to/easy-gate.json:/etc/easy-gate/easy-gate.json \
--restart unless-stopped \
r7wx/easy-gate
```

### Docker Compose

You can also run easy-gate by using the provided docker-compose file:

```bash
todo
docker-compose up
```

### Docker Compose (with nginx)

<p align="justify">
If you need to host easy-gate behind an already installed nginx instance, you can use the docker-compose file in the examples directory:
</p>

```bash
easy-gate:
image: r7wx/easy-gate:latest
container_name: easy-gate
expose:
- 8080
networks:
- nginx-net
volumes:
- ../easy-gate.json:/etc/easy-gate/easy-gate.json
- ./easy-gate.nginx.conf:/etc/nginx/conf.d/default.conf

[...]
```

<p align="justify">
In order to correctly use the groups feature you must bind another file to the easy-gate container: ./easy-gate.nginx.conf:/etc/nginx/conf.d/default.conf. This file will overwrite the internal easy-gate nginx configuration in order to forward requests headers:
</p>

```bash
todo
[...]
location / {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://easy-gate:8080;
}
[...]
```

You can find the complete file in the examples directory.

## Configuration

todo
<p align="justify">
Easy gate can be configured by the easy-gate.json file. An illustrative configuration file is provided in the root directory of this repository (easy-gate.json).
</p>

### Groups

<p align="justify">
Group entries are used to define which users can see which items, by providing the user subnet:
</p>

```json
"groups": [
{
"name": "internal",
"subnet": "192.168.1.1/24"
},
{
"name": "vpn",
"subnet": "10.8.1.1/24"
}
]
```

### Services

<p align="justify">
A service entry is used to define a service that is available in the infrastructure. Each service has a name, an url, an icon and the groups that can see it (defined in the groups section). If no group is provided the item can be seen by all users:
</p>

```json
{
"icon": "fa-brands fa-git-square",
"name": "Git",
"url": "https://git.example.vpn",
"groups": [
"vpn"
]
},
{
"icon": "fa-brands fa-docker",
"name": "Portainer",
"url": "https://portainer.example.internal",
"groups": []
}
```

### Notes

<p align="justify">
A note entry is used to define a simple text note which has a title and a content. Each note has a name, the note content (text) and the groups that can see it (defined in the groups section). If no group is provided the item can be seen by all users:
</p>

```json
{
"name": "Simple note",
"text": "This is a simple note for vpn users",
"groups": [
"vpn"
]
},
{
"name": "Global note",
"text": "This note will be visible to everyone",
"groups": []
}
```

### Icons

Icons are provided by the [Font Awesome](https://fontawesome.com/icons?d=gallery) library. Get the appropriate icon name by using the Font Awesome website (only free icons are available).
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
services:
easy-gate:
image: r7wx/easy-gate:latest
build: .
container_name: easy-gate
ports:
Expand Down
2 changes: 1 addition & 1 deletion easy-gate.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"groups": [
{
"name": "internal",
"subnet": "192.168.50.1/24"
"subnet": "192.168.1.1/24"
},
{
"name": "vpn",
Expand Down
2 changes: 1 addition & 1 deletion examples/docker-compose.nginx.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
easy-gate:
build: ../.
image: r7wx/easy-gate:latest
container_name: easy-gate
expose:
- 8080
Expand Down

0 comments on commit 042e62d

Please sign in to comment.