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

@ -41,7 +41,7 @@ endpoints:
responses:
-
status: 200
content: '{"data":[{"id":5,"project_id":null,"global":true,"name":"et","provider":"dropbox","created_at":"2025-04-05T17:35:56.000000Z","updated_at":"2025-04-05T17:35:56.000000Z"},{"id":6,"project_id":null,"global":true,"name":"sed","provider":"dropbox","created_at":"2025-04-05T17:35:56.000000Z","updated_at":"2025-04-05T17:35:56.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":5,"project_id":null,"global":true,"name":"veritatis","provider":"ftp","created_at":"2025-04-05T17:48:03.000000Z","updated_at":"2025-04-05T17:48:03.000000Z"},{"id":6,"project_id":null,"global":true,"name":"voluptas","provider":"dropbox","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: []
@ -49,7 +49,7 @@ endpoints:
auth:
- headers
- Authorization
- 'Bearer vk63dEVe6PD5af4gZcbh1a8'
- 'Bearer fgh4eV31dP58kvaDEaZbc66'
controller: null
method: null
route: null
@ -91,7 +91,7 @@ endpoints:
name: provider
description: 'The provider (aws, linode, hetzner, digitalocean, vultr, ...)'
required: true
example: quia
example: ab
type: string
enumValues: []
exampleWasSpecified: false
@ -101,7 +101,7 @@ endpoints:
name: name
description: 'The name of the storage provider.'
required: true
example: rerum
example: quo
type: string
enumValues: []
exampleWasSpecified: false
@ -111,7 +111,7 @@ endpoints:
name: token
description: 'The token if provider requires api token'
required: true
example: hic
example: in
type: string
enumValues: []
exampleWasSpecified: false
@ -121,7 +121,7 @@ endpoints:
name: key
description: 'The key if provider requires key'
required: true
example: repellat
example: sunt
type: string
enumValues: []
exampleWasSpecified: false
@ -131,23 +131,23 @@ endpoints:
name: secret
description: 'The secret if provider requires key'
required: true
example: maiores
example: molestias
type: string
enumValues: []
exampleWasSpecified: false
nullable: false
custom: []
cleanBodyParameters:
provider: quia
name: rerum
token: hic
key: repellat
secret: maiores
provider: ab
name: quo
token: in
key: sunt
secret: molestias
fileParameters: []
responses:
-
status: 200
content: '{"id":5,"project_id":null,"global":true,"name":"veritatis","provider":"ftp","created_at":"2025-04-05T17:35:56.000000Z","updated_at":"2025-04-05T17:35:56.000000Z"}'
content: '{"id":5,"project_id":null,"global":true,"name":"asperiores","provider":"dropbox","created_at":"2025-04-05T17:48:03.000000Z","updated_at":"2025-04-05T17:48:03.000000Z"}'
headers: []
description: ''
custom: []
@ -155,7 +155,7 @@ endpoints:
auth:
- headers
- Authorization
- 'Bearer 5ekD6EPbhdvVa84f31aZcg6'
- 'Bearer e584613dkZaPDEVvgcahbf6'
controller: null
method: null
route: null
@ -209,7 +209,7 @@ endpoints:
responses:
-
status: 200
content: '{"id":5,"project_id":null,"global":true,"name":"fuga","provider":"local","created_at":"2025-04-05T17:35:56.000000Z","updated_at":"2025-04-05T17:35:56.000000Z"}'
content: '{"id":5,"project_id":null,"global":true,"name":"ipsum","provider":"local","created_at":"2025-04-05T17:48:03.000000Z","updated_at":"2025-04-05T17:48:03.000000Z"}'
headers: []
description: ''
custom: []
@ -217,7 +217,7 @@ endpoints:
auth:
- headers
- Authorization
- 'Bearer 3fb86PcgDZadkhV1aEv4e56'
- 'Bearer h6Zk6834dDce5fbPa1VvagE'
controller: null
method: null
route: null
@ -270,7 +270,7 @@ endpoints:
name: name
description: 'The name of the storage provider.'
required: true
example: est
example: voluptas
type: string
enumValues: []
exampleWasSpecified: false
@ -289,13 +289,13 @@ endpoints:
nullable: false
custom: []
cleanBodyParameters:
name: est
name: voluptas
global: true
fileParameters: []
responses:
-
status: 200
content: '{"id":5,"project_id":null,"global":true,"name":"ut","provider":"ftp","created_at":"2025-04-05T17:35:56.000000Z","updated_at":"2025-04-05T17:35:56.000000Z"}'
content: '{"id":5,"project_id":null,"global":true,"name":"minima","provider":"ftp","created_at":"2025-04-05T17:48:03.000000Z","updated_at":"2025-04-05T17:48:03.000000Z"}'
headers: []
description: ''
custom: []
@ -303,7 +303,7 @@ endpoints:
auth:
- headers
- Authorization
- 'Bearer 8E6g3aDZcafV465bdkPe1vh'
- 'Bearer ak6fgd1Eba48chvPV3e5Z6D'
controller: null
method: null
route: null
@ -365,7 +365,7 @@ endpoints:
auth:
- headers
- Authorization
- 'Bearer vf34Dch58Va6bZgk61PaeEd'
- 'Bearer PcaDbh6ZE4aV1e8fdv56k3g'
controller: null
method: null
route: null