使狮身人面像文件私人 [英] Making sphinx documentation private

查看:166
本文介绍了使狮身人面像文件私人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以这是一个重复发生的问题,我没有资格修复它,但我需要修复它,所以我将不得不学习。有关过期/不可行的解决方案,请参见此问题为一个没有答案的类似问题。



基本问题,我需要提供一个私有python模块的文档。该项目托管在gitlab上,我使用CI来生成文档。它们对世界而言是可见的,这并不理想。这是一个已知问题,gitlab最终可能会提供解决方案。我等不了多久。我的计划是使用此项目(crypto-js)代码并包含它在码头运动员。不幸的是,我不知道如何去做,或者甚至有可能。



我的 ci.yml 是:

  image:tsgkadot / sphinx-plantuml 

阶段:
- 构建
页面:
阶段:构建
脚本:
# - pip install -r requirements.txt -U
- sphinx-build -b html ./doc public
artifacts:
paths:
- public
标签:
- docker

据我所知,crypto-js是接口如下所示:

  var unencrypted = document.getElementById('unencrypted_html')。value; 
var passphrase = document.getElementById('passphrase')。value;
var encrypted = CryptoJS.AES.encrypt(未加密,密码短语);
var hmac = CryptoJS.HmacSHA256(encrypted.toString(),CryptoJS.SHA256(passphrase))。toString();
var encryptedMsg = hmac + encrypted;

其中从sphinx生成的html文件必须传递给js和输出替换文件。另外,我阅读了 SO ,它可以包括js在狮身人面像中,但我不明白文件如何加密自己。我不介意使用一个密码加密所有文档,然后与相关方共享密码。



我也在相关问题上发布了这些想法gitlab,但似乎没有什么进展,因为他们正在寻找一个更完整的解决方案。



如果有像gitlab这样的git托管服务提供类似页面私人存储库,我也很乐意切换到。任何想法或指针如何实现这一点?

解决方案

因此,我已经做了一个基本的修复,现在的作品:



这个gitlab回购显示了一个工作示例此处



它使用静态密码保护,并在问题


So this is a reoccurring issue and I'm not qualified to fix it but I need it fixed so I'm going to have to learn. See this question for an outdated / not feasible solution, and for a similar question without answer.

Basic problem, I need to provide documentation for a private python module. The Project is hosted on gitlab and I use the CI to generate the docs. They are visible to the world and that isn't ideal. This is a known issue and gitlab may eventually provide a solution. I can't wait that long. My plan was to use this project (crypto-js) code and include it in the docker runner. Unfortunately I have no clue as to how to go about it or if that is even possible.

My ci.yml is:

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

As far as I can work out crypto-js is interfaced with like so:

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;

where the generated html file(s) from sphinx would have to be passed to the js and the output replace the files. Alternatively, i read on SO that it is possible to include js in sphinx, but I don't see how a file could encrypt itself. I don't mind using one password to encrypt all the documentation and then sharing the password with the relevant parties.

I've also posted these ideas on the relevant issue with gitlab but there seems to be little progress there as they are looking for a more complete solution.

If there is a git hosting service like gitlab that offers something like pages that are private for private repositories, I'd also be happy to switch to that. Any ideas or pointers as to how to implement this?

解决方案

So I've made a rudimentary fix that works for now:

This gitlab repo shows a working example here.

It uses static password protection and is also discussed in this issue.

这篇关于使狮身人面像文件私人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