Giter Club home page Giter Club logo

datart's Introduction

1 环境准备

  • JDK 1.8+

  • MySql5.7+

  • datart安装包(datart-server-1.0.0-alpha.0-install

  • Mail Server (可选)

  • ChromeWebDriver (可选)

  • Redis (可选)

  • 解压安装包

unzip datart-server-1.0.0-alpha.0-install

2 初始化数据库

  • 创建数据库,并将bin/datart.sql导入到数据库中
mysql> create database datart;
mysql> use datart;
mysql> source bin/datart.sql

3 修改配置文件

  • 配置文件位于 config/application-config.yml.example,先重命名为application-config.yml,需要配置的项为: 数据库连接信息,邮件配置,浏览器截图驱动

3.1 数据库连接信息

注:请务必保留连接串中的allowMultiQueries=true参数

spring:
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    type: com.alibaba.druid.pool.DruidDataSource
    url: jdbc:mysql://{IP:PORT}/datart?&allowMultiQueries=true
    username: { USERNAME }
    password: { PASSWORD }

3.2 服务端属性配置

  • Web服务绑定IP和端口
server:
  port: { PORT }
  address: { IP }
  • 配置服务端访问地址,创建分享,激活/邀请用户时,将使用这个地址作为服务端访问地址。
datart:
  server:
    address: http://{IP/域名}:{端口}
  • 其它可选配置项
datart:
  user:
    active:
      send-mail: true  # 注册用户时是否需要邮件验证激活

  security:
    token:
      secret: "sHAS$as@fsdkKjd" #加密密钥
      timeout-min: 30  # 登录会话有效时长,单位:分钟。

  env:
    file-path: ${user.dir}/files # 服务端文件保存位置 

注意:加密密钥每个服务端部署前应该进行修改,且部署后不能再次修改。如果是集群部署,同一个集群内的secret要保持统一

3.3 邮件服务配置 (可选)

邮件服务用于定时任务发送,用户注册/激活/邀请等功能。要体验完整的datart功能,请务必正确的邮件服务

  • 以下为完整配置
spring:
  mail:
    host: { 邮箱服务地址 }
    port: { 端口号 }
    username: { 邮箱地址 }
    fromAddress:
    password: { 邮箱服务密码 }
    senderName: { 发送者昵称 }

    properties:
      smtp:
        starttls:
          enable: true
          required: true
        auth: true
      mail:
        smtp:
          ssl:
            enable: true

配置说明

  • username为邮箱地址,password邮箱服务密码,需要注意的是常见免费邮箱(如 163 邮箱、QQ 邮箱、gmail 等)这里应填客户端独立密码,可前往对应邮箱账号设置页面开启 SMTP 服务,并申请客户端授权码(或独立密码,各邮箱提供商叫法不同)

下表为常见免费邮箱 SMTP 服务地址及端口: img_1.png

3.4截图配置 (可选)

  • 截图配置用于定时任务中的发送图片功能。
datart:
  screenshot:
    timeout-seconds: 60
    webdriver-type: CHROME
    webdriver-path: {Web Driver Path}
  • 配置说明 timeout-seconds 指定截图超时时间 webdriver-type 截图浏览器类型。(目前仅支持CHROME) webdriver-path webdriver地址。可执行文件的绝对地址,或远程webdriver的调用地址

注意:配置时请确保浏览器的版本和webdriver的版本匹配。推荐使用docker镜像 selenium/standalone-chrome 来配置远程截图服务。*

docker run -p 4444:4444 -d --name selenium-chrome --shm-size="2g" selenium/standalone-chrome
  • 然后配置 webdriver-path: "http://{IP}:4444/wd/hub"

datart's People

Contributors

cuiyansong avatar pengjunzhen avatar scottsut avatar tianlu-root avatar whenhowxu avatar xieliuduo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.