import { NSQLITE_TURBOCI_ADMIN_USERS } from "../db/types";
import { User } from "../types";

type Params = {
    user: NSQLITE_TURBOCI_ADMIN_USERS;
};

export default function grabDeploymentUserDirNames({ user }: Params) {
    const { username } = user;

    const user_dir = `/home/${username}`;
    const ssh_dir = `${user_dir}/.ssh`;
    const ssh_key_file = `${ssh_dir}/${username}`;
    const sshd_config_file = `/etc/ssh/sshd_config.d/${username}.conf`;
    const force_command_file = `/usr/local/bin/turboci-deployment-user-${username}`;

    return {
        user_dir,
        ssh_dir,
        ssh_key_file,
        sshd_config_file,
        force_command_file,
    };
}
