gpt4 book ai didi

javascript - 将 sphinx 文档设为私有(private)

转载 作者:行者123 更新时间:2023-11-29 16:40:48 25 4
gpt4 key购买 nike

所以这是一个反复出现的问题,我没有资格修复它,但我需要修复它,所以我将不得不学习。参见 this question对于过时/不可行的解决方案,以及 for a similar question without answer.

基本问题,我需要提供私有(private) python 模块的文档。该项目托管在 gitlab 上,我使用 CI 生成文档。它们对世界可见,这并不理想。这是 known issue而gitlab最终可能会提供一个解决方案。我不能等那么久。我的计划是使用这个项目 (crypto-js)代码并将其包含在 docker runner 中。不幸的是,我不知道如何去做,或者这是否可能。

我的 ci.yml 是:

image: tsgkadot/sphinx-plantuml

stages:
- build
pages:
stage: build
script:
#- pip install -r requirements.txt -U
- sphinx-build -b html ./doc public
artifacts:
paths:
- public
tags:
- docker

据我所知,crypto-js 的接口(interface)是这样的:

var unencrypted = document.getElementById('unencrypted_html').value;
var passphrase = document.getElementById('passphrase').value;
var encrypted = CryptoJS.AES.encrypt(unencrypted, passphrase);
var hmac = CryptoJS.HmacSHA256(encrypted.toString(), CryptoJS.SHA256(passphrase)).toString();
var encryptedMsg = hmac + encrypted;

从 sphinx 生成的 html 文件必须传递给 js,输出替换文件。或者,我阅读了 SO可以在 sphinx 中包含 js,但我看不到文件如何 self 加密。我不介意使用一个密码来加密所有文档,然后与相关方共享密码。

我还在 gitlab 的相关问题上发布了这些想法,但似乎进展甚微,因为他们正在寻找更完整的解决方案。

如果有像 gitlab 这样的 git 托管服务,它提供类似于私有(private)存储库的私有(private)页面之类的东西,我也很乐意切换到它。关于如何实现这个的任何想法或指示?

最佳答案

GitLab 现在支持页面的访问控制:

https://docs.gitlab.com/ce/administration/pages/#access-control

Pages access control is currently disabled by default. To enable it, you must:

  1. Enable it in /etc/gitlab/gitlab.rb

    gitlab_pages['access_control'] = true

  2. Reconfigure GitLab

关于javascript - 将 sphinx 文档设为私有(private),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46154383/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com