Gogs & Drone 1.0.0-rc.1 There was a problem enabling your repository

Gogs & Drone 1.0.0-rc.1 There was a problem enabling your repository.

There is not enough information in this post for us to help you debug. Please, at a minimum, provide your drone server logs with debug logs enabled.

{
  "admin": false,
  "level": "debug",
  "msg": "api: access granted",
  "read": true,
  "repository": "hexo/hexo",
  "request-id": "1D0JqIdnnGBJiB9rDiHSQUHMThQ",
  "time": "2018-11-15T02:01:12Z",
  "user.login": "drone",
  "visibility": "private",
  "write": true
}
{
  "admin": false,
  "level": "debug",
  "msg": "api: admin access required",
  "read": true,
  "repository": "hexo/hexo",
  "request-id": "1D0JqIdnnGBJiB9rDiHSQUHMThQ",
  "time": "2018-11-15T02:01:12Z",
  "user.login": "drone",
  "visibility": "private",
  "write": true
}
{
  "fields.time": "2018-11-15T02:01:12Z",
  "latency": 890706,
  "level": "debug",
  "method": "POST",
  "msg": "",
  "remote": "172.18.0.11:58798",
  "request": "/api/repos/hexo/hexo",
  "request-id": "1D0JqIdnnGBJiB9rDiHSQUHMThQ",
  "time": "2018-11-15T02:01:12Z"
}

It appears your user account does not have administrative access to the repository, which is required for activation, so that Drone can create webhooks. You will need to talk with the repository owner in Gogs and get admin access granted to your account, and then you need to re-sync your permissions (synchronize button on the home screen).

{
- "admin": false,
  "level": "debug",
- "msg": "api: admin access required",
  "read": true,
  "repository": "hexo/hexo",
  "request-id": "1D0JqIdnnGBJiB9rDiHSQUHMThQ",
  "time": "2018-11-15T02:01:12Z",
  "user.login": "drone",
  "visibility": "private",
  "write": true
}

But it does work in drone:0.8

Gogs 不区分用户和组织,组织是无法登录的。如果仓库属于组织的,那么仓库的所有贡献者都没有权限开启 Drone CI/CD,这不合理。
— translate —
Gogs does not distinguish between users and organizations, and organizations are unable to log in. If the repo belongs to an organization, it is unreasonable that all contributors to the repo do not have permission to open Drone CI/CD.

the repository endpoint returns the user access (read, write, admin) to the repository [1]. I have a gogs instance and am unable to reproduce, but if you think there is a drone error I encourage you to send a pull request.

[1] https://github.com/drone/go-scm/blob/master/scm/driver/gogs/repo.go#L34

谢谢。我可以接受 Repository 的管理员才能开启 Drone CI/CD,不过我觉得,Repository 的普通贡献者应该是不能够看到仓库的 Drone SETTINGS,以及可以RESTART pipeline。
— translate —
Thank you. I can accept repository administrators to open Drone CI/CD, but I think repository’s other contributors should not be able to see the Drone SETTINGS of the repository and should be able to RESTART pipeline.

If a non-administrative user visits the setting page, the API request will fail to load the secrets and cron settings. Access to these resources is enforced at the API level. So there is no real security issue.

If a user with read-only access tries to restart the build it will fail because write access is required. So again, this is enforced at the API level. So no security issue here either.

In both cases, this is just an area of improvement for the UI, to hide elements that the user does not actually have access to.

I think repository’s all contributors should be able to RESTART pipeline.Because each contributor submit the code would be notified Drone Server for CI/CD