banner
lca

lca

真正的不自由,是在自己的心中设下牢笼。

Ctfd category pagination settings

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.

  1. CTFd/themes/core/assets/js/pages/challenges.js

  2. 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.

  1. Install npm
sudo apt install npm
  1. After npm is installed, set the npm source
npm config set registry https://registry.npm.taobao.org
  1. Build
npm i && npm run build
  1. 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.

  1. The last step is to re-compose the docker and restart the ctfd container.
sudo docker-compose up -d
sudo docker restart 13d

The effect is as follows:

end...

Image source: https://wallhaven.cc/

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.