sbuerk/typo3-ensure-admin

提供创建或更新管理员用户的TYPO3 CLI命令

安装: 770

依赖者: 0

建议者: 0

安全: 0

星标: 1

关注者: 1

分支: 2

开放问题: 2

类型:typo3-cms-extension

2.0.3 2022-10-13 06:15 UTC

This package is auto-updated.

Last update: 2024-09-15 11:48:20 UTC


README

状态

任务

本扩展的任务是提供一个用于创建和更新用于预演和开发目的的用户工具。因此,它应仅作为项目的开发依赖项。

此外,它还提供了一个简单的密码编码命令,可以用来编码密码并将其用于设置TYPO3安装工具的密码,例如。

ℹ️ 此扩展仅处理与后端用户兼容的密码。这意味着,前端用户密码不受处理。

版本兼容性

替代方案

TYPO3 Console 包含一些命令,这些命令(部分)可以完成此扩展试图完成的功能。如果您已经在使用它,可能现有的功能适合您。那么就继续使用这个扩展。

ℹ️ 我们不知道还有其他扩展提供类似的功能。如果您知道,请告诉我们,我们将将其添加到这里作为替代方案。

安装

Composer

您可能希望将其作为 --dev 依赖项安装。

$ composer require --dev sbuerk/typo3-ensure-admin

用法

确保管理员用户

$ vendor/bin/typo3 sbuerk:admin:ensure [options]

概要

Description:
  Create or update an admin user

Usage:
  sbuerk:admin:ensure [options]

Options:
      --name=NAME            Admin username - ENV: TYPO3_ENSUREADMIN_USERNAME
      --email=EMAIL          Admin email - ENV: TYPO3_ENSUREADMIN_EMAIL
      --password=PASSWORD    Admin password (plain) - ENV: TYPO3_ENSUREADMIN_PASSWORD
      --firstname=FIRSTNAME  Admin firstname - ENV: TYPO3_ENSUREADMIN_FIRSTNAME
      --lastname=LASTNAME    Admin lastname - ENV: TYPO3_ENSUREADMIN_LASTNAME
      --json                 Response with json for tool usages.
      --force                Force admin user creation, means updating existing one.
  -h, --help                 Display help for the given command. When no command is given display help for the list command
  -q, --quiet                Do not output any message
  -V, --version              Display this application version
      --ansi|--no-ansi       Force (or disable --no-ansi) ANSI output
  -n, --no-interaction       Do not ask any interactive question
  -v|vv|vvv, --verbose       Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

此命令可以用于创建或更新管理员用户。如果用户存在,则必须提供 --force 标志来更新管理员用户。

此外,此命令支持 JSON响应 结果而不是正常文本输出,这可以用于集成到其他工具或工作流程中。使用 --json 标志来检索 JSON结果

一些选项是必需的,其他选项是可选的。选项可以作为命令行选项或作为环境变量提供,除了 --json--enforce 标志。

ℹ️ 如果为选项提供了两种变体,则选项变体优先于环境变量变体。

JSON响应结构

{
    "success": true,
    "message": "Success or error message"
}

正常模式JSON结果模式 都提供适当的退出代码,可以用作第一个指标,而无需真正读取输出。

密码编码

$ vendor/bin/typo3 sbuerk:password:encode <plain-password> [--json]

概要

Description:
  Takes a plain password and returns the password hash. Can be used as install tool password.

Usage:
  sbuerk:password:encode [options] [--] <plain>

Arguments:
  plain                 Plain password to encode to be used for install tool / .env setting

Options:
      --json            Output json result
  -h, --help            Display help for the given command. When no command is given display help for the list command
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi|--no-ansi  Force (or disable --no-ansi) ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

JSON响应结构

{
    "success": true,
    "password": "<hashed-password-string>",
    "message": "Message, for example the plain => hashed password success message"
}

正常模式JSON结果模式 都提供适当的退出代码,可以用作第一个指标,而无需真正读取输出。

TYPO3扩展仓库

对于非Composer项目,该扩展可在TER中以扩展密钥 cli_ensure_admin 提供,并可以使用扩展管理器进行安装。

标记和发布

packagist.org 通过GitHub钩子启用。TER发布由使用 tailor 标记版本时创建的 "publish.yml" GitHub工作流程创建。标记提交的提交信息用作TER上传注释。

$ Build/Scripts/runTests.sh -s clean
$ Build/Scripts/runTests.sh -s composerUpdate
$ composer req --dev typo3/tailor
$ .Build/bin/tailor set-version 2.0.3 --no-docs
$ composer rem --dev typo3/tailor
$ git commit -am "[RELEASE] 2.0.3 Updated and test publish workflow"
$ git tag 2.0.3
$ git push
$ git push --tags

反馈/错误报告/贡献

欢迎在GitHub仓库中提交错误报告、功能请求和拉取请求:https://github.com/sbuerk/typo3-ensure-admin