0.24.0 • Published 4 years ago

@lethe0305/doc-repo v0.24.0

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

English | 简体中文

doc-repo-service

doc-repo-service is the base service of Choerodon to manage Document library based on SVN. Current version: 0.23.0-alpha.1

Through the integration of SVN, Apache, Mysql and LDAP, doc-repo-service integrates the relevant open source tools , to achieve the functions of document library creation, file directory creation, update, delete, document library permission management, integration of the pig toothed fish permission system, or using LDAP login, log monitoring, etc. After a little simple configuration, you'll get the smoothest development experience.

Feature

doc-repo-service contains features as follows:

  • Document library server management :manage, maintain and authorize the server to the project
  • Document library management:create a document library for the project on the authorization server, associate the existing document library, customize a new server, and create a document library
  • Document library directory management:create directory, modify directory, delete directory
  • Permission management:assign permission, update permission and delete permission
  • Log monitoring:monitoring permission operation log
  • health check:check the health status of httpd and SVN services
  • LDAP usage:enable LDAP Based on the project layer, and use LDAP account to access the document library

Requirements

  • JAVA: doc-repo-service is based on java8
  • GitLab: GitLab is used as code repository. At the same time, Continuous Integration based on GitLab Runner is used to complete code compilation, unit test execution, code quality analysis, docker image generation, helm chart packaging, service version releasing and other automated processes
  • Harbor: Enterprise Docker registry service for hosting the docker images for the service versions
  • Kubernetes: Container orchestration management tool for deploying the helm chart packages corresponding to the service versions
  • ChartMuseum: Helm Chart Repository server., which is used to store the helm chart package corresponding to the service versions
  • Sonarqube: SonarQube empowers all developers to write cleaner and safer code for application services
  • MySQL: one of the most popular relational databases, for data persistence of doc-repo-service
  • Redis: In-memory database for data caching and partial non-persistent data storage
  • SVNSubversion is a free and open source version control system.
  • Apache2:Apache Server,integrating SVN and using HTTP protocol to access document library.

Dependencies

  • choerodon-register: Register server, in place of eureka-server
  • choerodon-platform:Platform Service,to operate user information and lov...
  • choerodon-gateway: Gateway service
  • choerodon-oauth: Oauth service
  • choerodon-asgard : Transaction consistency service
  • choerodon-file : File service

