当前位置: 首页 > 软件库 > Web应用开发 > >

jekyll-gitlab-letsencrypt

授权协议 View license
开发语言 JavaScript
所属分类 Web应用开发
软件类型 开源软件
地区 不详
投 递 者 谭玄天
操作系统 未知
开源组织
适用人群 未知
 软件概览

Deprecated

  • This gem uses the letsencypt ACME v1 API, which is now deprecated. A change to use the v2 API would be need to make it work.
  • It's probably not needed - gitlab now offers automatic Letsencrypt integration
    • I switched my own page to ^^ from this gem and it worked okay...

jekyll-gitlab-letsencrypt

This plugin automagically does the entire the letsencrypt process for your gitlab-hosted jekyll blog!

  • (automatic) It registers your email to the letsencrypt server
  • (automatic) It generates a challenge file, and commits it directly via the gitlab API
  • (automatic) It sleeps until the challenge file is live on the internet
  • (automatic) It asks letsencrypt to verify it
  • (automatic) It spits out the certificate chain and private key
  • (automatic) It updates the gitlab pages domain settings to use the certificate

Usage

Prerequisites

You must have:

  • A jekyll blog
    • Hosted on gitlab pages
    • With a domain name set up and working
  • Gitlab CI setup such that when you push to master (or your preferred branch), your changes are deployed live

Versions supported:

  • Jekyll 3+
    • 3.3.x - 3.8.x is tested against
  • Ruby 2.1+
    • Although 2.2+ recommend, as Jekyll itself doesn't support 2.1

Installation

  • Add to your Gemfile:
group :jekyll_plugins do
    gem 'jekyll-emojis'
    gem 'jekyll-more-emojis'
++  gem 'jekyll-gitlab-letsencrypt'
  end

and run bundle install

First-time Configuration

Add a gitlab-letsencrypt to your _config.yml:

gitlab-letsencrypt:
  # Gitlab settings:
  personal_access_token: 'MUCH SECRET'             # Gotten from the step above ^^
  gitlab_repo:           'gitlab_user/gitlab_repo' # Namespaced repository identifier

  # Domain settings:
  email:                 'example@example.com'     # Let's Encrypt email address
  domain:                'example.com'             # Domain that the cert will be issued for

  # Jekyll settings:
  base_path:  './'               # Where you want the file to go
  pretty_url: false              # Add a "/" on the end of the URL... set to `true` if you use permalink_style: pretty
  append_str: ''                 # Append this string to the end of the challenge URL
  filename:   'letsencrypt.html' # What to call the generated challenge file

  # Delay settings:
  initial_delay: 120 # How long to wait for Gitlab CI to push your changes before it starts checking
  delay_time:     15 # How long to wait between each check once it starts looking for the file

  # Optional settings you probably don't need:
  gitlab_url:     'https://someurl'           # Set if you need to use a self-hosted GitLab instance
  endpoint:       'https://somewhere'         # if you're doing the ACME thing outside of letsencrypt
  branch:         'master'                    # Defaults to master, but you can use a different branch
  layout:         'null'                      # Layout to use for challenge file - defaults to null, but you can change if needed
  scheme:         'https'                     # Scheme to use for challenge request; default http
  commit_message: 'Renew certificate [ROBOT]' # Commit message to use; defaults to "Automated Let's Encrypt renewal"

Running

  • Just type jekyll letsencrypt
$ jekyll letsencrypt
Registering example@example.com to https://acme-v01.api.letsencrypt.org/...
Pushing file to Gitlab
Commiting challenge file as lets.html
Done Commiting! Check https://gitlab.com/gitlab_user/gitlab_repo/commits/master
Going to check http://example.com/.well-known/acme-challenge/lots_of_numbers/ for the challenge to be present...
Waiting 120 seconds before we start checking for challenge..
Got response code 404, waiting 15 seconds...
Got response code 404, waiting 15 seconds...
Got response code 200, file is present!
Requesting verification...
Challenge status = valid
Challenge is valid!
Certificate retrieved!
Updating domain example.com pages setting with new certificates..
Success!

Alternative token usage

If you don't want to put your secret gitlab token in your _config.yml, you can pass it as an ENV var when you run the command:

GITLAB_TOKEN="VERY_SECRET_NOT_IN_GIT_PLEASE" jekyll letsencrypt

License

MIT

Credits/thanks

  • ❤️ Gitlab for free page hosting, free repos, and free CI!
  • ❤️ the Jekyll team for the easy-to-use blogging engine!
  • Inspired by the excellent gitlab-letsencrypt npm package.
  • Thanks to contributors:
    • @ethernet-zero
    • @daehlith
 相关资料
  • 虽然 GitWeb 相当简单。 但如果你正在寻找一个更现代,功能更全的 Git 服务器,这里有几个开源的解决方案可供你选择安装。 因为 GitLab 是其中最出名的一个,我们将它作为示例并讨论它的安装和使用。 这比 GitWeb 要复杂的多并且需要更多的维护,但它的确是一个功能更全的选择。 安装 GitLab 是一个数据库支持的 web 应用,所以相比于其他 git 服务器,它的安装过程涉及到更多

  • 自建代码托管平台,不如使用码云企业版,详细的对比请看这里。 GitLab是一个利用 Ruby on Rails 开发的开源应用程序,实现一个自托管的Git项目仓库,可通过Web界面进行访问公开的或者私人项目。 Gitee 为 Gitlab 开发的一个代码搜索工具 https://gitee.com/koode/kooder 它拥有与Github类似的功能,能够浏览源代码,管理缺陷和注释。可以管理团

  • Gitlab官方提供了 Helm 的方式在 Kubernetes 集群中来快速安装,但是在使用的过程中发现 Helm 提供的 Chart 包中有很多其他额外的配置,所以我们这里使用自定义的方式来安装,也就是自己来定义一些资源清单文件。 Gitlab主要涉及到3个应用:Redis、Postgresql、Gitlab 核心程序,实际上我们只要将这3个应用分别启动起来,然后加上对应的配置就可以很方便的安

  • gitlab-ci 是为 Gitlab 提供的持续集成服务器。 支持的操作系统: Ubuntu Linux Debian/GNU Linux 额外的 GitLab CI 要求: ruby 1.9.3 MySQL or PostgreSQL 当前版本 (3.x) 适用于 GitLab 5.3+.

  • GitLab-TreeView Chrome 扩展插件树形展示 GitLab 项目代码 特点 快速预览项目代码 贴近GitLab的UI风格 文件搜索 支持GitLab 9+

  • gitlab-mirrors 项目的目的是为了满足当前 Gitlab 所缺少的一个特性:远程仓库的镜像。而 gitlab-mirrors 可以创建远程仓库的只读拷贝,提供命令行接口用来管理镜像的仓库(如添加、删除和修改)。它使用的是 python-gitlab3 来跟 GitLab API 交互。 特性 镜像不同类型的源仓库:  Bazaar, Git, Mercurial, Subversion