65 Commits

Author SHA1 Message Date
4fc14c7a97 WIP: Add the project memership service
Signed-off-by: Nikolai Rodionov <iam@allanger.xyz>
2026-05-18 22:40:50 +02:00
951d2802de Trigger build
All checks were successful
ci/woodpecker/push/go-generate Pipeline was successful
ci/woodpecker/push/dart-generate Pipeline was successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/js-generate Pipeline was successful
ci/woodpecker/push/repo-checks Pipeline was successful
2026-05-18 19:50:58 +02:00
a1e6f16328 Add name and surname to accounts
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-05-18 19:43:00 +02:00
dfea0e6782 Add token uuid to return
All checks were successful
ci/woodpecker/push/dart-generate Pipeline was successful
ci/woodpecker/push/go-generate Pipeline was successful
ci/woodpecker/push/js-generate Pipeline was successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/repo-checks Pipeline was successful
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-05-17 22:07:42 +02:00
5121916c38 Start adding the projects API
All checks were successful
ci/woodpecker/push/dart-generate Pipeline was successful
ci/woodpecker/push/go-generate Pipeline was successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/js-generate Pipeline was successful
ci/woodpecker/push/repo-checks Pipeline was successful
Signed-off-by: Nikolai Rodionov <iam@allanger.xyz>
2026-05-15 15:21:13 +02:00
7d11a972f3 Move the token auth to a public service
All checks were successful
ci/woodpecker/push/go-generate Pipeline was successful
ci/woodpecker/push/dart-generate Pipeline was successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/js-generate Pipeline was successful
ci/woodpecker/push/repo-checks Pipeline was successful
Signed-off-by: Nikolai Rodionov <iam@allanger.xyz>
2026-05-15 10:36:51 +02:00
b8349e3962 Trigger build
All checks were successful
ci/woodpecker/push/dart-generate Pipeline was successful
ci/woodpecker/push/go-generate Pipeline was successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/js-generate Pipeline was successful
ci/woodpecker/push/repo-checks Pipeline was successful
2026-05-14 19:38:58 +02:00
3a364624a1 Trigger build 2026-05-14 19:38:51 +02:00
8353965c9e Trigger build 2026-05-14 19:38:46 +02:00
0c7ba3e42a Update the token auth method
Signed-off-by: Nikolai Rodionov <iam@allanger.xyz>
2026-05-14 19:38:23 +02:00
3b984ff0c2 Trigger build
Some checks failed
ci/woodpecker/push/dart-generate Pipeline failed
ci/woodpecker/push/go-generate Pipeline failed
ci/woodpecker/push/lint Pipeline failed
ci/woodpecker/push/js-generate Pipeline failed
ci/woodpecker/push/repo-checks Pipeline was successful
2026-05-14 19:13:51 +02:00
626228be51 Trigger build 2026-05-14 19:13:44 +02:00
697b2177f0 Add a method to recieve a JWT with a cli token
Signed-off-by: Nikolai Rodionov <iam@allanger.xyz>
2026-05-14 19:13:04 +02:00
1925e0de3f Trigger build
All checks were successful
ci/woodpecker/push/go-generate Pipeline was successful
ci/woodpecker/push/dart-generate Pipeline was successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/js-generate Pipeline was successful
ci/woodpecker/push/repo-checks Pipeline was successful
2026-05-14 17:22:18 +02:00
7d655b593b Update token metadata
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-05-14 17:22:00 +02:00
abe4f26370 Add more token metadata
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-05-14 17:15:50 +02:00
f2464648e1 Rename token permissions data
All checks were successful
ci/woodpecker/push/go-generate Pipeline was successful
ci/woodpecker/push/dart-generate Pipeline was successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/js-generate Pipeline was successful
ci/woodpecker/push/repo-checks Pipeline was successful
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-05-14 13:50:58 +02:00
14c078b64f Set token permissions on create
All checks were successful
ci/woodpecker/push/go-generate Pipeline was successful
ci/woodpecker/push/dart-generate Pipeline was successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/js-generate Pipeline was successful
ci/woodpecker/push/repo-checks Pipeline was successful
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-05-14 13:44:34 +02:00
8a346cccb7 Only return the token value on create
All checks were successful
ci/woodpecker/push/go-generate Pipeline was successful
ci/woodpecker/push/dart-generate Pipeline was successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/js-generate Pipeline was successful
ci/woodpecker/push/repo-checks Pipeline was successful
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-05-14 13:41:34 +02:00
6db0e356f8 Add ListPermissions method for tokens
All checks were successful
ci/woodpecker/push/go-generate Pipeline was successful
ci/woodpecker/push/dart-generate Pipeline was successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/js-generate Pipeline was successful
ci/woodpecker/push/repo-checks Pipeline was successful
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-05-14 11:55:48 +02:00
53c5c44307 Add dummy streaming methods
All checks were successful
ci/woodpecker/push/go-generate Pipeline was successful
ci/woodpecker/push/dart-generate Pipeline was successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/js-generate Pipeline was successful
ci/woodpecker/push/repo-checks Pipeline was successful
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-05-14 11:11:39 +02:00
dbd6423439 Fix naming for the test service
All checks were successful
ci/woodpecker/push/dart-generate Pipeline was successful
ci/woodpecker/push/go-generate Pipeline was successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/js-generate Pipeline was successful
ci/woodpecker/push/repo-checks Pipeline was successful
Signed-off-by: Nikolai Rodionov <iam@allanger.xyz>
2026-05-11 11:46:08 +02:00
52f43e57ad Add a token service
All checks were successful
ci/woodpecker/push/go-generate Pipeline was successful
ci/woodpecker/push/dart-generate Pipeline was successful
ci/woodpecker/push/js-generate Pipeline was successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/repo-checks Pipeline was successful
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-05-10 22:10:32 +02:00
a00093ffc1 Add a token service
Some checks failed
ci/woodpecker/push/js-generate Pipeline is pending
ci/woodpecker/push/lint Pipeline is pending
ci/woodpecker/push/repo-checks Pipeline is pending
ci/woodpecker/push/go-generate Pipeline failed
ci/woodpecker/push/dart-generate Pipeline failed
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-05-10 22:10:05 +02:00
92ae9a7a1b Separate services again
Some checks failed
ci/woodpecker/push/dart-generate Pipeline was successful
ci/woodpecker/push/go-generate Pipeline was successful
ci/woodpecker/push/lint Pipeline failed
ci/woodpecker/push/js-generate Pipeline was successful
ci/woodpecker/push/repo-checks Pipeline was successful
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-05-10 19:03:13 +02:00
2431d438e5 Move auth logic to options
Some checks failed
ci/woodpecker/push/go-generate Pipeline was successful
ci/woodpecker/push/dart-generate Pipeline was successful
ci/woodpecker/push/lint Pipeline failed
ci/woodpecker/push/js-generate Pipeline was successful
ci/woodpecker/push/repo-checks Pipeline was successful
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-05-10 18:56:08 +02:00
d88ceea9ea Move auth logic to options
Some checks failed
ci/woodpecker/push/go-generate Pipeline was successful
ci/woodpecker/push/dart-generate Pipeline was successful
ci/woodpecker/push/lint Pipeline failed
ci/woodpecker/push/js-generate Pipeline was successful
ci/woodpecker/push/repo-checks Pipeline was successful
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-05-10 18:42:26 +02:00
1325118309 Move auth logic to options
Some checks failed
ci/woodpecker/push/go-generate Pipeline failed
ci/woodpecker/push/dart-generate Pipeline failed
ci/woodpecker/push/lint Pipeline failed
ci/woodpecker/push/js-generate Pipeline failed
ci/woodpecker/push/repo-checks Pipeline was successful
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-05-10 18:41:11 +02:00
50a2797157 Move refresh token back to auth account
Some checks failed
ci/woodpecker/push/go-generate Pipeline was successful
ci/woodpecker/push/dart-generate Pipeline was successful
ci/woodpecker/push/lint Pipeline failed
ci/woodpecker/push/js-generate Pipeline was successful
ci/woodpecker/push/repo-checks Pipeline was successful
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-05-09 21:21:58 +02:00
9a404e5f09 Better comment
Some checks failed
ci/woodpecker/push/go-generate Pipeline was successful
ci/woodpecker/push/dart-generate Pipeline was successful
ci/woodpecker/push/lint Pipeline failed
ci/woodpecker/push/js-generate Pipeline was successful
ci/woodpecker/push/repo-checks Pipeline was successful
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-05-09 15:25:51 +02:00
2b8987cab4 Implement Internal Auth (#5)
Some checks failed
ci/woodpecker/push/dart-generate Pipeline was successful
ci/woodpecker/push/go-generate Pipeline was successful
ci/woodpecker/push/lint Pipeline failed
ci/woodpecker/push/js-generate Pipeline was successful
ci/woodpecker/push/repo-checks Pipeline was successful
Reviewed-on: #5
Co-authored-by: Nikolai Rodionov <allanger@badhouseplants.net>
Co-committed-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-05-08 19:17:06 +00:00
0401be278d Some basic proto setup (#4)
Some checks failed
ci/woodpecker/push/dart-generate Pipeline was successful
ci/woodpecker/push/go-generate Pipeline was successful
ci/woodpecker/push/lint Pipeline failed
ci/woodpecker/push/js-generate Pipeline was successful
ci/woodpecker/push/repo-checks Pipeline failed
Co-authored-by: Nikolai Rodionov <nrodionov@eos-uptrade.de>
Reviewed-on: #4
Co-authored-by: Nikolai Rodionov <allanger@badhouseplants.net>
Co-committed-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-04-30 15:23:56 +00:00
d3fd8e87e4 Configure Renovate (#3)
Some checks failed
ci/woodpecker/push/lint Pipeline is pending
ci/woodpecker/push/repo-checks Pipeline is pending
ci/woodpecker/push/js-generate Pipeline failed
ci/woodpecker/push/go-generate Pipeline failed
Welcome to [Renovate](https://github.com/renovatebot/renovate)! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.

🚦 To activate Renovate, merge this Pull Request. To disable Renovate, simply close this Pull Request unmerged.

---
### Detected Package Files

 * `.woodpecker/go-generate.yaml` (woodpecker)
 * `.woodpecker/js-generate.yaml` (woodpecker)
 * `.woodpecker/lint.yaml` (woodpecker)
 * `.woodpecker/repo-checks.yaml` (woodpecker)

### What to Expect

It looks like your repository dependencies are already up-to-date and no Pull Requests will be necessary right away.

---

 Got questions? Check out Renovate's [Docs](https://docs.renovatebot.com/), particularly the Getting Started section.
If you need any further assistance then you can also [request help here](https://github.com/renovatebot/renovate/discussions).

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).

<!--renovate-config-hash:94693a990c975907e7f13da3309b9d56ba02b3983519b41786edf5cf031e457c-->

Reviewed-on: #3
Co-authored-by: Kinda Bot <bot@badhouseplants.net>
Co-committed-by: Kinda Bot <bot@badhouseplants.net>
2026-04-30 15:23:40 +00:00
1d3ceb07da Add old proto from 2 years ago
Some checks failed
ci/woodpecker/push/js-generate Pipeline failed
ci/woodpecker/push/go-generate Pipeline was successful
ci/woodpecker/push/lint Pipeline failed
ci/woodpecker/push/repo-checks Pipeline failed
Signed-off-by: Nikolai Rodionov <iam@allanger.xyz>
2026-04-23 20:02:04 +02:00
ed3bc02006 Remove proto dir
All checks were successful
ci/woodpecker/push/js-generate Pipeline was successful
ci/woodpecker/push/go-generate Pipeline was successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/repo-checks Pipeline was successful
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-04-21 22:15:33 +02:00
b3d0888cc8 Change the js dir for proto
All checks were successful
ci/woodpecker/push/go-generate Pipeline was successful
ci/woodpecker/push/js-generate Pipeline was successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/repo-checks Pipeline was successful
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-04-21 22:06:10 +02:00
b9154d1062 Add js generation
All checks were successful
ci/woodpecker/push/go-generate Pipeline was successful
ci/woodpecker/push/js-generate Pipeline was successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/repo-checks Pipeline was successful
Signed-off-by: Nikolai Rodionov <iam@allanger.xyz>
2026-04-21 08:13:11 +02:00
f3e2a9dea1 Add js generation
Signed-off-by: Nikolai Rodionov <iam@allanger.xyz>
2026-04-21 08:11:30 +02:00
22e8ba2da5 Set the bot username
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/go-generate Pipeline was successful
ci/woodpecker/push/repo-checks Pipeline was successful
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-04-20 22:33:11 +02:00
cf30d5f2f2 Revert "Set the bot username"
Some checks failed
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/go-generate Pipeline failed
ci/woodpecker/push/repo-checks Pipeline was successful
This reverts commit 08bd14d5f0.
2026-04-20 22:31:47 +02:00
674ffc982d Set the bot username
Some checks failed
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/go-generate Pipeline failed
ci/woodpecker/push/repo-checks Pipeline was successful
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-04-20 22:30:46 +02:00
08bd14d5f0 Set the bot username
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/go-generate Pipeline was successful
ci/woodpecker/push/repo-checks Pipeline was successful
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-04-20 22:28:24 +02:00
bb5a976a1b Set the bot username
Some checks failed
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/repo-checks Pipeline failed
ci/woodpecker/push/go-generate Pipeline failed
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-04-20 22:27:59 +02:00
ed05cf345a Set the bot username
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/go-generate Pipeline was successful
ci/woodpecker/push/repo-checks Pipeline was successful
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-04-20 22:15:52 +02:00
418fb64387 Set the bot username
Some checks failed
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/go-generate Pipeline failed
ci/woodpecker/push/repo-checks Pipeline was successful
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-04-20 22:09:01 +02:00
2b810cf630 Test code generation in CI (#2)
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/go-generate Pipeline was successful
ci/woodpecker/push/repo-checks Pipeline was successful
Reviewed-on: #2
Co-authored-by: Nikolai Rodionov <allanger@badhouseplants.net>
Co-committed-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-04-20 20:03:17 +00:00
7f6a3e117e Try pulling the go repo
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/go-generate Pipeline was successful
ci/woodpecker/push/repo-checks Pipeline was successful
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-04-20 21:54:09 +02:00
659f9f8500 Try pulling the go repo
Some checks failed
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/go-generate Pipeline failed
ci/woodpecker/push/repo-checks Pipeline was successful
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-04-20 21:53:18 +02:00
1b1e500ef8 Try pulling the go repo
Some checks failed
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/go-generate Pipeline failed
ci/woodpecker/push/repo-checks Pipeline was successful
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-04-20 21:52:15 +02:00
0c909c00e1 Try pulling the go repo
Some checks failed
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/go-generate Pipeline failed
ci/woodpecker/push/repo-checks Pipeline was successful
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-04-20 21:50:48 +02:00
7a23c4cacb Try pulling the go repo
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-04-20 21:50:23 +02:00
397e515f34 Try pulling the go repo
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-04-20 21:50:10 +02:00
f46757640b Try pulling the go repo
Some checks failed
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/go-generate Pipeline failed
ci/woodpecker/push/repo-checks Pipeline was successful
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-04-20 21:47:00 +02:00
dab66a561c Try pulling the go repo
Some checks failed
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/go-generate Pipeline failed
ci/woodpecker/push/repo-checks Pipeline was successful
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-04-20 21:43:46 +02:00
bc6cb2a6e0 Only the test service
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/repo-checks Pipeline was successful
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-04-20 19:32:13 +02:00
c63c766895 Only the test service
Some checks failed
ci/woodpecker/push/repo-checks Pipeline failed
ci/woodpecker/push/lint Pipeline was successful
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-04-20 19:31:35 +02:00
d518a692b2 A small fix and add pre-commit pipeline
Some checks failed
ci/woodpecker/push/lint Pipeline failed
ci/woodpecker/push/repo-checks Pipeline failed
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-04-20 19:15:26 +02:00
b643af2f3d Try using buf
Some checks failed
ci/woodpecker/push/lint Pipeline failed
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-04-20 19:11:24 +02:00
54e1cedeb0 A couple up updates
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-04-19 22:28:28 +02:00
c2ec945fa4 A couple up updates
Some checks failed
ci/woodpecker/push/lint Pipeline failed
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-04-19 22:16:41 +02:00
4c45fd39fb A couple up updates
Some checks failed
ci/woodpecker/push/lint Pipeline failed
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-04-19 22:14:28 +02:00
066985346d A couple up updates
Signed-off-by: Nikolai Rodionov <allanger@badhouseplants.net>
2026-04-19 22:11:18 +02:00
Nikolai Rodionov
19468be271 Update the go module path 2024-09-23 13:15:16 +02:00
eb82a632ce Add an API to reset the password 2024-05-22 00:02:44 +02:00
165fe024d9 Add is email verified API 2024-05-22 00:02:44 +02:00
25 changed files with 1095 additions and 935 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
gen/

11
.pre-commit-config.yaml Normal file
View File

@@ -0,0 +1,11 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0 # Use the ref you want to point at
hooks:
- id: trailing-whitespace
exclude: README.md
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: end-of-file-fixer
exclude: README.md

View File

@@ -1,6 +0,0 @@
# Lint directives.
lint:
rules_option:
max_line_length:
max_chars: 120
tab_chars: 2

View File

@@ -0,0 +1,41 @@
---
when:
event:
- push
steps:
- name: Clone dart repo
image: alpine
environment:
GITEA_USER: devops-bot
GITEA_TOKEN:
from_secret: gitea_repo_access
commands:
- apk update && apk add git
- git clone https://$GITEA_USER:$GITEA_TOKEN@gitea.badhouseplants.net/softplayer/softplayer-dart-proto.git target
- git -C ./target config user.name "devops-bot"
- git -C ./target config user.email "bot@badhouseplants.net"
- git -C ./target checkout $CI_COMMIT_BRANCH || git -C ./target checkout -b $CI_COMMIT_BRANCH
- name: Generate code
image: bufbuild/buf
commands:
- buf generate
- rm -rf ./target/lib/src
- mkdir -p ./target/lib/src
- cp -r ./gen/dart/* ./target/
- name: Push the dart repo
image: alpine
environment:
GITEA_USER: devops-bot
GITEA_TOKEN:
from_secret: gitea_repo_access
commands:
- apk update && apk add git
- git -C ./target add .
- |-
git -C ./target commit --allow-empty \
-m "Update protobuf definitions: ${CI_COMMIT_SHA:0:8}" \
-m "By ${CI_COMMIT_AUTHOR}" \
-m "Commit link: ${CI_REPO_URL}/commit/${CI_COMMIT_SHA}" \
-m "Pipeline link: ${CI_PIPELINE_URL}"
- git -C ./target push --set-upstream origin $CI_COMMIT_BRANCH

View File

@@ -1,33 +0,0 @@
---
when:
event:
- push
branch: main
steps:
lint:
name: Generate docs
image: pseudomuto/protoc-gen-doc
secrets:
- softplayer_bot_ssh_key
- git_known_hosts
commands:
- mkdir -p ~/.ssh
- apk update && apk add git openssh
- echo $SOFTPLAYER_BOT_SSH_KEY | base64 -d > ~/.ssh/id_ed25519
- echo $GIT_KNOWN_HOSTS > ~/.ssh/known_hosts
- cat ~/.ssh/id_ed25519
- chmod 0600 ~/.ssh/id_ed25519
- protoc --proto_path=./proto --doc_out=. --doc_opt=markdown,README.md $(find ./proto -type f -iname "*.proto")
# To make sure there is always a change, even when protos are not updated
- echo "Generated on $(date)" >> README.md
- eval `ssh-agent`
- ssh-add ~/.ssh/id_ed25519
- git config --global user.email "allanger@badhouseplants.net"
- git config --global user.name "Softplayer Bot"
- git clone git@git.badhouseplants.net:softplayer/softplayer-proto.git /tmp/repo
- git -C /tmp/repo checkout generated-documentation
- mv README.md /tmp/repo/README.md
- git -C /tmp/repo add .
- git -C /tmp/repo commit -m "Update documentation from $CI_COMMIT_SHA"
- git -C /tmp/repo push

View File

@@ -0,0 +1,42 @@
---
when:
event:
- push
steps:
- name: Clone go repo
image: alpine
environment:
GITEA_USER: devops-bot
GITEA_TOKEN:
from_secret: gitea_repo_access
commands:
- apk update && apk add git
- git clone https://$GITEA_USER:$GITEA_TOKEN@gitea.badhouseplants.net/softplayer/softplayer-go-proto.git target
- git -C ./target config user.name "devops-bot"
- git -C ./target config user.email "bot@badhouseplants.net"
- git -C ./target checkout $CI_COMMIT_BRANCH || git -C ./target checkout -b $CI_COMMIT_BRANCH
- name: Generate code
image: bufbuild/buf
commands:
- buf generate
- rm -rf ./target/pkg/*
- cp -r ./gen/go/* ./target/pkg
- cp README.md ./target/APIDoc.md
- name: Clone go repo
image: alpine
environment:
GITEA_USER: devops-bot
GITEA_TOKEN:
from_secret: gitea_repo_access
commands:
- apk update && apk add git
- git -C ./target add .
- |-
git -C ./target commit --allow-empty \
-m "Update protobuf definitions: ${CI_COMMIT_SHA:0:8}" \
-m "By ${CI_COMMIT_AUTHOR}" \
-m "Commit link: ${CI_REPO_URL}/commit/${CI_COMMIT_SHA}" \
-m "Pipeline link: ${CI_PIPELINE_URL}"
- git -C ./target push --set-upstream origin $CI_COMMIT_BRANCH

View File

@@ -0,0 +1,41 @@
---
when:
event:
- push
steps:
- name: Clone js repo
image: alpine
environment:
GITEA_USER: devops-bot
GITEA_TOKEN:
from_secret: gitea_repo_access
commands:
- apk update && apk add git
- git clone https://$GITEA_USER:$GITEA_TOKEN@gitea.badhouseplants.net/softplayer/softplayer-js-proto.git target
- git -C ./target config user.name "devops-bot"
- git -C ./target config user.email "bot@badhouseplants.net"
- git -C ./target checkout $CI_COMMIT_BRANCH || git -C ./target checkout -b $CI_COMMIT_BRANCH
- name: Generate code
image: bufbuild/buf
commands:
- buf generate
- rm -rf ./target/src/api
- mkdir -p ./target/src/api
- cp -r ./gen/ts/* ./target/src/api
- name: Push the typescript repo
image: alpine
environment:
GITEA_USER: devops-bot
GITEA_TOKEN:
from_secret: gitea_repo_access
commands:
- apk update && apk add git
- git -C ./target add .
- |-
git -C ./target commit --allow-empty \
-m "Update protobuf definitions: ${CI_COMMIT_SHA:0:8}" \
-m "By ${CI_COMMIT_AUTHOR}" \
-m "Commit link: ${CI_REPO_URL}/commit/${CI_COMMIT_SHA}" \
-m "Pipeline link: ${CI_PIPELINE_URL}"
- git -C ./target push --set-upstream origin $CI_COMMIT_BRANCH

View File

@@ -4,8 +4,7 @@ when:
- push
steps:
lint:
name: Lint protobufs
image: yoheimuta/protolint
- name: Lint protobufs
image: bufbuild/buf
commands:
- protolint lint $(find . -type f -iname "*.proto")
- buf lint

View File

@@ -0,0 +1,10 @@
---
when:
event:
- push
steps:
- name: Run pre-commit
image: jfxs/pre-commit
commands:
- pre-commit run --all

View File

@@ -1,11 +0,0 @@
FROM alpine:3.16.2
RUN apk add --no-cache git make musl-dev go protobuf protobuf-dev
ENV GOROOT /usr/lib/go
ENV GOPATH /go
ENV PATH /go/bin:$PATH
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26
RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.1
CMD [ "protoc -v" ]

View File

@@ -1,36 +0,0 @@
# ---------------------------------------------------------------------
# -- Which container tool to use
# ---------------------------------------------------------------------
CONTAINER_TOOL ?= docker
protoc-docs-gen:
protoc \
--proto_path=./proto \
--doc_out=. \
--doc_opt=markdown,readme.md \
$$(find ./proto -type f -iname "*.proto")
docker-docs-gen:
$(CONTAINER_TOOL) run --rm \
-v $$(pwd):/out \
-v $$(pwd)/proto:/proto \
pseudomuto/protoc-gen-doc --doc_opt=markdown,README.md --proto_path=proto \
$$(find proto -type f -iname "*.proto")
docker-lint:
$(CONTAINER_TOOL) run --rm \
-v $$(pwd):/workspace \
--workdir /workspace \
yoheimuta/protolint lint \
$$(find . -type f -iname "*.proto")
docker-protobuf:
$(CONTAINER_TOOL) build -t gogen . && \
$(CONTAINER_TOOL) run --rm \
-v $$(pwd)/proto:/proto \
-v $$(pwd)/pkg:/pkg \
gogen \
protoc --go_out=/pkg/ --go_opt=paths=source_relative \
--go-grpc_out=/pkg/ --go-grpc_opt=paths=source_relative \
--proto_path=proto/proto \
$$(find proto -type f -iname "*.proto")

1176
README.md

File diff suppressed because it is too large Load Diff

13
Taskfile.yml Normal file
View File

@@ -0,0 +1,13 @@
# yaml-language-server: $schema=https://taskfile.dev/schema.json
version: "3"
tasks:
lint:
desc: Run linter
silent: true
cmd: buf lint
generate:
desc: Generate code
silent: true
cmd: buf generate

27
buf.gen.yaml Normal file
View File

@@ -0,0 +1,27 @@
version: v2
plugins:
- remote: buf.build/bufbuild/es
out: gen/ts
opt:
- target=ts
- remote: buf.build/protocolbuffers/go
out: gen/go
opt:
- paths=source_relative
- remote: buf.build/grpc/go
out: gen/go
opt:
- paths=source_relative
- require_unimplemented_servers=false
- remote: buf.build/community/pseudomuto-doc:v1.5.1
out: .
opt:
- markdown,README.md
- remote: buf.build/protocolbuffers/dart:v25.0.0
out: gen/dart/lib/src
opt:
- grpc

11
buf.yaml Normal file
View File

@@ -0,0 +1,11 @@
version: v2
modules:
- path: proto
lint:
use:
- STANDARD
enum_zero_value_suffix: _UNSPECIFIED
rpc_allow_same_request_response: true
rpc_allow_google_protobuf_empty_requests: true
rpc_allow_google_protobuf_empty_responses: true

View File

@@ -1,48 +0,0 @@
/// This file has messages for describing environments
syntax = "proto3";
package accounts;
import "google/protobuf/empty.proto";
option go_package = "git.badhouseplants.net/softplayer/softplayer-go-proto/pkg/accounts";
/**
* Service for handling environments
*/
service Accounts {
rpc SignUp (AccountWithPassword) returns (AccountFullWithToken) {}
rpc SignIn (AccountWithPassword) returns (AccountFullWithToken) {}
rpc ResetPassword (AccountData) returns (google.protobuf.Empty) {}
}
/**
* Represents a environment UUID only
*/
message AccountId {
string id = 1; // Contour ID: UUID
}
message AccountPassword {
string password = 1;
}
message AccountData {
string name = 1; // Account name
string email = 2; // Account email
}
message AccountWithPassword {
AccountData data = 1;
AccountPassword password = 2;
}
message AccountFull {
AccountId id = 1;
AccountData data = 2;
}
message AccountFullWithToken {
AccountId id = 1;
AccountData data = 2;
string token = 3;
}

View File

@@ -0,0 +1,70 @@
/// Protobuf definitions for the accounts service.
syntax = "proto3";
package accounts.v1;
import "google/protobuf/empty.proto";
option go_package = "gitea.badhouseplants.net/softplayer/softplayer-go-proto/pkg/accounts/v1";
/**
* Service for handling accounts that do not require authentication
*/
service PublicAccountsService {
// Sing in into an existing account
rpc SignIn (SignInRequest) returns (google.protobuf.Empty) {}
// Create a new account
rpc SignUp (SignUpRequest) returns (google.protobuf.Empty) {}
}
service AccountsService {
// Is email for the current account verified
rpc IsEmailVerified (IsEmailVerifiedRequest) returns (IsEmailVerifiedResponse) {}
rpc RefreshSession (google.protobuf.Empty) returns (google.protobuf.Empty) {}
// Authorize using long living tokens
rpc TokenAuthorization (google.protobuf.Empty) returns (google.protobuf.Empty) {}
}
message AccountPassword {
string password = 1;
}
message AccountData {
string name = 1; // Account name
string email = 2; // Account email
}
message PersonalData {
string name = 1;
string surname = 2;
}
message SignUpRequest {
string email = 1;
string password = 2;
PersonalData personal_data = 3;
}
message SignInRequest {
string email = 1;
string password = 2;
};
message ResetPasswordRequest {
AccountData data = 1;
}
message NewPasswordRequest {
AccountData data = 1;
AccountPassword password = 2;
string code = 3;
}
message IsEmailVerifiedRequest {
AccountData data = 1;
}
message IsEmailVerifiedResponse {
bool verified = 1;
}
message RefreshTokenRequest {
string session_id = 1;
}

View File

@@ -1,93 +0,0 @@
/// This file has messages for describing applications
syntax = "proto3";
package applications;
import "google/protobuf/empty.proto";
option go_package = "git.badhouseplants.net/softplayer/softplayer-go-proto/pkg/applications";
/**
* Service for handling applications
*/
service Applications {
rpc Create(CreateOptions) returns (ApplicationFull) {}
rpc Update(UpdateOptions) returns (ApplicationFull) {}
rpc Delete(DeleteOptions) returns (google.protobuf.Empty) {}
rpc Get(GetOptions) returns (ApplicationFull) {}
rpc List(ListOptions) returns (stream ApplicationFull) {}
}
/**
User related messages
*/
message OwnerId {
string uuid = 1; // UUID of a user that is creating an environemnt
}
message Token {
string token = 1; // Token that should be used to create an environment
}
/**
Services options
*/
message CreateOptions {
ApplicationMetadata metadata = 1;
ApplicationSpec spec = 2;
OwnerId owner_id = 3;
Token token = 4;
}
message UpdateOptions {
ApplicationId id = 1;
ApplicationMetadata metadata = 2;
ApplicationSpec spec = 3;
OwnerId owner_id = 4;
Token token = 5;
}
message DeleteOptions {
ApplicationId id = 1;
ApplicationMetadata metadata = 2;
OwnerId owner_id = 3;
Token token = 4;
}
message GetOptions {
ApplicationId id = 1;
ApplicationMetadata metadata = 2;
OwnerId owner_id = 3;
Token token = 4;
}
message ListOptions {
ApplicationMetadata metadata = 1;
OwnerId owner_id = 2;
Token token = 3;
}
/**
Environment related messages
*/
message ApplicationId {
string uuid = 1;
}
message ApplicationMetadata {
string name = 1;
string description = 2;
}
message ApplicationSpec {
string application = 1;
string version = 2;
string environemnt_id = 3;
map<string, string> config = 4;
string raw_config = 5;
}
message ApplicationFull {
ApplicationMetadata metadata = 1;
ApplicationSpec spec = 2;
ApplicationId id = 3;
}

View File

@@ -1,23 +0,0 @@
/// This file has messages for describing environments
syntax = "proto3";
package email;
import "google/protobuf/empty.proto";
option go_package = "git.badhouseplants.net/softplayer/softplayer-go-proto/pkg/email";
/*
* A service that should handle email validation
*/
service EmailValidation {
rpc SendRequest (RequestValidation) returns (google.protobuf.Empty) {}
rpc ValidateEmail (ConfirmValidation) returns (google.protobuf.Empty) {}
}
message RequestValidation {
string user_id = 1;
}
message ConfirmValidation {
string user_id = 1;
int32 code = 2;
}

View File

@@ -1,125 +0,0 @@
/// This file has messages for describing environments
syntax = "proto3";
package environments;
import "google/protobuf/empty.proto";
option go_package = "git.badhouseplants.net/softplayer/softplayer-go-proto/pkg/environments";
/**
* Service for handling environments
*/
service Environments {
rpc Create(CreateOptions) returns (EnvironmentFull) {}
rpc Update(UpdateOptions) returns (EnvironmentFull) {}
rpc Delete(DeleteOptions) returns (google.protobuf.Empty) {}
rpc Get(GetOptions) returns (EnvironmentFull) {}
rpc List(ListOptions) returns (stream EnvironmentFull) {}
}
/**
User related messages
*/
message OwnerId {
string uuid = 1; // UUID of a user that is creating an environemnt
}
message Token {
string token = 1; // Token that should be used to create an environment
}
/**
Services options
*/
message CreateOptions {
EnvironmentMetadata metadata = 1;
EnvironmentSpec spec = 2;
OwnerId owner_id = 3;
Token token = 4;
}
message UpdateOptions {
EnvironmentId id = 1;
EnvironmentMetadata metadata = 2;
EnvironmentSpec spec = 3;
OwnerId owner_id = 4;
Token token = 5;
}
message DeleteOptions {
EnvironmentId id = 1;
EnvironmentMetadata metadata = 2;
OwnerId owner_id = 3;
Token token = 4;
}
message GetOptions {
EnvironmentId id = 1;
EnvironmentMetadata metadata = 2;
OwnerId owner_id = 3;
Token token = 4;
}
message ListOptions {
EnvironmentMetadata metadata = 1;
string search_string = 2;
OwnerId owner_id = 3;
Token token = 4;
}
/**
Environment related messages
*/
message EnvironmentId {
string uuid = 1;
}
message EnvironmentMetadata {
string name = 1; // A name of the environment
string description = 2;
}
message EnvironmentSpec {
Provider provider = 1; // Provide
Kubernetes kubernetes = 2;
ServerType server_type = 3;
Location server_location = 4;
int32 disk_size = 5;
}
message EnvironmentFull {
EnvironmentMetadata metadata = 1;
EnvironmentSpec spec = 2;
EnvironmentId id = 3;
}
/**
Helpers and other messages
*/
enum Provider {
PROVIDER_UNSPECIFIED = 0;
PROVIDER_HETZNER = 1;
}
enum ServerType {
SERVER_TYPE_UNSPECIFIED = 0;
SERVER_TYPE_STARTER = 1;
SERVER_TYPE_REGULAR = 2;
SERVER_TYPE_PLUS = 3;
SERVER_TYPE_PRO = 4;
SERVER_TYPE_CUSTOM = 5;
}
enum Location {
LOCATION_UNSPECIFIED = 0;
LOCATION_HETZNER_NUREMBERG = 1;
LOCATION_HETZNER_FALKENSTEIN = 2;
LOCATION_HETZNER_HELSINKI = 3;
LOCATION_HETZNER_HILLSBORO = 4;
LOCATION_HETZNER_ASHBURN = 5;
}
enum Kubernetes {
KUBERNETES_UNSPECIFIED = 0;
KUBERNETES_K3S = 1;
}

View File

@@ -0,0 +1,27 @@
syntax = "proto3";
package project_membership.v1;
option go_package = "gitea.badhouseplants.net/softplayer/softplayer-go-proto/pkg/project_membership/v1";
service ProjectMembershipService {
rpc AddUserToProject(AddUserToProjectRequest) returns (AddUserToProjectResponse) {}
rpc ChangeMembership(ChangeMembershipRequest) returns (ChangeMembershipResponse) {}
rpc RemoveMembership(RemoveMembershipRequest) returns (RemoveMembershipResponse) {}
rpc GetMembership(GetMembershipRequest) returns (GetMembershipResponse) {}
rpc ListMemberships(ListMembershipsRequest) returns (stream ListMembershipsResponse) {}
}
message AddUserToProjectRequest {}
message AddUserToProjectResponse {}
message ChangeMembershipRequest {}
message ChangeMembershipResponse {}
message RemoveMembershipRequest {}
message RemoveMembershipResponse {}
message GetMembershipRequest {}
message GetMembershipResponse {}
message ListMembershipsRequest {}
message ListMembershipsResponse {}

View File

@@ -0,0 +1,19 @@
syntax = "proto3";
package projects.v1;
option go_package = "gitea.badhouseplants.net/softplayer/softplayer-go-proto/pkg/projects/v1";
service ProjectsService {
rpc CreateProject (CreateProjectRequest) returns (CreateProjectResponse) {}
rpc GetProject (GetProjectRequest) returns (GetProjectResponse) {}
rpc ListProjects (ListProjectsRequest) returns (stream ListProjectsResponse) {}
rpc UpdateProject (UpdateProjectRequest) returns (UpdateProjectResponse) {}
}
message CreateProjectRequest {}
message CreateProjectResponse {}
message GetProjectRequest {}
message GetProjectResponse {}
message ListProjectsRequest {}
message ListProjectsResponse {}
message UpdateProjectRequest {}
message UpdateProjectResponse {}

View File

@@ -0,0 +1,32 @@
syntax = "proto3";
package test.v1;
import "google/protobuf/empty.proto";
option go_package = "gitea.badhouseplants.net/softplayer/softplayer-go-proto/pkg/test/v1";
/**
* Service for handling environments
*/
service PublicTestService {
rpc Ping (PingRequest) returns (PingResponse) {}
rpc PingStream (google.protobuf.Empty) returns (stream PingStreamResponse) {}
}
service TestService {
rpc Pong (PongRequest) returns (PongResponse) {}
rpc PongStream (google.protobuf.Empty) returns (stream PongStreamResponse) {}
}
message PingRequest {}
message PingResponse {}
message PongRequest {}
message PongResponse {}
message PingStreamResponse {
string dummy = 1;
}
message PongStreamResponse {
string dummy = 1;
}

View File

@@ -0,0 +1,124 @@
/// Protobuf definitions for the accounts service.
syntax = "proto3";
package tokens.v1;
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
option go_package = "gitea.badhouseplants.net/softplayer/softplayer-go-proto/pkg/tokens/v1";
// Tokens should be used for programmatic access
// For example CLI or terraform modules
service TokensService {
// Create a new token
rpc CreateToken (CreateTokenRequest) returns (CreateTokenResponse) {}
// Update an existing token
rpc UpdateToken (UpdateTokenRequest) returns (UpdateTokenResponse) {}
// Expire an existing token
rpc ForceTokenExpiration (ForceTokenExpirationRequest) returns (google.protobuf.Empty) {}
// Create a new token with the same UUID
rpc RegenerateToken (RegenerateTokenRequest) returns (RegenerateTokenResponse) {}
// Get an existing token
rpc GetToken (GetTokenRequest) returns (GetTokenResponse) {}
// List all existing tokens
rpc ListTokens (google.protobuf.Empty) returns (stream ListTokensResponse) {}
// List all available permissions
rpc ListPermissions (google.protobuf.Empty) returns (stream ListPermissionsResponse) {}
}
// An endpoint to authenticate with a token should be here
service PublicTokensService {
// Recieve a JWT access token
// DO NOT implement it in the web app!
rpc AuthenticateWithToken(AuthenticateWithTokenRequest) returns (google.protobuf.Empty) {}
}
message TokenMetadata {
// A token name
string name = 1;
// Token expiration timestamp
google.protobuf.Timestamp expires_at = 2;
// When the token was used the last time
google.protobuf.Timestamp last_used_at = 3;
// When was the current token generated
google.protobuf.Timestamp generated_at = 4;
// When was the current token entry created
google.protobuf.Timestamp created_at = 5;
// When was the token revoked
google.protobuf.Timestamp revoked_at = 6;
}
message TokenUUID {
// An ID of a token
string uuid = 1;
}
message TokenValue {
// Token value
// Can be only retrieved once after the generation
string token = 1;
}
message MethodList {
repeated string methods = 1;
}
message TokenPermissions {
map<string, MethodList> permissions = 1;
}
message CreateTokenRequest {
TokenMetadata token_metadata = 1;
TokenPermissions token_permissions = 2;
}
message CreateTokenResponse {
TokenUUID token_uuid = 1;
TokenValue token_value = 2;
}
message UpdateTokenRequest {
TokenUUID token_uuid = 1;
TokenMetadata token_metadata = 2;
TokenPermissions token_permissions = 3;
}
message UpdateTokenResponse {
TokenUUID token_uuid = 1;
TokenMetadata token_metadata = 2;
TokenPermissions token_permissions = 3;
}
message ForceTokenExpirationRequest {
TokenUUID token_uuid = 1;
}
message RegenerateTokenRequest {
TokenUUID token_uuid = 1;
}
message RegenerateTokenResponse {
TokenUUID token_uuid = 1;
TokenValue token_value = 2;
}
message GetTokenRequest {
TokenUUID token_uuid = 1;
}
message GetTokenResponse {
TokenUUID token_uuid = 1;
TokenMetadata token_metadata = 2;
TokenPermissions token_permissions = 3;
}
message ListTokensResponse {
TokenUUID token_uuid = 1;
TokenMetadata token_metadata = 2;
TokenPermissions token_permissions = 3;
}
message ListPermissionsResponse {
TokenPermissions permissions = 1;
}
message AuthenticateWithTokenRequest {
TokenValue token_value = 1;
}

3
renovate.json Normal file
View File

@@ -0,0 +1,3 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json"
}