Skip to content

Commit

Permalink
Merge pull request #58 from seashell/dev
Browse files Browse the repository at this point in the history
dev
  • Loading branch information
edufschmidt committed Jun 20, 2021
2 parents 5f20868 + 8a236bb commit 497212e
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 22 deletions.
5 changes: 2 additions & 3 deletions docs/_coverpage.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@
- Single-binary, lightweight
- Encrypted node-to-node communication
- Dynamic network configuration
- Support for userspace WireGuard implementations
- Extensible via REST API
- Support for different WireGuard implementations
- Slick management dashboard
- Extensible via REST API

[GitHub](https://github.com/seashell/drago/)
[Get Started](/docs/)
Expand Down
2 changes: 1 addition & 1 deletion docs/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* acl
* [Overview](/docs/commands/acl/)
* [bootstrap](/docs/commands/acl/bootstrap)
* [policy upsert](/docs/commands/acl/policy-upsert)
* [policy apply](/docs/commands/acl/policy-apply)
* [policy delete](/docs/commands/acl/policy-delete)
* [policy list](/docs/commands/acl/policy-list)
* [policy info](/docs/commands/acl/policy-info)
Expand Down
4 changes: 4 additions & 0 deletions docs/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
background: var(--background)!important;
}

li:not(:last-child){
margin-bottom: 10px;
}

/* ----------------- Cover -----------------*/
section.cover .cover-main>p{
margin-top: 32px;
Expand Down
9 changes: 7 additions & 2 deletions docs/docs/commands/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# Drago Commands (CLI)

Drago is controlled via a very easy to use command-line interface (CLI). Drago is only a single command-line application: drago, which takes a subcommand such as "agent" or "status". The complete list of subcommands is in the navigation to the left.

To view a list of the available commands at any time, just run Drago with no arguments. To get help for any specific subcommand, run the subcommand with the -h argument.
Drago is controlled via a very easy to use command-line interface (CLI). Drago is only a single command-line application: `drago`, which takes subcommands such as `agent` or `status`. The complete list of subcommands is in the navigation to the left.

The Drago CLI is a well-behaved command line application. In erroneous cases, a non-zero exit status will be returned. It also responds to `-h` and `--help` as you would most likely expect.

To view a list of the available commands at any time, just run Drago with no arguments. To get help for any specific subcommand, run the subcommand with the `-h` argument.

Each command has been conveniently documented on this website. Links to each command can be found on the left.

### Remote usage

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/commands/acl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Run `drago acl <subcommand> [options] -h` for help on a specific subcommand.
Available subcommands:

- [`acl bootstrap`](/docs/commands/acl/bootstrap): Bootstrap the ACL system
- [`acl policy upsert`](/docs/commands/acl/policy-upsert): Create or update an ACL policy
- [`acl policy apply`](/docs/commands/acl/policy-apply): Create or update an ACL policy
- [`acl policy delete`](/docs/commands/acl/policy-delete): Delete an existing ACL policy
- [`acl policy info`](/docs/commands/acl/policy-info): Display info on an existing ACL policy
- [`acl policy list`](/docs/commands/acl/policy-list): List available ACL policies
Expand Down
14 changes: 5 additions & 9 deletions docs/docs/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
> This section is still a work-in-progress. If you think you can contribute, please see our [contribution guidelines](docs/../../../contributing.md).

Drago is a flexible configuration manager for WireGuard networks which is designed to make it simple to configure network overlays spanning heterogeneous nodes distributed across different clouds and physical locations.
Drago is a flexible configuration manager for WireGuard networks that is designed to make it simple to configure network overlays spanning heterogeneous nodes distributed across different clouds and physical locations.

Drago is meant to be simple, and provide a solid foundation for higher-level functionality. Need automatic IP assignment, dynamic firewall rules, or some kind of telemetry? You are free to implement on top of the already existing APIs.
Drago is meant to be simple and provide a solid foundation for higher-level functionality. Need automatic IP assignment, dynamic firewall rules, or some kind of telemetry? You are free to implement it on top of the already existing APIs.

## Use-cases

Expand All @@ -20,11 +20,7 @@ Drago is meant to be simple, and provide a solid foundation for higher-level fun
## Main features

- Single-binary, lightweight
- Slick management dashboard
- Encrypted node-to-node communication
- Support for multiple storage backends
- Support for userspace WireGuard implementations
- Dynamic network configuration
- Automatic key rotation
- Extensible via REST API
- Automatic IP assignment
- Support for different WireGuard implementations
- Slick management dashboard
- Extensible via REST API
4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ <h3> Drago </h3>
highlightColor: "#00eeee",
codeTypeColor: "#ffffff",
codeTextColor: "#ffffff",
codeBackgroudColor: "#111",
codeBackgroundColor: "#111",
borderColor: "#444444",
blockQuoteColour: "#858585",
sidebarSublink: "#b4b4b4",
Expand All @@ -97,7 +97,7 @@ <h3> Drago </h3>
background: "#ffffff",
textColor: "#000000",
codeTextColor: "#525252",
codeBackgroudColor: "#f8f8f8",
codeBackgroundColor: "#f8f8f8",
borderColor: "rgba(0, 0, 0, 0.07)",
blockQuoteColor: "#858585",
sidebarSublink: "#000000",
Expand Down
16 changes: 15 additions & 1 deletion drago/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,23 @@ func (s *NetworkService) UpsertNetwork(args *structs.NetworkUpsertRequest, out *
return structs.NewInvalidInputError(err.Error())
}

if n.ID == "" {
isNewNetwork := n.ID == ""

if isNewNetwork {
n.ID = uuid.Generate()
n.CreatedAt = time.Now()

networks, err := s.state.Networks(ctx)
if err != nil {
return structs.NewInternalError(err.Error())
}

for _, net := range networks {
if net.Name == n.Name {
return structs.NewInvalidInputError("network name already in use")
}
}

} else {
old, err := s.state.NetworkByID(ctx, n.ID)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions ui/src/views/clients/details/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,14 @@ const ClientDetails = () => {
const handleConnectionChange = (id, values) => {
const connection = {
id,
PeerSettings: {
[values.interfaceId]: {
PeerSettings: [
{
InterfaceID: values.interfaceId,
RoutingRules: {
AllowedIPs: values.allowedIPs,
},
},
},
],
persistentKeepalive: values.persistentKeepalive,
}

Expand Down

0 comments on commit 497212e

Please sign in to comment.