From e98e974e20f627696384e3fc78cbb5bd6f147b2b Mon Sep 17 00:00:00 2001 From: Dimitar Yanakiev Date: Sat, 5 Apr 2025 20:59:57 +0300 Subject: [PATCH] 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 --- .scribe/endpoints.cache/00.yaml | 24 +- .scribe/endpoints.cache/01.yaml | 34 +- .scribe/endpoints.cache/02.yaml | 42 +- .scribe/endpoints.cache/03.yaml | 54 +- .scribe/endpoints.cache/05.yaml | 26 +- .scribe/endpoints.cache/06.yaml | 20 +- .scribe/endpoints.cache/07.yaml | 54 +- .scribe/endpoints.cache/08.yaml | 46 +- .scribe/endpoints.cache/09.yaml | 22 +- .scribe/endpoints.cache/10.yaml | 16 +- .scribe/endpoints.cache/11.yaml | 211 ++- .scribe/endpoints.cache/12.yaml | 66 +- .scribe/endpoints.cache/13.yaml | 42 +- .scribe/endpoints/00.yaml | 24 +- .scribe/endpoints/01.yaml | 34 +- .scribe/endpoints/02.yaml | 42 +- .scribe/endpoints/03.yaml | 54 +- .scribe/endpoints/05.yaml | 26 +- .scribe/endpoints/06.yaml | 20 +- .scribe/endpoints/07.yaml | 54 +- .scribe/endpoints/08.yaml | 46 +- .scribe/endpoints/09.yaml | 22 +- .scribe/endpoints/10.yaml | 16 +- .scribe/endpoints/11.yaml | 211 ++- .scribe/endpoints/12.yaml | 66 +- .scribe/endpoints/13.yaml | 42 +- app/Http/Controllers/API/SiteController.php | 40 + public/api-docs/collection.json | 231 +++- public/api-docs/index.html | 1350 ++++++++++++------- public/api-docs/openapi.yaml | 789 ++++++----- tests/Feature/API/SitesTest.php | 75 ++ 31 files changed, 2404 insertions(+), 1395 deletions(-) diff --git a/.scribe/endpoints.cache/00.yaml b/.scribe/endpoints.cache/00.yaml index ba97ef5..c50f114 100644 --- a/.scribe/endpoints.cache/00.yaml +++ b/.scribe/endpoints.cache/00.yaml @@ -60,7 +60,7 @@ endpoints: auth: - headers - Authorization - - 'Bearer Pg1hVfEvc3e5kada68Z6b4D' + - 'Bearer eDa6Vdh1Z4vc35bP8E6gafk' controller: null method: null route: null @@ -113,7 +113,7 @@ endpoints: name: command description: '' required: true - example: nisi + example: quia type: string enumValues: [] exampleWasSpecified: false @@ -123,7 +123,7 @@ endpoints: name: user description: '' required: true - example: vito + example: root type: string enumValues: - root @@ -142,8 +142,8 @@ endpoints: nullable: false custom: [] cleanBodyParameters: - command: nisi - user: vito + command: quia + user: root frequency: '* * * * *' fileParameters: [] responses: @@ -157,7 +157,7 @@ endpoints: auth: - headers - Authorization - - 'Bearer 5E3Vv4cah8D6bZa1kgPfe6d' + - 'Bearer 66EeZvdh3kVaDP8f4ga5c1b' controller: null method: null route: null @@ -204,7 +204,7 @@ endpoints: name: cronJob_id description: 'The ID of the cronJob.' required: true - example: 14 + example: 6 type: integer enumValues: [] exampleWasSpecified: false @@ -213,7 +213,7 @@ endpoints: cleanUrlParameters: project_id: 1 server_id: 29 - cronJob_id: 14 + cronJob_id: 6 queryParameters: [] cleanQueryParameters: [] bodyParameters: [] @@ -230,7 +230,7 @@ endpoints: auth: - headers - Authorization - - 'Bearer e68fh451vcb6Zd3DEVaaPgk' + - 'Bearer D4c3Z65ebv8E16fahaVgPdk' controller: null method: null route: null @@ -277,7 +277,7 @@ endpoints: name: cronJob_id description: 'The ID of the cronJob.' required: true - example: 9 + example: 13 type: integer enumValues: [] exampleWasSpecified: false @@ -286,7 +286,7 @@ endpoints: cleanUrlParameters: project_id: 1 server_id: 29 - cronJob_id: 9 + cronJob_id: 13 queryParameters: [] cleanQueryParameters: [] bodyParameters: [] @@ -303,7 +303,7 @@ endpoints: auth: - headers - Authorization - - 'Bearer hEkD1b3a845fVPZg6ecad6v' + - 'Bearer h3cP4aZa1v8feDdEg5b6k6V' controller: null method: null route: null diff --git a/.scribe/endpoints.cache/01.yaml b/.scribe/endpoints.cache/01.yaml index 62c4dee..807dd80 100644 --- a/.scribe/endpoints.cache/01.yaml +++ b/.scribe/endpoints.cache/01.yaml @@ -52,7 +52,7 @@ endpoints: responses: - status: 200 - content: '{"data":[{"id":null,"server_id":null,"name":"conn.bridget","status":"ready","created_at":null,"updated_at":null},{"id":null,"server_id":null,"name":"aiden47","status":"ready","created_at":null,"updated_at":null}],"links":{"first":"\/?page=1","last":"\/?page=1","prev":null,"next":null},"meta":{"current_page":1,"from":1,"last_page":1,"links":[{"url":null,"label":"« Previous","active":false},{"url":"\/?page=1","label":"1","active":true},{"url":null,"label":"Next »","active":false}],"path":"\/","per_page":25,"to":2,"total":2}}' + content: '{"data":[{"id":null,"server_id":null,"name":"leffler.esther","status":"ready","created_at":null,"updated_at":null},{"id":null,"server_id":null,"name":"rhoda.rutherford","status":"ready","created_at":null,"updated_at":null}],"links":{"first":"\/?page=1","last":"\/?page=1","prev":null,"next":null},"meta":{"current_page":1,"from":1,"last_page":1,"links":[{"url":null,"label":"« Previous","active":false},{"url":"\/?page=1","label":"1","active":true},{"url":null,"label":"Next »","active":false}],"path":"\/","per_page":25,"to":2,"total":2}}' headers: [] description: '' custom: [] @@ -60,7 +60,7 @@ endpoints: auth: - headers - Authorization - - 'Bearer 5vVfe3hcg1akP6Z8ba64dDE' + - 'Bearer E1VdfegZah4k86b53Dc6Pva' controller: null method: null route: null @@ -113,7 +113,7 @@ endpoints: name: name description: '' required: true - example: vel + example: quisquam type: string enumValues: [] exampleWasSpecified: false @@ -123,7 +123,7 @@ endpoints: name: charset description: '' required: true - example: qui + example: omnis type: string enumValues: [] exampleWasSpecified: false @@ -133,21 +133,21 @@ endpoints: name: collation description: '' required: true - example: autem + example: at type: string enumValues: [] exampleWasSpecified: false nullable: false custom: [] cleanBodyParameters: - name: vel - charset: qui - collation: autem + name: quisquam + charset: omnis + collation: at fileParameters: [] responses: - status: 200 - content: '{"id":null,"server_id":null,"name":"rodolfo.bradtke","status":"ready","created_at":null,"updated_at":null}' + content: '{"id":null,"server_id":null,"name":"csawayn","status":"ready","created_at":null,"updated_at":null}' headers: [] description: '' custom: [] @@ -155,7 +155,7 @@ endpoints: auth: - headers - Authorization - - 'Bearer 3gf6ahcav1kb546DZeE8PdV' + - 'Bearer PVgkZ35ca4afd1EbD8ehv66' controller: null method: null route: null @@ -202,7 +202,7 @@ endpoints: name: id description: 'The ID of the database.' required: true - example: 17 + example: 8 type: integer enumValues: [] exampleWasSpecified: false @@ -211,7 +211,7 @@ endpoints: cleanUrlParameters: project_id: 1 server_id: 29 - id: 17 + id: 8 queryParameters: [] cleanQueryParameters: [] bodyParameters: [] @@ -220,7 +220,7 @@ endpoints: responses: - status: 200 - content: '{"id":null,"server_id":null,"name":"rhane","status":"ready","created_at":null,"updated_at":null}' + content: '{"id":null,"server_id":null,"name":"sandrine43","status":"ready","created_at":null,"updated_at":null}' headers: [] description: '' custom: [] @@ -228,7 +228,7 @@ endpoints: auth: - headers - Authorization - - 'Bearer VEvk3dP685Zahcf6a41bgDe' + - 'Bearer EP64D8g51adf6hbceavVZ3k' controller: null method: null route: null @@ -275,7 +275,7 @@ endpoints: name: database_id description: 'The ID of the database.' required: true - example: 5 + example: 8 type: integer enumValues: [] exampleWasSpecified: false @@ -284,7 +284,7 @@ endpoints: cleanUrlParameters: project_id: 1 server_id: 29 - database_id: 5 + database_id: 8 queryParameters: [] cleanQueryParameters: [] bodyParameters: [] @@ -301,7 +301,7 @@ endpoints: auth: - headers - Authorization - - 'Bearer dPZ8bga4DEh6V16ce35avfk' + - 'Bearer 8dgEk3Zv1eaVP66bDhf4ac5' controller: null method: null route: null diff --git a/.scribe/endpoints.cache/02.yaml b/.scribe/endpoints.cache/02.yaml index cfd1731..70c45c6 100644 --- a/.scribe/endpoints.cache/02.yaml +++ b/.scribe/endpoints.cache/02.yaml @@ -52,7 +52,7 @@ endpoints: responses: - status: 200 - content: '{"data":[{"id":null,"server_id":null,"username":"lavina.zemlak","databases":[],"host":"%","status":null,"created_at":null,"updated_at":null},{"id":null,"server_id":null,"username":"hill.cassidy","databases":[],"host":"%","status":null,"created_at":null,"updated_at":null}],"links":{"first":"\/?page=1","last":"\/?page=1","prev":null,"next":null},"meta":{"current_page":1,"from":1,"last_page":1,"links":[{"url":null,"label":"« Previous","active":false},{"url":"\/?page=1","label":"1","active":true},{"url":null,"label":"Next »","active":false}],"path":"\/","per_page":25,"to":2,"total":2}}' + content: '{"data":[{"id":null,"server_id":null,"username":"letha64","databases":[],"host":"%","status":null,"created_at":null,"updated_at":null},{"id":null,"server_id":null,"username":"hagenes.lurline","databases":[],"host":"%","status":null,"created_at":null,"updated_at":null}],"links":{"first":"\/?page=1","last":"\/?page=1","prev":null,"next":null},"meta":{"current_page":1,"from":1,"last_page":1,"links":[{"url":null,"label":"« Previous","active":false},{"url":"\/?page=1","label":"1","active":true},{"url":null,"label":"Next »","active":false}],"path":"\/","per_page":25,"to":2,"total":2}}' headers: [] description: '' custom: [] @@ -60,7 +60,7 @@ endpoints: auth: - headers - Authorization - - 'Bearer a51dvD3akbfE4cV8eP6Zh6g' + - 'Bearer d4g15bV3Pa6hDvck6eaEf8Z' controller: null method: null route: null @@ -113,7 +113,7 @@ endpoints: name: username description: '' required: true - example: tempore + example: qui type: string enumValues: [] exampleWasSpecified: false @@ -123,7 +123,7 @@ endpoints: name: password description: '' required: true - example: '!jUv.BBc]X' + example: 'xYv*3,#HQ=5*m{p]DI' type: string enumValues: [] exampleWasSpecified: false @@ -334,7 +334,7 @@ endpoints: name: global description: 'Accessible in all projects' required: true - example: false + example: true type: string enumValues: - true @@ -343,17 +343,17 @@ endpoints: nullable: false custom: [] cleanBodyParameters: - name: sunt - token: est - url: 'http://www.fay.com/quisquam-autem-illum-omnis-quo-enim-eligendi-velit' - username: ab - password: 'M@-*%?(B(UNE~Ibc#' - global: false + name: non + token: sunt + url: 'https://www.frami.org/ex-at-minus-rerum-quo-minus-ea' + username: natus + password: 'A^">*m{p]DI' + global: true fileParameters: [] responses: - status: 200 - content: '{"id":5,"project_id":null,"global":true,"name":"Jadyn Hyatt","provider":"github","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":"Neha Little","provider":"github","created_at":"2025-04-05T17:48:03.000000Z","updated_at":"2025-04-05T17:48:03.000000Z"}' headers: [] description: '' custom: [] @@ -361,7 +361,7 @@ endpoints: auth: - headers - Authorization - - 'Bearer 63kaaDdg5fvVPeEh18b4c6Z' + - 'Bearer v3f6aaPk61Ze8hVdDbE5g4c' controller: null method: null route: null @@ -423,7 +423,7 @@ endpoints: auth: - headers - Authorization - - 'Bearer vb6ZE63ea8Da5fPhdkcVg14' + - 'Bearer fgk61vD68E4cZhP3bV5adea' controller: null method: null route: null diff --git a/.scribe/endpoints.cache/13.yaml b/.scribe/endpoints.cache/13.yaml index ab62415..87fa937 100644 --- a/.scribe/endpoints.cache/13.yaml +++ b/.scribe/endpoints.cache/13.yaml @@ -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":"« Previous","active":false},{"url":"\/?page=1","label":"1","active":true},{"url":null,"label":"Next »","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":"« Previous","active":false},{"url":"\/?page=1","label":"1","active":true},{"url":null,"label":"Next »","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 diff --git a/.scribe/endpoints/00.yaml b/.scribe/endpoints/00.yaml index 62e650e..181eaec 100644 --- a/.scribe/endpoints/00.yaml +++ b/.scribe/endpoints/00.yaml @@ -58,7 +58,7 @@ endpoints: auth: - headers - Authorization - - 'Bearer Pg1hVfEvc3e5kada68Z6b4D' + - 'Bearer eDa6Vdh1Z4vc35bP8E6gafk' controller: null method: null route: null @@ -111,7 +111,7 @@ endpoints: name: command description: '' required: true - example: nisi + example: quia type: string enumValues: [] exampleWasSpecified: false @@ -121,7 +121,7 @@ endpoints: name: user description: '' required: true - example: vito + example: root type: string enumValues: - root @@ -140,8 +140,8 @@ endpoints: nullable: false custom: [] cleanBodyParameters: - command: nisi - user: vito + command: quia + user: root frequency: '* * * * *' fileParameters: [] responses: @@ -155,7 +155,7 @@ endpoints: auth: - headers - Authorization - - 'Bearer 5E3Vv4cah8D6bZa1kgPfe6d' + - 'Bearer 66EeZvdh3kVaDP8f4ga5c1b' controller: null method: null route: null @@ -202,7 +202,7 @@ endpoints: name: cronJob_id description: 'The ID of the cronJob.' required: true - example: 14 + example: 6 type: integer enumValues: [] exampleWasSpecified: false @@ -211,7 +211,7 @@ endpoints: cleanUrlParameters: project_id: 1 server_id: 29 - cronJob_id: 14 + cronJob_id: 6 queryParameters: [] cleanQueryParameters: [] bodyParameters: [] @@ -228,7 +228,7 @@ endpoints: auth: - headers - Authorization - - 'Bearer e68fh451vcb6Zd3DEVaaPgk' + - 'Bearer D4c3Z65ebv8E16fahaVgPdk' controller: null method: null route: null @@ -275,7 +275,7 @@ endpoints: name: cronJob_id description: 'The ID of the cronJob.' required: true - example: 9 + example: 13 type: integer enumValues: [] exampleWasSpecified: false @@ -284,7 +284,7 @@ endpoints: cleanUrlParameters: project_id: 1 server_id: 29 - cronJob_id: 9 + cronJob_id: 13 queryParameters: [] cleanQueryParameters: [] bodyParameters: [] @@ -301,7 +301,7 @@ endpoints: auth: - headers - Authorization - - 'Bearer hEkD1b3a845fVPZg6ecad6v' + - 'Bearer h3cP4aZa1v8feDdEg5b6k6V' controller: null method: null route: null diff --git a/.scribe/endpoints/01.yaml b/.scribe/endpoints/01.yaml index 354af12..f9069a1 100644 --- a/.scribe/endpoints/01.yaml +++ b/.scribe/endpoints/01.yaml @@ -50,7 +50,7 @@ endpoints: responses: - status: 200 - content: '{"data":[{"id":null,"server_id":null,"name":"conn.bridget","status":"ready","created_at":null,"updated_at":null},{"id":null,"server_id":null,"name":"aiden47","status":"ready","created_at":null,"updated_at":null}],"links":{"first":"\/?page=1","last":"\/?page=1","prev":null,"next":null},"meta":{"current_page":1,"from":1,"last_page":1,"links":[{"url":null,"label":"« Previous","active":false},{"url":"\/?page=1","label":"1","active":true},{"url":null,"label":"Next »","active":false}],"path":"\/","per_page":25,"to":2,"total":2}}' + content: '{"data":[{"id":null,"server_id":null,"name":"leffler.esther","status":"ready","created_at":null,"updated_at":null},{"id":null,"server_id":null,"name":"rhoda.rutherford","status":"ready","created_at":null,"updated_at":null}],"links":{"first":"\/?page=1","last":"\/?page=1","prev":null,"next":null},"meta":{"current_page":1,"from":1,"last_page":1,"links":[{"url":null,"label":"« Previous","active":false},{"url":"\/?page=1","label":"1","active":true},{"url":null,"label":"Next »","active":false}],"path":"\/","per_page":25,"to":2,"total":2}}' headers: [] description: '' custom: [] @@ -58,7 +58,7 @@ endpoints: auth: - headers - Authorization - - 'Bearer 5vVfe3hcg1akP6Z8ba64dDE' + - 'Bearer E1VdfegZah4k86b53Dc6Pva' controller: null method: null route: null @@ -111,7 +111,7 @@ endpoints: name: name description: '' required: true - example: vel + example: quisquam type: string enumValues: [] exampleWasSpecified: false @@ -121,7 +121,7 @@ endpoints: name: charset description: '' required: true - example: qui + example: omnis type: string enumValues: [] exampleWasSpecified: false @@ -131,21 +131,21 @@ endpoints: name: collation description: '' required: true - example: autem + example: at type: string enumValues: [] exampleWasSpecified: false nullable: false custom: [] cleanBodyParameters: - name: vel - charset: qui - collation: autem + name: quisquam + charset: omnis + collation: at fileParameters: [] responses: - status: 200 - content: '{"id":null,"server_id":null,"name":"rodolfo.bradtke","status":"ready","created_at":null,"updated_at":null}' + content: '{"id":null,"server_id":null,"name":"csawayn","status":"ready","created_at":null,"updated_at":null}' headers: [] description: '' custom: [] @@ -153,7 +153,7 @@ endpoints: auth: - headers - Authorization - - 'Bearer 3gf6ahcav1kb546DZeE8PdV' + - 'Bearer PVgkZ35ca4afd1EbD8ehv66' controller: null method: null route: null @@ -200,7 +200,7 @@ endpoints: name: id description: 'The ID of the database.' required: true - example: 17 + example: 8 type: integer enumValues: [] exampleWasSpecified: false @@ -209,7 +209,7 @@ endpoints: cleanUrlParameters: project_id: 1 server_id: 29 - id: 17 + id: 8 queryParameters: [] cleanQueryParameters: [] bodyParameters: [] @@ -218,7 +218,7 @@ endpoints: responses: - status: 200 - content: '{"id":null,"server_id":null,"name":"rhane","status":"ready","created_at":null,"updated_at":null}' + content: '{"id":null,"server_id":null,"name":"sandrine43","status":"ready","created_at":null,"updated_at":null}' headers: [] description: '' custom: [] @@ -226,7 +226,7 @@ endpoints: auth: - headers - Authorization - - 'Bearer VEvk3dP685Zahcf6a41bgDe' + - 'Bearer EP64D8g51adf6hbceavVZ3k' controller: null method: null route: null @@ -273,7 +273,7 @@ endpoints: name: database_id description: 'The ID of the database.' required: true - example: 5 + example: 8 type: integer enumValues: [] exampleWasSpecified: false @@ -282,7 +282,7 @@ endpoints: cleanUrlParameters: project_id: 1 server_id: 29 - database_id: 5 + database_id: 8 queryParameters: [] cleanQueryParameters: [] bodyParameters: [] @@ -299,7 +299,7 @@ endpoints: auth: - headers - Authorization - - 'Bearer dPZ8bga4DEh6V16ce35avfk' + - 'Bearer 8dgEk3Zv1eaVP66bDhf4ac5' controller: null method: null route: null diff --git a/.scribe/endpoints/02.yaml b/.scribe/endpoints/02.yaml index 76f24b1..a1d8a7a 100644 --- a/.scribe/endpoints/02.yaml +++ b/.scribe/endpoints/02.yaml @@ -50,7 +50,7 @@ endpoints: responses: - status: 200 - content: '{"data":[{"id":null,"server_id":null,"username":"lavina.zemlak","databases":[],"host":"%","status":null,"created_at":null,"updated_at":null},{"id":null,"server_id":null,"username":"hill.cassidy","databases":[],"host":"%","status":null,"created_at":null,"updated_at":null}],"links":{"first":"\/?page=1","last":"\/?page=1","prev":null,"next":null},"meta":{"current_page":1,"from":1,"last_page":1,"links":[{"url":null,"label":"« Previous","active":false},{"url":"\/?page=1","label":"1","active":true},{"url":null,"label":"Next »","active":false}],"path":"\/","per_page":25,"to":2,"total":2}}' + content: '{"data":[{"id":null,"server_id":null,"username":"letha64","databases":[],"host":"%","status":null,"created_at":null,"updated_at":null},{"id":null,"server_id":null,"username":"hagenes.lurline","databases":[],"host":"%","status":null,"created_at":null,"updated_at":null}],"links":{"first":"\/?page=1","last":"\/?page=1","prev":null,"next":null},"meta":{"current_page":1,"from":1,"last_page":1,"links":[{"url":null,"label":"« Previous","active":false},{"url":"\/?page=1","label":"1","active":true},{"url":null,"label":"Next »","active":false}],"path":"\/","per_page":25,"to":2,"total":2}}' headers: [] description: '' custom: [] @@ -58,7 +58,7 @@ endpoints: auth: - headers - Authorization - - 'Bearer a51dvD3akbfE4cV8eP6Zh6g' + - 'Bearer d4g15bV3Pa6hDvck6eaEf8Z' controller: null method: null route: null @@ -111,7 +111,7 @@ endpoints: name: username description: '' required: true - example: tempore + example: qui type: string enumValues: [] exampleWasSpecified: false @@ -121,7 +121,7 @@ endpoints: name: password description: '' required: true - example: '!jUv.BBc]X' + example: 'xYv*3,#HQ=5*m{p]DI' type: string enumValues: [] exampleWasSpecified: false @@ -332,7 +332,7 @@ endpoints: name: global description: 'Accessible in all projects' required: true - example: false + example: true type: string enumValues: - true @@ -341,17 +341,17 @@ endpoints: nullable: false custom: [] cleanBodyParameters: - name: sunt - token: est - url: 'http://www.fay.com/quisquam-autem-illum-omnis-quo-enim-eligendi-velit' - username: ab - password: 'M@-*%?(B(UNE~Ibc#' - global: false + name: non + token: sunt + url: 'https://www.frami.org/ex-at-minus-rerum-quo-minus-ea' + username: natus + password: 'A^">*m{p]DI' + global: true fileParameters: [] responses: - status: 200 - content: '{"id":5,"project_id":null,"global":true,"name":"Jadyn Hyatt","provider":"github","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":"Neha Little","provider":"github","created_at":"2025-04-05T17:48:03.000000Z","updated_at":"2025-04-05T17:48:03.000000Z"}' headers: [] description: '' custom: [] @@ -359,7 +359,7 @@ endpoints: auth: - headers - Authorization - - 'Bearer 63kaaDdg5fvVPeEh18b4c6Z' + - 'Bearer v3f6aaPk61Ze8hVdDbE5g4c' controller: null method: null route: null @@ -421,7 +421,7 @@ endpoints: auth: - headers - Authorization - - 'Bearer vb6ZE63ea8Da5fPhdkcVg14' + - 'Bearer fgk61vD68E4cZhP3bV5adea' controller: null method: null route: null diff --git a/.scribe/endpoints/13.yaml b/.scribe/endpoints/13.yaml index 75b68d1..bc38a9b 100644 --- a/.scribe/endpoints/13.yaml +++ b/.scribe/endpoints/13.yaml @@ -39,7 +39,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":"« Previous","active":false},{"url":"\/?page=1","label":"1","active":true},{"url":null,"label":"Next »","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":"« Previous","active":false},{"url":"\/?page=1","label":"1","active":true},{"url":null,"label":"Next »","active":false}],"path":"\/","per_page":25,"to":2,"total":2}}' headers: [] description: '' custom: [] @@ -47,7 +47,7 @@ endpoints: auth: - headers - Authorization - - 'Bearer vk63dEVe6PD5af4gZcbh1a8' + - 'Bearer fgh4eV31dP58kvaDEaZbc66' controller: null method: null route: null @@ -89,7 +89,7 @@ endpoints: name: provider description: 'The provider (aws, linode, hetzner, digitalocean, vultr, ...)' required: true - example: quia + example: ab type: string enumValues: [] exampleWasSpecified: false @@ -99,7 +99,7 @@ endpoints: name: name description: 'The name of the storage provider.' required: true - example: rerum + example: quo type: string enumValues: [] exampleWasSpecified: false @@ -109,7 +109,7 @@ endpoints: name: token description: 'The token if provider requires api token' required: true - example: hic + example: in type: string enumValues: [] exampleWasSpecified: false @@ -119,7 +119,7 @@ endpoints: name: key description: 'The key if provider requires key' required: true - example: repellat + example: sunt type: string enumValues: [] exampleWasSpecified: false @@ -129,23 +129,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: [] @@ -153,7 +153,7 @@ endpoints: auth: - headers - Authorization - - 'Bearer 5ekD6EPbhdvVa84f31aZcg6' + - 'Bearer e584613dkZaPDEVvgcahbf6' controller: null method: null route: null @@ -207,7 +207,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: [] @@ -215,7 +215,7 @@ endpoints: auth: - headers - Authorization - - 'Bearer 3fb86PcgDZadkhV1aEv4e56' + - 'Bearer h6Zk6834dDce5fbPa1VvagE' controller: null method: null route: null @@ -268,7 +268,7 @@ endpoints: name: name description: 'The name of the storage provider.' required: true - example: est + example: voluptas type: string enumValues: [] exampleWasSpecified: false @@ -287,13 +287,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: [] @@ -301,7 +301,7 @@ endpoints: auth: - headers - Authorization - - 'Bearer 8E6g3aDZcafV465bdkPe1vh' + - 'Bearer ak6fgd1Eba48chvPV3e5Z6D' controller: null method: null route: null @@ -363,7 +363,7 @@ endpoints: auth: - headers - Authorization - - 'Bearer vf34Dch58Va6bZgk61PaeEd' + - 'Bearer PcaDbh6ZE4aV1e8fdv56k3g' controller: null method: null route: null diff --git a/app/Http/Controllers/API/SiteController.php b/app/Http/Controllers/API/SiteController.php index 91abd55..6cb6aed 100644 --- a/app/Http/Controllers/API/SiteController.php +++ b/app/Http/Controllers/API/SiteController.php @@ -6,6 +6,7 @@ use App\Actions\Site\Deploy; use App\Actions\Site\UpdateAliases; use App\Actions\Site\UpdateDeploymentScript; +use App\Actions\Site\UpdateEnv; use App\Actions\Site\UpdateLoadBalancer; use App\Enums\LoadBalancerMethod; use App\Enums\SiteType; @@ -184,6 +185,45 @@ public function showDeploymentScript(Project $project, Server $server, Site $sit ]); } + #[Get('{site}/env', name: 'api.projects.servers.sites.env.show', middleware: 'ability:read')] + #[Endpoint(title: 'env', description: 'Get site .env file content')] + #[Response(content: [ + 'data' => [ + 'env' => 'APP_NAME=Laravel\nAPP_ENV=production', + ], + ], status: 200)] + public function showEnv(Project $project, Server $server, Site $site): \Illuminate\Http\JsonResponse + { + $this->authorize('view', [$site, $server]); + + $this->validateRoute($project, $server, $site); + + return response()->json([ + 'data' => [ + 'env' => $site->getEnv(), + ], + ]); + } + + #[Put('{site}/env', name: 'api.projects.servers.sites.env', middleware: 'ability:write')] + #[Endpoint(title: 'env', description: 'Update site .env file')] + #[BodyParam(name: 'env', type: 'string', description: 'Content of the .env file')] + #[Response(status: 200)] + public function updateEnv(Request $request, Project $project, Server $server, Site $site): SiteResource + { + $this->authorize('update', [$site, $server]); + + $this->validateRoute($project, $server, $site); + + $this->validate($request, [ + 'env' => ['required', 'string'], + ]); + + app(UpdateEnv::class)->update($site, $request->all()); + + return new SiteResource($site); + } + private function validateRoute(Project $project, Server $server, ?Site $site = null): void { if ($project->id !== $server->project_id) { diff --git a/public/api-docs/collection.json b/public/api-docs/collection.json index be847ce..c04bf79 100644 --- a/public/api-docs/collection.json +++ b/public/api-docs/collection.json @@ -10,7 +10,7 @@ ], "info": { "name": "API Documentation", - "_postman_id": "a3f834cc-c09b-4ca3-8824-6310bbb83f4e", + "_postman_id": "bda1e04e-cc4f-4eae-9beb-dba7c9287038", "description": "VitoDeploy's API documentation.", "schema": "https:\/\/schema.getpostman.com\/json\/collection\/v2.1.0\/collection.json" }, @@ -101,7 +101,7 @@ ], "body": { "mode": "raw", - "raw": "{\"command\":\"nisi\",\"user\":\"vito\",\"frequency\":\"* * * * *\"}" + "raw": "{\"command\":\"quia\",\"user\":\"root\",\"frequency\":\"* * * * *\"}" }, "description": "Create a new cron job." }, @@ -138,7 +138,7 @@ { "id": "cronJob_id", "key": "cronJob_id", - "value": "14", + "value": "6", "description": "The ID of the cronJob." } ] @@ -190,7 +190,7 @@ { "id": "cronJob_id", "key": "cronJob_id", - "value": "9", + "value": "13", "description": "The ID of the cronJob." } ] @@ -265,7 +265,7 @@ { "header": [], "code": 200, - "body": "{\"data\":[{\"id\":null,\"server_id\":null,\"username\":\"lavina.zemlak\",\"databases\":[],\"host\":\"%\",\"status\":null,\"created_at\":null,\"updated_at\":null},{\"id\":null,\"server_id\":null,\"username\":\"hill.cassidy\",\"databases\":[],\"host\":\"%\",\"status\":null,\"created_at\":null,\"updated_at\":null}],\"links\":{\"first\":\"\\\/?page=1\",\"last\":\"\\\/?page=1\",\"prev\":null,\"next\":null},\"meta\":{\"current_page\":1,\"from\":1,\"last_page\":1,\"links\":[{\"url\":null,\"label\":\"« Previous\",\"active\":false},{\"url\":\"\\\/?page=1\",\"label\":\"1\",\"active\":true},{\"url\":null,\"label\":\"Next »\",\"active\":false}],\"path\":\"\\\/\",\"per_page\":25,\"to\":2,\"total\":2}}", + "body": "{\"data\":[{\"id\":null,\"server_id\":null,\"username\":\"letha64\",\"databases\":[],\"host\":\"%\",\"status\":null,\"created_at\":null,\"updated_at\":null},{\"id\":null,\"server_id\":null,\"username\":\"hagenes.lurline\",\"databases\":[],\"host\":\"%\",\"status\":null,\"created_at\":null,\"updated_at\":null}],\"links\":{\"first\":\"\\\/?page=1\",\"last\":\"\\\/?page=1\",\"prev\":null,\"next\":null},\"meta\":{\"current_page\":1,\"from\":1,\"last_page\":1,\"links\":[{\"url\":null,\"label\":\"« Previous\",\"active\":false},{\"url\":\"\\\/?page=1\",\"label\":\"1\",\"active\":true},{\"url\":null,\"label\":\"Next »\",\"active\":false}],\"path\":\"\\\/\",\"per_page\":25,\"to\":2,\"total\":2}}", "name": "" } ] @@ -306,7 +306,7 @@ ], "body": { "mode": "raw", - "raw": "{\"username\":\"tempore\",\"password\":\"!jUv.BBc]X\",\"host\":\"%\"}" + "raw": "{\"username\":\"qui\",\"password\":\"xYv*3,#HQ=5*m{p]DI\",\"global\":true}" }, "description": "" }, @@ -2944,7 +3051,7 @@ { "header": [], "code": 200, - "body": "{\"id\":5,\"project_id\":null,\"global\":true,\"name\":\"Jadyn Hyatt\",\"provider\":\"github\",\"created_at\":\"2025-04-05T17:35:56.000000Z\",\"updated_at\":\"2025-04-05T17:35:56.000000Z\"}", + "body": "{\"id\":5,\"project_id\":null,\"global\":true,\"name\":\"Neha Little\",\"provider\":\"github\",\"created_at\":\"2025-04-05T17:48:03.000000Z\",\"updated_at\":\"2025-04-05T17:48:03.000000Z\"}", "name": "" } ] @@ -3042,7 +3149,7 @@ { "header": [], "code": 200, - "body": "{\"data\":[{\"id\":null,\"user\":null,\"name\":\"Moriah Kemmer\",\"created_at\":null,\"updated_at\":null},{\"id\":null,\"user\":null,\"name\":\"Delilah Gaylord\",\"created_at\":null,\"updated_at\":null}],\"links\":{\"first\":\"\\\/?page=1\",\"last\":\"\\\/?page=1\",\"prev\":null,\"next\":null},\"meta\":{\"current_page\":1,\"from\":1,\"last_page\":1,\"links\":[{\"url\":null,\"label\":\"« Previous\",\"active\":false},{\"url\":\"\\\/?page=1\",\"label\":\"1\",\"active\":true},{\"url\":null,\"label\":\"Next »\",\"active\":false}],\"path\":\"\\\/\",\"per_page\":25,\"to\":2,\"total\":2}}", + "body": "{\"data\":[{\"id\":null,\"user\":null,\"name\":\"Santa Goyette\",\"created_at\":null,\"updated_at\":null},{\"id\":null,\"user\":null,\"name\":\"Cecil Cummings\",\"created_at\":null,\"updated_at\":null}],\"links\":{\"first\":\"\\\/?page=1\",\"last\":\"\\\/?page=1\",\"prev\":null,\"next\":null},\"meta\":{\"current_page\":1,\"from\":1,\"last_page\":1,\"links\":[{\"url\":null,\"label\":\"« Previous\",\"active\":false},{\"url\":\"\\\/?page=1\",\"label\":\"1\",\"active\":true},{\"url\":null,\"label\":\"Next »\",\"active\":false}],\"path\":\"\\\/\",\"per_page\":25,\"to\":2,\"total\":2}}", "name": "" } ] @@ -3083,7 +3190,7 @@ ], "body": { "mode": "raw", - "raw": "{\"key_id\":\"id\",\"name\":\"qui\",\"public_key\":\"vitae\"}" + "raw": "{\"key_id\":\"explicabo\",\"name\":\"deleniti\",\"public_key\":\"sapiente\"}" }, "description": "Deploy ssh key to server." }, @@ -3091,7 +3198,7 @@ { "header": [], "code": 200, - "body": "{\"id\":null,\"user\":null,\"name\":\"Jesse Gleason\",\"created_at\":null,\"updated_at\":null}", + "body": "{\"id\":null,\"user\":null,\"name\":\"Mr. Reagan Jacobson V\",\"created_at\":null,\"updated_at\":null}", "name": "" } ] @@ -3189,7 +3296,7 @@ { "header": [], "code": 200, - "body": "{\"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\":\"« Previous\",\"active\":false},{\"url\":\"\\\/?page=1\",\"label\":\"1\",\"active\":true},{\"url\":null,\"label\":\"Next »\",\"active\":false}],\"path\":\"\\\/\",\"per_page\":25,\"to\":2,\"total\":2}}", + "body": "{\"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\":\"« Previous\",\"active\":false},{\"url\":\"\\\/?page=1\",\"label\":\"1\",\"active\":true},{\"url\":null,\"label\":\"Next »\",\"active\":false}],\"path\":\"\\\/\",\"per_page\":25,\"to\":2,\"total\":2}}", "name": "" } ] @@ -3224,7 +3331,7 @@ ], "body": { "mode": "raw", - "raw": "{\"provider\":\"quia\",\"name\":\"rerum\",\"token\":\"hic\",\"key\":\"repellat\",\"secret\":\"maiores\"}" + "raw": "{\"provider\":\"ab\",\"name\":\"quo\",\"token\":\"in\",\"key\":\"sunt\",\"secret\":\"molestias\"}" }, "description": "" }, @@ -3232,7 +3339,7 @@ { "header": [], "code": 200, - "body": "{\"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\"}", + "body": "{\"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\"}", "name": "" } ] @@ -3278,7 +3385,7 @@ { "header": [], "code": 200, - "body": "{\"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\"}", + "body": "{\"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\"}", "name": "" } ] @@ -3319,7 +3426,7 @@ ], "body": { "mode": "raw", - "raw": "{\"name\":\"est\",\"global\":true}" + "raw": "{\"name\":\"voluptas\",\"global\":true}" }, "description": "" }, @@ -3327,7 +3434,7 @@ { "header": [], "code": 200, - "body": "{\"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\"}", + "body": "{\"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\"}", "name": "" } ] diff --git a/public/api-docs/index.html b/public/api-docs/index.html index 699f616..bdc2bfe 100644 --- a/public/api-docs/index.html +++ b/public/api-docs/index.html @@ -307,6 +307,12 @@
  • deployment-script +
  • +
  • + env +
  • +
  • + env
  • @@ -647,8 +653,8 @@

    c --header "Content-Type: application/json" \ --header "Accept: application/json" \ --data "{ - \"command\": \"nisi\", - \"user\": \"vito\", + \"command\": \"quia\", + \"user\": \"root\", \"frequency\": \"* * * * *\" }" @@ -666,8 +672,8 @@

    c 'Accept' => 'application/json', ], 'json' => [ - 'command' => 'nisi', - 'user' => 'vito', + 'command' => 'quia', + 'user' => 'root', 'frequency' => '* * * * *', ], ] @@ -688,8 +694,8 @@

    c }; let body = { - "command": "nisi", - "user": "vito", + "command": "quia", + "user": "root", "frequency": "* * * * *" }; @@ -829,10 +835,10 @@

    Body Parameters

     
    -

    Example: nisi

    +

    Example: quia

    user   @@ -840,10 +846,10 @@

    Body Parameters

     
    -

    Example: vito

    +

    Example: root

    Must be one of:
    • root
    • vito
    @@ -874,7 +880,7 @@

    curl --request GET \
    -    --get "https://your-vito-url/api/projects/1/servers/29/cron-jobs/14" \
    +    --get "https://your-vito-url/api/projects/1/servers/29/cron-jobs/6" \
         --header "Authorization: Bearer YOUR-API-KEY" \
         --header "Content-Type: application/json" \
         --header "Accept: application/json"
    @@ -882,7 +888,7 @@

    $client = new \GuzzleHttp\Client();
    -$url = 'https://your-vito-url/api/projects/1/servers/29/cron-jobs/14';
    +$url = 'https://your-vito-url/api/projects/1/servers/29/cron-jobs/6';
     $response = $client->get(
         $url,
         [
    @@ -899,7 +905,7 @@ 

    const url = new URL(
    -    "https://your-vito-url/api/projects/1/servers/29/cron-jobs/14"
    +    "https://your-vito-url/api/projects/1/servers/29/cron-jobs/6"
     );
     
     const headers = {
    @@ -1042,10 +1048,10 @@ 

    URL Parameters

     
    -

    The ID of the cronJob. Example: 14

    +

    The ID of the cronJob. Example: 6

    @@ -1063,7 +1069,7 @@

    curl --request DELETE \
    -    "https://your-vito-url/api/projects/1/servers/29/cron-jobs/9" \
    +    "https://your-vito-url/api/projects/1/servers/29/cron-jobs/13" \
         --header "Authorization: Bearer YOUR-API-KEY" \
         --header "Content-Type: application/json" \
         --header "Accept: application/json"
    @@ -1071,7 +1077,7 @@

    $client = new \GuzzleHttp\Client();
    -$url = 'https://your-vito-url/api/projects/1/servers/29/cron-jobs/9';
    +$url = 'https://your-vito-url/api/projects/1/servers/29/cron-jobs/13';
     $response = $client->delete(
         $url,
         [
    @@ -1088,7 +1094,7 @@ 

    const url = new URL(
    -    "https://your-vito-url/api/projects/1/servers/29/cron-jobs/9"
    +    "https://your-vito-url/api/projects/1/servers/29/cron-jobs/13"
     );
     
     const headers = {
    @@ -1221,10 +1227,10 @@ 

    URL Parameters

     
    -

    The ID of the cronJob. Example: 9

    +

    The ID of the cronJob. Example: 13

    @@ -1298,7 +1304,7 @@

    @@ -1494,8 +1500,8 @@

    { "id": null, "server_id": null, - "username": "irwin45", + "username": "marcelle95", "databases": [], "host": "%", "status": null, @@ -1657,10 +1663,10 @@

    Body Parameters

     
    -

    Example: tempore

    +

    Example: qui

    password   @@ -1668,10 +1674,10 @@

    Body Parameters

     
    -

    Example: !jUv.BBc]X

    +

    Example: xYv*3,#HQ=5<w!

    host   @@ -1700,7 +1706,7 @@

    curl --request GET \
    -    --get "https://your-vito-url/api/projects/1/servers/29/database-users/3" \
    +    --get "https://your-vito-url/api/projects/1/servers/29/database-users/1" \
         --header "Authorization: Bearer YOUR-API-KEY" \
         --header "Content-Type: application/json" \
         --header "Accept: application/json"

    @@ -1708,7 +1714,7 @@

    $client = new \GuzzleHttp\Client();
    -$url = 'https://your-vito-url/api/projects/1/servers/29/database-users/3';
    +$url = 'https://your-vito-url/api/projects/1/servers/29/database-users/1';
     $response = $client->get(
         $url,
         [
    @@ -1725,7 +1731,7 @@ 

    const url = new URL(
    -    "https://your-vito-url/api/projects/1/servers/29/database-users/3"
    +    "https://your-vito-url/api/projects/1/servers/29/database-users/1"
     );
     
     const headers = {
    @@ -1750,7 +1756,7 @@ 

    { "id": null, "server_id": null, - "username": "frederic.koss", + "username": "brandi53", "databases": [], "host": "%", "status": null, @@ -1868,10 +1874,10 @@

    URL Parameters

     
    -

    The ID of the databaseUser. Example: 3

    +

    The ID of the databaseUser. Example: 1

    @@ -1889,19 +1895,19 @@

    curl --request POST \
    -    "https://your-vito-url/api/projects/1/servers/29/database-users/12/link" \
    +    "https://your-vito-url/api/projects/1/servers/29/database-users/4/link" \
         --header "Authorization: Bearer YOUR-API-KEY" \
         --header "Content-Type: application/json" \
         --header "Accept: application/json" \
         --data "{
    -    \"databases\": \"numquam\"
    +    \"databases\": \"maiores\"
     }"
     
    $client = new \GuzzleHttp\Client();
    -$url = 'https://your-vito-url/api/projects/1/servers/29/database-users/12/link';
    +$url = 'https://your-vito-url/api/projects/1/servers/29/database-users/4/link';
     $response = $client->post(
         $url,
         [
    @@ -1911,7 +1917,7 @@ 

    const url = new URL(
    -    "https://your-vito-url/api/projects/1/servers/29/database-users/12/link"
    +    "https://your-vito-url/api/projects/1/servers/29/database-users/4/link"
     );
     
     const headers = {
    @@ -1931,7 +1937,7 @@ 

    { "id": null, "server_id": null, - "username": "georgiana.hand", + "username": "kschmidt", "databases": [], "host": "%", "status": null, @@ -2069,10 +2075,10 @@

    URL Parameters

     
    -

    The ID of the databaseUser. Example: 12

    +

    The ID of the databaseUser. Example: 4

    Body Parameters

    @@ -2081,10 +2087,10 @@

    Body Parameters

     
    -

    Array of database names to link to the user. Example: numquam

    +

    Array of database names to link to the user. Example: maiores

    @@ -2102,7 +2108,7 @@

    curl --request DELETE \
    -    "https://your-vito-url/api/projects/1/servers/29/database-users/6" \
    +    "https://your-vito-url/api/projects/1/servers/29/database-users/20" \
         --header "Authorization: Bearer YOUR-API-KEY" \
         --header "Content-Type: application/json" \
         --header "Accept: application/json"
    @@ -2110,7 +2116,7 @@

    $client = new \GuzzleHttp\Client();
    -$url = 'https://your-vito-url/api/projects/1/servers/29/database-users/6';
    +$url = 'https://your-vito-url/api/projects/1/servers/29/database-users/20';
     $response = $client->delete(
         $url,
         [
    @@ -2127,7 +2133,7 @@ 

    const url = new URL(
    -    "https://your-vito-url/api/projects/1/servers/29/database-users/6"
    +    "https://your-vito-url/api/projects/1/servers/29/database-users/20"
     );
     
     const headers = {
    @@ -2260,10 +2266,10 @@ 

    URL Parameters

     
    -

    The ID of the databaseUser. Example: 6

    +

    The ID of the databaseUser. Example: 20

    @@ -2337,7 +2343,7 @@

    li { "id": null, "server_id": null, - "name": "conn.bridget", + "name": "leffler.esther", "status": "ready", "created_at": null, "updated_at": null @@ -2345,7 +2351,7 @@

    li { "id": null, "server_id": null, - "name": "aiden47", + "name": "rhoda.rutherford", "status": "ready", "created_at": null, "updated_at": null @@ -2510,9 +2516,9 @@

    c --header "Content-Type: application/json" \ --header "Accept: application/json" \ --data "{ - \"name\": \"vel\", - \"charset\": \"qui\", - \"collation\": \"autem\" + \"name\": \"quisquam\", + \"charset\": \"omnis\", + \"collation\": \"at\" }"

    @@ -2529,9 +2535,9 @@

    c 'Accept' => 'application/json', ], 'json' => [ - 'name' => 'vel', - 'charset' => 'qui', - 'collation' => 'autem', + 'name' => 'quisquam', + 'charset' => 'omnis', + 'collation' => 'at', ], ] ); @@ -2551,9 +2557,9 @@

    c }; let body = { - "name": "vel", - "charset": "qui", - "collation": "autem" + "name": "quisquam", + "charset": "omnis", + "collation": "at" }; fetch(url, { @@ -2573,7 +2579,7 @@

    c { "id": null, "server_id": null, - "name": "rodolfo.bradtke", + "name": "csawayn", "status": "ready", "created_at": null, "updated_at": null @@ -2690,10 +2696,10 @@

    Body Parameters

     
    -

    Example: vel

    +

    Example: quisquam

    charset   @@ -2701,10 +2707,10 @@

    Body Parameters

     
    -

    Example: qui

    +

    Example: omnis

    collation   @@ -2712,10 +2718,10 @@

    Body Parameters

     
    -

    Example: autem

    +

    Example: at

    @@ -2733,7 +2739,7 @@

    curl --request GET \
    -    --get "https://your-vito-url/api/projects/1/servers/29/databases/17" \
    +    --get "https://your-vito-url/api/projects/1/servers/29/databases/8" \
         --header "Authorization: Bearer YOUR-API-KEY" \
         --header "Content-Type: application/json" \
         --header "Accept: application/json"
    @@ -2741,7 +2747,7 @@

    $client = new \GuzzleHttp\Client();
    -$url = 'https://your-vito-url/api/projects/1/servers/29/databases/17';
    +$url = 'https://your-vito-url/api/projects/1/servers/29/databases/8';
     $response = $client->get(
         $url,
         [
    @@ -2758,7 +2764,7 @@ 

    const url = new URL(
    -    "https://your-vito-url/api/projects/1/servers/29/databases/17"
    +    "https://your-vito-url/api/projects/1/servers/29/databases/8"
     );
     
     const headers = {
    @@ -2783,7 +2789,7 @@ 

    { "id": null, "server_id": null, - "name": "rhane", + "name": "sandrine43", "status": "ready", "created_at": null, "updated_at": null @@ -2899,10 +2905,10 @@

    URL Parameters

     
    -

    The ID of the database. Example: 17

    +

    The ID of the database. Example: 8

    @@ -2920,7 +2926,7 @@

    curl --request DELETE \
    -    "https://your-vito-url/api/projects/1/servers/29/databases/5" \
    +    "https://your-vito-url/api/projects/1/servers/29/databases/8" \
         --header "Authorization: Bearer YOUR-API-KEY" \
         --header "Content-Type: application/json" \
         --header "Accept: application/json"
    @@ -2928,7 +2934,7 @@

    $client = new \GuzzleHttp\Client();
    -$url = 'https://your-vito-url/api/projects/1/servers/29/databases/5';
    +$url = 'https://your-vito-url/api/projects/1/servers/29/databases/8';
     $response = $client->delete(
         $url,
         [
    @@ -2945,7 +2951,7 @@ 

    const url = new URL(
    -    "https://your-vito-url/api/projects/1/servers/29/databases/5"
    +    "https://your-vito-url/api/projects/1/servers/29/databases/8"
     );
     
     const headers = {
    @@ -3078,10 +3084,10 @@ 

    URL Parameters

     
    -

    The ID of the database. Example: 5

    +

    The ID of the database. Example: 8

    @@ -3154,12 +3160,12 @@

    @@ -3362,11 +3368,11 @@

    { "id": null, - "name": "consequuntur", + "name": "omnis", "server_id": null, "type": "allow", "protocol": "tcp", - "port": 50101, - "source": "133.245.21.1", + "port": 54634, + "source": "246.242.9.65", "mask": 24, "note": "test", "status": null, @@ -3535,10 +3541,10 @@

    Body Parameters

     
    -

    Example: eum

    +

    Example: sapiente

    type   @@ -3546,10 +3552,10 @@

    Body Parameters

     
    -

    Example: deny

    +

    Example: allow

    Must be one of:
    • allow
    • deny
    @@ -3559,10 +3565,10 @@

    Body Parameters

     
    -

    Example: udp

    +

    Example: tcp

    Must be one of:
    • tcp
    • udp
    @@ -3572,10 +3578,10 @@

    Body Parameters

     
    -

    Example: incidunt

    +

    Example: et

    source   @@ -3583,10 +3589,10 @@

    Body Parameters

    optional  
    -

    Example: quisquam

    +

    Example: doloribus

    mask   @@ -3620,11 +3626,11 @@

    @@ -3642,11 +3648,11 @@

    { "id": null, - "name": "numquam", + "name": "consequatur", "server_id": null, "type": "allow", "protocol": "tcp", - "port": 52010, - "source": "159.227.119.185", + "port": 879, + "source": "206.106.27.116", "mask": 24, "note": "test", "status": null, @@ -3826,10 +3832,10 @@

    Body Parameters

     
    -

    Example: dolor

    +

    Example: et

    type   @@ -3837,10 +3843,10 @@

    Body Parameters

     
    -

    Example: deny

    +

    Example: allow

    Must be one of:
    • allow
    • deny
    @@ -3863,10 +3869,10 @@

    Body Parameters

     
    -

    Example: qui

    +

    Example: aut

    source   @@ -3874,10 +3880,10 @@

    Body Parameters

    optional  
    -

    Example: porro

    +

    Example: et

    mask   @@ -3955,12 +3961,12 @@

    { "id": null, - "name": "voluptatem", + "name": "dolores", "server_id": null, "type": "allow", "protocol": "tcp", - "port": 5812, - "source": "122.105.250.56", + "port": 4691, + "source": "147.108.28.144", "mask": 24, "note": "test", "status": null, @@ -4480,15 +4486,15 @@

    list

    "data": [ { "id": 3, - "name": "Selina Wintheiser DDS", - "created_at": "2025-04-05T17:35:55.000000Z", - "updated_at": "2025-04-05T17:35:55.000000Z" + "name": "Mr. Drake Nader", + "created_at": "2025-04-05T17:48:03.000000Z", + "updated_at": "2025-04-05T17:48:03.000000Z" }, { "id": 4, - "name": "Shanna Deckow", - "created_at": "2025-04-05T17:35:55.000000Z", - "updated_at": "2025-04-05T17:35:55.000000Z" + "name": "Wilhelmine Jacobson", + "created_at": "2025-04-05T17:48:03.000000Z", + "updated_at": "2025-04-05T17:48:03.000000Z" } ], "links": { @@ -4627,7 +4633,7 @@

    create

    --header "Content-Type: application/json" \ --header "Accept: application/json" \ --data "{ - \"name\": \"quibusdam\" + \"name\": \"dignissimos\" }"

    @@ -4644,7 +4650,7 @@

    create

    'Accept' => 'application/json', ], 'json' => [ - 'name' => 'quibusdam', + 'name' => 'dignissimos', ], ] ); @@ -4664,7 +4670,7 @@

    create

    }; let body = { - "name": "quibusdam" + "name": "dignissimos" }; fetch(url, { @@ -4683,9 +4689,9 @@

    create

    { "id": 3, - "name": "Mr. Johathan Koch", - "created_at": "2025-04-05T17:35:55.000000Z", - "updated_at": "2025-04-05T17:35:55.000000Z" + "name": "Pattie Cole", + "created_at": "2025-04-05T17:48:03.000000Z", + "updated_at": "2025-04-05T17:48:03.000000Z" }

    @@ -4776,10 +4782,10 @@

    Body Parameters

     
    -

    The name of the project. Example: quibusdam

    +

    The name of the project. Example: dignissimos

    @@ -4846,9 +4852,9 @@

    show

    { "id": 3, - "name": "Jorge Schulist V", - "created_at": "2025-04-05T17:35:55.000000Z", - "updated_at": "2025-04-05T17:35:55.000000Z" + "name": "Mr. Elias Bauch", + "created_at": "2025-04-05T17:48:03.000000Z", + "updated_at": "2025-04-05T17:48:03.000000Z" }

    @@ -4965,7 +4971,7 @@

    update

    --header "Content-Type: application/json" \ --header "Accept: application/json" \ --data "{ - \"name\": \"enim\" + \"name\": \"sunt\" }"

    @@ -4982,7 +4988,7 @@

    update

    'Accept' => 'application/json', ], 'json' => [ - 'name' => 'enim', + 'name' => 'sunt', ], ] ); @@ -5002,7 +5008,7 @@

    update

    }; let body = { - "name": "enim" + "name": "sunt" }; fetch(url, { @@ -5021,9 +5027,9 @@

    update

    { "id": 3, - "name": "Annie Windler", - "created_at": "2025-04-05T17:35:55.000000Z", - "updated_at": "2025-04-05T17:35:55.000000Z" + "name": "Elfrieda Jakubowski", + "created_at": "2025-04-05T17:48:03.000000Z", + "updated_at": "2025-04-05T17:48:03.000000Z" }

    @@ -5126,10 +5132,10 @@

    Body Parameters

     
    -

    The name of the project. Example: enim

    +

    The name of the project. Example: sunt

    @@ -5360,9 +5366,9 @@

    @@ -5567,9 +5573,9 @@

    Body Parameters

     
    -

    Example: qui

    +

    Example: odit

    to   @@ -5743,10 +5749,10 @@

    Body Parameters

     
    -

    Example: voluptatum

    +

    Example: incidunt

    mode   @@ -5754,10 +5760,10 @@

    Body Parameters

     
    -

    Example: 302

    +

    Example: 301

    Must be one of:
    • 301
    • 302
    • 307
    • 308
    @@ -6024,19 +6030,19 @@

    list

    create< --header "Content-Type: application/json" \ --header "Accept: application/json" \ --data "{ - \"provider\": \"sunt\", - \"name\": \"aut\", - \"token\": \"id\", - \"key\": \"porro\", - \"secret\": \"voluptas\" + \"provider\": \"corrupti\", + \"name\": \"est\", + \"token\": \"rerum\", + \"key\": \"ut\", + \"secret\": \"sed\" }"

    @@ -6208,11 +6214,11 @@

    create< 'Accept' => 'application/json', ], 'json' => [ - 'provider' => 'sunt', - 'name' => 'aut', - 'token' => 'id', - 'key' => 'porro', - 'secret' => 'voluptas', + 'provider' => 'corrupti', + 'name' => 'est', + 'token' => 'rerum', + 'key' => 'ut', + 'secret' => 'sed', ], ] ); @@ -6232,11 +6238,11 @@

    create< }; let body = { - "provider": "sunt", - "name": "aut", - "token": "id", - "key": "porro", - "secret": "voluptas" + "provider": "corrupti", + "name": "est", + "token": "rerum", + "key": "ut", + "secret": "sed" }; fetch(url, { @@ -6257,10 +6263,10 @@

    create< "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" + "name": "voluptas", + "provider": "vultr", + "created_at": "2025-04-05T17:48:03.000000Z", + "updated_at": "2025-04-05T17:48:03.000000Z" }

    @@ -6363,10 +6369,10 @@

    Body Parameters

     
    -

    The provider (aws, linode, hetzner, digitalocean, vultr, ...) Example: sunt

    +

    The provider (aws, linode, hetzner, digitalocean, vultr, ...) Example: corrupti

    name   @@ -6374,10 +6380,10 @@

    Body Parameters

     
    -

    The name of the server provider. Example: aut

    +

    The name of the server provider. Example: est

    token   @@ -6385,10 +6391,10 @@

    Body Parameters

     
    -

    The token if provider requires api token Example: id

    +

    The token if provider requires api token Example: rerum

    key   @@ -6396,10 +6402,10 @@

    Body Parameters

     
    -

    The key if provider requires key Example: porro

    +

    The key if provider requires key Example: ut

    secret   @@ -6407,10 +6413,10 @@

    Body Parameters

     
    -

    The secret if provider requires key Example: voluptas

    +

    The secret if provider requires key Example: sed

    @@ -6479,10 +6485,10 @@

    @@ -6628,8 +6634,8 @@

    Body Parameters

     
    -

    The name of the server provider. Example: aliquam

    +

    The name of the server provider. Example: earum

    global   @@ -6802,7 +6808,7 @@

    Body Parameters

    value="" data-component="body">
    -

    Accessible in all projects Example: true

    +

    Accessible in all projects Example: false

    Must be one of:
    • 1
    @@ -7048,10 +7054,10 @@

    list

    "project_id": null, "user_id": null, "provider_id": null, - "name": "Marcelino Rodriguez", + "name": "Miss Bonita Vandervort IV", "ssh_user": "vito", - "ip": "128.182.22.13", - "local_ip": "19.119.134.124", + "ip": "120.222.195.212", + "local_ip": "138.119.37.248", "port": 22, "os": "ubuntu_22", "type": "regular", @@ -7075,10 +7081,10 @@

    list

    "project_id": null, "user_id": null, "provider_id": null, - "name": "Everardo Conn", + "name": "Dr. Shanie Batz IV", "ssh_user": "vito", - "ip": "62.215.59.124", - "local_ip": "32.153.141.12", + "ip": "241.88.138.163", + "local_ip": "138.226.232.93", "port": 22, "os": "ubuntu_22", "type": "regular", @@ -7246,17 +7252,17 @@

    create

    --header "Content-Type: application/json" \ --header "Accept: application/json" \ --data "{ - \"provider\": \"ut\", - \"server_provider\": \"hetzner\", - \"region\": \"consectetur\", + \"provider\": \"fugiat\", + \"server_provider\": \"digitalocean\", + \"region\": \"itaque\", \"plan\": \"voluptatum\", - \"ip\": \"quisquam\", - \"port\": \"sapiente\", - \"name\": \"itaque\", - \"os\": \"aut\", + \"ip\": \"ut\", + \"port\": \"reiciendis\", + \"name\": \"et\", + \"os\": \"vel\", \"webserver\": \"nginx\", - \"database\": \"postgresql13\", - \"php\": \"7.4\" + \"database\": \"mysql80\", + \"php\": \"7.2\" }"
    @@ -7273,17 +7279,17 @@

    create

    'Accept' => 'application/json', ], 'json' => [ - 'provider' => 'ut', - 'server_provider' => 'hetzner', - 'region' => 'consectetur', + 'provider' => 'fugiat', + 'server_provider' => 'digitalocean', + 'region' => 'itaque', 'plan' => 'voluptatum', - 'ip' => 'quisquam', - 'port' => 'sapiente', - 'name' => 'itaque', - 'os' => 'aut', + 'ip' => 'ut', + 'port' => 'reiciendis', + 'name' => 'et', + 'os' => 'vel', 'webserver' => 'nginx', - 'database' => 'postgresql13', - 'php' => '7.4', + 'database' => 'mysql80', + 'php' => '7.2', ], ] ); @@ -7303,17 +7309,17 @@

    create

    }; let body = { - "provider": "ut", - "server_provider": "hetzner", - "region": "consectetur", + "provider": "fugiat", + "server_provider": "digitalocean", + "region": "itaque", "plan": "voluptatum", - "ip": "quisquam", - "port": "sapiente", - "name": "itaque", - "os": "aut", + "ip": "ut", + "port": "reiciendis", + "name": "et", + "os": "vel", "webserver": "nginx", - "database": "postgresql13", - "php": "7.4" + "database": "mysql80", + "php": "7.2" }; fetch(url, { @@ -7335,10 +7341,10 @@

    create

    "project_id": null, "user_id": null, "provider_id": null, - "name": "Sidney Grant", + "name": "Jeromy Mann", "ssh_user": "vito", - "ip": "22.232.10.97", - "local_ip": "107.107.187.150", + "ip": "128.70.209.89", + "local_ip": "150.217.250.187", "port": 22, "os": "ubuntu_22", "type": "regular", @@ -7458,10 +7464,10 @@

    Body Parameters

     
    -

    The server provider type Example: ut

    +

    The server provider type Example: fugiat

    server_provider   @@ -7469,10 +7475,10 @@

    Body Parameters

     
    -

    If the provider is not custom, the ID of the server provider profile Example: hetzner

    +

    If the provider is not custom, the ID of the server provider profile Example: digitalocean

    Must be one of:
    • custom
    • hetzner
    • digitalocean
    • linode
    • vultr
    @@ -7482,10 +7488,10 @@

    Body Parameters

     
    -

    Provider region if the provider is not custom Example: consectetur

    +

    Provider region if the provider is not custom Example: itaque

    plan   @@ -7504,10 +7510,10 @@

    Body Parameters

     
    -

    SSH IP address if the provider is custom Example: quisquam

    +

    SSH IP address if the provider is custom Example: ut

    port   @@ -7515,10 +7521,10 @@

    Body Parameters

     
    -

    SSH Port if the provider is custom Example: sapiente

    +

    SSH Port if the provider is custom Example: reiciendis

    name   @@ -7526,10 +7532,10 @@

    Body Parameters

     
    -

    The name of the server. Example: itaque

    +

    The name of the server. Example: et

    os   @@ -7537,10 +7543,10 @@

    Body Parameters

     
    -

    The os of the server Example: aut

    +

    The os of the server Example: vel

    webserver   @@ -7561,10 +7567,10 @@

    Body Parameters

     
    -

    Database Example: postgresql13

    +

    Database Example: mysql80

    Must be one of:
    • none
    • mysql57
    • mysql80
    • mariadb103
    • mariadb104
    • mariadb103
    • postgresql12
    • postgresql13
    • postgresql14
    • postgresql15
    • postgresql16
    @@ -7574,10 +7580,10 @@

    Body Parameters

     
    -

    PHP version Example: 7.4

    +

    PHP version Example: 7.2

    Must be one of:
    • 7.0
    • 7.1
    • 7.2
    • 7.3
    • 7.4
    • 8.0
    • 8.1
    • 8.2
    • 8.3
    @@ -7649,10 +7655,10 @@

    show

    "project_id": null, "user_id": null, "provider_id": null, - "name": "Maria Zemlak", + "name": "Miss Maya Schaden I", "ssh_user": "vito", - "ip": "4.166.233.247", - "local_ip": "92.197.44.184", + "ip": "44.57.83.39", + "local_ip": "46.22.92.58", "port": 22, "os": "ubuntu_22", "type": "regular", @@ -10049,20 +10055,20 @@

    create @@ -10079,20 +10085,20 @@

    createcreateBody Parameters

     
    -

    Example: wordpress

    +

    Example: php-blank

    Must be one of:
    • php
    • php-blank
    • phpmyadmin
    • laravel
    • wordpress
    • load-balancer
    @@ -10287,10 +10293,10 @@

    Body Parameters

     
    -

    Example: ut

    +

    Example: impedit

    aliases   @@ -10333,10 +10339,10 @@

    Body Parameters

     
    -

    Source control ID, Required for Sites which support source control Example: animi

    +

    Source control ID, Required for Sites which support source control Example: non

    repository   @@ -10398,10 +10404,10 @@

    Body Parameters

     
    -

    user, to isolate the website under a new user Example: est

    +

    user, to isolate the website under a new user Example: voluptate

    method   @@ -10409,10 +10415,10 @@

    Body Parameters

     
    -

    Load balancer method, Required if the site type is Load balancer Example: least-connections

    +

    Load balancer method, Required if the site type is Load balancer Example: ip-hash

    Must be one of:
    • round-robin
    • least-connections
    • ip-hash
    @@ -10817,7 +10823,7 @@

    @@ -10837,7 +10843,7 @@

    @@ -11063,7 +11069,7 @@

    @@ -11452,7 +11458,7 @@

    Body Parameters

     
    -

    Content of the deployment script Example: culpa

    +

    Content of the deployment script Example: voluptatem

    @@ -11799,6 +11805,394 @@

    URL Parameters

    +

    env

    + +

    +requires authentication +

    + +

    Get site .env file content

    + + +
    Example request:
    + + +
    +
    curl --request GET \
    +    --get "https://your-vito-url/api/projects/1/servers/29/sites/44/env" \
    +    --header "Authorization: Bearer YOUR-API-KEY" \
    +    --header "Content-Type: application/json" \
    +    --header "Accept: application/json"
    + + +
    +
    $client = new \GuzzleHttp\Client();
    +$url = 'https://your-vito-url/api/projects/1/servers/29/sites/44/env';
    +$response = $client->get(
    +    $url,
    +    [
    +        'headers' => [
    +            'Authorization' => 'Bearer YOUR-API-KEY',
    +            'Content-Type' => 'application/json',
    +            'Accept' => 'application/json',
    +        ],
    +    ]
    +);
    +$body = $response->getBody();
    +print_r(json_decode((string) $body));
    + + +
    +
    const url = new URL(
    +    "https://your-vito-url/api/projects/1/servers/29/sites/44/env"
    +);
    +
    +const headers = {
    +    "Authorization": "Bearer YOUR-API-KEY",
    +    "Content-Type": "application/json",
    +    "Accept": "application/json",
    +};
    +
    +fetch(url, {
    +    method: "GET",
    +    headers,
    +}).then(response => response.json());
    + +
    + + +
    +

    Example response (200):

    +
    +
    +
    +{
    +    "data": {
    +        "env": "APP_NAME=Laravel\\nAPP_ENV=production"
    +    }
    +}
    + 
    +
    + + +
    +

    + Request    + +    + +

    +

    + GET + api/projects/{project_id}/servers/{server_id}/sites/{site_id}/env +

    +

    Headers

    +
    + Authorization   +  +   + +
    +

    Example: Bearer YOUR-API-KEY

    +
    +
    + Content-Type   +  +   + +
    +

    Example: application/json

    +
    +
    + Accept   +  +   + +
    +

    Example: application/json

    +
    +

    URL Parameters

    +
    + project_id   +integer  +   + +
    +

    The ID of the project. Example: 1

    +
    +
    + server_id   +integer  +   + +
    +

    The ID of the server. Example: 29

    +
    +
    + site_id   +integer  +   + +
    +

    The ID of the site. Example: 44

    +
    +
    + +

    env

    + +

    +requires authentication +

    + +

    Update site .env file

    + + +
    Example request:
    + + +
    +
    curl --request PUT \
    +    "https://your-vito-url/api/projects/1/servers/29/sites/44/env" \
    +    --header "Authorization: Bearer YOUR-API-KEY" \
    +    --header "Content-Type: application/json" \
    +    --header "Accept: application/json" \
    +    --data "{
    +    \"env\": \"quam\"
    +}"
    +
    + + +
    +
    $client = new \GuzzleHttp\Client();
    +$url = 'https://your-vito-url/api/projects/1/servers/29/sites/44/env';
    +$response = $client->put(
    +    $url,
    +    [
    +        'headers' => [
    +            'Authorization' => 'Bearer YOUR-API-KEY',
    +            'Content-Type' => 'application/json',
    +            'Accept' => 'application/json',
    +        ],
    +        'json' => [
    +            'env' => 'quam',
    +        ],
    +    ]
    +);
    +$body = $response->getBody();
    +print_r(json_decode((string) $body));
    + + +
    +
    const url = new URL(
    +    "https://your-vito-url/api/projects/1/servers/29/sites/44/env"
    +);
    +
    +const headers = {
    +    "Authorization": "Bearer YOUR-API-KEY",
    +    "Content-Type": "application/json",
    +    "Accept": "application/json",
    +};
    +
    +let body = {
    +    "env": "quam"
    +};
    +
    +fetch(url, {
    +    method: "PUT",
    +    headers,
    +    body: JSON.stringify(body),
    +}).then(response => response.json());
    + +
    + + +
    +

    Example response (200):

    +
    +
    +
    +
    + 
    +
    + + +
    +

    + Request    + +    + +

    +

    + PUT + api/projects/{project_id}/servers/{server_id}/sites/{site_id}/env +

    +

    Headers

    +
    + Authorization   +  +   + +
    +

    Example: Bearer YOUR-API-KEY

    +
    +
    + Content-Type   +  +   + +
    +

    Example: application/json

    +
    +
    + Accept   +  +   + +
    +

    Example: application/json

    +
    +

    URL Parameters

    +
    + project_id   +integer  +   + +
    +

    The ID of the project. Example: 1

    +
    +
    + server_id   +integer  +   + +
    +

    The ID of the server. Example: 29

    +
    +
    + site_id   +integer  +   + +
    +

    The ID of the site. Example: 44

    +
    +

    Body Parameters

    +
    + env   +string  +   + +
    +

    Content of the .env file Example: quam

    +
    +
    +

    source-controls

    @@ -11870,19 +12264,19 @@

    list

    "id": 5, "project_id": null, "global": true, - "name": "Dawson Ratke IV", + "name": "Zella Robel", "provider": "github", - "created_at": "2025-04-05T17:35:56.000000Z", - "updated_at": "2025-04-05T17:35:56.000000Z" + "created_at": "2025-04-05T17:48:03.000000Z", + "updated_at": "2025-04-05T17:48:03.000000Z" }, { "id": 6, "project_id": null, "global": true, - "name": "Miss Caterina Mann DVM", + "name": "Jairo Williamson", "provider": "github", - "created_at": "2025-04-05T17:35:56.000000Z", - "updated_at": "2025-04-05T17:35:56.000000Z" + "created_at": "2025-04-05T17:48:03.000000Z", + "updated_at": "2025-04-05T17:48:03.000000Z" } ], "links": { @@ -12033,12 +12427,12 @@

    create @@ -12055,12 +12449,12 @@

    createcreatecreate @@ -12212,10 +12606,10 @@

    Body Parameters

     
    -

    The provider Example: github

    +

    The provider Example: gitlab

    Must be one of:
    • gitlab
    • github
    • bitbucket
    @@ -12225,10 +12619,10 @@

    Body Parameters

     
    -

    The name of the storage provider. Example: est

    +

    The name of the storage provider. Example: molestias

    token   @@ -12236,10 +12630,10 @@

    Body Parameters

     
    -

    The token if provider requires api token Example: ea

    +

    The token if provider requires api token Example: in

    url   @@ -12247,10 +12641,10 @@

    Body Parameters

     
    -

    The URL if the provider is Gitlab and it is self-hosted Example: http://koepp.info/maiores-nostrum-consequuntur-dicta-iure-ullam

    +

    The URL if the provider is Gitlab and it is self-hosted Example: https://www.white.com/aperiam-dolor-nemo-qui-rerum-quod-quas

    username   @@ -12258,10 +12652,10 @@

    Body Parameters

     
    -

    The username if the provider is Bitbucket Example: ducimus

    +

    The username if the provider is Bitbucket Example: consectetur

    password   @@ -12269,10 +12663,10 @@

    Body Parameters

     
    -

    The password if the provider is Bitbucket Example: S#AHlt"?l6SDU^b?T6

    +

    The password if the provider is Bitbucket Example: y*P4_]ZdjE_:

    @@ -12341,10 +12735,10 @@

    @@ -12494,12 +12888,12 @@

    Body Parameters

     
    -

    The name of the storage provider. Example: sunt

    +

    The name of the storage provider. Example: non

    token   @@ -12673,10 +13067,10 @@

    Body Parameters

     
    -

    The token if provider requires api token Example: est

    +

    The token if provider requires api token Example: sunt

    url   @@ -12684,10 +13078,10 @@

    Body Parameters

     
    -

    The URL if the provider is Gitlab and it is self-hosted Example: http://www.fay.com/quisquam-autem-illum-omnis-quo-enim-eligendi-velit

    +

    The URL if the provider is Gitlab and it is self-hosted Example: https://www.frami.org/ex-at-minus-rerum-quo-minus-ea

    username   @@ -12695,10 +13089,10 @@

    Body Parameters

     
    -

    The username if the provider is Bitbucket Example: ab

    +

    The username if the provider is Bitbucket Example: natus

    password   @@ -12706,10 +13100,10 @@

    Body Parameters

      *m{p]DI" data-component="body">
    -

    The password if the provider is Bitbucket Example: M@-*%?(B(UNE~Ibc#

    +

    The password if the provider is Bitbucket Example: A^">*m{p]DI

    global   @@ -12720,7 +13114,7 @@

    Body Parameters

    value="" data-component="body">
    -

    Accessible in all projects Example: false

    +

    Accessible in all projects Example: true

    Must be one of:
    • 1
    @@ -12964,14 +13358,14 @@

    list { "id": null, "user": null, - "name": "Moriah Kemmer", + "name": "Santa Goyette", "created_at": null, "updated_at": null }, { "id": null, "user": null, - "name": "Delilah Gaylord", + "name": "Cecil Cummings", "created_at": null, "updated_at": null } @@ -13135,9 +13529,9 @@

    cre --header "Content-Type: application/json" \ --header "Accept: application/json" \ --data "{ - \"key_id\": \"id\", - \"name\": \"qui\", - \"public_key\": \"vitae\" + \"key_id\": \"explicabo\", + \"name\": \"deleniti\", + \"public_key\": \"sapiente\" }" @@ -13154,9 +13548,9 @@

    cre 'Accept' => 'application/json', ], 'json' => [ - 'key_id' => 'id', - 'name' => 'qui', - 'public_key' => 'vitae', + 'key_id' => 'explicabo', + 'name' => 'deleniti', + 'public_key' => 'sapiente', ], ] ); @@ -13176,9 +13570,9 @@

    cre }; let body = { - "key_id": "id", - "name": "qui", - "public_key": "vitae" + "key_id": "explicabo", + "name": "deleniti", + "public_key": "sapiente" }; fetch(url, { @@ -13198,7 +13592,7 @@

    cre { "id": null, "user": null, - "name": "Jesse Gleason", + "name": "Mr. Reagan Jacobson V", "created_at": null, "updated_at": null } @@ -13314,10 +13708,10 @@

    Body Parameters

     
    -

    The ID of the key. Example: id

    +

    The ID of the key. Example: explicabo

    name   @@ -13325,10 +13719,10 @@

    Body Parameters

     
    -

    Key name, required if key_id is not provided. Example: qui

    +

    Key name, required if key_id is not provided. Example: deleniti

    public_key   @@ -13336,10 +13730,10 @@

    Body Parameters

     
    -

    Public Key, required if key_id is not provided. Example: vitae

    +

    Public Key, required if key_id is not provided. Example: sapiente

    @@ -13593,19 +13987,19 @@

    listcreat --header "Content-Type: application/json" \ --header "Accept: application/json" \ --data "{ - \"provider\": \"quia\", - \"name\": \"rerum\", - \"token\": \"hic\", - \"key\": \"repellat\", - \"secret\": \"maiores\" + \"provider\": \"ab\", + \"name\": \"quo\", + \"token\": \"in\", + \"key\": \"sunt\", + \"secret\": \"molestias\" }" @@ -13777,11 +14171,11 @@

    creat 'Accept' => 'application/json', ], 'json' => [ - 'provider' => 'quia', - 'name' => 'rerum', - 'token' => 'hic', - 'key' => 'repellat', - 'secret' => 'maiores', + 'provider' => 'ab', + 'name' => 'quo', + 'token' => 'in', + 'key' => 'sunt', + 'secret' => 'molestias', ], ] ); @@ -13801,11 +14195,11 @@

    creat }; let body = { - "provider": "quia", - "name": "rerum", - "token": "hic", - "key": "repellat", - "secret": "maiores" + "provider": "ab", + "name": "quo", + "token": "in", + "key": "sunt", + "secret": "molestias" }; fetch(url, { @@ -13826,10 +14220,10 @@

    creat "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" + "name": "asperiores", + "provider": "dropbox", + "created_at": "2025-04-05T17:48:03.000000Z", + "updated_at": "2025-04-05T17:48:03.000000Z" } @@ -13932,10 +14326,10 @@

    Body Parameters

     
    -

    The provider (aws, linode, hetzner, digitalocean, vultr, ...) Example: quia

    +

    The provider (aws, linode, hetzner, digitalocean, vultr, ...) Example: ab

    name   @@ -13943,10 +14337,10 @@

    Body Parameters

     
    -

    The name of the storage provider. Example: rerum

    +

    The name of the storage provider. Example: quo

    token   @@ -13954,10 +14348,10 @@

    Body Parameters

     
    -

    The token if provider requires api token Example: hic

    +

    The token if provider requires api token Example: in

    key   @@ -13965,10 +14359,10 @@

    Body Parameters

     
    -

    The key if provider requires key Example: repellat

    +

    The key if provider requires key Example: sunt

    secret   @@ -13976,10 +14370,10 @@

    Body Parameters

     
    -

    The secret if provider requires key Example: maiores

    +

    The secret if provider requires key Example: molestias

    @@ -14048,10 +14442,10 @@

    @@ -14197,7 +14591,7 @@

    Body Parameters

     
    -

    The name of the storage provider. Example: est

    +

    The name of the storage provider. Example: voluptas

    global   diff --git a/public/api-docs/openapi.yaml b/public/api-docs/openapi.yaml index f1c897c..e20bb05 100644 --- a/public/api-docs/openapi.yaml +++ b/public/api-docs/openapi.yaml @@ -241,12 +241,12 @@ paths: command: type: string description: '' - example: nisi + example: quia nullable: false user: type: string description: '' - example: vito + example: root nullable: false enum: - root @@ -357,7 +357,7 @@ paths: in: path name: cronJob_id description: 'The ID of the cronJob.' - example: 14 + example: 6 required: true schema: type: integer @@ -379,7 +379,7 @@ paths: - id: null server_id: null - username: lavina.zemlak + username: letha64 databases: [] host: '%' status: null @@ -388,7 +388,7 @@ paths: - id: null server_id: null - username: hill.cassidy + username: hagenes.lurline databases: [] host: '%' status: null @@ -427,7 +427,7 @@ paths: - id: null server_id: null - username: lavina.zemlak + username: letha64 databases: [] host: '%' status: null @@ -436,7 +436,7 @@ paths: - id: null server_id: null - username: hill.cassidy + username: hagenes.lurline databases: [] host: '%' status: null @@ -453,7 +453,7 @@ paths: example: null username: type: string - example: lavina.zemlak + example: letha64 databases: type: array example: [] @@ -552,7 +552,7 @@ paths: example: id: null server_id: null - username: irwin45 + username: marcelle95 databases: [] host: '%' status: null @@ -567,7 +567,7 @@ paths: example: null username: type: string - example: irwin45 + example: marcelle95 databases: type: array example: [] @@ -595,12 +595,12 @@ paths: username: type: string description: '' - example: tempore + example: qui nullable: false password: type: string description: '' - example: '!jUv.BBc]X' + example: 'xYv*3,#HQ=5*m{p]DI' nullable: false global: type: string description: 'Accessible in all projects' - example: false + example: true nullable: false enum: - true @@ -5246,13 +5325,13 @@ paths: - id: null user: null - name: 'Moriah Kemmer' + name: 'Santa Goyette' created_at: null updated_at: null - id: null user: null - name: 'Delilah Gaylord' + name: 'Cecil Cummings' created_at: null updated_at: null links: @@ -5288,13 +5367,13 @@ paths: - id: null user: null - name: 'Moriah Kemmer' + name: 'Santa Goyette' created_at: null updated_at: null - id: null user: null - name: 'Delilah Gaylord' + name: 'Cecil Cummings' created_at: null updated_at: null items: @@ -5308,7 +5387,7 @@ paths: example: null name: type: string - example: 'Moriah Kemmer' + example: 'Santa Goyette' created_at: type: string example: null @@ -5398,7 +5477,7 @@ paths: example: id: null user: null - name: 'Jesse Gleason' + name: 'Mr. Reagan Jacobson V' created_at: null updated_at: null properties: @@ -5410,7 +5489,7 @@ paths: example: null name: type: string - example: 'Jesse Gleason' + example: 'Mr. Reagan Jacobson V' created_at: type: string example: null @@ -5429,17 +5508,17 @@ paths: key_id: type: string description: 'The ID of the key.' - example: id + example: explicabo nullable: false name: type: string description: 'Key name, required if key_id is not provided.' - example: qui + example: deleniti nullable: false public_key: type: string description: 'Public Key, required if key_id is not provided.' - example: vitae + example: sapiente nullable: false required: - key_id @@ -5517,18 +5596,18 @@ paths: 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' + 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: sed + name: voluptas provider: dropbox - created_at: '2025-04-05T17:35:56.000000Z' - updated_at: '2025-04-05T17:35:56.000000Z' + created_at: '2025-04-05T17:48:03.000000Z' + updated_at: '2025-04-05T17:48:03.000000Z' links: first: '/?page=1' last: '/?page=1' @@ -5563,18 +5642,18 @@ paths: 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' + 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: sed + name: voluptas provider: dropbox - created_at: '2025-04-05T17:35:56.000000Z' - updated_at: '2025-04-05T17:35:56.000000Z' + created_at: '2025-04-05T17:48:03.000000Z' + updated_at: '2025-04-05T17:48:03.000000Z' items: type: object properties: @@ -5589,16 +5668,16 @@ paths: example: true name: type: string - example: et + example: veritatis provider: type: string - example: dropbox + example: ftp created_at: type: string - example: '2025-04-05T17:35:56.000000Z' + example: '2025-04-05T17:48:03.000000Z' updated_at: type: string - example: '2025-04-05T17:35:56.000000Z' + example: '2025-04-05T17:48:03.000000Z' links: type: object properties: @@ -5683,10 +5762,10 @@ paths: 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' + name: asperiores + provider: dropbox + created_at: '2025-04-05T17:48:03.000000Z' + updated_at: '2025-04-05T17:48:03.000000Z' properties: id: type: integer @@ -5699,16 +5778,16 @@ paths: example: true name: type: string - example: veritatis + example: asperiores provider: type: string - example: ftp + example: dropbox created_at: type: string - example: '2025-04-05T17:35:56.000000Z' + example: '2025-04-05T17:48:03.000000Z' updated_at: type: string - example: '2025-04-05T17:35:56.000000Z' + example: '2025-04-05T17:48:03.000000Z' tags: - storage-providers requestBody: @@ -5721,27 +5800,27 @@ paths: provider: type: string description: 'The provider (aws, linode, hetzner, digitalocean, vultr, ...)' - example: quia + example: ab nullable: false name: type: string description: 'The name of the storage provider.' - example: rerum + example: quo nullable: false token: type: string description: 'The token if provider requires api token' - example: hic + example: in nullable: false key: type: string description: 'The key if provider requires key' - example: repellat + example: sunt nullable: false secret: type: string description: 'The secret if provider requires key' - example: maiores + example: molestias nullable: false required: - provider @@ -5775,10 +5854,10 @@ paths: id: 5 project_id: null global: true - name: fuga + name: ipsum provider: local - created_at: '2025-04-05T17:35:56.000000Z' - updated_at: '2025-04-05T17:35:56.000000Z' + created_at: '2025-04-05T17:48:03.000000Z' + updated_at: '2025-04-05T17:48:03.000000Z' properties: id: type: integer @@ -5791,16 +5870,16 @@ paths: example: true name: type: string - example: fuga + example: ipsum provider: type: string example: local created_at: type: string - example: '2025-04-05T17:35:56.000000Z' + example: '2025-04-05T17:48:03.000000Z' updated_at: type: string - example: '2025-04-05T17:35:56.000000Z' + example: '2025-04-05T17:48:03.000000Z' tags: - storage-providers put: @@ -5819,10 +5898,10 @@ paths: id: 5 project_id: null global: true - name: ut + name: minima provider: ftp - created_at: '2025-04-05T17:35:56.000000Z' - updated_at: '2025-04-05T17:35:56.000000Z' + created_at: '2025-04-05T17:48:03.000000Z' + updated_at: '2025-04-05T17:48:03.000000Z' properties: id: type: integer @@ -5835,16 +5914,16 @@ paths: example: true name: type: string - example: ut + example: minima provider: type: string example: ftp created_at: type: string - example: '2025-04-05T17:35:56.000000Z' + example: '2025-04-05T17:48:03.000000Z' updated_at: type: string - example: '2025-04-05T17:35:56.000000Z' + example: '2025-04-05T17:48:03.000000Z' tags: - storage-providers requestBody: @@ -5857,7 +5936,7 @@ paths: name: type: string description: 'The name of the storage provider.' - example: est + example: voluptas nullable: false global: type: string diff --git a/tests/Feature/API/SitesTest.php b/tests/Feature/API/SitesTest.php index c9a43eb..296dbf2 100644 --- a/tests/Feature/API/SitesTest.php +++ b/tests/Feature/API/SitesTest.php @@ -312,6 +312,81 @@ public function test_show_deployment_script(): void ->assertJsonPath('script', $scriptContent); } + public function test_show_env(): void + { + $envContent = "APP_NAME=Laravel\nAPP_ENV=production"; + SSH::fake($envContent); + + Sanctum::actingAs($this->user, ['read']); + + /** @var Site $site */ + $site = Site::factory()->create([ + 'server_id' => $this->server->id, + ]); + + $this->json('GET', route('api.projects.servers.sites.env.show', [ + 'project' => $this->server->project, + 'server' => $this->server, + 'site' => $site, + ])) + ->assertSuccessful() + ->assertJsonStructure([ + 'data' => [ + 'env', + ], + ]) + ->assertJsonFragment([ + 'env' => $envContent, + ]); + } + + public function test_show_env_unauthorized(): void + { + SSH::fake(); + + Sanctum::actingAs($this->user, []); // no abilities + + /** @var Site $site */ + $site = Site::factory()->create([ + 'server_id' => $this->server->id, + ]); + + $this->json('GET', route('api.projects.servers.sites.env.show', [ + 'project' => $this->server->project, + 'server' => $this->server, + 'site' => $site, + ])) + ->assertForbidden(); + } + + public function test_update_env(): void + { + SSH::fake(); + + Sanctum::actingAs($this->user, ['read', 'write']); + + /** @var Site $site */ + $site = Site::factory()->create([ + 'server_id' => $this->server->id, + ]); + + $envContent = "APP_NAME=Laravel\nAPP_ENV=production"; + + $this->json('PUT', route('api.projects.servers.sites.env', [ + 'project' => $this->server->project, + 'server' => $this->server, + 'site' => $site, + ]), [ + 'env' => $envContent, + ]) + ->assertSuccessful() + ->assertJsonFragment([ + 'domain' => $site->domain, + ]); + + SSH::assertExecuted('edit-file'); + } + public static function create_data(): array { return \Tests\Feature\SitesTest::create_data();