felix-cao / Blog

A little progress a day makes you a big success!
31 stars 4 forks source link

基于绿联 NAS + frp 内网穿透搭建外网可以访问的 gitlab #217

Open felix-cao opened 11 months ago

felix-cao commented 11 months ago

一、安装 frps 服务端程序

在自己的阿里云 Linux 服务器上

wget https://gitee.com/mvscode/frps-onekey/raw/master/install-frps.sh -O ./install-frps.sh
chmod 700 ./install-frps.sh
./install-frps.sh install
image

安装最终结果

image

服务端配置文件位置: /usr/local/frps/frps.ini

二、准备客户端 frpc.ini 配置文件

[common]
server_addr = 39.100.140.89
server_port = 3000
token = ***********

[gitlabssh]
type = tcp
local_ip = 192.168.0.2
local_port = 8122
remote_port = 8122

[gitlab]
type = tcp
local_ip = 192.168.0.2
local_port = 8180
remote_port = 8180

其中 192.168.0.2 是 绿联 NAS 的地址。

三、在绿联 NAS 上安装 frpc 客户端

image image image

最后登录 frp 的控制台 http://39.100.140.xx:8445

image

四、在绿联NAS中安装 gitlab

4.1 下载镜像文件

镜像管理 -> 添加

image

4.2 创建容器

网络选择 bridge 端口映射

image

试试打开 http://192.168.0.185:8180/

4.3 账号密码登录

参考 Install GitLab using Docker Engine

默认username : root

获取密码

grep 'Password:' /etc/gitlab/initial_root_password
image