Code Monkey home page Code Monkey logo

laravel-forge-api's People

Contributors

acurrieclark avatar casperlaitw avatar cbl avatar jbreuer95 avatar sardoj avatar svenluijten avatar tzurbaev avatar

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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

laravel-forge-api's Issues

Empty list items

In my use case there is the occasional scenario where i request a list of resources from a server where none of that particular resource exist. For example asking for a list of databases on the server.

At the moment, because the result is an empty array, an InvalidArgumentException is thrown. I wonder if the current check for valid response might be better changed from:

<?php
if (empty($json[$itemsKey])) {
    throw new InvalidArgumentException('Given response is not a '.$this->resourcePath().' response.');
}

to

<?php
if (!isset($json[$itemsKey])) {
    throw new InvalidArgumentException('Given response is not a '.$this->resourcePath().' response.');
}

This would allow an empty array to be returned if indeed there were no items, but would still throw an exception if the wrong response was returned.

ListCertificates is not returning a list

I have confirmed that I am getting a valid Site from SiteManager Class. Here is my code:

$certificates = new CertificatesManager();
$certificates->list()->from($site)

And here is the response:

GuzzleHttp\Exception\ClientException with message 'Client error: `GET https://forge.laravel.com/api/v1/servers/100050/certificates` resulted in a `404 Not Found` response:
Resource not found.

It appears the API call is not providing the 'sites' portion of the API URI call before the certificates.

From the tests, this appears it should be structured as:
https://forge.laravel.com/api/v1/servers/1/sites/1/certificates'

What am I missing here?

Creating a site on LoadBalancer

I am trying to add a site to LoadBalancer server and not an app server.
How can I add a new site to the server and specify the servers to which it should route the requests (instead of specifying git repo and other stuff)?

Thanks!

Activate composer

Hello, is it possible to activate composer in a site application?

Let's Encrypt Certificate Path

Hey There,

There's an issue with the create Let's Encrypt certificate resource or API path. The documentation says it needs to be:
/api/v1/servers/{serverId}/sites/{siteId}/certificates/letsencrypt

Your code generates the following:
/api/v1/servers/{serverId}/sites/{siteId}/letsencrypt

Within the following file:
Laravel\Forge\Certificates\Commands\ObtainLetsEncryptCertificateCommand

The change It needs to be changed from:

public function resourcePath()
{
    return 'letsencrypt';
}

to:

public function resourcePath()
{
    return 'certificates/letsencrypt';
}

(sorry, didn't have time to create a pull request)

Thank you,
Kris

Rate limiting

One of the issues which crops up now and again (for me, and for users of other Forge SDKs that I have seen) is the current API rate limit. It is currently set at 30 requests/minute.
Is there any way that automatic (perhaps optional) rate limiting could be worked into this SDK? I realise there are ways it could be done externally, but I wonder if it might be worth looking into. More than happy to contribute as ever if you think it is worthwhile.

No such file or directory when creating a new certificate

sometimes, it happens that instead of creating the CSR, no file is created.
Is there a way to delete those false entries?

According to the Forge API, there is a DELETE /api/v1/servers/{serverId}/sites/{siteId}/certificates/{id} command, but I can't find it in your classes/functions

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.