tzurbaev / laravel-forge-api Goto Github PK
View Code? Open in Web Editor NEWPHP SDK for Laravel Forge API
License: MIT License
PHP SDK for Laravel Forge API
License: MIT License
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?
When creating a new server, the sudo and database passwords are returned outside outside of the server
object. With the current implementation, there is no way of accessing these properties.
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!
Hello, is it possible to activate composer in a site application?
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.
Is it possible to add an option to isolate a site?
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
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.