Comments (4)
Juan! Great idea.
Here's the general overview for how the tugboat internals work. There are 4 main components you need to understand:
CLI Interface
We use a ruby gem called thor to handle the nitty gritty of the command line interface. This includes options (--name
) and parameters (tugboat create FOO
, where FOO is a parameter).
Here's an example of a command in the CLI interface: https://github.com/pearkes/tugboat/blob/master/lib/tugboat/cli.rb#L302-L323
Middleware Sequences
The CLI interface calls a middleware sequence, in this case: https://github.com/pearkes/tugboat/blob/master/lib/tugboat/middleware.rb#L220-L228
That file autoloads a bunch of middleware classes...we call those steps in this case.
Middleware Steps
Each step is pretty simple. You call it like this, and then the actual step looks like so: https://github.com/pearkes/tugboat/blob/master/lib/tugboat/middleware/wait_for_state.rb
"Environment"
All of this middleware requires something like "shared state". Basically, if I'm going to call the WaitForState
step, I need to have a droplet_id
in the environment for WaitForState
to pick up. How does it get there? There's a step called FindDroplet
that gets called prior to WaitForState
. It does the heavy lifting of finding the right droplet (including dealing with multiple droplets. You can see how it deposits the ID into the env here.
You'll also need to interact with the digital_ocean gem, which is how we talk to the DO API. You can see examples of that in just about every step.
Hope that helps! Let me know if things are still unclear. :)
from tugboat.
This is a nice addition. But really painful to deploy some UI as CLI for this.
Here's an idea:
We could read .zone files, like sync a folder!
You just edit you DNS in yr editor! tugboat dns list
tugboat dns sync
.
Maybe ~/.tugboat/dns/....
from tugboat.
@nofxx I would typically prefer to just abuse their API for this – just as we do with the droplets.
But, I see the point you have on how complex it would get.
Could we do something like:
$ tugboat records foobar.com -r A -i 33.33.33.33
Which would add an A record?
We could start with minimal feature set – i.e just adding/overwriting records for existing domains, the most common use case.
from tugboat.
I'd suggest to use CloudFlafre API for DNS and DDoS/CDN support, not Digital Ocean (BTW they use CloudFlare too)
from tugboat.
Related Issues (20)
- Seems to be a limit to the number of retrieved droplets HOT 3
- Commands like "droplets" need formatting switches HOT 6
- Wrong color for successful snapshot creation? HOT 1
- bug in connect HOT 1
- Show private ip alongside public ip in droplets list HOT 1
- `tugboat create` with options is not picking up default ssh key HOT 8
- Domain and records support HOT 2
- API call to add ssh keys HOT 3
- Does Tugboat Support Multiple Teams Yet? HOT 8
- feature request: have tugboat support the block storage api HOT 3
- suggestion: ability to list and remove snapshots usign tugboat HOT 3
- Change to droplet_kit for API HOT 2
- This compared to doctl? HOT 1
- specify configuration file path HOT 13
- Cross-site Scripting (XSS) Through Unescaped JSON String in petems/tugboat (master)
- Insecure Storage Of Cache Files in petems/tugboat (master) HOT 1
- Arbitrary Code Injection Or Denial Of Service (DoS) Through Unsafe Middleware in petems/tugboat (master)
- Release Tugboat for 2.4.1 support HOT 2
- snapshot not working HOT 1
- I am getting "Failed to create Droplet: found unpermitted parameters: backups_enabled"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tugboat.