2023-11-10 08:06:17 -05:00
|
|
|
# enable federation
|
|
|
|
|
|
|
|
copy the app.ini in this folder in custom/conf in the forgejo root directory.
|
|
|
|
Then change the paths in app.ini accordingly to you local environment.
|
|
|
|
|
2023-11-10 08:37:00 -05:00
|
|
|
```
|
|
|
|
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; ;
|
|
|
|
; ; SQLite Configuration
|
|
|
|
; ;
|
|
|
|
DB_TYPE = sqlite3
|
|
|
|
; defaults to data/gitea.db
|
|
|
|
PATH = /home/jem/repo/opensource/forgejo/data/gitea.db
|
|
|
|
; Query timeout defaults to: 500
|
|
|
|
SQLITE_TIMEOUT =
|
|
|
|
; defaults to sqlite database default (often DELETE), can be used to enable WAL mode. https://www.sqlite.org/pragma.html#pragma_journal_mode
|
|
|
|
SQLITE_JOURNAL_MODE =
|
|
|
|
HOST =
|
|
|
|
NAME =
|
|
|
|
USER =
|
|
|
|
PASSWD =
|
|
|
|
SCHEMA =
|
|
|
|
SSL_MODE = disable
|
|
|
|
LOG_SQL = false
|
|
|
|
|
|
|
|
|
|
|
|
[federation]
|
|
|
|
ENABLED = true
|
|
|
|
```
|
|
|
|
|
2023-10-27 07:33:14 -05:00
|
|
|
# build
|
|
|
|
|
|
|
|
```
|
2023-10-27 04:50:39 -05:00
|
|
|
TAGS="sqlite" make build generate-swagger
|
2023-10-27 07:33:14 -05:00
|
|
|
```
|
|
|
|
|
|
|
|
# launch local
|
|
|
|
|
2023-11-23 11:02:36 -05:00
|
|
|
```bash
|
|
|
|
# create a user
|
2023-10-27 04:50:39 -05:00
|
|
|
./gitea admin user create --name me --password me --email "buero@meissa.de"
|
2023-11-23 11:02:36 -05:00
|
|
|
|
|
|
|
# create a token
|
2023-10-27 04:50:39 -05:00
|
|
|
./gitea admin user generate-access-token -u me -t token --scopes write:activitypub,write:repository,write:user
|
2023-11-23 11:02:36 -05:00
|
|
|
|
|
|
|
# create a repo
|
|
|
|
curl -X 'POST' \
|
|
|
|
'http://localhost:3000/api/v1/user/repos?token=ReplaceThisWithYourGeneratedToken' \
|
|
|
|
-H 'accept: application/json' \
|
|
|
|
-H 'Content-Type: application/json' \
|
|
|
|
-d '{
|
|
|
|
"auto_init": false,
|
|
|
|
"default_branch": "main",
|
|
|
|
"description": "none",
|
|
|
|
"gitignores": "none",
|
|
|
|
"issue_labels": "",
|
|
|
|
"license": "apache",
|
|
|
|
"name": "repo",
|
|
|
|
"private": true,
|
|
|
|
"readme": "This is a readme",
|
|
|
|
"template": false,
|
|
|
|
"trust_model": "default"
|
|
|
|
}'
|
2023-10-27 07:33:14 -05:00
|
|
|
```
|
|
|
|
|
2023-11-29 07:24:59 -05:00
|
|
|
# Datastructures handy for local tests
|
|
|
|
|
|
|
|
## Star activity
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"id": "http://localhost:3000/api/v1/activitypub/user-id/1/outbox/12345",
|
|
|
|
"type": "Star",
|
|
|
|
"source": "forgejo",
|
|
|
|
"actor": "http://localhost:3000/api/v1/activitypub/user-id/1",
|
|
|
|
"object": "http://localhost:3000/api/v1/activitypub/repository-id/1"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2023-10-27 07:33:14 -05:00
|
|
|
# sync base branch
|
|
|
|
|
|
|
|
```
|
2023-11-06 03:27:41 -05:00
|
|
|
# setup a second repo for excosy implementation
|
|
|
|
git clone https://git.exozy.me/a/gitea.git exosy
|
|
|
|
|
2023-11-06 03:12:09 -05:00
|
|
|
# add remotes
|
|
|
|
git remote add forgejo git@codeberg.org:forgejo/forgejo.git
|
|
|
|
|
|
|
|
# rebase on top of forgejo/forge-development
|
2023-10-27 07:33:14 -05:00
|
|
|
git checkout forgejo-development
|
2023-11-07 12:01:52 -05:00
|
|
|
git fetch forgejo
|
2023-11-03 11:05:48 -05:00
|
|
|
git rebase --onto forgejo/forgejo-development
|
2023-10-27 07:33:14 -05:00
|
|
|
git push --force
|
|
|
|
|
|
|
|
git checkout forgejo-federated-star
|
|
|
|
git rebase forgejo-development
|
|
|
|
git push --force
|
2023-11-03 11:58:47 -05:00
|
|
|
|
2023-11-06 03:12:09 -05:00
|
|
|
# continue local development after rebase & force-push has happened
|
2023-11-03 11:58:47 -05:00
|
|
|
git reset --hard origin/forgejo-federated-star
|
2023-11-03 11:45:53 -05:00
|
|
|
```
|
2023-11-15 03:08:17 -05:00
|
|
|
|
|
|
|
# generate swagger api client
|
|
|
|
|
2023-11-17 11:19:08 -05:00
|
|
|
go run github.com/go-swagger/go-swagger/cmd/swagger@v0.30.5 generate client -f './templates/swagger/v1_json.tmpl' -c "modules/activitypub2" --operation 'activitypubPerson' --skip-models --existing-models 'github.com/go-ap/activitypub' --skip-validation
|