Skip to content

Commit

Permalink
added support of digitalocean
Browse files Browse the repository at this point in the history
  • Loading branch information
mlabouardy committed Jul 25, 2019
1 parent 7d73c8a commit 8b9d8e4
Show file tree
Hide file tree
Showing 109 changed files with 10,187 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ jobs:
chmod +x komiser_windows_amd64.exe komiser_darwin_amd64 komiser_linux_amd64
- run:
name: Push Linux binary
command: aws s3 cp komiser_linux_amd64 s3://komiser/2.3.0/linux/komiser --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers
command: aws s3 cp komiser_linux_amd64 s3://komiser/2.4.0/linux/komiser --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers
- run:
name: Push Windows binary
command: aws s3 cp komiser_windows_amd64.exe s3://komiser/2.3.0/windows/komiser --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers
command: aws s3 cp komiser_windows_amd64.exe s3://komiser/2.4.0/windows/komiser --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers
- run:
name: Push Mac OS X binary
command: aws s3 cp komiser_darwin_amd64 s3://komiser/2.3.0/osx/komiser --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers
command: aws s3 cp komiser_darwin_amd64 s3://komiser/2.4.0/osx/komiser --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers
- run:
name: Upload IAM policy
command: aws s3 cp policy.json s3://komiser/policy.json --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM alpine:3.9.4
MAINTAINER mlabouardy <[email protected]>

ENV VERSION 2.3.0
ENV VERSION 2.4.0
ENV PORT 3000
ENV DURATION 30

Expand Down
10 changes: 10 additions & 0 deletions Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 27 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@ Stay under budget by uncovering hidden costs, monitoring increases in spend, and

