Preparation
Environmental requirements
Working directory
Refers to the working directory that Halo depends on. When Halo is running, a halo-next folder will be generated in the current user directory of the system. The absolute path is ~/halo-next. It usually contains the following directories or files:
db
: Stores the physical files of H2 Database. If you use other databases, this directory will not exist.themes
: Contains themes installed by users.plugins
: Contains plug-ins installed by users.attachments
: Attachment directory.logs
: Run log directory.
Development environment running
Project structure description
Currently, if you need to run Halo completely, you need a total of three parts:
Halo main project ( halo-dev/halo )
Console console (hosted in Halo main project)
Theme (the default theme is already included in the main Halo project)
Clone project
If you have already forked the relevant warehouse, please replace halo-dev in the following command with your GitHub username.
git clone https://github.com/halo-dev/halo
# Or use ssh to clone (recommended)
git clone [email protected]:halo-dev/halo.git
Run Console
cd path/to/halo
Linux / macOS platform:
make -C console dev
Windows platform:
cd console
pnpm install
pnpm build:packages
pnpm dev
In the end, the console prints the following information, which means it is running normally:
VITE v3.1.6 ready in 638 ms
➜ Local: http://localhost:3000/console/
HINT
Please do not directly use the running port (3000) of the Console to access, as it will cause failure to log in normally due to cross-domain issues. It is recommended to follow the next steps to run Halo with the dev configuration file. In the dev configuration file, we proxy the Console access by default. address, so subsequent access to the Console http://localhost:8090/console
can be accessed. Relevant configuration of the agent:
halo:
console:
proxy:
endpoint: http://localhost:3000/
enabled: true
Run Halo
Open the Halo project in IntelliJ IDEA and wait for Gradle initialization and dependency downloading to complete.
Modify the running configuration of IntelliJ IDEA
macOS/Linux Change Active Profiles to
dev
, as shown:Windows changes Active Profiles to
dev,win
, as shown in the figure:
Click the Run button of IntelliJ IDEA and wait for the project to start.
Or use Gradle to run
# macOS / Linux
./gradlew bootRun --args="--spring.profiles.active=dev"
# Windows
gradlew.bat bootRun --args="--spring.profiles.active=dev,win"
Finally visit http://localhost:8090/console
to enter the console. Visit http://localhost:8090
to enter the homepage of the site.