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, similar to ctfshow and buuoj.
Project address: https://github.com/frankli0324/ctfd-pages-theme
After taking a look, many people have npm errors in this project. I have also tried several times and encountered npm errors. I don't know what those errors mean. Although there are errors, the desired effect can still be achieved.
Here is a process for setting up. I directly modified the files in the core
directory based on ctfd-pages-theme
, and only need to replace two files.
-
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 pre-work is done, you can start building with npm.
- Install npm
sudo apt install npm
- After npm is installed, set the npm source
npm config set registry https://registry.npm.taobao.org
- Build
npm i && npm run build
- If there is an error in the build as shown below, it means 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-compose the
docker
and restart thectfd container
.
sudo docker-compose up -d
sudo docker restart 13d
The effect is as follows:
end...
Image source: https://wallhaven.cc/