• Welcome to the world's largest Chinese hacker forum

    Welcome to the world's largest Chinese hacker forum, our forum registration is open! You can now register for technical communication with us, this is a free and open to the world of the BBS, we founded the purpose for the study of network security, please don't release business of black/grey, or on the BBS posts, to seek help hacker if violations, we will permanently frozen your IP and account, thank you for your cooperation. Hacker attack and defense cracking or network Security

    business please click here: Creation Security  From CNHACKTEAM

Recommended Posts

Gitea安装成功后,我们希望在部署的Gitea网站上使用访问跟踪代码或其他JS脚本。这只能通过自定义模板来实现。

配置路径

首先需要访问Gitea的站点管理界面,然后找到自定义文件根路径配置属性。

gitea-templates-01

那么路径就是你需要设置模板的路径,然后在这个路径下新建两个文件夹templates/custom。

所以完整的路径是:/var/lib/gitea/custom/templates/custom

gitea-templates-02

文件

创建一个vi header.tmpl文件,然后将JS跟踪代码放在这个文件中。

重启

然后重启Gitea服务,完成所有页面的跟踪代码插入。

校验安装

完成以上步骤后,右键查看网站源代码。

gitea-templates-03

如果能看到插入的源代码,说明配置已经成功。

https://www.ossez.com/t/gitea/13944

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now