1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-28 13:49:13 -05:00
forgejo/docs/unsure-where-to-put/dev-notes.md

131 lines
3.9 KiB
Markdown
Raw Normal View History

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
```
# build
```
2023-10-27 05:50:39 -04:00
TAGS="sqlite" make build generate-swagger
```
2024-04-04 12:33:08 -04:00
# apply on k8s
```bash
kubectl exec -it forgejo-.. -- /bin/bash
su git
cd /app/gitea/
```
# launch local
```bash
2023-12-15 08:45:20 -05:00
# cleanup
./gitea admin user delete --purge -id 8
./gitea admin user delete --purge -id 9
./gitea admin user delete --purge -id 10
# create a user
2023-12-16 12:38:31 -05:00
./gitea admin user create --username me --password me --email "buero@meissa.de" --admin
2023-12-15 08:45:20 -05:00
./gitea admin user create --username stargoose1 --random-password --email "stargoose1@meissa.de"
./gitea admin user create --username stargoose2 --random-password --email "stargoose2@meissa.de"
./gitea admin user create --username stargoose3 --random-password --email "stargoose3@meissa.de"
2023-12-16 12:38:31 -05:00
./gitea admin user create --username stargoose4 --random-password --email "stargoose4@meissa.de"
./gitea admin user create --username stargoose5 --random-password --email "stargoose5@meissa.de"
./gitea admin user create --username stargoose6 --random-password --email "stargoose6@meissa.de"
./gitea admin user create --username stargoose7 --random-password --email "stargoose7@meissa.de"
./gitea admin user create --username stargoose8 --random-password --email "stargoose8@meissa.de"
./gitea admin user create --username stargoose9 --random-password --email "stargoose9@meissa.de"
./gitea admin user create --username stargoose10 --random-password --email "stargoose10@meissa.de"
./gitea admin user create --username stargoose11 --random-password --email "stargoose11@meissa.de"
./gitea admin user create --username stargoose12 --random-password --email "stargoose12@meissa.de"
2023-12-15 08:45:20 -05:00
./gitea admin user list
# create a token
2023-10-27 05:50:39 -04:00
./gitea admin user generate-access-token -u me -t token --scopes write:activitypub,write:repository,write:user
# create a repo
2023-12-19 05:32:57 -05:00
```bash
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-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",
2024-01-04 12:04:46 -05:00
"type": "Like",
"actor": "https://federated-repo.prod.meissa.de/api/v1/activitypub/user-id/13",
2024-01-04 12:04:46 -05:00
"object": "http://localhost:3000/api/v1/activitypub/repository-id/2",
"startTime": "2014-12-31T23:00:00-08:00"
2023-11-29 07:24:59 -05:00
}
```
# sync base branch
2024-01-05 06:03:36 -05:00
``` bash
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
2024-02-12 04:14:16 -05:00
git switch forgejo
2023-11-07 12:01:52 -05:00
git fetch forgejo
2024-03-04 07:57:33 -05:00
git pull
git push
2024-01-26 10:13:55 -05:00
git switch forgejo-federated-star
2024-03-04 07:57:33 -05:00
git merge forgejo
git push
2024-01-26 11:16:26 -05:00
```
2024-01-05 06:03:36 -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
2023-11-29 03:21:54 -05:00
2023-11-30 10:00:39 -05:00
# Documentation for learn & reference