Tag Archives: drone

The drone settings page is not trusted

The drone settings page is not trusted

In the tutorial of building the drone cicd system, check trusted in the main part of settings. The normal page is like this

If you don’t have a trusted page, like this

It means that the user who logs in to drone is not an administrator, so you can’t see the option of trusted.

Solution

Check if there is drone in the docker running parameter of drone_ USER_ Create , as shown in the figure below

docker run \
  --volume=/opt/bin/drone/data:/data \
  --env=DRONE_GIT_ALWAYS_AUTH=true \
  --env=DRONE_GIT_USERNAME=xxx \
  --env=DRONE_GIT_PASSWORD=xxx \
  --env=DRONE_GOGS=true \
  --env=DRONE_GOGS_SKIP_VERIFY=false \
  --env=DRONE_GOGS_SERVER=http://xxx \
  --env=DRONE_PROVIDER=gogs \
  --env=DRONE_RPC_SECRET=xxx \
  --env=DRONE_USER_CREATE=username:yourUsername,admin:true \
  --env=DRONE_SERVER_PROTO=http \
  --publish=xxx:80 \
  --publish=xxx:443 \
  --restart=always \
  --detach=true \
  --name=drone \
  -h drone \
  drone/drone:1

--env=DRONE_ USER_ CREATE= username:yourUsername , admin:true this line is very important. After that, you can log in to drone with your user name and become an administrator. If you don’t add it, you won’t see the trusted button.

At that time, the -- env in my line was written as - env which resulted in that the parameters in this line did not take effect and that I did not run drone as an administrator, so I could not see the option of trusted.

Others: how to restart drone after it has been run?

docker rm -f drone # Delete the original image
# Run the above docker run to build a new image and run it

[Solved] fatal: could not read Username for

Total: could not read username for ‘http:// solution

After deploying the clone (cicd software), when the commit is triggered, the problem occurs when the clone runner executes the pull warehouse code (on his deployed gogs)

Initialized empty Git repository in /drone/src/.git/
+ git fetch origin +refs/heads/master:
fatal: could not read Username for 'http://ip:port': terminal prompts disabled

The reason is that you need to enter the user name and password, but because this is cicd software, there is no time to enter the password, so there are two solutions:

Using SSH, you can produce git public key on the server where drone is located and upload it to code hosting (I use the gogs built by myself here, but there will also be GitHub, gitea, gitee, gitlab, etc.), so that you don’t need to download and upload the user name and password, and use the memory password mechanism of GIT to save the user name and password

Enter the server where the drone is located, log in with the drone process user, enter the home directory ( Cd ~ ) and execute git clone [your git code path] , and find that you need to enter a password, Ctrl + C interrupt execution touch. Git credentials create. Git credentials file execute vim. Git credentials edit the file, press I key to enter edit mode, enter: HTTP (s):// {your user name}: {your password} @ your git server address [Note: select HTTPS/HTTP, Remove curly brackets] press ESC Enter : WQ save and exit to execute git config -- global credential.helper store cat ~ /. Gitconfig found one more item:

[credential]
helper = store

Explain that it has been configured. Try again git clone [your git code path] no need to enter a password

Fatal: could not read username for ‘http://…’: terminal prompts disabled problem solving~