Friends who have set up ctfd may know that if there are many questions in ctfd, all the questions will be displayed on one page. At this time, a classification pagination plugin is needed. After searching on the Internet, I found a project that can meet the requirements, which has a similar effect to ctfshow and buuoj.
Project address: https://github.com/frankli0324/ctfd-pages-theme
After taking a look, many people encountered npm errors in this project. I also tried several times and encountered npm errors. I don't know what those errors mean. Although there are errors, you can ignore them and still achieve the desired effect.
Here is a process for setting up. I directly modified the files in the core
directory based on ctfd-pages-theme
. Only two files need to be replaced.
- CTFd/themes/core/assets/js/pages/challenges.js
- CTFd/themes/core/templates/challenges.html
If you directly modify the challenges.*
files in the core
directory, you can ignore the instructions in the ctfd-pages-theme project to "replace webpack.config.js with the webpack.config.js in the repository and build using npm". You can directly use the original webpack.config.js
file.
After the preparatory work is done, you can start building with npm.
- Install npm
sudo apt install npm
- After installing npm, set the npm source
npm config set registry https://registry.npm.taobao.org
- Build
npm i && npm run build
- If the build fails with the following error, there is a problem with the npm build
But if there is green text above the error message.
It means that the pages classification page can be used. Why is there an error? After checking, it may be related to the admin theme
, but this message can be ignored.
- The last step is to re-run
docker-compose
and restart thectfd container
.
sudo docker-compose up -d
sudo docker restart 13d
The effect is as follows:
end...
Image source: https://wallhaven.cc/