Add endpoint for reading and updating site .env file (#564)

* feat(api): Add endpoint for reading site .env file

- Add GET /api/projects/{project}/servers/{server}/sites/{site}/env endpoint
- Add feature tests with SSH mocking

* added updating env

* fix coding style

* generate docs

---------

Co-authored-by: Saeed Vaziry <mr.saeedvaziry@gmail.com>
This commit is contained in:
Dimitar Yanakiev
2025-04-05 20:59:57 +03:00
committed by GitHub
parent 2a670146d8
commit e98e974e20
31 changed files with 2404 additions and 1395 deletions

View File

@ -39,7 +39,7 @@ endpoints:
responses:
-
status: 200
content: '{"data":[{"id":3,"project_id":null,"global":true,"name":"ducimus","provider":"digitalocean","created_at":"2025-04-05T17:35:55.000000Z","updated_at":"2025-04-05T17:35:55.000000Z"},{"id":4,"project_id":null,"global":true,"name":"nesciunt","provider":"hetzner","created_at":"2025-04-05T17:35:55.000000Z","updated_at":"2025-04-05T17:35:55.000000Z"}],"links":{"first":"\/?page=1","last":"\/?page=1","prev":null,"next":null},"meta":{"current_page":1,"from":1,"last_page":1,"links":[{"url":null,"label":"&laquo; Previous","active":false},{"url":"\/?page=1","label":"1","active":true},{"url":null,"label":"Next &raquo;","active":false}],"path":"\/","per_page":25,"to":2,"total":2}}'
content: '{"data":[{"id":3,"project_id":null,"global":true,"name":"aut","provider":"hetzner","created_at":"2025-04-05T17:48:03.000000Z","updated_at":"2025-04-05T17:48:03.000000Z"},{"id":4,"project_id":null,"global":true,"name":"qui","provider":"aws","created_at":"2025-04-05T17:48:03.000000Z","updated_at":"2025-04-05T17:48:03.000000Z"}],"links":{"first":"\/?page=1","last":"\/?page=1","prev":null,"next":null},"meta":{"current_page":1,"from":1,"last_page":1,"links":[{"url":null,"label":"&laquo; Previous","active":false},{"url":"\/?page=1","label":"1","active":true},{"url":null,"label":"Next &raquo;","active":false}],"path":"\/","per_page":25,"to":2,"total":2}}'
headers: []
description: ''
custom: []
@ -47,7 +47,7 @@ endpoints:
auth:
- headers
- Authorization
- 'Bearer 6vkc3Ed6ebga48aPVfZ5D1h'
- 'Bearer 3evaP8h6VEZkbfgaD6d1c45'
controller: null
method: null
route: null
@ -89,7 +89,7 @@ endpoints:
name: provider
description: 'The provider (aws, linode, hetzner, digitalocean, vultr, ...)'
required: true
example: sunt
example: corrupti
type: string
enumValues: []
exampleWasSpecified: false
@ -99,7 +99,7 @@ endpoints:
name: name
description: 'The name of the server provider.'
required: true
example: aut
example: est
type: string
enumValues: []
exampleWasSpecified: false
@ -109,7 +109,7 @@ endpoints:
name: token
description: 'The token if provider requires api token'
required: true
example: id
example: rerum
type: string
enumValues: []
exampleWasSpecified: false
@ -119,7 +119,7 @@ endpoints:
name: key
description: 'The key if provider requires key'
required: true
example: porro
example: ut
type: string
enumValues: []
exampleWasSpecified: false
@ -129,23 +129,23 @@ endpoints:
name: secret
description: 'The secret if provider requires key'
required: true
example: voluptas
example: sed
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanBodyParameters:
provider: sunt
name: aut
token: id
key: porro
secret: voluptas
provider: corrupti
name: est
token: rerum
key: ut
secret: sed
fileParameters: []
responses:
-
status: 200
content: '{"id":3,"project_id":null,"global":true,"name":"nemo","provider":"linode","created_at":"2025-04-05T17:35:56.000000Z","updated_at":"2025-04-05T17:35:56.000000Z"}'
content: '{"id":3,"project_id":null,"global":true,"name":"voluptas","provider":"vultr","created_at":"2025-04-05T17:48:03.000000Z","updated_at":"2025-04-05T17:48:03.000000Z"}'
headers: []
description: ''
custom: []
@ -153,7 +153,7 @@ endpoints:
auth:
- headers
- Authorization
- 'Bearer v634eED6kgab1c5PaVdhZf8'
- 'Bearer 6g6vfEck83VaPhd5Zabe1D4'
controller: null
method: null
route: null
@ -207,7 +207,7 @@ endpoints:
responses:
-
status: 200
content: '{"id":3,"project_id":null,"global":true,"name":"ut","provider":"aws","created_at":"2025-04-05T17:35:56.000000Z","updated_at":"2025-04-05T17:35:56.000000Z"}'
content: '{"id":3,"project_id":null,"global":true,"name":"et","provider":"digitalocean","created_at":"2025-04-05T17:48:03.000000Z","updated_at":"2025-04-05T17:48:03.000000Z"}'
headers: []
description: ''
custom: []
@ -215,7 +215,7 @@ endpoints:
auth:
- headers
- Authorization
- 'Bearer ckv4P5E8g663abheVfaZdD1'
- 'Bearer va63cDe8dPf5Z4Vahb1E6kg'
controller: null
method: null
route: null
@ -268,7 +268,7 @@ endpoints:
name: name
description: 'The name of the server provider.'
required: true
example: aliquam
example: earum
type: string
enumValues: []
exampleWasSpecified: false
@ -278,7 +278,7 @@ endpoints:
name: global
description: 'Accessible in all projects'
required: true
example: true
example: false
type: string
enumValues:
- true
@ -287,13 +287,13 @@ endpoints:
nullable: false
custom: []
cleanBodyParameters:
name: aliquam
global: true
name: earum
global: false
fileParameters: []
responses:
-
status: 200
content: '{"id":3,"project_id":null,"global":true,"name":"et","provider":"digitalocean","created_at":"2025-04-05T17:35:56.000000Z","updated_at":"2025-04-05T17:35:56.000000Z"}'
content: '{"id":3,"project_id":null,"global":true,"name":"architecto","provider":"digitalocean","created_at":"2025-04-05T17:48:03.000000Z","updated_at":"2025-04-05T17:48:03.000000Z"}'
headers: []
description: ''
custom: []
@ -301,7 +301,7 @@ endpoints:
auth:
- headers
- Authorization
- 'Bearer kD53eZ6h8PEvbd1gfcaaV64'
- 'Bearer 4e1dghaV6D856P3ZbfkcEva'
controller: null
method: null
route: null
@ -363,7 +363,7 @@ endpoints:
auth:
- headers
- Authorization
- 'Bearer ebcf146dDhP3Z5a6vg8kVEa'
- 'Bearer fcVa8ev63gP5DaZbkdhE461'
controller: null
method: null
route: null