Commit graph

143 commits

Author SHA1 Message Date
devlux
5671956a31
Correct http cache headers for firefox (#3017)
Co-authored-by: Luca Marinucci <luca.marinucci@devlux.ch>
Co-authored-by: Anbraten <anton@ju60.de>
2023-12-26 08:37:13 +01:00
6543
3f1f563180
fix and lint swagger file (#3007)
Co-authored-by: qwerty287 <ndev@web.de>
2023-12-24 15:50:01 +01:00
Anbraten
619858e0e9
Ignore pipelines without config (#2949)
Co-authored-by: 6543 <6543@obermui.de>
2023-12-21 11:13:25 +01:00
6543
257a76c5ea
Improve error handling when activating a repository (#2965)
Activate Repo:
- Don't drop errors and also always log them on the server.
- Show users only meaningful error messages.
2023-12-19 06:25:59 +01:00
6543
4974d4cffe
ignore some errors on repairAllRepos (#2792)
close  #2791

Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2023-12-13 14:53:38 +01:00
runephilosof-karnovgroup
adb2c82790
Update go module path for major version 2 (#2905)
https://go.dev/doc/modules/release-workflow#breaking

Fixes https://github.com/woodpecker-ci/woodpecker/issues/2913 fixes
#2654
```
runephilosof@fedora:~/code/platform-woodpecker/woodpecker-repo-configurator (master)$ go get go.woodpecker-ci.org/woodpecker@v2.0.0
go: go.woodpecker-ci.org/woodpecker@v2.0.0: invalid version: module contains a go.mod file, so module path must match major version ("go.woodpecker-ci.org/woodpecker/v2")
```

---------

Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2023-12-08 08:15:08 +01:00
qwerty287
342b25826c
Rename link to url (#2812)
As of https://woodpecker-ci.org/docs/next/usage/terminiology#conventions
2023-11-14 17:12:12 +01:00
qwerty287
fd77b2e9d7
Fix repo owner filter (#2808)
and move to server config instead of middleware

cc @xoxys 

closes #2784
2023-11-12 14:39:41 +01:00
6543
5a7b689e30
Switch to go vanity urls (#2706)
Co-authored-by: Anbraten <anton@ju60.de>
2023-11-07 08:04:33 +01:00
qwerty287
e74115027b
Add some tests (#2652)
and some cleanups
2023-10-28 13:37:54 +02:00
Anbraten
f44aa8a6fd
Remove plugin-only option from secrets (#2213) 2023-10-24 20:38:47 +02:00
qwerty287
387637bb4e
Use repo user to repair (#2645)
Solve
https://github.com/woodpecker-ci/woodpecker/pull/2642#pullrequestreview-1694731501
2023-10-24 15:54:43 +02:00
qwerty287
5045f1e431
Remove deprecated API paths (#2639) 2023-10-24 15:21:05 +02:00
qwerty287
69917c1a0d
Add "Repair all" button (#2642)
to the admin repo list

ref #2639
2023-10-24 14:12:55 +02:00
qwerty287
0e5defa807
Refactor/simplify pubsub (#2554) 2023-10-13 07:34:33 +02:00
qwerty287
53b79eabcd
Add test for handling pipeline error (#2547)
Credits: @langecode

Taken from #2504
2023-10-08 14:58:13 +02:00
qwerty287
22dfd2ef62
Refactor pipeline parsing and forge refreshing (#2527)
- refactor pipeline parsing
- do not parse the pipeline multiple times to perform filter checks, do
this once and perform checks on the result directly
    - code deduplication
- refactor forge token refreshing
    - move refreshing to a helper func to reduce code

---------

Co-authored-by: Anbraten <anton@ju60.de>
2023-10-08 14:05:06 +02:00
qwerty287
6699577aba
Fix ccmenu endpoint (#2543) 2023-10-07 18:59:59 +02:00
Tom Kneiphof
baaf8b97e1
Fix usage of WOODPECKER_ROOT_PATH (#2485)
I had experienced some issues running Woodpecker behind a reverse-proxy,
resulting from not defining the `WOODPECKER_ROOT_PATH` environment
variable in #2477.

As suggested by @qwerty287, specifying `WOODPECKER_ROOT_PATH=/foo`
*mostly* solved the issue of running the woodpecker server at an url
like `https://example.org/foo`.
However, the webhook urls and badge urls were generated excluding the
configured `WOODPECKER_ROOT_PATH`.

This PR (mostly) fixes issues related to non-empty
`WOODPECKER_ROOT_PATH`.

---------

Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2023-09-22 16:43:31 +02:00
qwerty287
d04bb72e5e
Add repos list for admins (#2347) 2023-09-08 12:26:20 +02:00
Matheus Moraes
85e157bb10
fix(server/api/repo): Fix repair webhook host (#2372)
Fixes https://github.com/woodpecker-ci/woodpecker/issues/2371

Similar change to
https://github.com/woodpecker-ci/woodpecker/pull/1869/files#diff-3cd73db84155aa0447a17dadc8f50271d646fcf6132606cf2ab703cc7b80eb38R113
2023-09-06 12:17:23 +02:00
qwerty287
3e563ef198
Use API error helpers and improve response codes (#2366) 2023-09-02 13:31:10 +02:00
qwerty287
e847cbadfa
Check permissions on repo lookup (#2357)
There was no permission check when looking up repos so you were able to
get basic repo information even if you're not allowed to.

This uses `session.MustPull` (and set repo/perms before) to fix this.
2023-08-30 16:35:34 +02:00
qwerty287
5bd12aa646
Show that repo is disabled (#2340)
And allow to show badges for disabled repos

Fixes 3rd checkbox from
https://github.com/woodpecker-ci/woodpecker/discussions/2162#discussion-5498655

![Screenshot 2023-08-28 at 11-13-23
Woodpecker](https://github.com/woodpecker-ci/woodpecker/assets/80460567/d881f0c5-6225-4921-9d05-a26f27ad5365)
2023-08-28 18:57:44 +02:00
qwerty287
479ced3b25
Add org list (#2338)
![Screenshot 2023-08-28 at 10-08-20
Woodpecker](https://github.com/woodpecker-ci/woodpecker/assets/80460567/e3248b05-7899-43ca-a0cf-4834eae078d8)
Closes #2307
2023-08-28 11:15:16 +02:00
Pablo Ovelleiro Corral
cf9a4be128
Add missing return (#2316) 2023-08-22 09:47:29 +02:00
qwerty287
81ead7cbf2
Support user secrets (#2126) 2023-08-21 15:04:12 +02:00
Pablo Ovelleiro Corral
09624aa286
Pass netrc data to external config service request (#2310)
Co-authored-by: Anbraten <anton@ju60.de>
2023-08-21 13:22:33 +02:00
6543
a5ef372190
Move "skip ci" logic into global pipeline conditions (#2216)
... and make custom errors follow std err conventions

this fix a 500 response if the whole pipeline is filtered out
2023-08-17 15:52:43 +02:00
6543
c2448b1745
Restructure webhook parsing (#2221)
Co-authored-by: Anbraten <anton@ju60.de>
2023-08-16 16:15:44 +02:00
Anbraten
479e500b1b
Move hook and events-stream routes to use /api prefix (#2212)
- move hook and events-stream routes to use `/api` prefix
- rename build to pipeline
2023-08-16 02:42:37 +02:00
qwerty287
67b7de5cc2
Fix UI and backend paths with subpath (#1799)
I'm not sure if this is an ideal fix for this, but it seems to work for
me. If you have another idea just let me know.

Closes #1798 
Closes #1773
2023-08-07 16:05:18 +02:00
qwerty287
4ad3968ff1
Fix swagger response code (#2119)
Closes #2118
2023-08-05 19:44:49 +02:00
6543
6d373daea0
Handle case where there is no latest pipeline for GetBadge (#2042)
address  error 2 of #2036
2023-07-28 00:34:22 +02:00
Anbraten
e5d5ec8b47
Use id to access orgs (#1873)
closes #1743 

fixes: setting secrets for own user namespace

- create org in database
- use orgID for org related APIs

Co-authored-by: 6543 <6543@obermui.de>
2023-07-21 19:45:32 +02:00
6543
d9991e67e5
let HookParse func explicit ignore events (#1942)
for now it's not clear defined, what to do on an unsupported event.
e.g. gitea webhook panel shows 500 error and no message.

now we have a successful webhook and a message to show an info
2023-07-14 02:03:54 +02:00
Patrick Schratz
a4c791c6e5
Correct wording (#1982) 2023-07-12 13:49:18 +02:00
6543
edb92025df
Correct api docs of PostRepo & GetRepos (#1974)
... and report if needed forge_remote_id is not valid
2023-07-11 18:51:03 +02:00
6543
6c58e9db9b
Fix agent auth (#1952)
if no global agent secret set, disable agent registration via it
2023-07-08 18:09:34 +02:00
6543
b4acbafffc
save forge at the beginning and use it (#1939)
fly-by refactor ...
2023-07-07 15:43:11 +02:00
Anbraten
3d435a9cb7
Fix log view (#1874)
closes #1857
closes #1520
closes #1879 
- fixes unicode log lines as reported in matrix

---------

Co-authored-by: 6543 <6543@obermui.de>
2023-07-01 18:55:00 +02:00
qwerty287
3033abc3b4
Add own workflow model (#1784)
Closes #1287

---------

Co-authored-by: 6543 <6543@obermui.de>
2023-06-27 18:01:18 +02:00
Benedikt Kleiner
a958049485
sync repo permissions on login (#1853)
if indeed a bug, fixes #1851 after re-log

close #1666
2023-06-24 10:08:34 +02:00
qwerty287
c3c1d3bcb5
Return after error (#1875)
This allows you to work around the max timeout on the server.
2023-06-19 17:46:48 +02:00
Thomas Anderson
0c3021473f
Added Woodpecker Host Config used for Webhooks (#1869)
When SCM and Woodpecker are deployed in the same cluster, I want that
SCM requests Woodpecker directly by internal URL.


![Webhook-host-diagram](https://github.com/woodpecker-ci/woodpecker/assets/127358482/c4689d55-839a-4731-95b3-5734ba561e5f)
 
This PR adds optional URL used for Webhook calls.
2023-06-18 14:47:40 +02:00
Anbraten
ff01a9ff1d
Access repos by their ids (#1691)
closes #1295 
closes #648

# TODO
- [x] add new routes with `:repoID`
- [x] load repo in middleware using `:repoID` if present
- [x] update UI routes `:owner/:name` to `:repoID`
- [x] load repos using id in UI
- [x] add lookup endpoint `:owner/:name` to `:repoID`
- [x] redirect `:owner/:name` to `:repoID` in UI
- [x] use badge with `:repoID` route in UI
- [x] update `woodpecker-go`
- [x] check cli
- [x] add migrations / deprecation notes
- [x] check if #648 got solved directly
- [x] Test
  - [x] create repo
  - [x] repo pages
  - [x] ui redirects
  - [x] forge status links
2023-06-13 01:07:52 +02:00
Anbraten
556607b525
Rework log streaming and related functions (#1802)
closes #1801
closes #1815 
closes #1144
closes  #983
closes  #557
closes #1827
regression of #1791

# TODO
- [x] adjust log model
- [x] add migration for logs
- [x] send log line via grpc using step-id
- [x] save log-line to db
- [x] stream log-lines to UI
- [x] use less structs for log-data
- [x] make web UI work
  - [x] display logs loaded from db
  - [x] display streaming logs
- [ ] ~~make migration work~~ -> dedicated pull (#1828)

# TESTED
- [x] new logs are stored in database
- [x] log retrieval via cli (of new logs) works
- [x] log streaming works (tested via curl & webui)
- [x] log retrieval via web (of new logs) works

---------

Co-authored-by: 6543 <6543@obermui.de>
2023-06-06 09:52:08 +02:00
Martin W. Kirst
14177635b6
Update swagger API specification (#1782)
# Summary

This PR drops the outdated former swagger.yaml/json and introduced
automatic API document generation from Go code.
The generated code is also used to generate documentation/markdown for
the community page,
as well as enable the Woodpecker server to serve a Swagger Web UI for
manual tinkering.

I did opt-in for gin-swagger, a middleware for the Gin framework, to
ease implementation and have a sophisticated output.
This middleware only produces Swagger v2 specs. AFAIK the newer OpenApi
3x tooling is not yet that mature,
so I guess that's fine for now.

## Implemenation notes

- former swagger.json files removed
- former // swagger godocs removed
- introduced new dependency gin-swagger, which uses godoc annotations on
top of Gin Handler functions.
- reworked Makefile to automatically generate Go code for the server
- introduce new dependency go-swagger, to generate Markdown for
documentation purposes
- add a Swagger Web UI, incl. capabilities for manual API exploration
- consider relative root paths in the implementation
- write documentation for all exposed API endpoints
- incl. API docs in the community website (auto-generated)
- provide developer documentation, for the Woodpecker authors
- no other existing logic/code was intentionally changed

---------

close #292

---------

Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
Co-authored-by: 6543 <6543@obermui.de>
2023-06-03 21:38:36 +02:00
Anbraten
c464f857ae
Remove unused file system api (#1791)
Co-authored-by: 6543 <6543@obermui.de>
2023-05-31 18:03:03 +02:00
qwerty287
a15821428f
Always send a status back to forge (#1751) 2023-05-14 14:18:43 +02:00