类 CrshAutoConfiguration


  • @Configuration
    @ConditionalOnClass(org.crsh.plugin.PluginLifeCycle.class)
    @EnableConfigurationProperties(ShellProperties.class)
    @Deprecated
    public class CrshAutoConfiguration
    extends Object
    已过时。
    as of 1.5 since CRaSH is not actively maintained
    Auto-configuration for embedding an extensible shell into a Spring Boot enabled application. By default a SSH daemon is started on port 2000. If the CRaSH Telnet plugin is available on the classpath, Telnet daemon will be launched on port 5000.

    The default shell authentication method uses a username and password combination. If no configuration is provided the default username is 'user' and the password will be printed to console during application startup. Those default values can be overridden by using management.shell.auth.simple.username and management.shell.auth.simple.password.

    If a Spring Security AuthenticationManager is detected, this configuration will create a CRaSHPlugin to forward shell authentication requests to Spring Security. This authentication method will get enabled if management.shell.auth.type is set to spring or if no explicit management.shell.auth is provided and a AuthenticationManager is available. In the latter case shell access will be restricted to users having roles that match those configured in ManagementServerProperties. Required roles can be overridden by management.shell.auth.spring.roles.

    To add customizations to the shell simply define beans of type CRaSHPlugin in the application context. Those beans will get auto detected during startup and registered with the underlying shell infrastructure. To configure plugins and the CRaSH infrastructure add beans of type ShellProperties.CrshShellProperties to the application context.

    Additional shell commands can be implemented using the guide and documentation at crashub.org. By default Boot will search for commands using the following classpath scanning pattern classpath*:/commands/** . To add different locations or override the default use management.shell.command-path-patterns in your application configuration.

    另请参阅:
    ShellProperties