**Discuss it on [Product Hunt](https://www.producthunt.com/posts/komiser) 🦄**

*Komiser EE is available in private beta test stage, sign in for free at [https://cloud.komiser.io](https://cloud.komiser.io)*

[![Twitter URL](https://img.shields.io/twitter/url/https/twitter.com/fold_left.svg?style=social&label=Follow%20%40Komiser)](https://twitter.com/komiseree) [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Optimize%20Cost%20and%20Security%20on%20AWS&url=https://github.com/mlabouardy/komiser&via=mlabouardy&hashtags=komiser,aws,gcp,cloud,serverless,devops)

**Highlights**

* Analyze and manage cloud cost, usage, security, and governance in one place.
* Control your usage and create visibility across all used services to achieve maximum cost-effectiveness.
* Detect potential vulnerabilities that could put your cloud environment at risk.
* Get a deep understanding of how you spend on the AWS, GCP, OVH and Azure.
* Get a deep understanding of how you spend on the AWS, GCP, OVH, DigitalOcean and Azure.

<p align="center">

Expand All @@ -37,24 +39,24 @@ Does your company use Komiser? Ask your manager or marketing team if your compa

## Download

Below are the available downloads for the latest version of Komiser (2.3.0). Please download the proper package for your operating system and architecture.
Below are the available downloads for the latest version of Komiser (2.4.0). Please download the proper package for your operating system and architecture.

### Linux:

```
wget https://cli.komiser.io/2.3.0/linux/komiser
wget https://cli.komiser.io/2.4.0/linux/komiser
```

### Windows:

```
wget https://cli.komiser.io/2.3.0/windows/komiser
wget https://cli.komiser.io/2.4.0/windows/komiser
```

### Mac OS X:

```
wget https://cli.komiser.io/2.3.0/osx/komiser
wget https://cli.komiser.io/2.4.0/osx/komiser
```

_Note_: make sure to add the execution permission to Komiser `chmod +x komiser`
Expand All @@ -67,7 +69,7 @@ brew install komiser
### Docker:

```
docker run -d -p 3000:3000 -e AWS_ACCESS_KEY_ID="" -e AWS_SECRET_ACCESS_KEY="" -e AWS_DEFAULT_REGION="" --name komiser mlabouardy/komiser:2.3.0
docker run -d -p 3000:3000 -e AWS_ACCESS_KEY_ID="" -e AWS_SECRET_ACCESS_KEY="" -e AWS_DEFAULT_REGION="" --name komiser mlabouardy/komiser:2.4.0
```

## How to use
Expand Down Expand Up @@ -211,6 +213,25 @@ consumer_key=my_consumer_key
<img src="https://s3.eu-west-3.amazonaws.com/komiser-assets/images/dashboard-ovh.png"/>
</p>

### DigitalOcean

* To generate a personal access token, log in to the [DigitalOcean Control Panel](https://cloud.digitalocean.com/).

* Click the **API** link in the main navigation, In the **Personal access tokens** section, click the **Generate New Token** button.

* Create a *ready-only* scope token. When you click **Generate Token**, your token will be generated.

* Set *DIGITALOCEAN_ACCESS_TOKEN* environment variable:

```
export DIGITALOCEAN_ACCESS_TOKEN=<TOKEN>
```

* If you point your browser to http://localhost:3000, you should be able to see your projects:

<p align="center">
<img src="https://s3.eu-west-3.amazonaws.com/komiser-assets/images/dashboard-digitalocean.png"/>
</p>

## Options

Expand Down
2 changes: 1 addition & 1 deletion dashboard/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
<p>Security</p>
</a>
</li>
<li class="nav-item" routerLinkActive="active">
<li class="nav-item" routerLinkActive="active" *ngIf="currentProvider.value != 'digitalocean'">
<a routerLink="/data-and-ai">
<i class="la la-commenting"></i>
<p>Data & AI</p>
Expand Down
22 changes: 20 additions & 2 deletions dashboard/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Component, OnDestroy } from '@angular/core';
import { AwsService } from './aws.service';
import { GcpService } from './gcp.service';
import { OvhService } from './ovh.service';
import { DigitaloceanService } from './digitalocean.service';
import { StoreService } from './store.service';
import { not } from '@angular/compiler/src/output/output_ast';
import { Subscription } from 'rxjs';
Expand Down Expand Up @@ -36,14 +37,18 @@ export class AppComponent implements OnDestroy {
{
label: 'OVH',
value: 'ovh'
},
{
label: 'DigitalOcean',
value: 'digitalocean'
}
];

private _storeService: StoreService;

private providers: Map<String, Object> = new Map<String, Object>();

constructor(private awsService: AwsService, private gcpService: GcpService, private storeService: StoreService, private ovhService: OvhService) {
constructor(private awsService: AwsService, private gcpService: GcpService, private storeService: StoreService, private digitaloceanService: DigitaloceanService, private ovhService: OvhService) {

this.providers['aws'] = {
label: 'Amazon Web Services',
Expand All @@ -63,6 +68,12 @@ export class AppComponent implements OnDestroy {
logo: 'https://cdn.komiser.io/images/ovh.jpg'
};

this.providers['digitalocean'] = {
label: 'DigitalOcean',
value: 'digitalocean',
logo: 'https://cdn.komiser.io/images/digitalocean.png'
};

//if (this.storeService.getProvider() == 'aws') {
if (localStorage.getItem('profile')) {
this.currentProfile = localStorage.getItem('profile');
Expand Down Expand Up @@ -123,7 +134,14 @@ export class AppComponent implements OnDestroy {
}, err => {
this.accountName = 'Username';
});
}else {
}else if(this.currentProvider.value == 'digitalocean'){
this.redAlarms = 0;
this.digitaloceanService.getProfile().subscribe(data => {
this.accountName = data.email.substring(0, data.email.indexOf('@'))
}, err => {
this.accountName = 'Username';
});
} else {
this.redAlarms = 0;

this.gcpService.getProjects().subscribe(data => {
Expand Down
14 changes: 13 additions & 1 deletion dashboard/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { DataAndAiComponent } from './data-and-ai/data-and-ai.component';
import { AwsService } from './aws.service';
import { GcpService } from './gcp.service';
import { OvhService } from './ovh.service';
import { DigitaloceanService } from './digitalocean.service';
import { StoreService } from './store.service';
import { PaginationModule } from 'ngx-bootstrap/pagination';
import { ProfileComponent } from './profile/profile.component';
Expand Down Expand Up @@ -47,6 +48,11 @@ import { OvhSecurityComponent } from './security/ovh/ovh.component';
import { OvhDataAndAIComponent } from './data-and-ai/ovh/ovh.component';
import { OvhLimitsComponent } from './limits/ovh/ovh.component';
import { OvhProfileComponent } from './profile/ovh/ovh.component';
import { DigitaloceanDashboardComponent } from './dashboard/digitalocean/digitalocean.component';
import { DigitaloceanComputeComponent } from './compute/digitalocean/digitalocean.component';
import { DigitaloceanStorageComponent } from './storage/digitalocean/digitalocean.component';
import { DigitaloceanNetworkComponent } from './network/digitalocean/digitalocean.component';
import { DigitaloceanSecurityComponent } from './security/digitalocean/digitalocean.component';



Expand Down Expand Up @@ -132,7 +138,12 @@ const appRoutes: Routes = [
OvhSecurityComponent,
OvhDataAndAIComponent,
OvhLimitsComponent,
OvhProfileComponent
OvhProfileComponent,
DigitaloceanDashboardComponent,
DigitaloceanComputeComponent,
DigitaloceanStorageComponent,
DigitaloceanNetworkComponent,
DigitaloceanSecurityComponent
],
imports: [
RouterModule.forRoot(
Expand All @@ -147,6 +158,7 @@ const appRoutes: Routes = [
],
providers: [
AwsService,
DigitaloceanService,
StoreService,
GoogleAnalyticsService,
GcpService,
Expand Down
2 changes: 2 additions & 0 deletions dashboard/src/app/compute/compute.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ <h4 class="page-title">Compute</h4>
<aws-compute *ngIf="provider == 'aws'"></aws-compute>

<ovh-compute *ngIf="provider == 'ovh'"></ovh-compute>

<digitalocean-compute *ngIf="provider == 'digitalocean'"></digitalocean-compute>
</div>
</div>
24 changes: 24 additions & 0 deletions dashboard/src/app/compute/digitalocean/digitalocean.component.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.card-golang{
background: #72CEDD !important;
}


.card-python{
background: #FFD344 !important;
}

.limit-column{
max-width: 300px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}

.gcp-logo {
width: 40px !important;
padding-bottom: 10px !important;
}

#gaeBandwidthChart{
min-height: 150px;
}
Loading

0 comments on commit 8b9d8e4

Please sign in to comment.