Skip to content
Try Gitea Cloud ☁️ for 30 days → Accelerate your Development & Deploys!
Support

Audit Log

Since Gitea 1.28 the audit log is part of the open source edition, and Gitea Enterprise builds on it. Everything the open source audit log offers (the audit event model, the [audit] settings and the recorded actions) works the same way in Gitea Enterprise. This page only describes what Gitea Enterprise adds or does differently. For the shared part, see the audit log documentation of the open source edition.

Open source Gitea Enterprise
Default of [audit].RECORD_OUTPUT disabled database, recording is on out of the box
Default of [audit].RETENTION_DAYS 30 0, records are kept forever
Recorded actions Community actions Open source actions plus the actions listed below

The audit pages of users, organizations and repositories, the action, origin and actor filters and the JSONL export of the admin page are part of the open source edition as well. Gitea Enterprise adds the admin API, CSV export and the keyword and time range filters of the API.

RECORD_OUTPUT, RETENTION_DAYS and RECORD_PUSH_PULL_FILE_NAMES are set in the [audit] section of app.ini. RECORD_PUSH_PULL_FILE_NAMES (default false) also records the file names of each push and pull, which costs an extra git command per push and pull and grows each record by up to a few KB.

Pruning runs in the delete_old_audit_events cron task once a day. It is registered only while RETENTION_DAYS is above 0, so an upgrade never deletes history by itself.

Page Who can see it Contents
Site Administration > Audit Log (/-/admin/audit-logs) Site administrators Every record
/user/settings/audit-logs The signed-in user Records scoped to their account
/org/{org}/settings/audit-logs Organization owners Records scoped to the organization
/{owner}/{repo}/settings/audit-logs Repository administrators Records scoped to the repository

A scoped page never shows the records of another entity. The admin API is available at /api/v1/admin/audit-logs and /api/v1/admin/audit-logs/export.

The operation filter takes an action such as repository:label:create, or the start of an action such as repository:label or repository, and selects every action below it. The admin API filters by operator_id, action, q, start_unix and end_unix.

Field Meaning
action What happened, for example repository:archive.
operation_type Deprecated, use action. It has the same value as action.
operator_id / operator_name Who did it. An unauthenticated request is recorded as anonymous, the CLI as (gitea-cli) and authentication source syncs as (gitea-auth-source).
scope_type / scope_id / scope_name The entity the record is listed under: system, user, organization or repository.
origin How the operation reached Gitea: ui, api, cli or system (cron tasks, git hooks, the internal API).
ip_address The client address, when the operation came through a request.

These actions are recorded by Gitea Enterprise only. All other actions are shared with the open source edition.

  • accesstoken:approve
  • accesstoken:disable
  • accesstoken:enable
  • accesstoken:expiry:change
  • accesstoken:leak:revoke
  • accesstoken:reject
  • accesstoken:revoke
  • agent:command:deny
  • agent:create
  • agent:deliveryplan:approve
  • agent:deliveryplan:cancel
  • agent:deliveryplan:markdone
  • agent:deliveryplan:pause
  • agent:deliveryplan:resume
  • agent:deliveryplan:submit
  • agent:deliverystep:retry
  • agent:task:create
  • agent:update
  • issue:comment:update
  • issue:lock
  • issue:status:close
  • issue:status:reopen
  • issue:unlock
  • issue:update
  • organization:accesstoken:approval:autogrant
  • organization:branch:protection:add
  • organization:branch:protection:remove
  • organization:branch:protection:update
  • organization:label:create
  • organization:label:delete
  • organization:label:update
  • organization:member:add
  • organization:member:update
  • organization:oauth2application:grant
  • organization:settings:update
  • package:create
  • package:delete
  • package:download
  • package:upload
  • pr:review:submit
  • pr:reviewrequest:add
  • pr:reviewrequest:remove
  • pr:targetbranch:update
  • pr:wip:add
  • pr:wip:remove
  • project:close
  • project:reopen
  • repository:archive:download
  • repository:avatar:remove
  • repository:avatar:update
  • repository:branch:checkout
  • repository:branch:delete
  • repository:branch:merge
  • repository:file:download
  • repository:git:clone
  • repository:git:pull
  • repository:git:push
  • repository:git:ref:create
  • repository:git:ref:delete
  • repository:label:create
  • repository:label:delete
  • repository:label:update
  • repository:milestone:create
  • repository:milestone:delete
  • repository:milestone:update
  • repository:mirror:push:update
  • repository:pushprotection:block
  • repository:pushprotection:bypass
  • repository:pushprotection:report
  • repository:pushrule:exempt
  • repository:pushrule:update
  • repository:reference:update
  • repository:release:create
  • repository:release:delete
  • repository:release:update
  • repository:security:scan
  • repository:securityscan:branch:update
  • repository:securityscan:cleanup
  • repository:securityscan:disable
  • repository:securityscan:enable
  • repository:settings:update
  • system:announcement:update
  • system:license:activate
  • system:license:remove
  • system:license:update
  • system:maintenance:run
  • system:package:cleanup
  • system:repository:adopt
  • system:settings:auth:update
  • system:settings:cache:update
  • system:settings:mailer:update
  • system:settings:session:update
  • system:settings:storage:update
  • system:settings:update
  • system:webhook:default:add
  • system:webhook:default:remove
  • system:webhook:default:update
  • user:authentication:fail
  • user:authentication:logout
  • user:authentication:success
  • user:update

Site administrators can export the records matching the current filters, from Site Administration > Audit Log or with GET /admin/audit-logs/export:

  • CSV (default): a spreadsheet friendly table. The web download starts with a UTF-8 byte-order mark so Microsoft Excel opens it correctly; the API response omits it.
  • JSONL (?format=jsonl): one JSON object per line, in the shape of the open source audit event, for log collectors.
  • Records move from the ee_audit_log table to the audit_event table of the open source edition. The conversion runs as a migration, in batches that resume if the upgrade is interrupted, and no record is skipped. The old table is kept, apart from pruning by RETENTION_DAYS, and can be dropped once you have checked the result.
  • Records written before the upgrade have the origin unknown, because the UI and the API were not told apart before.
  • operation_type of the admin audit API and of the export now has the value of action (for example user:authentication:success instead of user:sign_in). Read action. The old names still work as a filter and are kept as legacy_operation_type in the record metadata.
  • Closing and reopening a project are recorded as project:close and project:reopen, they were project:update.
  • Recording stays on after the upgrade unless RECORD_OUTPUT is set to disabled.