Failed to clone private github repositories on a readthedocs local server - django-allauth

I have installed a readthedocs local server but I am unable to build private github repositories from my organization through django-allauth.
I have admin privileges in all repositories, and I have configured django-allauth in the admin panel:
Adding the Client ID and Secret key to "admin/socialaccounts/socialapplications".
Adding an access Token into "admin/socialaccounts/socialtoken".
Adding the following configuration to the "admin/oauth/remoterepository"
Every time I try to build the repository I get the following error:
Failed to import project: Failed to get code from 'https://github.com/my-organization/my-project.git' (git clone): 128 git
clone error output: fatal: could not read Username for 'https://github.com': No such device or address
Does somebody know why is this happening? has somebody been able to configure a local readthedocs server in a similar scenario, using private repositories within an organization?

I have fixed the issue adding the flag:
ALLOW_PRIVATE_REPOS = True
Into my settings file my-project/readthedocs/settings/local_settings.py. This will activate x-oauth-basic urls for the Github repositories, allowing me to use my Github personal access token to clone the repository. I have just updated the Repository clone url field on admin/oauth/remoterepository using the following format:
https://<your token>:x-oauth-basic#github.com/my-organization/my-project.git

Related

XCode - GitHub ´SecureTransport error: I/O error. (-1)´

I'm having an issue when pushing to my GitHub repo (it's an iOS app for iPhone). I haven't had any problem doing this in the last few years. However, without changing anything related to the connection between XCode and GitHub, now I get this error message:
I've checked and all my credentials are up to date, the project is working fine, and I'm able to do commits, but when I do the push. The error appears and no push is done.
Furthermore, I've tried pushing other projects and there is no problem. Also, the push size is not that big.
What should I do to solve this error? I'm using the Source Control functionality of XCode.
When doing the push through command line (terminal), I found out that the error was produced due to a file that had a size of +100MB. I had to remove it and everything went fine.
Remark: That file was a pod library. So, be careful when pushing all your project. At the end, to backup the whole project you just need the podfile, as it is the one you use to install pod libraries.
I had same issue cause of selecting different origin, select default origin and Source Control > Push and select Origin in dropdown then push
I was having this issue then I used terminal and I realised that I needed to add my personal access token to my push request.
To get your personal access token, go to your github.com account->profile->Settings->Developer settings->Personal access tokens and generate a new token. Save somewhere safe as you can only copy once else you have to regenerate again
Initialising and committing your project locally. Skip if you've already committed
cd <directory of your project>
git init
git add .
git commit -m "type in a commit message here"
Pushing to your remote project on github.com
git remote add origin https://github.com/AccountName/testProject.git
git push -u origin master
It'll prompt you to enter Username & Password but password should be your token already created on github prior and NOT your account password
Username for 'https://github.com': <your username here>
Password for '<your username is shown here>': <access token here>

Get {"error":"404 Not Found"} when uploading pypi package to gitlab with twine

