问题
I installed read-the-docs to produce documentation starting from projects on a private git repository which needs user/password authentication.
When import manually a project, how can I put user and password to allow read-the-docs to clone the repo?
Many thanks, Max
回答1:
I've recently faced the same problem. There's one more question like this here Why can't I clone a git repo for readthedocs to build the documentation? where the author gave his own conclusion about the problem.
As it's written here https://docs.readthedocs.io/en/latest/open-source-philosophy.html readthedocs provides official support for open source projects. As I can understand, usage of a private repo assumes that the soft is not open source. And here https://docs.readthedocs.io/en/latest/business/index.html it's written specifically about private repos: the solution is to use the paid service readthedocs.com
A few days later, I received the following email from the support (I asked about VS Online in particular):
We don't support private repositories on our community site, readthedocs.org -- it is for open source software only. We don't support VSTS or VS Online directly with our commercial hosting, but there is at least support for SSH cloning of repositories. I'd suggest trialing an account there if your software is not open source.
回答2:
If I understand correctly, you're running a local clone of readthedocs.org. To allow SSH cloning of private repos, you can create a file /readthedocs/settings/local_settings.py (if not already done) and add following setting:
ALLOW_PRIVATE_REPOS = True
Just make sure the user rtd is running as, has SSH pubkey access to the repo.
来源:https://stackoverflow.com/questions/46907540/use-a-private-git-repository-with-read-the-docs