2022年10月

Debian/Ubuntu使用Nexus的私有镜像源

以Debian11为例

  1. 修改/etc/apt/source.list

    vim /etc/apt/source.list
    # deb cdrom:[Debian GNU/Linux 11.2.0 _Bullseye_ - Official amd64 DVD Binary-1 20211218-11:13]/ bullseye contrib main
    
    #deb cdrom:[Debian GNU/Linux 11.2.0 _Bullseye_ - Official amd64 DVD Binary-1 20211218-11:13]/ bullseye contrib main
    
    deb http://deb.debian.org/debian/ bullseye main
    deb-src http://deb.debian.org/debian/ bullseye main
    
    deb http://security.debian.org/debian-security bullseye-security main contrib
    deb-src http://security.debian.org/debian-security bullseye-security main contrib
    
    # bullseye-updates, to get updates before a point release is made;
    # see https://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_updates_and_backports
    deb http://deb.debian.org/debian/ bullseye-updates main contrib
    deb-src http://deb.debian.org/debian/ bullseye-updates main contrib

    把其中的地址替换成你的私有镜像源地址

    # deb cdrom:[Debian GNU/Linux 11.2.0 _Bullseye_ - Official amd64 DVD Binary-1 20211218-11:13]/ bullseye contrib main
    
    #deb cdrom:[Debian GNU/Linux 11.2.0 _Bullseye_ - Official amd64 DVD Binary-1 20211218-11:13]/ bullseye contrib main
    
    deb http://mirror.nfools.org:8081/repository/debian-bullseye/ bullseye main
    deb-src http://mirror.nfools.org:8081/repository/debian-bullseye/ bullseye main
    
    deb http://security.debian.org/debian-security bullseye-security main contrib
    deb-src http://security.debian.org/debian-security bullseye-security main contrib
    
    # bullseye-updates, to get updates before a point release is made;
    # see https://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_updates_and_backports
    deb http://deb.debian.org/debian/ bullseye-updates main contrib
    deb-src http://deb.debian.org/debian/ bullseye-updates main contrib

    保存并退出

  2. 创建/etc/apt/auth.conf.d/nexus.local.intranet.conf(如果你的仓库允许匿名访问,则忽略这一步)

    vim /etc/apt/auth.conf.d/nexus.local.intranet.conf

    配置你的镜像源地址、登录名和密码

    machine http://mirror.nfools.org:8081/
    login public
    password public

    保存并退出

  3. 更新apt

    apt update

以Ubuntu为例

同上,略。

假如你要使用if语句判断Query类的成员变量in是否为null,你可能会这么写: <if test="null != query.in"></if>(错误)


正确的做法是把Query类的in变量名改成其它名字,比如改成contains <if test="null != query.contains"></if>(正确)

1.在套件中心停用Gitlab。
屏幕截图 2022-10-07 225900.png
2.打开docker,右键编辑synology_gitlab,在端口设置中将本地端口44333(自定义), 映射到容器端口443,然后在环境变量中新增GITLAB_HTTPS true
屏幕截图 2022-10-07 230252.png
屏幕截图 2022-10-07 230325.png
完成以上步骤后,重启Gitlab,就可以在浏览器上使用https访问Gitlab了。
但是当使用克隆代码时,仍然是使用原来的端口。
3.在环境变量中修改GITLAB_PORT的值为44333(自定义)
屏幕截图 2022-10-07 230713.png
然后重启Gitlab就完事了。