1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-08-11 17:50:58 +00:00
Commit graph

887 commits

Author SHA1 Message Date
_
c455fb07f2 fix(git): add support for parsing weirder remote URLs 2025-03-31 23:45:06 -07:00
_
3f6addab2a fix(tests): explicitly set git-config user.name/user.email to avoid spurious test failures 2025-03-31 23:45:06 -07:00
benniekiss
53de9c1c27 fix GOOS parsing to match expected GHA RUNNER_OS values (#106)
This PR is a carryover from [upstream](https://github.com/nektos/act/pull/2422):

> github actions reports RUNNER_OS for linux and windows with [capital letters](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/variables#default-environment-variables) (Linux, Windows). This should increase compatibility when runner uses `-self-hosted`
>
> Currently, when workflows are run within containers, RUNNER_OS is [hardcoded](https://code.forgejo.org/forgejo/act/search/branch/main?path=&q=RUNNER_OS&mode=exact) to `Linux` correctly, so this will make RUNNER_OS more consistent.

Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/106
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org>
Co-authored-by: benniekiss <benniekiss@noreply.code.forgejo.org>
Co-committed-by: benniekiss <benniekiss@noreply.code.forgejo.org>
2025-03-31 07:52:49 +00:00
Kwonunn
b6a4f494cd Merge pull request 'fix: reduce the time during which the database stays open' (#109) from earl-warren/act:wip-proxy-lock into main
Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/109
Reviewed-by: Kwonunn <kwonunn@noreply.code.forgejo.org>
2025-03-24 19:31:09 +00:00
Kwonunn
835a9d2068 fix: move reading cache to separate function 2025-03-24 10:48:28 +01:00
Kwonunn
639b83c26c fix: do not immediately close the db after opening it 2025-03-24 10:17:04 +01:00
Earl Warren
187e1df52c fix: reduce the time during which the database stays open
* During get/upload, close the database while reading/writing so
  it does not stay open for longer than necessary. This may be helpful
  when uploads run in parallel.
* Be more informative when returning error 500
* Make useCache handle errors
* Return 500 immediately when writing the cache fails instead of falling
  through to 200

Refs: https://code.forgejo.org/forgejo/runner/issues/509
2025-03-23 23:25:09 +01:00
Kwonunn
776ccb8b21 Merge pull request 'Fix security issues with cache by proxying access' (#107) from Kwonunn/act:fix/cache-proxy into main
Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/107
2025-03-21 14:19:38 +00:00
Kwonunn
ef94958cd5 review: Gusted review 2025-03-21 13:45:51 +00:00
Kwonunn
9150081892 return 404 when not found 2025-03-21 13:45:51 +00:00
Kwonunn
62310a5a09 set external url header 2025-03-21 13:45:51 +00:00
Kwonunn
e54faaf56d fix tests for cache proxy 2025-03-21 13:45:51 +00:00
Kwonunn
43f1298653 fix: external url and mac function matching 2025-03-21 13:45:51 +00:00
Kwonunn
57a2a56e32 add unit tests for mac calculation 2025-03-21 13:45:51 +00:00
Kwonunn
aa0c46539c review: add retries to generating runid in case of collision 2025-03-21 13:45:51 +00:00
Kwonunn
ef43d7c615 review: fix various issues brought up by Gusted 2025-03-21 13:45:51 +00:00
Kwonunn
7a21d64333 review: discard params in clean 2025-03-21 13:45:51 +00:00
Kwonunn
11062e4d6a return 403 instead of 500 when not authorized correctly 2025-03-21 13:45:51 +00:00
Kwonunn
e3adb49c50 functional save and restore through proxy 2025-03-21 13:45:51 +00:00
Kwonunn
95e754c06b integrate the new cache proxy with the server viceice set up 2025-03-21 13:45:51 +00:00
Kwonunn
a6a1df7556 use safe sync.Map 2025-03-21 13:45:51 +00:00
Kwonunn
41032137ea add copyright notice 2025-03-21 13:45:51 +00:00
Kwonunn
d736bb3435 rename workflowid to runid 2025-03-21 13:45:51 +00:00
Kwonunn
ce51735d7a update the reverse proxy to read workflow id and inject new auth info 2025-03-21 13:45:51 +00:00
Kwonunn
f81731e2d9 add CreateWorkflowData 2025-03-21 13:45:51 +00:00
Kwonunn
d92f9305dc wip: begin implementation of new design in proxy 2025-03-21 13:45:51 +00:00
Kwonunn
975364553b fix cache proxy to work properly 2025-03-21 13:45:51 +00:00
Kwonunn
4b5ffd768f implement proxy server 2025-03-21 13:45:51 +00:00
Kwonunn
11006f4ef3 implement hmac generation 2025-03-21 13:45:51 +00:00
Kwonunn
8bc36fb69a create cache proxy based on cache server 2025-03-21 13:45:51 +00:00
Michael Kriese
7458ddfaf4 fix: join org and repo 2025-03-21 13:45:51 +00:00
Michael Kriese
21ca8102fa fix: validate timestamp 2025-03-21 13:45:51 +00:00
Michael Kriese
1082b31367 fix: partial secure cache 2025-03-21 13:45:51 +00:00
earl-warren
ea79e3de41 Merge pull request 'fix: ensure the LXC template does not have obsolete APT' (#102) from earl-warren/act:wip-apt-old into main
Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/102
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2025-01-29 10:02:37 +00:00
Earl Warren
4df32aa3df fix: ensure the LXC template does not have obsolete APT
Upgrade to lxc-helper 1.0.1
2025-01-29 10:30:14 +01:00
Earl Warren
50aec4962b chore(upgrade): sync lxc-helpers v1.0.3 2025-01-29 10:30:12 +01:00
Michael Kriese
54fead51c6 fix(jobparser): support workflow_call.inputs and workflow_call.outputs (#70)
- Closes #69
- #45
- https://codeberg.org/forgejo/forgejo/issues/6069

Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/70
Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-committed-by: Michael Kriese <michael.kriese@visualon.de>
2025-01-29 08:38:30 +00:00
earl-warren
0e99df94b7 Merge pull request 'fix(tests): binds are not sorted' (#97) from earl-warren/act:wip-test into main
Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/97
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2025-01-23 16:45:52 +00:00
Earl Warren
e0facd1ee5 fix(tests): binds are not sorted
That creates false negative in test runs. Just keep one, there is no
value in having more.
2025-01-22 22:24:27 +01:00
Earl Warren
d92e4a8aff feat: --hostname is allowed in container options (#95)
It is useful to set an alternative hostname when running a service
such as:

```yaml
services:
  minio:
    image: data.forgejo.org/oci/bitnami/minio:2024.8.17
    options: >-
      --hostname alternate.minio
```

Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/95
Reviewed-by: Kwonunn <kwonunn@noreply.code.forgejo.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-01-22 18:22:29 +00:00
earl-warren
a8bfb47292 Merge pull request 'fix: do not ignore the config container.options when starting a job' (#92) from earl-warren/act:wip-mount into main
Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/92
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2025-01-11 11:01:26 +00:00
Earl Warren
790d1776e7 fix: do not ignore the config container.options when starting a job 2025-01-11 08:45:08 +01:00
Earl Warren
ed911869e1 fix: filter job container options with an allow list
The workflow can only contain the following options for a container:

- --volume
- --tmpfs
2025-01-09 12:10:21 +01:00
Earl Warren
1a77a34726 chore(refactor): split parseOptions out of mergeContainerConfigs 2025-01-09 12:10:21 +01:00
Earl Warren
fc518884f9 chore(refactor): split Options into ConfigOptions & JobOptions
They are both command line options to be parsed as if provided to
docker-run, but they are not to be trusted in the same way.
2025-01-09 12:10:21 +01:00
earl-warren
b03a6b9004 Merge pull request 'feat: Improve logging of error messages' (#90) from vpotyarkin/act:feature/improve-error-logging into main
Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/90
Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org>
2025-01-09 10:29:17 +00:00
Vitaliy Potyarkin
591770bf63 refactor: Improve logging of error messages
Logging bare errors might lead to long troubleshooting sessions when error
is not specific enough. This commit adds helpful context messages to
logged errors.

Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
2025-01-09 12:36:30 +03:00
earl-warren
84eca8312d Merge pull request 'feat: export runtime token as FORGEJO_TOKEN' (#88) from xtex/act:forgejo-token-env into main
Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/88
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2025-01-05 11:28:57 +00:00
xtex
606d8701ed feat: export runtime token as FORGEJO_TOKEN 2025-01-04 20:01:43 +08:00
earl-warren
cf74c364fb Merge pull request 'chore(lint): fix lint errors' (#84) from earl-warren/act:wip-lint into main
Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/84
2025-01-02 08:50:27 +00:00