This commit is contained in:
Zsolt Ero
2023-12-07 21:44:08 +01:00
parent 0f81a008d8
commit fa02cac384
3 changed files with 6 additions and 3 deletions

View File

@@ -8,7 +8,7 @@ from ssh_lib.kernel import set_cpu_governor, setup_kernel_settings
from ssh_lib.nginx import certbot, nginx
from ssh_lib.pkg_base import pkg_base, pkg_clean, pkg_upgrade
from ssh_lib.planetiler import install_planetiler
from ssh_lib.utils import reboot, setup_time
from ssh_lib.utils import add_user, enable_sudo, reboot, setup_time
def prepare_server(c):
@@ -23,6 +23,9 @@ def prepare_server(c):
nginx(c)
certbot(c)
add_user(c, 'ofm', OFM_USER_PASSWD)
enable_sudo(c, 'ofm')
install_planetiler(c)

View File

@@ -8,7 +8,7 @@ requirements = [
]
setup(
name='openfreemaps',
name='openfreemap',
python_requires='>=3.10',
install_requires=requirements,
packages=['ssh_lib'],

View File

@@ -108,7 +108,7 @@ def add_user(c, username, passwd=None):
# ssh-key login only
c.sudo(f'adduser --disabled-password --gecos "" {username}', warn=True)
if passwd:
c.sudo(f'echo "{username}:{passwd}" | chpasswd')
sudo_cmd(c, f'echo "{username}:{passwd}" | chpasswd')
def remove_user(c, username):