gitlab 调整
Ubuntu 分区小了
gitlab
镜像越来越大了,终于空间不够用了……
gitlab 备份
备份项目
1 | docker exec -t <container name> gitlab-rake gitlab:backup:create |
注意备份docker-compose.yml
文件
备份设置文件
1 | docker exec -t <your container name> /bin/sh -c 'umask 0077; tar cfz /secret/gitlab/backups/$(date "+etc-gitlab-\%s.tgz") -C / etc/gitlab' |
注意 /secret/gitlab/backups/
在本地的文件挂载。
备份文件在/var/opt/gitlab/backups
中 注意导出。
还原是注意 镜像版本
的一致性。 不一致时有错误提示。
准备工作完成
重新安装 ubuntu
下载最新ubuntu
镜像安装。
UI
比之前强点……
注意开启openssh
设置 ssh
1 | sudo nano /etc/ssh/sshd_config |
修改端口Port 22
添加 公钥
1 | mkdir .ssh |
复制公钥到authorized_keys
重启 ssh 服务
1 | sudo service sshd restart |
安装 zsh
1 | sudo apt install zsh |
重新登录后检测
1 | echo $SHELL |
安装 oh my zsh
1 | sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" |
设置~/.zshrc
1 | ZSH_THEME="agnoster" |
安装powerline fonts
1 | sudo apt-get install fonts-powerline |
安装 docker
更新包资源
1 | sudo apt-get update |
安装必要包
1 | sudo apt-get install \ |
安装公钥
1 | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - |
验证公钥
1 | sudo apt-key fingerprint 0EBFCD88 |
指定版本
1 | sudo add-apt-repository \ |
安装
1 | sudo apt-get install docker-ce docker-ce-cli containerd.io |
免去sudo
1 | sudo groupadd docker |
安装docker-compose
安装
1 | sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose |
提权
1 | sudo chmod +x /usr/local/bin/docker-compose |
创建链接
1 | sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose |
还原 gitlab 备份
1 | docker exec -it <container name> gitlab-rake gitlab:backup:restore |
注意将文件挂载到/var/opt/gitlab/backups
修改ip
ip设置文件位置
1 | ls /etc/netplan/ |
修改内容
1 | enp0s3: |
原本内容
1 | enp0s3: |
确认更改
1 | sudo netplan apply |
其他
确认正在使用的ip
1 | ip addr |
炸毛!
炸毛!
系统升级后usb
不能用了……
还原后发现日记忘保存了……
几天的份就这样消失了……
蠢哭😭😭😭
github
账号2FA
与 recovery code
双失效……
联系客服中……
好在公钥还在,希望能续一秒……
需要使用ssh -T [email protected] verify
如果你有其他账号,需要修改为对应的Host
地址用于对应账号。
vue 上传
vue 上传文件
在vue中确认上传的文件
input
标签中设置ref
1 | <input type="file" ref="FileUp" class="custom-file-input" id="customFile" @change="FileUpload"> |
1 | FileUpload() { |
随后文件可以正常上传。
自动获取文件名
bootstrap 4
中自动载入文件名需要使用bs-custom-file-input
包
1 | npm install bs-custom-file-input --save |
vue 中使用
1 | mounted() { |
之后再选择文件后,input
便签可以自动显示文件名。
axios 中上传文件方法
上传文件时,需要headers
为multipart/form-data
。
注意请求时使用formData
不能使用form
formData
中数据使用append()
传入
1 | formData.append('file', this.upform.upfile) |
注意laravel
中数据名称对应
1 | axios.post('/game/json' , formData , |