当前位置:   article > 正文

gitlab页脚添加备案号_gitlab 增加备案信息

gitlab 增加备案信息

01 gitlab页脚添加备案号

gitlab是用ruby开发的,也采用mvc的方式,所以在安装的主目录中/opt/gitlab/embedded/service/gitlab-rails/app/下面会看到 models, views, controllers目录。猜测页脚内容可能在 views 下面。

在搜索 /opt/gitlab/embedded/service/gitlab-rails/app/views$目录下搜索:
grep -rn "https://about.gitlab.com/" ./
会查到如下内容对应的文件。

link_to _("About GitLab"), "https://about.gitlab.com/"
  • 1

gitlab的sign_in页面的页脚内容在/opt/gitlab/embedded/service/gitlab-rails/app/views/layouts/下的devise*.haml两个ruby文件中。

devise.html.haml
devise_empty.html.haml
  • 1
  • 2

sudo vim devise_empty.html.haml

    .container
      .footer-links
        = link_to _("Explore"), explore_root_path
        = link_to _("Help"), help_path
        = link_to _("About GitLab"), "https://about.gitlab.com/"
    = footer_message
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

改为:

    .container
      .footer-links
        = link_to _("Explore"), explore_root_path
        = link_to _("Help"), help_path
        = link_to _("沪ICP备19006551号"), "http://beian.miit.gov.cn/"
    = footer_message
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

02 配置中文

/profile 页面下可以设置语言

03 修改管理员密码

设置gitlab的超级管理员密码为12345678

sudo gitlab-rails console production
user = User.where(id:1).first
user.password = '12345678'
user.password_confirmation = '12345678'
user.save!
quit
sudo gitlab-ctl restart
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
ubuntu@VM-14-230-ubuntu:~$ sudo gitlab-rails console production
-------------------------------------------------------------------------------------
 GitLab:       11.6.0-ee (4c09765)
 GitLab Shell: 8.4.3
 postgresql:   9.6.11
-------------------------------------------------------------------------------------
Loading production environment (Rails 5.0.7)
irb(main):001:0> user = User.where(id:1).first
=> #<User id:1 @root>
irb(main):002:0> user.password = '12345678'
=> "12345678"
irb(main):003:0> user.password_confirmation = '12345678'
=> "12345678"
irb(main):004:0> user.save!
Enqueued ActionMailer::DeliveryJob (Job ID: 7ac4e02f-c97b-43ed-be8b-ff33c2ae53e9) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", #<GlobalID:0x00007fd565229f60 @uri=#<URI::GID gid://gitlab/User/1>>
=> true
irb(main):005:0> quit
ubuntu@VM-14-230-ubuntu:~$ sudo gitlab-ctl restart
ok: run: alertmanager: (pid 10618) 0s
ok: run: gitaly: (pid 10637) 1s
ok: run: gitlab-monitor: (pid 10650) 0s
ok: run: gitlab-workhorse: (pid 10667) 1s
ok: run: logrotate: (pid 10691) 0s
ok: run: nginx: (pid 10720) 1s
ok: run: node-exporter: (pid 10726) 0s
ok: run: postgres-exporter: (pid 10770) 0s
ok: run: postgresql: (pid 10819) 1s
ok: run: prometheus: (pid 10828) 0s
ok: run: redis: (pid 10839) 1s
ok: run: redis-exporter: (pid 10845) 0s
ok: run: sidekiq: (pid 10857) 0s
ok: run: unicorn: (pid 10869) 0s
ubuntu@VM-14-230-ubuntu:~$ 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号