halo 博客程序

Posted by eye on 02-08,2023

halo

Halo 一个基于Java Spring Boot 的博客项目, 好用又强大的开源建站工具。

Docker 安装 Halo

docker run \
  -it -d \
  --name halo \
  -p 8090:8090 \
  -v ~/.halo2:/root/.halo2 \
  halohub/halo:2.2 \
  --halo.external-url=http://localhost:8090/ \
  --halo.security.initializer.superadminuser=admin \
  --halo.security.initializer.superadminpassword=P@88w0rd

配置文件 application.yaml

# halo 1.6
server:           
  port: 8090
                                           
  # Response data gzip.                                                                                                                                                                                  
  compression:           
    enabled: false                                                                                                                                                                                                  
spring:                                     
  datasource:               
                                                     
    ##    # H2 database configuration.
    ##    driver-class-name: org.h2.Driver
    ##    url: jdbc:h2:file:~/.halo/db/halo
    ##    username: admin
    ##    password: 123456
    ##               
   # MySQL database configuration.
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://127.0.0.1:3306/halo?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true                                                                
    username: halo
    password: halo
                                                     
      ##  # H2 database console configuration.
      ##  h2:             
      ##    console:
      ##      settings:  
      ##        web-allow-others: false                                                                                                                                                                             
      ##      path: /h2-console
      ##      enabled: false                                                                                                                                                                                        
      ##                                                                                                  
halo:                                                                                                     
                                                     
  # Your admin client path is https://your-domain/{admin-path}                        
  admin-path: admin-cp
                                                     
  # memory or level                                  
  cache: memory