docs: def add_user(username, password):
      """
      Adds record to passwd-like file for ProFTPD, creates home directory and
      sets permissions for important files.
  
      Args:
          username (str): User's name.
          password (str): User's password.
      """
      assert _is_valid_username(username), \
              "Invalid format of username '%s'!" % username
  
      assert username not in passwd_reader.load_users(), \
              "User '%s' is already registered!" % username
  
      assert password, "Password is reqired!"
  
      # add new user to the proftpd's passwd file
      home_dir = settings.DATA_PATH + username
      sh.ftpasswd(
          passwd=True,                    # passwd file, not group file
          name=username,
          home=home_dir,                  # chroot in DATA_PATH
          shell="/bin/false",
          uid=settings.PROFTPD_USERS_GID, # TODO: parse dynamically?
          gid=settings.PROFTPD_USERS_GID,
          stdin=True,                 # tell ftpasswd to read password from stdin
          file=settings.LOGIN_FILE,
          _in=password
      )
  
      # create home dir if not exists
      if not os.path.exists(home_dir):
          os.makedirs(home_dir, 0775)
  
      # I am using PROFTPD_USERS_GID (2000) for all our users - this GID
      # shouldn't be used by other than FTP users!
      passwd_reader.set_permissions(home_dir, gid=settings.PROFTPD_USERS_GID)
      passwd_reader.set_permissions(settings.LOGIN_FILE, mode=0600)
  
      create_lock_file(home_dir + "/" + settings.LOCK_FILENAME)
  
      reload_configuration()