Giter Site home page Giter Site logo

faastruby-cli's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

faastruby-cli's Issues

Runner Calculator

As a developer, i'd like a tool that can calculate how many runners I need for my app based on function size, so that I can estimate my costs.

Add ability to delete account

I'd like to be able to delete my own account.

Here's a suggestion:

$ faastruby destroy-account

The above command will prompt for confirmation. When I say yes, the command will wait for a secret token.
An email will be sent to me with this secret token that I must paste in the terminal prompt. The CLI then sends the request to the server to destroy the account with that confirmation token and the account gets deleted.

Use a folder inside a git repository as template

With the templates feature, you can initialize a function from a Git repository.
This enhancement would allow users to use folders inside a Git repo as the source template, instead of having multiple repositories.

Examples:

~$ faastruby new FUNCTION_NAME --template github:user/repo/folder/subfolder
# or
~$ faastruby new FUNCTION_NAME --template git:[email protected]:/user/repo.git/folder/subfolder

Add ability to reset password

I'd like to be able to reset my password.

Here's a suggestion:

$ faastruby update-account --reset-password

The above command will send me an email with a confirmation token and prompt me for this token. Once I paste it in, I will be asked for the new password and a password confirmation. The CLI will then send the request to the server with this token and the password will be changed.
If the operation was successful, the CLI will ask "Do you wish to force logout from all machines and invalidate all current API credentials?". If I respond yes, the CLI will exec "faastruby logout --all".

Then I can perform a faastruby login with my new password.

Add command to list all workspaces an account has access to

As you start building different things and use different environments, it gets hard to keep track of what you have deployed to the cloud platform.

Users should be able to list all workspaces associated with their accounts. Something like:

# This should return a list of all workspaces associated with the account
$ faastruby ls
WORKSPACE                   FUNCTIONS        RUNNERS
myworkspace-stage-89292d    2                3
myworkspace-prod-89292d     2                3
myworkspace-feat-89292d     2                3

# Then allow listing the functions from a workspace using the same syntax
$ faastruby ls myworkspace-feat-89292d
FUNCTION        ENDPOINT                                                       
catch-all       https://myworkspace-feat-89292d.tor1.faast.cloud/catch-all      
root            https://myworkspace-feat-89292d.tor1.faast.cloud/               

The first example requires the creation of a new API endpoint.

Add templates for asset-functions that serve Javascript and CSS

The idea is to create a template for the command faastruby new that would initialize a folder with a function already prepared to serve Javascript and CSS.
The command could be, for example:

~$ faastruby new FUNCTION_NAME --template assets

Note that we must have templates for all the supported runtimes (--runtime).

The resulting folder could look like this:

function_folder
├── assets
│   ├── javascript
│   │   └── application.js
│   └── stylesheets
│       └── application.css
├── spec
│   ├── handler_spec.rb
│   └── spec_helper.rb
├── Gemfile
└── handler.rb

Example requests:

  • /workspace-name/function-name?css=application.css
  • /workspace-name/function-name?js=application.js

And an example Ruby function could be like:

def handler(event)
  return render(css: File.read("assets/stylesheets/#{event.query_params['css']}")) if event.query_params.has_key?('css')
  return render(js: File.read("assets/javascript/#{event.query_params['js']}")) if event.query_params.has_key?('js')
end

There's also the need for sanitizing the input. For example, we don't want to allow js=../foo.js (which would not result in anything bad because the platform is secured against stuff like that - but it is better to avoid anyways). So there's a need for some sort of regular expression to remove everything fromcss= and js= but letters, numbers, dashes, underlines and one period.
The above is just a suggestion. Feel free to propose something better.

Minify CSS and Javascript when building the function package during deploy

It would be nice if faastruby deploy-to would precompile javascript and css before creating the ZIP package on asset-functions.
The code for deploy-to is here: https://github.com/FaaStRuby/faastruby-cli/blob/master/lib/faastruby/cli/commands/function/deploy_to.rb

The idea is to do that with as minimal dependencies as possible, and fail gracefully if the dependencies are not installed. The implementation might be coupled with #6.

Feature: Custom domains

Users should be able to add custom domains to their accounts and associate them with workspaces.

The whole process can be done via CLI. Here's a suggestion:

$ faastruby domain --add example.com   # to add a domain
$ faastruby domain --remove example.com   # to remove a domain

When you add a domain, the CLI will hit the API domains endpoint and receive a response with a Let's Encrypt DNS challenge.
The user will be prompted to make the proper DNS changes and run:

$ faastruby domain --verify example.com

It will then hit an API endpoint that will trigger a Let's encrypt verification.
If everything works, the domain is ready to be associated with a workspace.

Users can associate a domain to a workspace manually by running:

$ faastruby update-workspace WORKSPACE_NAME --attach-domain app.example.com   # will attach the domain
$ faastruby update-workspace WORKSPACE_NAME --detach-domain app.example.com   # will detach the domain

Users can also add that domain to Local's project.yml file, choosing which environments will use this domain. Users should also be able to set custom names for workspaces that use custom domains, so myworkspace-prod-12345.example.com could be actually app.example.com. This will work by simply orchestrating the command update-workspace.

Add support for Crystal on FaaStRuby server

Users should be able to run Crystal functions on FaaStRuby Server as well.
The Crystal function code should be compiled on-the-fly when any modification is made.
If a file gets modified, the contents of before_build in faastruby.yml will run, then the Crystal function will be compiled.

Password Confirmations

Impacts #18 as well as standard signup behavior.

Need to take in a password confirmation, compare values; reject if they don't match, otherwise proceed with signup or password reset.

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.