研究在openldap中实现posix用户的锁定
· 2 min read
目前锁定用户能够达成的效果是禁止用户在portal中登录, 但是用户仍然可以在linux中进行登录.
调研一下AccountDisable
属性
目前锁定用户能够达成的效果是禁止用户在portal中登录, 但是用户仍然可以在linux中进行登录.
调研一下AccountDisable
属性
如果在application.yml
中配置duration值时不给定单位的话, 那么解析出的单位为毫秒, 如果需要自定义单位的话需要提供@DurationUnit
,
建议配置Duration单位, 强制指定单位确保行为符合期望
BindConverter
List<ConversionService> delegates
List<Converter> converters
StringToDurationConverter (SpringBoot)
NumberToDurationConverter (SpringBoot) 此处会根据注解去判断单位
DurationStyle.SIMPLE.parse
在别的项目中使用platform导入内部公共库时报错, 报错信息如下:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':extractIncludeProto'.
> Could not resolve all files for configuration ':compileProtoPath'.
> Could not resolve com.fastonetech.library:fastone-bom:1.1.0-SNAPSHOT.
Required by:
project :
> No matching variant of com.fastonetech.library:fastone-bom:0.1.0-SNAPSHOT:20221123.055858-93 was found. The consumer was configured to find a runtime of a platform, preferably only the resources files but:
- Variant 'apiElements' capability com.fastonetech.library:fastone-bom:0.1.0-SNAPSHOT declares a component, packaged as a jar:
- Incompatible because this component declares an API of a library and the consumer needed a runtime of a platform
- Variant 'runtimeElements' capability com.fastonetech.library:fastone-bom:0.1.0-SNAPSHOT declares a runtime of a component, packaged as a jar:
- Incompatible because this component declares a library and the consumer needed a platform
> Could not find com.fastonetech.library:filter-spring-boot-starter:.
Required by:
project :
> Could not find com.fastonetech.library:rpc-spring-boot-starter:.
Required by:
project :
> Could not find com.fastonetech.library:security-spring-boot-starter:.
Required by:
project :
> Could not find com.fastonetech.library:prometheus-querying-client:.
Required by:
project :
Camunda调用Delegate时会开启事务(为了保证失败时可以回滚数据), Spring的@Transaction propagation = Propagation.REQUIRED , 然后就用了Camunda的那个事务, Camunda的事务中修改是对DB不生效的所以你看不到事务过程中修改的数据提交的结果
@Component
class StartClusterDelegate(
private val clusterOperator: ClusterOperator
) : JavaDelegate, LogCapability {
override fun execute(execution: DelegateExecution) {
clusterOperator.start(execution.getVariableAs(VARNAME_CLUSTER_ID))
}
}
@Component
class ClusterOperator(
private val clusterService: ClusterService,
private val csClusterOperator: CsClusterOperator,
private val csStorageOperator: CsStorageOperator,
private val clusterBastionUserOperator: ClusterBastionUserOperator,
private val netEnvOperator: NetEnvOperator
) : LongTimeOperationCapability {
override fun start(id: Long) {
clusterService.get(id).orNull()!!.let { cluster ->
clusterService.patch(id) {
state = ClusterState.STARTING
}
logger.info("Begin start cluster $id")
csStorageOperator.start(cluster.csStorageId)
csClusterOperator.start(cluster.csClusterId!!)
clusterBastionUserOperator.start(cluster.id)
logger.info("Successful to start cluster $id")
clusterService.patch(id) {
state = ClusterState.RUNNING
}
}
}
}
@Service
class ClusterService(
private val engine: ProcessEngine,
private val clusterRepo: ClusterRepository,
private val client: DeployService
) : LogCapability {
@Transactional(propagation = Propagation.REQUIRES_NEW)
fun patch(id: Long, patchFun: PatchClusterDto.() -> Unit): Either<ClusterOperationError, ClusterDetail> =
clusterRepo.findById(id).map { originCluster ->
val patch = PatchClusterDto(patchFun).apply {
logger.info("patch request {}", this)
}
val patchedCluster = originCluster.copy(
cloudAccount = patch.cloudAccount ?: originCluster.cloudAccount,
csNetEnvId = patch.csNetEnvId ?: originCluster.csNetEnvId,
csStorageId = patch.csStoreId ?: originCluster.csStorageId,
csClusterId = patch.csClusterId ?: originCluster.csClusterId,
isDelivered = when (patch.deliveryCluster) {
DeliveryCluster.YES -> true
DeliveryCluster.NO -> false
DeliveryCluster.NONE -> originCluster.isDelivered
},
state = patch.state ?: originCluster.state
)
patchedCluster.apply {
logger.info("patched cluster {}", this)
}
}.map {
clusterRepo.save(it)
get(it.id)
}.orElseGet {
Either.left(ClusterOperationError.NoSuchCluster(id))
}
}
camunda:
bpm:
job-execution:
lock-time-in-millis: 999999999
在项目中添加rest依赖项
implementation("org.camunda.bpm.springboot:camunda-bpm-spring-boot-starter-rest:7.14.0")
kotlin-jpa插件会为data class
生成无参构造器,导致非空字段跳过了Null检查
@Entity
class ProjectInfo(
var name: String,
var code: String,
var ownerName: String,
var applicantName: String,
var companyCode: String,
var companyName: String,
var projectType: ProjectType,
var submitDate: LocalDateTime = LocalDateTime.now(),
var planStartDate: LocalDate?,
var planEndDate: LocalDate?,
var endDate: String,
var targetCustomers: Array<String>?,
var formStatus: ApplicationStatus = ApplicationStatus.DRAFT,
var projectStatus: ApplicationProjectStatus = ApplicationProjectStatus.DRAFT,
var comments: String?
) {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
val id: Long = -1
}
maven下载依赖时出现报错
[ERROR] Failed to execute goal on project specification-lib: Could not resolve dependencies for project com.fastonetech:specification-lib:jar:3.0.0-SNAPSHOT: Failed to collect dependencies at io.cucumber:cucumber-spring:jar:7.9.0 -> io.cucumber:cucumber-core:jar:7.9.0 -> io.cucumber:html-formatter:jar:20.1.0 -> io.cucumber:messages:jar:19.1.4-SNAPSHOT: Failed to read artifact descriptor for io.cucumber:messages:jar:19.1.4-SNAPSHOT: Could not transfer artifact io.cucumber:messages:pom:19.1.4-SNAPSHOT from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [nexus-tencentyun (http://mirrors.tencent.com/nexus/repository/maven-public/, default, releases+snapshots), fastone (http://nexus.fastonetech.com/repository/fastone-snapshot/, default, releases+snapshots)] -> [Help 1]
172.17.0.0/16默认为docker的网段 尽量避免网段跟docker网段冲突 例如设置为173.0.0.0/16
ip route get 172.17.0.13