Skip to content

Latest commit

 

History

History
295 lines (212 loc) · 13.7 KB

README_en_US.md

File metadata and controls

295 lines (212 loc) · 13.7 KB

Solo

Small and beautiful blog system, designed for programmers





中文

💡 Introduction

Solo is a small and beautiful open source blog system, designed for programmers. Solo has a very active community, which can push articles as posts to the community, and replies from the community will be linked as blog comments (for details, please visit B3log Ideas - Distributed Community Network).

This is a brand new online community experience, so that you who love recording and sharing no longer feel lonely!

Welcome to Solo Official Discussion Forum to learn more.

🗃 Showcases

https://ld246.com/top/solo

✨ Features

🎨 Screenshots

Start

start.png

Console

console.png

Post

post.png

Skin

skins.png

Front

pinghsu.png

Bubble.png

nijigen.png

timeline.png

Casper.png

Jane.png

🍱 Skins

The current built-in skins are as follows, you can click to preview:

Welcome to here recommend good-looking skin, we will try to make it.

🛠️ Setup

Solo supports "dynamic and static":

  • Dynamic blog: built on the server, the process runs in resident memory, and is used online
  • Static blog: run on local computer, generate and export static site after writing

Video demo tutorial

More video tutorials are being produced successively, welcome to follow me on Bilibili: Scrap Programmer D.

Run locally

Local operation is mainly used for trial or static site generation, please refer to here for usage of static site generation.

(Video demo tutorial please see here)

Download and unzip the latest Solo package, enter the decompression directory and execute:

  • Windows: java -cp "lib/*;." org.b3log.solo.Server
  • Unix-like: java -cp "lib/*:." org.b3log.solo.Server

If you have a Java development environment, you can refer to here to build and run through the source code (Video demo tutorial please see here).

Docker

Docker deployment is a dynamic blog usage, mainly used to deploy dynamic blogs on the server.

(Video demo tutorial please see here)

Get the latest image

docker pull b3log/solo

Start the container

  • Use MySQL

  Create database schema manually (schema name solo, character set use utf8mb4, sorting rule utf8mb4_general_ci):

create database solo default character set utf8mb4 collate utf8mb4_general_ci;
create user 'root'@'127.0.0.1' identified by '123456';
grant all privileges on *.* to 'root'@'127.0.0.1';
flush privileges;

Start container:

docker run --detach --name solo --network=host \
    --env RUNTIME_DB="MYSQL" \
    --env JDBC_USERNAME="root" \
    --env JDBC_PASSWORD="123456" \
    --env JDBC_DRIVER="com.mysql.cj.jdbc.Driver" \
    --env JDBC_URL="jdbc:mysql://127.0.0.1:3306/solo?useUnicode=yes&characterEncoding=UTF-8&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true" \
    b3log/solo --listen_port=8080 --server_scheme=http --server_host=localhost --server_port=

For simplicity, the host network mode is used to connect to MySQL on the host.

  • Use H2 Database
    docker run --detach --name solo --volume ~/solo_h2/:/opt/solo/h2/ --publish 8080:8080 \
        --env RUNTIME_DB="H2" \
        --env JDBC_USERNAME="root" \
        --env JDBC_PASSWORD="123456" \
        --env JDBC_DRIVER="org.h2.Driver" \
        --env JDBC_URL="jdbc:h2:/opt/solo/h2/db;MODE=MYSQL" \
        b3log/solo --listen_port=8080 --server_scheme=http --server_host=localhost --server_port=

Start command line arguments description:

  • --listen_port: the process listen port
  • --server_scheme: the protocol for the final visiting, if the anti-generation service is enabled with HTTPS, it also needs to be changed to https
  • --server_host: the domain name or public IP for the final visiting, do not bring port
  • --server_port: the port for the final visiting, use the default 80 or 443 of the browser to leave the value blank

The description of the complete startup arguments can be viewed using -h.

Logging configuration

By default, logs are printed to the standard output stream through log4j2, which can be viewed through docker logs solo. If you need to override the log4j configuration, you can mount the file to achieve:

--volume ~/log4j2.xml:/opt/solo/log4j2.xml

Skin configuration

If you want to use other skins, you can mount the directory skins (it needs to contain all the skins you want to use):

--volume ~/skins/:/opt/solo/skins/

Version upgrade

  1. Pull the latest image
  2. Restart the container

You can refer to here to write a restart script and run it through crontab every morning to achieve automatic update.

Docker Compose

Please refer to here, thanks to @liumapp for providing it.

NGINX reverse proxy

upstream backend {
    server localhost:8080; # Solo listen port
}

server {
    listen       80;
    server_name  88250.b3log.org; # blog domain

    access_log off;

    location / {
        proxy_pass http://backend$request_uri;
        proxy_set_header  Host $http_host;
        proxy_set_header  X-Real-IP $remote_addr;
        client_max_body_size  10m;
    }
}

Be sure to configure:

proxy_set_header  Host $http_host;
proxy_set_header  X-Real-IP $remote_addr;

Otherwise, "Latke configuration error" or abnormal style may appear on the access page; the function of counting online visitors will be abnormal.

📜 Documentation

🏘️ Community

📄 License

Solo uses the Mulan Permissive Software License,Version 2 open source license.

🙏 Acknowledgement

  • jQuery: Front-end JavaScript tool library
  • Vditor: In-browser Markdown editor
  • Highlight.js: Front-end code syntax highlighting library
  • pjax: pushState + AJAX = pjax
  • jsoup: Java HTML parser
  • flexmark: Java Markdown processor
  • Apache Commons: Java commons library
  • Latke: Java Web framework based on JSON