I am following the official documentation while trying to upload my pypi package to gitlab private repository using twine.
I am working on a community project on gitlab.com that is set to private.
I am using the following commandline:
twine upload dist/*.tar.gz --skip-existing --verbose --repository-url https://gitlab.com/api/v4/projects/mygroup/myproject/packages/pypi
When I run this command, twine asks for username and password. I enter my email and 2-factor token (I have 2-factor authentication enabled for my gitlab.com account)
Enter your username: my#email.com
/home/myname/.venv/myproject/lib/python3.7/site-packages/twine/auth.py:72: UserWarning: No recommended backend was available. Install a recommended 3rd party backend package; or, install the keyrings.alt package if you want to use the non-recommended backends. See https://pypi.org/project/keyring for details.
warnings.warn(str(exc))
Enter your password:
Then I get a pleasant message:
Uploading myproject-0.0.1.tar.gz
100%|██████████████████| 25.6k/25.6k [00:00<00:00, 87.4kB/s]
Followed by a less pleasant error message:
Content received from server:
{"error":"404 Not Found"}
HTTPError: 404 Not Found from https://gitlab.com/api/v4/projects/mygroup/myproject/packages/pypi
Not Found
At this stage I have a few comments.
Documentation mentions a repository of example gitlab-ci.yaml files but there is no mention of PyPi or twine in in any of the examples that I could find there.
Documentation mentions gitlab.example.com. I don't know why, will this work for gitlab.com as well?
Anyway, I don't know how to proceed from here. I have limited ways of debugging this or interpreting the meaning of the resulting error. How can I make this work?
As far as I know, you have to use the project id in the repository-url:
twine upload dist/*.tar.gz --skip-existing --verbose --repository-url https://gitlab.com/api/v4/projects/<PROJECT_ID>/packages/pypi

Please make sure you have the correct access right and the repository exists github

When I try to push my changes to my github repo I am receiving the error:
Fatal: 'git#github.comRedHoodJT1988/hello_app.git' does not appear to be a git repository
Fatal: could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
I have looked at the documentation and completed the steps here:https://help.github.com/articles/error-permission-denied-publickey/
As well as looked at other sites and nothing is working. I am able to connect to ssh because I receive the message :Hi RedHoodJT1988...
I am at a loss for what to do next. I am not using a cloud IDE I am on a macbook pro if that helps. Also, not sure if it matters, I am developing a Ruby on Rails application.
You're missing a colon in your address and need to change your remote named origin
git remote remove origin
git remote add origin https://github.com/RedHoodJT1988/hello_app.git
Since it is an SSH URL, there should not be any https involved:
git remote set-url origin git#github.com:RedHoodJT1988/hello_app.git

Remote Git repository unreachable in XCode 5

I have created a remote Git repository for a new project. I have added to my remotes and XCode recognizes it. When creating the new project, I checked the box for Source Control > create git repository on: and selected "Add to New Server"
When I enter my login credentials, I get the following message:
The server https://... is unavailable or may not exist. Check the server address, check your network connection, and then try again.
I have verified that my login is correct and the url is definitely valid. What might I be doing wrong?
Thanks!
Was able to solve my issue using the following:
git remote add origin git#github.com:pheepster/<repoName>.git
git push origin master:master
with the help of: https://stackoverflow.com/a/14470400/2115842
In addition to the two git commands in #Pheepster's answer, I suggest you check you are running the current version of GIT on both the development Mac and Server. Once I had the current version of GIT on both systems the two lines above solved my issue.

git clone problem

i have create clone of project on local machine with
git clone git#github.com:test/abc.git
Now i want to deploy my project on my ubuntu server .
so i have created a script which install git on my ubuntu server.
And now i want to deploy my rails project on server.
like git clone git#github.com:test/abc.git but i have not set ssh key on my server.
Is there any way i can create clone without set up ssh key on my server.
Is compulsotion that we have to create to ssh each on every server?
What if i have 20 server ? i need to set up ssh key for every server to clone?
Is there any way just ask the password than it will create a clone?
Or any other way?
You can use the read-only version. Next to the name of your repository you can select the http protocol. This url can be used without ssh key. If it is a private repository you'll need to add your username to the url.
$ git clone http://myname#github.com:test/abc.git
Initialized empty Git repository in /Users/myname/Projects/abc/.git/
password:
Then you type your password and a bit later you have your clone. A disadvantage is that you need to enter your password if you use a private repo.
Although I fail to see the problem of adding a few ssh-keys. If you really need to deploy to 20 servers you might consider thinking of using a packaging method with good OS support for automatic updating.
It is a mistake to try to use a configuration management tool in order to deploy an installation. Do you really intend to update the code from each of those 20 systems? Why then are you granting them write access to the code?
Create a tarball or use whatever package management systems are available in the language you are developing in (e.g. in Perl, you could use Dist::Zilla, Module::Install or ExtUtils::MakeMaker).
We created a php script which built RPMs (and Using Alien also built DEBs) for updating our 200+ machine fleet. As a url like "http://repo/fetch/rpm/" was called a script checked if there had been a new git tag inserted in package_name repository and if so use an RPM template we created on a per repo basis (typically put in .build/rpm.spec) to build the RPM, save it to a local cache directory and read the contents out as a file header.
I realize for your application that won't work since you're using GitHub - but it's just an idea for those who have their own remote repositories. A cron on the boxes would query once a day those URLs and run rpm -Uvh on the output.
For your instance it might be wise to tarball each release and either put that in a public accessible URL or create a script to rsync it to each server + exec
If you're deploying rails projects, you should check out Capistrano - http://www.capify.org/index.php/Getting_Started

Resources