Service Configuration

  • bootstrap.yml:

    server:
      port: 8080
    management:
      server: 
        port: 8081
      endpoints:
        web:
          exposure:
            include: '*'
    
    spring:
      profiles:
        active: default
      cloud:
        config:
          fail-fast: false
          enabled: ${SPRING_CLOUD_CONFIG_ENABLED:false}
          uri: ${SPRING_CLOUD_CONFIG_URI:http://dev.hzero.org:8010}
          retry:
            maxAttempts: 6
            multiplier: 1.1
            maxInterval: 2000
          label: ${SPRING_CLOUD_CONFIG_LABEL:}
    
    eureka:
      instance:
        preferIpAddress: ${EUREKA_INSTANCE_PREFER_IP_ADDRESS:true}
        leaseRenewalIntervalInSeconds: 10
        leaseExpirationDurationInSeconds: 30
        metadata-map:
          VERSION: 1.2.0.RELEASE
      client:
        serviceUrl:
          defaultZone: ${EUREKA_DEFAULT_ZONE:http://localhost:8000/eureka/}
        registryFetchIntervalSeconds: 10
        disable-delta: true
  • application.yml:

    spring:
      application:
        name: hrds_doc_repo
      datasource:
        url: ${SPRING_DATASOURCE_URL:jdbc:mysql://db.hzero.org:3306/hrds_doc_repo?useUnicode=true&characterEncoding=utf-8&useSSL=false}
        username:  ${SPRING_DATASOURCE_USERNAME:root}
        password: ${SPRING_DATASOURCE_PASSWORD:root}
        hikari:
          minimum-idle: ${SPRING_DATASOURCE_MINIMUM_IDLE:20}
          maximum-pool-size: ${SPRING_DATASOURCE_MAXIMUM_POOL_SIZE:200}
          connection-timeout: ${SPRING_DATASOURCE_CONNECTION_TIMEOUT:30000}
      redis:
        host: redis.hzero.org
        port: 6379
        database: 1
        jedis:
          pool:
            max-active: ${SPRING_REDIS_POOL_MAX_ACTIVE:50}
            max-idle: ${SPRING_REDIS_POOL_MAX_IDLE:50}
            max-wait: ${SPRING_REDIS_POOL_MAX_WAIT:5000}
      resources:
        cache.period: 3600
        chain.gzipped: true
        chain.cache: true
    
    server:
      undertow:
        io-threads: ${SERVER_UNDERTOW_IO_THREADS:4}
        worker-threads: ${SERVER_UNDERTOW_WORKER_THREADS:128}
        buffer-size: ${SERVER_UNDERTOW_BUFFER_SIZE:1024}
        direct-buffers: true
        max-http-post-size: 10485760
        allow-unescaped-characters-in-url: true
    
    feign:
      hystrix:
        enabled: true
    
    hystrix:
      threadpool:
        default:
          coreSize: 1000
          maximumSize: 1000
      command:
        default:
          execution:
            isolation:
              thread:
                timeoutInMilliseconds: ${HYSTRIX_COMMAND_TIMEOUT_IN_MILLISECONDS:40000}
    
    ribbon:
      ReadTimeout: ${RIBBON_READ_TIMEOUT:30000}
      ConnectTimeout: ${RIBBON_CONNECT_TIMEOUT:3000}
      OkToRetryOnAllOperations: true
      MaxAutoRetries: 1
      MaxAutoRetriesNextServer: 1
    file-service:
      ribbon:
        ReadTimeout: 60000
        ConnectTimeout: 60000
    base-service:
      ribbon:
        ReadTimeout: 60000
        ConnectTimeout: 60000
    
    mybatis:
      mapperLocations: classpath*:/mapper/**/*.xml , classpath*:/mapper/*.xml
      configuration:
        mapUnderscoreToCamelCase: true
      log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
    
    
    logging:
      level:
        org.apache.ibatis: ${LOGGING_RDUDM:debug}
        io.choerodon: ${LOGGING_RDUDM:debug}
        org.hzero: ${LOGGING_RDUDM:debug}
        org.hrds.rdudm: ${LOGGING_RDUDM:debug}
    
    hzero:
      scheduler:
        autoRegister: false
    
    choerodon:
      category:
        enabled: true # 是否开启项目/组织类型控制
      devops:
        message: true
      eureka:
        event:
          max-cache-size: 300
          retry-time: 5
          retry-interval: 3
          skip-services: config**, **register-server, **gateway**, zipkin**, hystrix**, oauth**
      saga:
        consumer:
          enabled: true # 启动消费端1
          thread-num: 2 # saga消息消费线程池大小
          max-poll-size: 200 # 每次拉取消息最大数量
          poll-interval-ms: 1000 # 拉取间隔,默认1000毫秒
      schedule:
        consumer:
          enabled: true # 启用任务调度消费端
          thread-num: 1 # 任务调度消费线程数
          poll-interval-ms: 1000 # 拉取间隔,默认1000毫秒
      cleanPermission: false
    
    ldap:
      url: ${LDAP_URL:ldap://ldap.hzero.org:389/dc=test,dc=com?sn?sub?(objectClass=*)}
      bindDN: ${LDAP_BIND_DN:cn=Manager,dc=hand-china,dc=com}
      bindPassword: ${LDAP_BIND_PASSWORD:test}
## Installation and Getting Started
1. create database `hrds_doc_repo`, create user `choerodon` and grant permission:

 ```sql
 CREATE USER 'choerodon'@'%' IDENTIFIED BY "choerodon";
 CREATE DATABASE hrds_doc_repo DEFAULT CHARACTER SET utf8;
 GRANT ALL PRIVILEGES ON hrds_doc_repo.* TO choerodon@'%';
 FLUSH PRIVILEGES;
  1. pull source code of doc-repo-service:

    git clone https://github.com/choerodon/doc-repo-service.git
  2. Execute command in the project root directory: sh init-database.sh

  3. Run with the following commands or run RdudmApplication directly in the integrated environment:

    mvn clean spring-boot:run

Links

ChangeLog

Reporting Issues

If you find any shortcomings or bugs, please describe them in the issue.

How to Contribute

Pull requests are welcomed! Follow to know for more information on how to contribute.