fix: remove public key deployment from deploy-keys
Deploy-keys now only: - Creates /var/lib/syncserver/ssh/keys on remote - Uploads private keys of all other machines to that path - Populates known_hosts with all other machine hosts No longer touches authorized_keys or reads server public key.
This commit is contained in:
@@ -125,12 +125,11 @@ export interface DeployKeysResponse {
|
||||
|
||||
export interface DeployKeysOptions {
|
||||
known_hosts_host?: string;
|
||||
include_server_key?: boolean;
|
||||
}
|
||||
|
||||
export async function deployKeys(machineId: number, options?: DeployKeysOptions): Promise<DeployKeysResponse> {
|
||||
return api<DeployKeysResponse>(`/api/machines/${machineId}/deploy-keys`, {
|
||||
method: 'POST',
|
||||
body: options ?? { include_server_key: true },
|
||||
body: options ?? {},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -217,7 +217,7 @@ export default function Machines() {
|
||||
async function handleDeployKeys(m: Machine) {
|
||||
setDeployModal({ machine: m, result: null, loading: true });
|
||||
try {
|
||||
const result = await deployKeys(m.id, { include_server_key: true });
|
||||
const result = await deployKeys(m.id);
|
||||
setDeployModal({ machine: m, result, loading: false });
|
||||
} catch (e: unknown) {
|
||||
setDeployModal({ machine: m, result: { success: false, messages: [], errors: [(e as Error).message] }, loading: false });
|
||||
|
||||
Reference in New Issue
Block a user