Coder Social home page Coder Social logo

parisbite / doorkeeper Goto Github PK

View Code? Open in Web Editor NEW

This project forked from patoroco/doorkeeper

1.0 0.0 0.0 476 KB

Github action that allows you to open or close a specific port in your DigitalOcean firewall.

License: MIT License

Shell 3.93% JavaScript 3.25% TypeScript 92.82%

doorkeeper's Introduction

Doorman

Doorkeeper DigitalOcean Action Tests

This Github action allows you to open or close an specific port in your DigitalOcean firewall. It's really useful for deploy in your instances from Github Actions, as they don't provide a list of IPs to add to your security groups.

Diagram of doorkeeper

Usage

You need to generate a personal access token from your DigitalOcean Applications & API page.

DigitalOcean token

Copy that token, and paste in the secrets of your repo: Github Repo Secrets

Create or update a workflow, adding the file .github/workflows/doorkeeper.yml (more info about how to use Github Actions).

############################
## prepare your artifacts ##
############################

- name: Doorkeeper open
  uses: patoroco/doorkeeper@master
  with:
    digitaloceanToken: ${{ secrets.DO_TOKEN }}
    firewallName: "name_of_the_firewall"
    actionToDo: "add"
    dryRun: false

############################
## deploy to DigitalOcean ##
############################

- name: Doorkeeper close
  uses: patoroco/doorkeeper@master
  with:
    digitaloceanToken: ${{ secrets.DO_TOKEN }}
    firewallName: "name_of_the_firewall"
    actionToDo: "remove"
    dryRun: false

To check that everything is working as expected, you have to push these changes to your repo, and a new build in the Actions tab should be starting.

Development

First of all, you have to install the dependencies:

npm install

I've been using act to test the action in local, and it's really useful because it doesn't require to push anything to github. After install it, you can do:

npm run local:action

You can also run the code itself using:

npm run local

LICENSE

doorkeeper's People

Contributors

patoroco avatar dependabot[bot] avatar bmoers avatar yringler avatar

Stargazers

Paris Manzo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.