Commit graph

79 commits

Author SHA1 Message Date
qwerty287
111eb7ef48
Fix dropped env vars (#3969)
Co-authored-by: 6543 <6543@obermui.de>
2024-07-25 17:17:09 +02:00
6543
659e925d0e
Remove WOODPECKER_DEV_OAUTH_HOST and WOODPECKER_DEV_GITEA_OAUTH_URL (#3961)
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2024-07-23 14:25:39 +02:00
6543
cd5f6f71a2
Migrate to github.com/urfave/cli/v3 (#2951) 2024-07-18 01:26:35 +02:00
qwerty287
c72468478d
Allow to store logs in files (#3568)
Co-authored-by: Anbraten <6918444+anbraten@users.noreply.github.com>
2024-06-06 14:34:57 +02:00
qwerty287
964860434c
Fix missing WOODPECKER_BITBUCKET_DC_URL (#3761) 2024-06-05 14:41:37 +02:00
6543
4ec046e415
Spellcheck "server/*" (#3753)
Co-authored-by: Anbraten <6918444+anbraten@users.noreply.github.com>
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2024-06-04 08:30:54 +02:00
qwerty287
91b122e1ce
Native forgejo support (#3684)
Co-authored-by: Robert Kaussow <xoxys@rknet.org>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
2024-06-01 11:23:19 +02:00
Dan
6132136d55
Fix oauth file envvars (#3726)
Co-authored-by: Anbraten <6918444+anbraten@users.noreply.github.com>
2024-05-27 11:22:31 +02:00
Anbraten
5527d9bf86
Cleanup server env settings (#3670)
Co-authored-by: Robert Kaussow <mail@thegeeklab.de>
Co-authored-by: Robert Kaussow <xoxys@rknet.org>
2024-05-15 15:45:08 +02:00
6543
378ec1a67a
Make retry count of config fetching form forge configure (#3699)
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2024-05-13 19:43:45 +02:00
Anbraten
d494b6a959
Use forge from db (#1417)
This is the first step towards support for multiple forges (#138). It
inserts a forge using the currently existing env varaibles into db and
uses this forge from db later on in all places of the code.

closes #621

addresses #138 

# TODO
- [x] add forges table
- [x] add id of forge to repo
- [x] use forge of repo
- [x] add forge from env vars to db if not exists
- [x] migrate repo.ForgeID to the newly generated forge
- [x] support cache with forge from repo
- [x] maybe add forge loading cache? (use LRU cache for forges, I expect
users to have less than 10 forges normally)

---------

Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2024-04-16 08:04:55 +02:00
qwerty287
00f0fcd416
Rework addons (use rpc) (#3268)
Co-authored-by: Anbraten <6918444+anbraten@users.noreply.github.com>
2024-04-15 10:04:21 +02:00
Aumetra Weisman
20b84a1aee
Add flag to only access public repositories on GitHub (#3566) 2024-03-29 14:36:48 +01:00
qwerty287
326069c983
Fix flag name (#3534)
and remove two unused flags

should close https://github.com/woodpecker-ci/woodpecker/issues/3528
2024-03-21 21:39:16 +01:00
qwerty287
fbdfa14a00
Allow separate gitea oauth URL (#3513)
closes https://github.com/woodpecker-ci/woodpecker/issues/3470

---------

Co-authored-by: Robert Kaussow <xoxys@rknet.org>
2024-03-21 11:37:02 +01:00
smainz
65a429d24a
Fix usage of WOODPECKER_DATABASE_DATASOURCE_FILE (#3404)
fixes #3389

Set variable to let server detect if it's deployed within a container
image.
Set the default database connection based on this.

---------

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Anbraten <6918444+anbraten@users.noreply.github.com>
2024-02-26 20:12:41 +01:00
Thor Anker Kvisgård Lange
364d708923
Add bitbucket datacenter (server) support (#2503)
This pull-requests re-introduces the Bitbucket Server support with a
more or less complete rewrite of the forge implementation. We have a lot
of on-premises git repositories hosted in Bitbucket Server and need a CI
solution for running that and Woodpecker looks promising.

The implementation is based on external Bitbucket Server REST client
library which we are maintaining and have created in another context.
Besides the original support for Bitbucket the re-implementation also
adds support for handling Bitbucket pull-request events.
2024-02-20 15:58:02 +01:00
qwerty287
0c05c38ddd
Move cmd/common to shared (#3092) 2023-12-31 23:29:56 +01:00
6543
74f6824d03
Add option to disable version check in admin web UI (#3040)
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2023-12-27 22:16:15 +01:00
qwerty287
dfc2c265b1
Support go plugins for forges and agent backends (#2751)
As of #2520 

Support to load new forges and agent backends at runtime using go's
plugin system. (https://pkg.go.dev/plugin)

I also added a simple example addon (a new forge which just prints log
statements), it should be removed later of course, but you can see an
example.

---------

Co-authored-by: Michalis Zampetakis <mzampetakis@gmail.com>
Co-authored-by: Anbraten <anton@ju60.de>
2023-12-20 14:26:57 +01:00
qwerty287
360b41f961
Remove separate root path config (#2943) 2023-12-13 15:51:18 +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
6543
5a7b689e30
Switch to go vanity urls (#2706)
Co-authored-by: Anbraten <anton@ju60.de>
2023-11-07 08:04:33 +01:00
qwerty287
d284aeb545
Fix default status (#2715)
Regression #2695

probably closes #2716
2023-11-03 13:00:34 +01:00
qwerty287
abb2f280eb
Unique status for matrix (#2695)
implement this fix but with an additional field on workflows to not
change the workflow name

closes #1840 
closes #713

---------

Co-authored-by: 6543 <6543@obermui.de>
2023-11-01 17:28:02 +01:00
qwerty287
aeb7bcb26a
Remove WOODPECKER_DOCS config (#2647) 2023-10-25 15:05:19 +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
Robert Kaussow
008a8c6acb
Fix usage description for backend-http-proxy flag (#2250) 2023-08-19 16:27:21 +02:00
6543
d253f8cc30
Make sure we dont have hidden options for backend and pipeline compiler (#2123)
move options based on **os.Getenv** into flags

---------
*Sponsored by Kithara Software GmbH*
2023-08-07 21:13:26 +02:00
6543
3d4758578a
Add opt save global log output to file (#2115)
close  #1933

---------
*Sponsored by Kithara Software GmbH*
2023-08-07 20:47:30 +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
1a7f7a9427
Allow to disable swagger (#2093)
https://github.com/woodpecker-ci/woodpecker/issues/1944
2023-08-03 02:42:30 +02:00
Robert Kaussow
443c23c58a
Use global logger for xorm logs and add options (#1997)
Please let me know if this goes in the right direction. Needs some tests and docs.
2023-07-15 01:15:13 +02:00
qwerty287
570f5044e8
Drop support for Bitbucket Server (#1994)
Closes #1962
2023-07-13 15:47:25 +02:00
Robert Kaussow
fe7eb64bf9
Add option to read grpc-secret from file (#1972) 2023-07-10 23:53:02 +02:00
Martin W. Kirst
2c1fc4b500
support custom .JS and .CSS files for custom banner messages (white-labeling) (#1781)
This PR introduces two new server configuration options, for providing a
custom .JS and .CSS file.
These can be used to show custom banner messages, add
environment-dependent signals, or simply a corporate logo.

### Motivation (what problem I try to solve)

I'm operating Woodpecker in multiple k8s clusters for different
environments.
When having multiple browser tabs open, I prefer strong indicators for
each environment.
E.g. a red "PROD" banner, or just a blue "QA" banner.
Also, we sometimes need to have the chance for maintenance, and instead
of broadcasting emails,
I prefer a banner message, stating something like: "Heads-up: there's a
planned downtime, next Friday, blabla...".

Also, I like to have the firm's logo visible, which makes Woodpecker
look more like an integral part of our platform.

### Implementation notes

* Two new config options are introduced ```WOODPECKER_CUSTOM_CSS_FILE```
and ```WOODPECKER_CUSTOM_JS_FILE```
* I've piggy-bagged the existing handler for assets, as it seemed to me
a minimally invasive approach
* the option along with an example is documented
* a simple unit test for the Gin-handler ensures some regression safety
* no extra dependencies are introduced

### Visual example

The documented example will look like this.

![Screenshot 2023-05-27 at 17 00
44](https://github.com/woodpecker-ci/woodpecker/assets/1189394/8940392e-463c-4651-a1eb-f017cd3cd64d)

### Areas of uncertainty 

This is my first contribution to Woodpecker and I tried my best to align
with your conventions.
That said, I found myself uncertain about these things and would be glad
about getting feedback.

* The handler tests are somewhat different than the other ones because I
wanted to keep them simple - I hope that still matches your coding
guidelines
* caching the page sometimes will let the browser not recognize changes
and a user must reload. I'm not fully into the details of how caching is
implemented and neither can judge if it's a real problem. Another pair
of eyes would be good.
2023-07-10 12:46:35 +02:00
qwerty287
cd982fcbd1
Fix pipeline status calculation/reporting (#1898)
Closes #1895 
Regression of #1784
2023-06-29 14:56:01 +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
6543
5139624cf8
Migrate old logs to new database schema (#1828)
address new models based on #1802
2023-06-12 22:43:14 +02:00
qwerty287
2ccf7c6f1a
Drop Gogs support (#1752)
Gogs support is broken (and we won't fix it because we don't care about
it...) because it does not support OAuth, at least after we introduced
the new Vue UI.

See:

77d830d5b5/server/forge/gogs/gogs.go (L84)

This route is not present in the new UI.
2023-05-14 10:34:05 +02:00
meak
41a50ae915
Allow to configure port for SSL (#1735)
Co-authored-by: Mehdi Katranji <hello@mek.yt>
Co-authored-by: Lauris BH <lauris@nix.lv>
2023-05-11 06:11:10 +02:00
qwerty287
54d4ec04c0
Drop Gogs private mode (#1726)
You should use `WOODPECKER_AUTHENTICATE_PUBLIC_REPOS` instead if repos
sent from forge as public should be authenticated
2023-04-30 14:01:11 +02:00
qwerty287
b90e7904a5
Support path prefix (#1714)
closes #1636 
closes #1429
supersedes #1586

Uses a different approach: just take the index.html compiled by vite and
replace the paths to js and other files using regex. This is not
compatible with the dev proxy which is also the reason why we can't use
go templates for this.
2023-04-29 17:51:50 +02:00
qwerty287
0970f35df5
Do not store inactive repos (#1658)
Do not sync repos with forge if the repo is not necessary in DB.

In the DB, only repos that were active once or repos that are currently
active are stored. When trying to enable new repos, the repos list is
fetched from the forge instead and displayed directly. In addition to
this, the forge func `Perm` was removed and is now merged with `Repo`.

Solves a TODO on RepoBatch.

---------

Co-authored-by: Anbraten <anton@ju60.de>
2023-03-21 23:01:59 +01:00
qwerty287
f582ad3159
Various enhancements in configuration (#1645)
- backends: move to cli flags instead of os.Getenv
- ssh: support 2fa with key and password
- allow to set grpc jwt secret (solves todo)
- allow to set default and max timeout (solves todo)

Closes https://github.com/woodpecker-ci/woodpecker/issues/896
Closes https://github.com/woodpecker-ci/woodpecker/issues/1131
2023-03-19 20:24:43 +01:00
qwerty287
37dc8a46e0
Drop coding support (#1644)
Coding support is likely broken and nobody will ever fix it. Also it
looks like nobody wants to use it, otherwise we would have get some bug
reports.

---------

Co-authored-by: 6543 <6543@obermui.de>
2023-03-19 09:36:04 +01:00
Alexander Matyushentsev
9288670c61
feat: expose unprotected metrics endpoint (#1614)
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Anbraten <anton@ju60.de>
2023-03-12 09:41:10 +01:00
Earl Warren
7835a632e4
Define WOODPECKER_FORGE_TIMEOUT server config (#1558)
When a server such as Codeberg has unusually high response time, three
seconds may not be enough to fetch the configuration.

Signed-off-by: Earl Warren <contact@earl-warren.org>
Co-authored-by: 6543 <6543@obermui.de>
2023-02-01 18:53:19 +01:00
antomy-gc
6516a28cdd
Secrets encryption in database (#1475)
closes #101

Added secrets encryption in database

- Google TINK or simple AES as encryption mechanisms
- Keys rotation support on TINK
- Existing SecretService is wrapped by encryption layer
- Encryption can be enabled and disabled at any time

Co-authored-by: Kuzmin Ilya <ilia.kuzmin@indrive.com>
Co-authored-by: 6543 <6543@obermui.de>
2023-01-12 20:59:07 +01:00
Josh Soref
023d03dd61
Spelling (#1405)
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-11-09 08:12:17 +01:00