mirror of
https://github.com/usbharu/Hideout.git
synced 2026-07-07 14:08:21 +00:00
Compare commits
321 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5417299c16 | |||
| 46232fb315 | |||
| 097574c5b6 | |||
| 4aa0df1790 | |||
| e3c9c60427 | |||
| ea1de67a13 | |||
| be548d55aa | |||
| 56bc8d3d27 | |||
| 6b00c9d626 | |||
| 9ff29be365 | |||
| 22be156bc7 | |||
| 4e29b8a4e6 | |||
| 2080ba8154 | |||
| 660668c2fa | |||
| 8865ed8ecb | |||
| 733e947660 | |||
| 36374b4bf8 | |||
| 80fb6f9eea | |||
| 229720ebf0 | |||
| 7392e6a5ac | |||
| 5d4117bb21 | |||
| b681c1c1e2 | |||
| 0583909749 | |||
| e95c5078a3 | |||
|
8b4167d847
|
|||
|
98385c6b82
|
|||
| 83cff53fac | |||
| e7f4e46a73 | |||
| 8138c2a76d | |||
| b4035bebcf | |||
| 1d6fbaca90 | |||
|
e28b8f0d6c
|
|||
| ac2a8e4da2 | |||
| 91aa7c7def | |||
| 578ed2d8fe | |||
| 516147252b | |||
|
c88ff0b3fe
|
|||
|
3c604abe37
|
|||
|
adf1dfc1f3
|
|||
| a935537332 | |||
| 4a6deacb7e | |||
| 2ce08e0430 | |||
| dddbc8e4db | |||
| b0cc7c9df5 | |||
| f995f44c15 | |||
|
10767d01c6
|
|||
| 063d8f1359 | |||
| 88f3bfbc7a | |||
| 7e08beb352 | |||
| 1728ea863a | |||
| 9baefbc73f | |||
| 04c2931863 | |||
| 285cc7fbd6 | |||
| f49bec3252 | |||
|
8f3286d745
|
|||
| 5e073233da | |||
| 6819c8d847 | |||
|
ff6da7174b
|
|||
|
8c14a966aa
|
|||
| 0e6a17be79 | |||
| 6044796043 | |||
|
5ac1e3b267
|
|||
|
4c026fb243
|
|||
|
4be93fea86
|
|||
| ac5dee2551 | |||
| c1b20f01c1 | |||
| f43507383e | |||
|
043d6422f0
|
|||
|
206b7fdbf5
|
|||
| 26f84da964 | |||
|
d696494100
|
|||
|
17cc92d344
|
|||
|
c37e442dd7
|
|||
|
ecdbf74e57
|
|||
| 26b9d640b5 | |||
| fac35ba604 | |||
|
e4ebc0bc4e
|
|||
|
124dcd6050
|
|||
|
253e25e51d
|
|||
|
4679995144
|
|||
| 1f34792a1d | |||
| fdcf58fca9 | |||
| e75fc0cc38 | |||
|
5fd181a339
|
|||
| 5e5bbe756b | |||
|
27cf8227ea
|
|||
|
8bf1fe06a8
|
|||
|
d4157a3b38
|
|||
|
98964cc656
|
|||
|
ae0e4a4013
|
|||
| a65c46f32c | |||
| 6f88d64b82 | |||
| ced61dd5bd | |||
| e4ff5e3d57 | |||
| 1fdbb879b3 | |||
| 92e88078ab | |||
|
e19a165be4
|
|||
|
af0c3d0149
|
|||
| df1792781c | |||
|
f036febf5c
|
|||
| 50a0648a14 | |||
| 0cb7c25703 | |||
| fc70635e2d | |||
|
334462d402
|
|||
| 522bac6e6b | |||
| a7e9ee1f37 | |||
| 1e3dab503a | |||
|
0e66d5a49a
|
|||
| 0a8595330b | |||
| 1493dee67a | |||
| 2ef645e351 | |||
| 9195c7892d | |||
| 8e8e588d53 | |||
| cf35c46e71 | |||
| fa4a3c2c19 | |||
| 915562de4b | |||
| f727bb0ae5 | |||
| 48add4530a | |||
| 3306ae1b5d | |||
| d306d86e50 | |||
|
2693b83be2
|
|||
| d4008e71d6 | |||
| ac0b8cacd4 | |||
| b52f1e5f3f | |||
| 4a5dd2aed4 | |||
| e3c014dcaf | |||
| 84f6ace729 | |||
| 12a6e5ca20 | |||
| 7dad7d31ea | |||
| fc86ad89c3 | |||
| 9866f5979a | |||
| 842e1628a3 | |||
| 97b9b26ad9 | |||
| 309a6afde3 | |||
| 41c240c6dc | |||
| 6f7bb26ef1 | |||
| 035edec6d6 | |||
| 614379bc22 | |||
| 1a1906dabb | |||
| 7c153488e5 | |||
| 0c8ca2d3eb | |||
| 9fea1ca380 | |||
| e261b2d3cb | |||
| 23248b6766 | |||
| 19883b7960 | |||
| 39c510c60a | |||
| 34361ce87c | |||
| 409e6a8f8e | |||
| f7ee527fd3 | |||
| 2c17c91c0b | |||
| d4ac8c7ae3 | |||
|
1f2feb6668
|
|||
| 70f62c334b | |||
|
b85b6d1c47
|
|||
| bc167f72f2 | |||
| 27d045363e | |||
| 33ad2ee301 | |||
| 459599e577 | |||
| 20b1893faf | |||
|
abac2fa93e
|
|||
|
d0c2fe2fff
|
|||
|
f89f7c1faa
|
|||
|
c75f5da307
|
|||
|
07e1a1354b
|
|||
| 05035eba4e | |||
|
fcb3f1a7bc
|
|||
|
8e36f50366
|
|||
|
13e438f3b8
|
|||
|
ecf41d387b
|
|||
|
56577c9137
|
|||
|
4e4cada0b7
|
|||
|
73451a1918
|
|||
|
4216beaf8a
|
|||
|
ef0eacf1bf
|
|||
| bcf0f65e06 | |||
|
90d28ee8a1
|
|||
|
22bd24304c
|
|||
|
4c62651da5
|
|||
| dfbb3b0f35 | |||
| 32483abfe0 | |||
| c3fdf98fd6 | |||
|
96d51a885f
|
|||
|
309ea569e8
|
|||
| d33a9065e9 | |||
|
386b8a0ec3
|
|||
| 8b5e3b3cec | |||
|
b0ee6b117e
|
|||
| 5777adac93 | |||
| a9b7759220 | |||
|
857beccd59
|
|||
|
9bc5f01c9b
|
|||
|
d2b69b162a
|
|||
| 1e2813284d | |||
| 0e0b5bc0ac | |||
| 2d9f271d3d | |||
| a5f7fff032 | |||
| 79adbf46cb | |||
|
b52839192c
|
|||
|
22084ee4be
|
|||
|
9677b11f5c
|
|||
| 1020fe2adf | |||
|
6d233a1d39
|
|||
| 350f17c0b1 | |||
| d8d903437e | |||
|
80918e1c2e
|
|||
|
30b58c1e14
|
|||
|
0fe96360a9
|
|||
|
ec0934a411
|
|||
|
35eded28e5
|
|||
|
0b1fe6eefc
|
|||
|
d2030bc9e5
|
|||
| d4122429ee | |||
|
4bc9e3abd2
|
|||
|
1a2142e83b
|
|||
|
26b3bdd721
|
|||
|
acb9efdfef
|
|||
|
80a8a5dcee
|
|||
|
3faf6b9c34
|
|||
|
3890659a7d
|
|||
|
ee7bdf66eb
|
|||
|
455c7aea3f
|
|||
|
4a9b192e84
|
|||
|
f622d23a7b
|
|||
|
23fb7f9f2a
|
|||
|
bb6e03461a
|
|||
|
579ac44372
|
|||
|
4eb8127105
|
|||
|
031ba79450
|
|||
|
95ac60bfec
|
|||
|
e36c7d6fb9
|
|||
|
ee665eddb3
|
|||
|
6ffd675f35
|
|||
|
af70c18b7a
|
|||
|
5456413e42
|
|||
|
375113f384
|
|||
|
e6573ccbb3
|
|||
|
bd74ca1e0f
|
|||
|
a4cfbe81a1
|
|||
|
42c6e0b093
|
|||
|
26e0679435
|
|||
| 572ceacc67 | |||
|
f7e151b575
|
|||
|
f83d47e877
|
|||
|
cb52248b1c
|
|||
|
5cc8267135
|
|||
|
33d7bcb665
|
|||
| b38d34d1ac | |||
|
884d17cf47
|
|||
|
0801216a0d
|
|||
| 75a59d7393 | |||
|
56a4e94e41
|
|||
|
2c10fc5330
|
|||
|
bc02913e55
|
|||
| a1cef4657e | |||
|
d9b51d44e1
|
|||
|
c52d157696
|
|||
|
6904bc0692
|
|||
|
3a923c7c57
|
|||
|
bde0b31d28
|
|||
| 5f97c45906 | |||
|
acd96aaed3
|
|||
| c5f5883c96 | |||
|
481a788410
|
|||
|
7ce7e3085a
|
|||
| 857a46057f | |||
|
86d469451b
|
|||
|
934e032b70
|
|||
| f7ccd36429 | |||
| 8dd55744ec | |||
| 94d0bedb36 | |||
|
e46c85984c
|
|||
|
1503ee1844
|
|||
|
900ed51d09
|
|||
| 1316558443 | |||
|
e43e1575cf
|
|||
|
67208e5899
|
|||
| 74aa1302d4 | |||
|
24e97abf3f
|
|||
|
daae3b2912
|
|||
| 2fc5962ddd | |||
|
4f5c07e735
|
|||
|
9ed85bae07
|
|||
| f82680236e | |||
|
1c80911365
|
|||
| d74101a2b6 | |||
| 5969371a40 | |||
| 3a81783d2c | |||
|
831bb17fca
|
|||
|
94365e09f2
|
|||
|
0dcd2b1b9a
|
|||
| 7345d985bd | |||
|
d4fd61d31d
|
|||
| 72659bf57b | |||
|
85d36e5aa2
|
|||
|
404ca6c531
|
|||
|
8e43427f15
|
|||
|
554ce68c93
|
|||
| 88ab8d23df | |||
|
57430b7e4a
|
|||
|
575763c605
|
|||
|
1e07807ebc
|
|||
|
90a815cf5d
|
|||
|
d9297b0992
|
|||
| d1560f25aa | |||
|
34a36b5ed5
|
|||
|
498d6d73da
|
|||
|
93e93c6b01
|
|||
|
95c901790f
|
|||
|
2501990dac
|
|||
|
bf2dbf159a
|
|||
|
5c554bfa16
|
|||
|
1983841cef
|
|||
|
e67eb788a7
|
|||
|
fa66ccaa0c
|
|||
| d2c608333d | |||
| ad112406b8 | |||
| 88d34a6b71 | |||
|
9daf79904b
|
|||
|
29cbb5f93e
|
|||
|
37c8335165
|
|||
|
27ccca02c0
|
@@ -1,16 +1,14 @@
|
||||
name: PullRequest Merge Check
|
||||
|
||||
name: pull-request-merge-check.yml
|
||||
on:
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- 'owl/**'
|
||||
branches:
|
||||
- "develop"
|
||||
types:
|
||||
- opened # default
|
||||
- reopened # default
|
||||
- synchronize # default
|
||||
- ready_for_review # 必要
|
||||
- opened
|
||||
- reopened
|
||||
- synchronize
|
||||
- ready_for_review
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
@@ -22,10 +20,70 @@ permissions:
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
setup:
|
||||
name: Setup
|
||||
change:
|
||||
if: github.event.pull_request.draft == false
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
hideout: ${{ steps.filter.outputs.hideout }}
|
||||
owl: ${{ steps.filter.outputs.owl }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.PAT }}
|
||||
|
||||
- name: Check Changes
|
||||
uses: dorny/paths-filter@v3
|
||||
id: filter
|
||||
with:
|
||||
filters: |
|
||||
hideout:
|
||||
- 'hideout/**'
|
||||
- 'libs.versions.toml'
|
||||
owl:
|
||||
- 'owl/**'
|
||||
- 'libs.versions.toml'
|
||||
|
||||
hideout-setup:
|
||||
needs:
|
||||
- change
|
||||
if: github.event.pull_request.draft == false && needs.change.outputs.hideout == 'true'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.PAT }}
|
||||
|
||||
- name: Gradle Wrapper Validation
|
||||
uses: gradle/actions/wrapper-validation@v4
|
||||
|
||||
- name: Set up JDK 21
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '21'
|
||||
distribution: 'temurin'
|
||||
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
with:
|
||||
cache-read-only: false
|
||||
gradle-home-cache-cleanup: true
|
||||
- name: Build
|
||||
run: ./gradlew :hideout:test
|
||||
|
||||
- name: JUnit Test Report
|
||||
if: ${{ always() }}
|
||||
uses: mikepenz/action-junit-report@v5
|
||||
with:
|
||||
report_paths: '**/TEST-*.xml'
|
||||
check_name: 'hideout-core JUnit Test Report'
|
||||
|
||||
owl-setup:
|
||||
needs:
|
||||
- change
|
||||
if: github.event.pull_request.draft == false && needs.change.outputs.owl == 'true'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
@@ -48,16 +106,30 @@ jobs:
|
||||
gradle-home-cache-cleanup: true
|
||||
|
||||
- name: Build
|
||||
run: ./gradlew classes --no-daemon
|
||||
run: ./gradlew :owl:test
|
||||
|
||||
unit-test:
|
||||
name: Unit Test
|
||||
needs: [ setup ]
|
||||
- name: JUnit Test Report
|
||||
if: ${{ always() }}
|
||||
uses: mikepenz/action-junit-report@v5
|
||||
with:
|
||||
report_paths: '**/TEST-*.xml'
|
||||
check_name: 'owl JUnit Test Report'
|
||||
|
||||
|
||||
lint:
|
||||
if: always() && (needs.change.outputs.hideout == 'true' || needs.change.outputs.owl == 'true')
|
||||
needs:
|
||||
- change
|
||||
- hideout-setup
|
||||
- owl-setup
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.head_ref }}
|
||||
token: ${{ secrets.PAT }}
|
||||
|
||||
- name: Set up JDK 21
|
||||
@@ -72,55 +144,8 @@ jobs:
|
||||
cache-read-only: false
|
||||
gradle-home-cache-cleanup: true
|
||||
|
||||
- name: Unit Test
|
||||
run: ./hideout-core/gradlew :hideout-core:koverXmlReport
|
||||
|
||||
- name: Add coverage report to PR
|
||||
if: always()
|
||||
id: kover
|
||||
uses: madrapps/jacoco-report@v1.7.0
|
||||
with:
|
||||
paths: |
|
||||
${{ github.workspace }}/hideout-core/build/reports/kover/report.xml
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
title: Code Coverage
|
||||
update-comment: true
|
||||
min-coverage-overall: 80
|
||||
min-coverage-changed-files: 80
|
||||
coverage-counter-type: LINE
|
||||
|
||||
- name: JUnit Test Report
|
||||
uses: mikepenz/action-junit-report@v4
|
||||
with:
|
||||
report_paths: '**/TEST-*.xml'
|
||||
|
||||
lint:
|
||||
name: Lint
|
||||
needs: [ setup ]
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.head_ref }}
|
||||
token: '${{ secrets.PAT }}'
|
||||
|
||||
- name: Set up JDK 21
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '21'
|
||||
distribution: 'temurin'
|
||||
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
with:
|
||||
cache-read-only: false
|
||||
gradle-home-cache-cleanup: true
|
||||
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew :hideout-core:detektMain :hideout-mastodon:detektMain
|
||||
- name: Lint
|
||||
run: ./gradlew :hideout:detekt :owl:detektMain
|
||||
|
||||
- name: Auto Commit
|
||||
if: ${{ always() }}
|
||||
|
||||
+3
-2
@@ -42,11 +42,12 @@ out/
|
||||
/tomcat/
|
||||
/tomcat-e2e/
|
||||
/e2eTest.log
|
||||
/files/
|
||||
|
||||
*.log
|
||||
/hideout-core/files/
|
||||
/hideout-core/.kotlin/sessions/
|
||||
/hideout-mastodon/.kotlin/sessions/
|
||||
/http-client.private.env.json
|
||||
/logs/
|
||||
**/logs/
|
||||
/hideout-mastodon/logs/
|
||||
**/files/
|
||||
|
||||
@@ -1,75 +1,3 @@
|
||||
# Hideout
|
||||
|
||||
HideoutはMastodon互換APIを備えたSNSで、ActivityPubに対応し、KotlinとSpring Frameworkを使用して制作されているソフトウェアです。現在は開発中で、SNSとして主要な機能を備えていますが、セキュリティの問題や不安定なテーブル定義などがあるためホストすることはおすすめしません。
|
||||
|
||||
## 特徴
|
||||
|
||||
### ActivityPubでつながるネットワーク
|
||||
|
||||
ActivityPubを実装しているためMastodonやMisskey、Pleromaとつながることができます。また、ActivityPub以外の分散型の通信プロトコルを実装することがあるかもしれません。
|
||||
|
||||
### Mastodon互換API
|
||||
|
||||
OAuth2プロバイダーを含めたほとんどのAPIがMastodonとの互換性を持っているため、既存のMastodon クライアントを使用することができます!また、今後Fedibirdやglitch-soc互換のAPIを実装するかもしれません。
|
||||
|
||||
## セルフホスト
|
||||
|
||||
> [!CAUTION]
|
||||
> **免責事項**
|
||||
>
|
||||
> 本ソフトウェアを利用して発生したすべての事象に対して開発者は責任を負いません。
|
||||
> 本ソフトウェアはApache License 2.0を採用しています。
|
||||
|
||||
現時点でセルフホストはおすすめしませんが、実験用としてホストすることはできます!
|
||||
|
||||
### 使用技術
|
||||
|
||||
- **Kotlin** 強力な言語機能でアプリケーションの安全性を高めます。
|
||||
- **Spring Framework** (Spring Boot/Spring Security/Spring Web/Spring Data) 豊富な機能と堅牢なライブラリでソフトウェアの基幹部分を担います。
|
||||
- **OpenAPI** スキーマファーストのエンドポイント自動生成はAPIの安定性を高めます。
|
||||
|
||||
### 要件
|
||||
|
||||
#### 起動
|
||||
|
||||
- Java 21
|
||||
- PostgreSQL 12+
|
||||
- MongoDB(必須でない) 4.4.x+
|
||||
|
||||
#### ビルド
|
||||
|
||||
- Java 21
|
||||
- Gradle 8+
|
||||
|
||||
実験用途として、PostgreSQLはH2DB(バンドル)のPostgreSQL互換モードでも問題ありません。
|
||||
|
||||
Java 17でもビルド/起動ができますが、サポートしません。
|
||||
|
||||
MongoDBを使用しない場合、構成で`hideout.use-mongodb`をfalseにする必要があります。
|
||||
|
||||
### ビルド
|
||||
|
||||
今後のリリースでビルド済みjarなどを使う場合はスキップしてください。
|
||||
|
||||
|
||||
```bash
|
||||
gradle bootJar
|
||||
```
|
||||
|
||||
`build/libs/hideout-x.x.x.jar`が生成されます。
|
||||
|
||||
### 起動
|
||||
|
||||
適切に設定した`application-dev.yml`などをクラスパス上に準備します。
|
||||
|
||||
`dev`は`prod`などに置き換えたり、[複数指定すること](https://spring.pleiades.io/spring-boot/docs/current/reference/html/application-properties.html#application-properties.core.spring.profiles.active)もできます。
|
||||
|
||||
```bash
|
||||
java -jar build/libs/hideout-x.x.x.jar --spring.profiles.active=dev
|
||||
```
|
||||
|
||||
https://spring.pleiades.io/spring-boot/docs/current/reference/html/getting-started.html#getting-started.first-application.executable-jar.gradle
|
||||
|
||||
### 注意事項
|
||||
|
||||
本ソフトウェアは開発中です。正常に機能しない場合があります。また、連合先に迷惑をかける事になる可能性があります。DB/設定ファイル/その他リソースなどの利用方法に破壊的な変更が入る可能性があります。
|
||||
ActivityPubで繋がれるSNSを目指している
|
||||
@@ -14,51 +14,4 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.kotlin.jvm)
|
||||
alias(libs.plugins.spring.boot)
|
||||
alias(libs.plugins.kotlin.spring)
|
||||
}
|
||||
|
||||
apply {
|
||||
plugin("io.spring.dependency-management")
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
url = uri("https://git.usbharu.dev/api/packages/usbharu/maven")
|
||||
}
|
||||
maven {
|
||||
name = "GitHubPackages"
|
||||
url = uri("https://maven.pkg.github.com/usbharu/http-signature")
|
||||
credentials {
|
||||
|
||||
username = project.findProperty("gpr.user") as String? ?: System.getenv("USERNAME")
|
||||
password = project.findProperty("gpr.key") as String? ?: System.getenv("TOKEN")
|
||||
}
|
||||
}
|
||||
maven {
|
||||
name = "GitHubPackages2"
|
||||
url = uri("https://maven.pkg.github.com/multim-dev/emoji-kt")
|
||||
credentials {
|
||||
|
||||
username = project.findProperty("gpr.user") as String? ?: System.getenv("USERNAME")
|
||||
password = project.findProperty("gpr.key") as String? ?: System.getenv("TOKEN")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("dev.usbharu:hideout-core:0.0.1")
|
||||
implementation("dev.usbharu:hideout-mastodon:1.0-SNAPSHOT")
|
||||
}
|
||||
|
||||
tasks.register("run") {
|
||||
dependsOn(gradle.includedBuild("hideout-core").task(":run"))
|
||||
}
|
||||
|
||||
springBoot {
|
||||
mainClass = "dev.usbharu.hideout.SpringApplicationKt"
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
version: "3"
|
||||
|
||||
services:
|
||||
db:
|
||||
image: postgres:17
|
||||
ports:
|
||||
- "5432:5432"
|
||||
environment:
|
||||
POSTGRES_USER: "postgres"
|
||||
POSTGRES_PASSWORD: "password"
|
||||
POSTGRES_DB: "hideout"
|
||||
|
||||
mongodb:
|
||||
image: mongo:8.0.12
|
||||
ports:
|
||||
- "27017:27017"
|
||||
|
||||
elasticsearch:
|
||||
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.29
|
||||
container_name: elasticsearch
|
||||
environment:
|
||||
- discovery.type=single-node
|
||||
- cluster.name=docker-cluster
|
||||
- bootstrap.memory_lock=true
|
||||
- xpack.security.enabled=true
|
||||
- xpack.monitoring.collection.enabled=true
|
||||
- ELASTIC_PASSWORD=Passw0rd
|
||||
- "ES_JAVA_OPTS=-Xms512M -Xmx512M"
|
||||
ports:
|
||||
- "9200:9200"
|
||||
volumes:
|
||||
- elasticsearch-data:/usr/share/elasticsearch/data
|
||||
kibana:
|
||||
image: docker.elastic.co/kibana/kibana:7.17.29
|
||||
container_name: kibana
|
||||
ports:
|
||||
- "5601:5601"
|
||||
environment:
|
||||
- ELASTICSEARCH_URL=http://elasticsearch:9200
|
||||
- ELASTICSEARCH_USERNAME=elastic
|
||||
- ELASTICSEARCH_PASSWORD=Passw0rd
|
||||
depends_on:
|
||||
- elasticsearch
|
||||
|
||||
fluentd:
|
||||
build: ./fluentd
|
||||
volumes:
|
||||
- ./fluentd/conf:/fluentd/etc
|
||||
- ../logs:/in
|
||||
depends_on:
|
||||
- "elasticsearch"
|
||||
ports:
|
||||
- "24224:24224"
|
||||
- "24224:24224/udp"
|
||||
|
||||
volumes:
|
||||
elasticsearch-data:
|
||||
driver: local
|
||||
@@ -0,0 +1,4 @@
|
||||
FROM fluent/fluentd:v1.16-debian-2
|
||||
USER root
|
||||
RUN fluent-gem install fluent-plugin-elasticsearch --no-document
|
||||
USER fluent
|
||||
@@ -0,0 +1,22 @@
|
||||
<source>
|
||||
@type tail
|
||||
path /in/logFile.log.json
|
||||
pos_file /in/logFile.pos
|
||||
tag hideout
|
||||
<parse>
|
||||
@type json
|
||||
</parse>
|
||||
</source>
|
||||
|
||||
<match hideout>
|
||||
@type elasticsearch
|
||||
host elasticsearch
|
||||
include_tag_key true
|
||||
port 9200
|
||||
include_timestamp true
|
||||
user elastic
|
||||
password Passw0rd
|
||||
logstash_format true
|
||||
logstash_prefix hideout
|
||||
flush_interval 10s
|
||||
</match>
|
||||
@@ -1,16 +0,0 @@
|
||||
version: "3"
|
||||
|
||||
services:
|
||||
db:
|
||||
image: postgres:16
|
||||
ports:
|
||||
- "5432:5432"
|
||||
environment:
|
||||
POSTGRES_USER: "postgres"
|
||||
POSTGRES_PASSWORD: "password"
|
||||
POSTGRES_DB: "hideout"
|
||||
|
||||
mongodb:
|
||||
image: mongo:7.0.14
|
||||
ports:
|
||||
- "27017:27017"
|
||||
+2
-1
@@ -1,4 +1,5 @@
|
||||
org.gradle.parallel=true
|
||||
org.gradle.configureondemand=true
|
||||
org.gradle.caching=true
|
||||
org.gradle.jvmargs=-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC --add-opens=java.base/java.util.concurrent.locks=ALL-UNNAMED
|
||||
org.gradle.jvmargs=-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC --add-opens=java.base/java.util.concurrent.locks=ALL-UNNAMED
|
||||
kotlin.compiler.preciseCompilationResultsBackup=true
|
||||
Vendored
BIN
Binary file not shown.
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -86,8 +86,7 @@ done
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
|
||||
' "$PWD" ) || exit
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
@@ -115,7 +114,7 @@ case "$( uname )" in #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
CLASSPATH="\\\"\\\""
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
@@ -206,7 +205,7 @@ fi
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
@@ -214,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
|
||||
Vendored
+2
-2
@@ -70,11 +70,11 @@ goto fail
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
set CLASSPATH=
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
plugins {
|
||||
kotlin("jvm") version "1.9.25"
|
||||
}
|
||||
|
||||
group = "dev.usbharu"
|
||||
version = "1.0-SNAPSHOT"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testImplementation(kotlin("test"))
|
||||
}
|
||||
|
||||
tasks.test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
kotlin {
|
||||
jvmToolchain(21)
|
||||
}
|
||||
Binary file not shown.
@@ -1,7 +0,0 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -1,5 +0,0 @@
|
||||
plugins {
|
||||
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
|
||||
}
|
||||
rootProject.name = "hideout-activitypub"
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
package dev.usbharu
|
||||
|
||||
fun main() {
|
||||
println("Hello World!")
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2024 usbharu
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
kotlin.code.style=official
|
||||
org.gradle.parallel=true
|
||||
org.gradle.configureondemand=true
|
||||
org.gradle.caching=true
|
||||
org.gradle.jvmargs=-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC
|
||||
BIN
Binary file not shown.
Vendored
-252
@@ -1,252 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||
# noncompliant, but you have some other compliant shell such as ksh or
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||
#
|
||||
# The "traditional" practice of packing multiple parameters into a
|
||||
# space-separated string is a well documented source of bugs and security
|
||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||
# options in "$@", and eventually passing that to Java.
|
||||
#
|
||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||
# see the in-line comments for details.
|
||||
#
|
||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
|
||||
# Resolve links: $0 may be a link
|
||||
app_path=$0
|
||||
|
||||
# Need this for daisy-chained symlinks.
|
||||
while
|
||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||
[ -h "$app_path" ]
|
||||
do
|
||||
ls=$( ls -ld "$app_path" )
|
||||
link=${ls#*' -> '}
|
||||
case $link in #(
|
||||
/*) app_path=$link ;; #(
|
||||
*) app_path=$APP_HOME$link ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
|
||||
' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
} >&2
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
} >&2
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "$( uname )" in #(
|
||||
CYGWIN* ) cygwin=true ;; #(
|
||||
Darwin* ) darwin=true ;; #(
|
||||
MSYS* | MINGW* ) msys=true ;; #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||
else
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command, stacking in reverse order:
|
||||
# * args from the command line
|
||||
# * the main class name
|
||||
# * -classpath
|
||||
# * -D...appname settings
|
||||
# * --module-path (only if needed)
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
for arg do
|
||||
if
|
||||
case $arg in #(
|
||||
-*) false ;; # don't mess with options #(
|
||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||
[ -e "$t" ] ;; #(
|
||||
*) false ;;
|
||||
esac
|
||||
then
|
||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||
fi
|
||||
# Roll the args list around exactly as many times as the number of
|
||||
# args, so each arg winds up back in the position where it started, but
|
||||
# possibly modified.
|
||||
#
|
||||
# NB: a `for` loop captures its iteration list before it begins, so
|
||||
# changing the positional parameters here affects neither the number of
|
||||
# iterations, nor the values presented in `arg`.
|
||||
shift # remove old arg
|
||||
set -- "$@" "$arg" # push replacement arg
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
#
|
||||
# In Bash we could simply go:
|
||||
#
|
||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||
# set -- "${ARGS[@]}" "$@"
|
||||
#
|
||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||
# character that might be a shell metacharacter, then use eval to reverse
|
||||
# that process (while maintaining the separation between arguments), and wrap
|
||||
# the whole thing up as a single "set" statement.
|
||||
#
|
||||
# This will of course break if any of these variables contains a newline or
|
||||
# an unmatched quote.
|
||||
#
|
||||
|
||||
eval "set -- $(
|
||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||
xargs -n1 |
|
||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||
tr '\n' ' '
|
||||
)" '"$@"'
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
Vendored
-94
@@ -1,94 +0,0 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
@rem SPDX-License-Identifier: Apache-2.0
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@rem This is normally unused
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
@@ -1,22 +0,0 @@
|
||||
plugins {
|
||||
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
|
||||
}
|
||||
rootProject.name = "hideout-core"
|
||||
|
||||
//ローカルで変更した時、リリースまではアンコメント リリース後はコメントアウト
|
||||
//includeBuild("../owl")
|
||||
|
||||
dependencyResolutionManagement {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
url = uri("https://git.usbharu.dev/api/packages/usbharu/maven")
|
||||
}
|
||||
}
|
||||
|
||||
versionCatalogs {
|
||||
create("libs") {
|
||||
from(files("../libs.versions.toml"))
|
||||
}
|
||||
}
|
||||
}
|
||||
-38
@@ -1,38 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.actor
|
||||
|
||||
import dev.usbharu.hideout.core.domain.model.actor.Actor
|
||||
import java.net.URI
|
||||
|
||||
data class ActorDetail(
|
||||
val id: Long,
|
||||
val name: String,
|
||||
val screenName: String,
|
||||
val host: String,
|
||||
val remoteUrl: String?,
|
||||
val locked: Boolean,
|
||||
val description: String,
|
||||
val postsCount: Int,
|
||||
val iconUrl: URI?,
|
||||
val bannerURL: URI?,
|
||||
val followingCount: Int?,
|
||||
val followersCount: Int?,
|
||||
) {
|
||||
companion object {
|
||||
fun of(actor: Actor, iconUrl: URI?, bannerURL: URI?): ActorDetail {
|
||||
return ActorDetail(
|
||||
id = actor.id.id,
|
||||
name = actor.name.name,
|
||||
screenName = actor.screenName.screenName,
|
||||
host = actor.url.host,
|
||||
remoteUrl = actor.url.toString(),
|
||||
locked = actor.locked,
|
||||
description = actor.description.description,
|
||||
postsCount = actor.postsCount.postsCount,
|
||||
iconUrl = iconUrl,
|
||||
bannerURL = bannerURL,
|
||||
followingCount = actor.followingCount?.relationshipCount,
|
||||
followersCount = actor.followersCount?.relationshipCount,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.actor
|
||||
|
||||
import dev.usbharu.hideout.core.domain.model.actor.ActorId
|
||||
|
||||
data class DeleteLocalActor(val actorId: ActorId)
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.actor
|
||||
|
||||
import dev.usbharu.hideout.core.domain.model.support.acct.Acct
|
||||
|
||||
data class GetActorDetail(
|
||||
val actorName: Acct? = null,
|
||||
val id: Long? = null
|
||||
)
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.actor
|
||||
|
||||
data class MigrationLocalActor(val from: Long, val to: Long)
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.actor
|
||||
|
||||
import org.springframework.stereotype.Service
|
||||
|
||||
@Service
|
||||
interface SetAlsoKnownAsLocalActorApplicationService {
|
||||
suspend fun setAlsoKnownAs(actorId: Long, alsoKnownAs: List<Long>)
|
||||
}
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.actor
|
||||
|
||||
data class SuspendLocalActor(val actorId: Long)
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.actor
|
||||
|
||||
data class UnsuspendLocalActor(val actorId: Long)
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.domainevent.subscribers
|
||||
|
||||
import dev.usbharu.hideout.core.domain.shared.domainevent.DomainEvent
|
||||
import dev.usbharu.hideout.core.domain.shared.domainevent.DomainEventBody
|
||||
|
||||
interface DomainEventSubscriber {
|
||||
fun <T : DomainEventBody> subscribe(eventName: String, domainEventConsumer: DomainEventConsumer<T>)
|
||||
}
|
||||
|
||||
typealias DomainEventConsumer<T> = suspend (DomainEvent<T>) -> Unit
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.domainevent.subscribers
|
||||
|
||||
data class RegisterHomeTimeline(
|
||||
val userDetailId: Long
|
||||
)
|
||||
-21
@@ -1,21 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.domainevent.subscribers
|
||||
|
||||
import dev.usbharu.hideout.core.domain.event.userdetail.UserDetailEvent
|
||||
import dev.usbharu.hideout.core.domain.event.userdetail.UserDetailEventBody
|
||||
import dev.usbharu.hideout.core.domain.model.support.principal.Anonymous
|
||||
import org.springframework.stereotype.Component
|
||||
|
||||
@Component
|
||||
class RegisterLocalUserSetHomeTimelineSubscriber(
|
||||
private val domainEventSubscriber: DomainEventSubscriber,
|
||||
private val userRegisterHomeTimelineApplicationService: UserRegisterHomeTimelineApplicationService
|
||||
) : Subscriber {
|
||||
override fun init() {
|
||||
domainEventSubscriber.subscribe<UserDetailEventBody>(UserDetailEvent.CREATE.eventName) {
|
||||
userRegisterHomeTimelineApplicationService.execute(
|
||||
RegisterHomeTimeline(it.body.getUserDetail().id),
|
||||
Anonymous
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
-21
@@ -1,21 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.domainevent.subscribers
|
||||
|
||||
import dev.usbharu.hideout.core.application.timeline.SetTimelineToTimelineStoreApplicationService
|
||||
import dev.usbharu.hideout.core.application.timeline.SetTimleineStore
|
||||
import dev.usbharu.hideout.core.domain.event.timeline.TimelineEvent
|
||||
import dev.usbharu.hideout.core.domain.event.timeline.TimelineEventBody
|
||||
import dev.usbharu.hideout.core.domain.model.support.principal.Anonymous
|
||||
import org.springframework.stereotype.Component
|
||||
|
||||
@Component
|
||||
class RegisterTimelineSetTimelineStoreSubscriber(
|
||||
private val domainEventSubscriber: DomainEventSubscriber,
|
||||
private val setTimelineToTimelineStoreApplicationService: SetTimelineToTimelineStoreApplicationService
|
||||
) : Subscriber {
|
||||
|
||||
override fun init() {
|
||||
domainEventSubscriber.subscribe<TimelineEventBody>(TimelineEvent.CREATE.eventName) {
|
||||
setTimelineToTimelineStoreApplicationService.execute(SetTimleineStore(it.body.getTimelineId()), Anonymous)
|
||||
}
|
||||
}
|
||||
}
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.domainevent.subscribers
|
||||
|
||||
interface Subscriber {
|
||||
fun init()
|
||||
}
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.domainevent.subscribers
|
||||
|
||||
import org.springframework.boot.ApplicationArguments
|
||||
import org.springframework.boot.ApplicationRunner
|
||||
import org.springframework.stereotype.Component
|
||||
|
||||
@Component
|
||||
class SubscriberRunner(private val subscribers: List<Subscriber>) : ApplicationRunner {
|
||||
override fun run(args: ApplicationArguments?) {
|
||||
subscribers.forEach { it.init() }
|
||||
}
|
||||
}
|
||||
-20
@@ -1,20 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.domainevent.subscribers
|
||||
|
||||
import dev.usbharu.hideout.core.application.timeline.AddPost
|
||||
import dev.usbharu.hideout.core.application.timeline.TimelineAddPostApplicationService
|
||||
import dev.usbharu.hideout.core.domain.event.post.PostEvent
|
||||
import dev.usbharu.hideout.core.domain.event.post.PostEventBody
|
||||
import dev.usbharu.hideout.core.domain.model.support.principal.Anonymous
|
||||
import org.springframework.stereotype.Component
|
||||
|
||||
@Component
|
||||
class TimelinePostCreateSubscriber(
|
||||
private val timelineAddPostApplicationService: TimelineAddPostApplicationService,
|
||||
private val domainEventSubscriber: DomainEventSubscriber,
|
||||
) : Subscriber {
|
||||
override fun init() {
|
||||
domainEventSubscriber.subscribe<PostEventBody>(PostEvent.CREATE.eventName) {
|
||||
timelineAddPostApplicationService.execute(AddPost(it.body.getPostId()), Anonymous)
|
||||
}
|
||||
}
|
||||
}
|
||||
-45
@@ -1,45 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.domainevent.subscribers
|
||||
|
||||
import dev.usbharu.hideout.core.application.exception.InternalServerException
|
||||
import dev.usbharu.hideout.core.application.timeline.AddTimelineRelationship
|
||||
import dev.usbharu.hideout.core.application.timeline.UserAddTimelineRelationshipApplicationService
|
||||
import dev.usbharu.hideout.core.domain.event.relationship.RelationshipEvent
|
||||
import dev.usbharu.hideout.core.domain.event.relationship.RelationshipEventBody
|
||||
import dev.usbharu.hideout.core.domain.model.timelinerelationship.Visible
|
||||
import dev.usbharu.hideout.core.domain.model.userdetails.UserDetailRepository
|
||||
import org.slf4j.LoggerFactory
|
||||
import org.springframework.stereotype.Component
|
||||
|
||||
@Component
|
||||
class TimelineRelationshipFollowSubscriber(
|
||||
private val userAddTimelineRelationshipApplicationService: UserAddTimelineRelationshipApplicationService,
|
||||
private val userDetailRepository: UserDetailRepository,
|
||||
private val domainEventSubscriber: DomainEventSubscriber
|
||||
) : Subscriber {
|
||||
|
||||
override fun init() {
|
||||
domainEventSubscriber.subscribe<RelationshipEventBody>(RelationshipEvent.ACCEPT_FOLLOW.eventName) {
|
||||
val relationship = it.body.getRelationship()
|
||||
val userDetail = userDetailRepository.findByActorId(relationship.actorId.id)
|
||||
?: throw InternalServerException("Userdetail ${relationship.actorId} not found by actorid.")
|
||||
if (userDetail.homeTimelineId == null) {
|
||||
logger.warn("Home timeline for ${relationship.actorId} is not found")
|
||||
return@subscribe
|
||||
}
|
||||
|
||||
@Suppress("UnsafeCallOnNullableType")
|
||||
userAddTimelineRelationshipApplicationService.execute(
|
||||
AddTimelineRelationship(
|
||||
userDetail.homeTimelineId!!,
|
||||
relationship.targetActorId,
|
||||
Visible.FOLLOWERS
|
||||
),
|
||||
it.body.principal
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val logger = LoggerFactory.getLogger(TimelineRelationshipFollowSubscriber::class.java)
|
||||
}
|
||||
}
|
||||
-46
@@ -1,46 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.domainevent.subscribers
|
||||
|
||||
import dev.usbharu.hideout.core.application.timeline.RemoveTimelineRelationship
|
||||
import dev.usbharu.hideout.core.application.timeline.UserRemoveTimelineRelationshipApplicationService
|
||||
import dev.usbharu.hideout.core.domain.event.relationship.RelationshipEvent
|
||||
import dev.usbharu.hideout.core.domain.event.relationship.RelationshipEventBody
|
||||
import dev.usbharu.hideout.core.domain.model.timelinerelationship.TimelineRelationshipRepository
|
||||
import dev.usbharu.hideout.core.domain.model.userdetails.UserDetailRepository
|
||||
import org.slf4j.LoggerFactory
|
||||
import org.springframework.stereotype.Component
|
||||
|
||||
@Component
|
||||
class TimelineRelationshipUnfollowSubscriber(
|
||||
private val domainEventSubscriber: DomainEventSubscriber,
|
||||
private val userRemoveTimelineRelationshipApplicationService: UserRemoveTimelineRelationshipApplicationService,
|
||||
private val userDetailRepository: UserDetailRepository,
|
||||
private val timelineRelationshipRepository: TimelineRelationshipRepository,
|
||||
) : Subscriber {
|
||||
override fun init() {
|
||||
domainEventSubscriber.subscribe<RelationshipEventBody>(RelationshipEvent.UNFOLLOW.eventName) {
|
||||
val relationship = it.body.getRelationship()
|
||||
val userDetail = userDetailRepository.findByActorId(relationship.actorId.id) ?: throw IllegalStateException(
|
||||
"UserDetail ${relationship.actorId} not found by actorId."
|
||||
)
|
||||
if (userDetail.homeTimelineId == null) {
|
||||
logger.warn("HomeTimeline for ${userDetail.id} not found.")
|
||||
return@subscribe
|
||||
}
|
||||
|
||||
val timelineRelationship = timelineRelationshipRepository.findByTimelineIdAndActorId(
|
||||
userDetail.homeTimelineId!!,
|
||||
relationship.targetActorId
|
||||
)
|
||||
?: throw IllegalStateException("TimelineRelationship ${userDetail.homeTimelineId} to ${relationship.targetActorId} not found by timelineId and ActorId")
|
||||
|
||||
userRemoveTimelineRelationshipApplicationService.execute(
|
||||
RemoveTimelineRelationship(timelineRelationship.id),
|
||||
it.body.principal
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val logger = LoggerFactory.getLogger(TimelineRelationshipUnfollowSubscriber::class.java)
|
||||
}
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.exception
|
||||
|
||||
class InternalServerException : RuntimeException {
|
||||
constructor() : super()
|
||||
constructor(message: String?) : super(message)
|
||||
constructor(message: String?, cause: Throwable?) : super(message, cause)
|
||||
constructor(cause: Throwable?) : super(cause)
|
||||
constructor(message: String?, cause: Throwable?, enableSuppression: Boolean, writableStackTrace: Boolean) : super(
|
||||
message,
|
||||
cause,
|
||||
enableSuppression,
|
||||
writableStackTrace
|
||||
)
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.exception
|
||||
|
||||
class PermissionDeniedException : RuntimeException {
|
||||
constructor() : super()
|
||||
constructor(message: String?) : super(message)
|
||||
constructor(message: String?, cause: Throwable?) : super(message, cause)
|
||||
constructor(cause: Throwable?) : super(cause)
|
||||
constructor(message: String?, cause: Throwable?, enableSuppression: Boolean, writableStackTrace: Boolean) : super(
|
||||
message,
|
||||
cause,
|
||||
enableSuppression,
|
||||
writableStackTrace
|
||||
)
|
||||
}
|
||||
-17
@@ -1,17 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.instance
|
||||
|
||||
import dev.usbharu.hideout.core.domain.model.instance.Instance
|
||||
import java.net.URI
|
||||
|
||||
data class Instance(val id: Long, val name: String, val url: URI, val description: String) {
|
||||
companion object {
|
||||
fun of(instance: Instance): dev.usbharu.hideout.core.application.instance.Instance {
|
||||
return Instance(
|
||||
instance.id.instanceId,
|
||||
instance.name.name,
|
||||
instance.url,
|
||||
instance.description.description
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2024 usbharu
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package dev.usbharu.hideout.core.application.media
|
||||
|
||||
import dev.usbharu.hideout.core.domain.model.media.FileType
|
||||
import dev.usbharu.hideout.core.domain.model.media.Media
|
||||
import dev.usbharu.hideout.core.domain.model.media.MimeType
|
||||
import java.net.URI
|
||||
|
||||
data class Media(
|
||||
val id: Long,
|
||||
val name: String,
|
||||
val url: URI,
|
||||
val thumbprintURI: URI?,
|
||||
val remoteURL: URI?,
|
||||
val type: FileType,
|
||||
val mimeType: MimeType,
|
||||
val blurHash: String?,
|
||||
val description: String?
|
||||
) {
|
||||
companion object {
|
||||
fun of(media: Media): dev.usbharu.hideout.core.application.media.Media {
|
||||
return Media(
|
||||
id = media.id.id,
|
||||
name = media.name.name,
|
||||
url = media.url,
|
||||
thumbprintURI = media.thumbnailUrl,
|
||||
remoteURL = media.remoteUrl,
|
||||
type = media.type,
|
||||
mimeType = media.mimeType,
|
||||
blurHash = media.blurHash?.hash,
|
||||
description = media.description?.description
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.post
|
||||
|
||||
import dev.usbharu.hideout.core.domain.model.actor.Actor
|
||||
import dev.usbharu.hideout.core.domain.model.media.Media
|
||||
import java.net.URI
|
||||
|
||||
data class ActorDetail(
|
||||
val actorId: Long,
|
||||
val instanceId: Long,
|
||||
val name: String,
|
||||
val domain: String,
|
||||
val screenName: String,
|
||||
val url: URI,
|
||||
val locked: Boolean,
|
||||
val icon: URI?,
|
||||
) {
|
||||
companion object {
|
||||
fun of(actor: Actor, iconMedia: Media?): ActorDetail {
|
||||
return ActorDetail(
|
||||
actorId = actor.id.id,
|
||||
instanceId = actor.instance.instanceId,
|
||||
name = actor.name.name,
|
||||
domain = actor.domain.domain,
|
||||
screenName = actor.screenName.screenName,
|
||||
url = actor.url,
|
||||
locked = actor.locked,
|
||||
icon = iconMedia?.url
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.post
|
||||
|
||||
data class DeleteLocalPost(val postId: Long)
|
||||
-48
@@ -1,48 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2024 usbharu
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package dev.usbharu.hideout.core.application.post
|
||||
|
||||
import dev.usbharu.hideout.core.application.exception.PermissionDeniedException
|
||||
import dev.usbharu.hideout.core.application.shared.AbstractApplicationService
|
||||
import dev.usbharu.hideout.core.application.shared.Transaction
|
||||
import dev.usbharu.hideout.core.domain.model.post.PostId
|
||||
import dev.usbharu.hideout.core.domain.model.post.PostRepository
|
||||
import dev.usbharu.hideout.core.domain.model.support.principal.Principal
|
||||
import dev.usbharu.hideout.core.domain.service.post.IPostReadAccessControl
|
||||
import org.slf4j.LoggerFactory
|
||||
import org.springframework.stereotype.Service
|
||||
|
||||
@Service
|
||||
class GetPostApplicationService(
|
||||
private val postRepository: PostRepository,
|
||||
private val iPostReadAccessControl: IPostReadAccessControl,
|
||||
transaction: Transaction
|
||||
) :
|
||||
AbstractApplicationService<GetPost, Post>(transaction, logger) {
|
||||
|
||||
override suspend fun internalExecute(command: GetPost, principal: Principal): Post {
|
||||
val post = postRepository.findById(PostId(command.postId)) ?: throw IllegalArgumentException("Post not found")
|
||||
if (iPostReadAccessControl.isAllow(post, principal).not()) {
|
||||
throw PermissionDeniedException()
|
||||
}
|
||||
return Post.of(post)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val logger = LoggerFactory.getLogger(GetPostApplicationService::class.java)
|
||||
}
|
||||
}
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.post
|
||||
|
||||
data class GetPostDetail(val postId: Long)
|
||||
@@ -1,58 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2024 usbharu
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package dev.usbharu.hideout.core.application.post
|
||||
|
||||
import dev.usbharu.hideout.core.domain.model.post.Post
|
||||
import dev.usbharu.hideout.core.domain.model.post.Visibility
|
||||
import java.net.URI
|
||||
import java.time.Instant
|
||||
|
||||
data class Post(
|
||||
val id: Long,
|
||||
val actorId: Long,
|
||||
val overview: String?,
|
||||
val text: String,
|
||||
val content: String,
|
||||
val createdAt: Instant,
|
||||
val visibility: Visibility,
|
||||
val url: URI,
|
||||
val repostId: Long?,
|
||||
val replyId: Long?,
|
||||
val sensitive: Boolean,
|
||||
val mediaIds: List<Long>,
|
||||
val moveTo: Long?,
|
||||
) {
|
||||
companion object {
|
||||
fun of(post: Post): dev.usbharu.hideout.core.application.post.Post {
|
||||
return Post(
|
||||
id = post.id.id,
|
||||
actorId = post.actorId.id,
|
||||
overview = post.overview?.overview,
|
||||
text = post.text,
|
||||
content = post.content.content,
|
||||
createdAt = post.createdAt,
|
||||
visibility = post.visibility,
|
||||
url = post.url,
|
||||
repostId = post.repostId?.id,
|
||||
replyId = post.replyId?.id,
|
||||
sensitive = post.sensitive,
|
||||
mediaIds = post.mediaIds.map { it.id },
|
||||
moveTo = post.moveTo?.id
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
-29
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2024 usbharu
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package dev.usbharu.hideout.core.application.post
|
||||
|
||||
import dev.usbharu.hideout.core.domain.model.post.Visibility
|
||||
|
||||
data class RegisterLocalPost(
|
||||
val content: String,
|
||||
val overview: String?,
|
||||
val visibility: Visibility,
|
||||
val repostId: Long?,
|
||||
val replyId: Long?,
|
||||
val sensitive: Boolean,
|
||||
val mediaIds: List<Long>,
|
||||
)
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2024 usbharu
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package dev.usbharu.hideout.core.application.post
|
||||
|
||||
data class UpdateLocalNote(
|
||||
val postId: Long,
|
||||
val overview: String?,
|
||||
val content: String,
|
||||
val sensitive: Boolean,
|
||||
val mediaIds: List<Long>
|
||||
)
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.reaction
|
||||
|
||||
data class CreateReaction(val postId: Long, val customEmojiId: Long?, val unicodeEmoji: String)
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.reaction
|
||||
|
||||
data class RemoveReaction(
|
||||
val postId: Long,
|
||||
val customEmojiId: Long?,
|
||||
val unicodeEmoji: String
|
||||
)
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2024 usbharu
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package dev.usbharu.hideout.core.application.relationship.acceptfollowrequest
|
||||
|
||||
data class AcceptFollowRequest(val sourceActorId: Long)
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2024 usbharu
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package dev.usbharu.hideout.core.application.relationship.block
|
||||
|
||||
data class Block(val targetActorId: Long)
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2024 usbharu
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package dev.usbharu.hideout.core.application.relationship.followrequest
|
||||
|
||||
data class FollowRequest(val targetActorId: Long)
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2024 usbharu
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package dev.usbharu.hideout.core.application.relationship.get
|
||||
|
||||
data class GetRelationship(val targetActorId: Long)
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2024 usbharu
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package dev.usbharu.hideout.core.application.relationship.mute
|
||||
|
||||
data class Mute(val targetActorId: Long)
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2024 usbharu
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package dev.usbharu.hideout.core.application.relationship.rejectfollowrequest
|
||||
|
||||
data class RejectFollowRequest(val sourceActorId: Long)
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2024 usbharu
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package dev.usbharu.hideout.core.application.relationship.removefromfollowers
|
||||
|
||||
data class RemoveFromFollowers(val targetActorId: Long)
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2024 usbharu
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package dev.usbharu.hideout.core.application.relationship.unblock
|
||||
|
||||
data class Unblock(val targetActorId: Long)
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2024 usbharu
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package dev.usbharu.hideout.core.application.relationship.unfollow
|
||||
|
||||
data class Unfollow(val targetActorId: Long)
|
||||
@@ -1,5 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.timeline
|
||||
|
||||
import dev.usbharu.hideout.core.domain.model.post.PostId
|
||||
|
||||
data class AddPost(val postId: PostId)
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.timeline
|
||||
|
||||
import dev.usbharu.hideout.core.domain.model.actor.ActorId
|
||||
import dev.usbharu.hideout.core.domain.model.timeline.TimelineId
|
||||
import dev.usbharu.hideout.core.domain.model.timelinerelationship.Visible
|
||||
|
||||
data class AddTimelineRelationship(
|
||||
val timelineId: TimelineId,
|
||||
val actorId: ActorId,
|
||||
val visible: Visible
|
||||
)
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.timeline
|
||||
|
||||
data class GetTimelines(val userDetailId: Long)
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.timeline
|
||||
|
||||
import dev.usbharu.hideout.core.domain.model.support.page.Page
|
||||
|
||||
data class GetUserTimeline(val id: Long, val page: Page)
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.timeline
|
||||
|
||||
import dev.usbharu.hideout.core.domain.model.support.page.Page
|
||||
|
||||
data class ReadTimeline(
|
||||
val timelineId: Long,
|
||||
val mediaOnly: Boolean,
|
||||
val localOnly: Boolean,
|
||||
val remoteOnly: Boolean,
|
||||
val page: Page
|
||||
)
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.timeline
|
||||
|
||||
import dev.usbharu.hideout.core.domain.model.timeline.TimelineVisibility
|
||||
|
||||
data class RegisterTimeline(
|
||||
val timelineName: String,
|
||||
val visibility: TimelineVisibility
|
||||
)
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.timeline
|
||||
|
||||
import dev.usbharu.hideout.core.domain.model.timelinerelationship.TimelineRelationshipId
|
||||
|
||||
data class RemoveTimelineRelationship(val timelineRelationshipId: TimelineRelationshipId)
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.timeline
|
||||
|
||||
import dev.usbharu.hideout.core.domain.model.timeline.TimelineId
|
||||
|
||||
data class SetTimleineStore(val timelineId: TimelineId)
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
package dev.usbharu.hideout.core.config
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties
|
||||
|
||||
@ConfigurationProperties("hideout.timeline.default")
|
||||
data class DefaultTimelineStoreConfig(
|
||||
val actorPostsCount: Int = 500
|
||||
)
|
||||
@@ -1,16 +0,0 @@
|
||||
package dev.usbharu.hideout.core.config
|
||||
|
||||
import org.springframework.boot.autoconfigure.flyway.FlywayMigrationStrategy
|
||||
import org.springframework.context.annotation.Bean
|
||||
import org.springframework.context.annotation.Configuration
|
||||
|
||||
@Configuration
|
||||
class FlywayConfig {
|
||||
@Bean
|
||||
fun cleanMigrateStrategy(): FlywayMigrationStrategy {
|
||||
return FlywayMigrationStrategy { migrate ->
|
||||
migrate.repair()
|
||||
migrate.migrate()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package dev.usbharu.hideout.core.config
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties
|
||||
|
||||
@ConfigurationProperties("hideout.media.image.imageio")
|
||||
data class ImageIOImageConfig(
|
||||
val thumbnailsWidth: Int = 1000,
|
||||
val thumbnailsHeight: Int = 1000,
|
||||
val format: String = "jpeg"
|
||||
)
|
||||
@@ -1,26 +0,0 @@
|
||||
package dev.usbharu.hideout.core.config
|
||||
|
||||
import org.springframework.boot.autoconfigure.context.MessageSourceProperties
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties
|
||||
import org.springframework.context.MessageSource
|
||||
import org.springframework.context.annotation.Bean
|
||||
import org.springframework.context.annotation.Configuration
|
||||
import org.springframework.context.annotation.Profile
|
||||
import org.springframework.context.support.ReloadableResourceBundleMessageSource
|
||||
|
||||
@Configuration
|
||||
@Profile("dev")
|
||||
class MessageSourceConfig {
|
||||
@Bean
|
||||
fun messageSource(messageSourceProperties: MessageSourceProperties): MessageSource {
|
||||
val reloadableResourceBundleMessageSource = ReloadableResourceBundleMessageSource()
|
||||
reloadableResourceBundleMessageSource.setBasename("classpath:" + messageSourceProperties.basename)
|
||||
reloadableResourceBundleMessageSource.setCacheSeconds(0)
|
||||
return reloadableResourceBundleMessageSource
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Profile("dev")
|
||||
@ConfigurationProperties(prefix = "spring.messages")
|
||||
fun messageSourceProperties(): MessageSourceProperties = MessageSourceProperties()
|
||||
}
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
package dev.usbharu.hideout.core.domain.model.filter
|
||||
|
||||
enum class FilterAction {
|
||||
WARN,
|
||||
HIDE
|
||||
}
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
package dev.usbharu.hideout.core.domain.model.filter
|
||||
|
||||
enum class FilterContext {
|
||||
HOME,
|
||||
NOTIFICATION,
|
||||
PUBLIC,
|
||||
THREAD,
|
||||
ACCOUNT
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package dev.usbharu.hideout.core.domain.model.filter
|
||||
|
||||
@JvmInline
|
||||
value class FilterId(val id: Long) {
|
||||
init {
|
||||
require(0 <= id)
|
||||
}
|
||||
}
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
package dev.usbharu.hideout.core.domain.model.filter
|
||||
|
||||
class FilterKeyword(
|
||||
val id: FilterKeywordId,
|
||||
var keyword: FilterKeywordKeyword,
|
||||
val mode: FilterMode
|
||||
)
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
package dev.usbharu.hideout.core.domain.model.filter
|
||||
|
||||
@JvmInline
|
||||
value class FilterKeywordId(val id: Long)
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
package dev.usbharu.hideout.core.domain.model.filter
|
||||
|
||||
@JvmInline
|
||||
value class FilterKeywordKeyword(val keyword: String)
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
package dev.usbharu.hideout.core.domain.model.filter
|
||||
|
||||
enum class FilterMode {
|
||||
WHOLE_WORD,
|
||||
REGEX,
|
||||
NONE
|
||||
}
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
package dev.usbharu.hideout.core.domain.model.filter
|
||||
|
||||
class FilterName(name: String) {
|
||||
|
||||
val name = name.take(LENGTH)
|
||||
|
||||
companion object {
|
||||
const val LENGTH = 300
|
||||
}
|
||||
}
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
package dev.usbharu.hideout.core.domain.model.filter
|
||||
|
||||
import dev.usbharu.hideout.core.domain.model.userdetails.UserDetailId
|
||||
|
||||
interface FilterRepository {
|
||||
suspend fun save(filter: Filter): Filter
|
||||
suspend fun delete(filter: Filter)
|
||||
|
||||
suspend fun findByFilterKeywordId(filterKeywordId: FilterKeywordId): Filter?
|
||||
suspend fun findByFilterId(filterId: FilterId): Filter?
|
||||
suspend fun findByUserDetailId(userDetailId: UserDetailId): List<Filter>
|
||||
}
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
package dev.usbharu.hideout.core.domain.model.filter
|
||||
|
||||
class FilterResult(val filter: Filter, val matchedKeyword: String)
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
package dev.usbharu.hideout.core.domain.model.filter
|
||||
|
||||
import dev.usbharu.hideout.core.domain.model.post.Post
|
||||
|
||||
class FilteredPost(val post: Post, val filterResults: List<FilterResult>)
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
package dev.usbharu.hideout.core.domain.model.followtimeline
|
||||
|
||||
import dev.usbharu.hideout.core.domain.model.timeline.TimelineId
|
||||
import dev.usbharu.hideout.core.domain.model.userdetails.UserDetailId
|
||||
|
||||
class FollowTimeline(val userDetailId: UserDetailId, val timelineId: TimelineId)
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
package dev.usbharu.hideout.core.domain.model.followtimeline
|
||||
|
||||
interface FollowTimelineRepository {
|
||||
suspend fun save(followTimeline: FollowTimeline): FollowTimeline
|
||||
suspend fun delete(followTimeline: FollowTimeline)
|
||||
}
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
package dev.usbharu.hideout.core.domain.model.reaction
|
||||
|
||||
@JvmInline
|
||||
value class ReactionId(val value: Long)
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
package dev.usbharu.hideout.core.domain.model.support.acct
|
||||
|
||||
data class Acct(
|
||||
val userpart: String,
|
||||
val host: String
|
||||
) {
|
||||
override fun toString(): String = "acct:$userpart@$host"
|
||||
|
||||
companion object {
|
||||
|
||||
fun of(acct: String): Acct {
|
||||
return Acct(
|
||||
acct.substringBeforeLast('@'),
|
||||
acct.substringAfterLast('@', "")
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
package dev.usbharu.hideout.core.domain.model.support.page
|
||||
|
||||
class PaginationList<T, ID>(list: List<T>, val next: ID?, val prev: ID?) : List<T> by list
|
||||
-22
@@ -1,22 +0,0 @@
|
||||
package dev.usbharu.hideout.core.domain.model.support.postdetail
|
||||
|
||||
import dev.usbharu.hideout.core.domain.model.actor.Actor
|
||||
import dev.usbharu.hideout.core.domain.model.post.Post
|
||||
|
||||
data class PostDetail(
|
||||
val post: Post,
|
||||
val reply: Post? = null,
|
||||
val repost: Post? = null,
|
||||
val postActor: Actor,
|
||||
val replyActor: Actor? = null,
|
||||
val repostActor: Actor? = null
|
||||
) {
|
||||
init {
|
||||
require(post.replyId == reply?.id)
|
||||
require(post.repostId == repost?.id)
|
||||
|
||||
require(post.actorId == postActor.id)
|
||||
require(reply?.actorId == replyActor?.id)
|
||||
require(repost?.actorId == repostActor?.id)
|
||||
}
|
||||
}
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
package dev.usbharu.hideout.core.domain.model.support.principal
|
||||
|
||||
import dev.usbharu.hideout.core.domain.model.actor.ActorId
|
||||
|
||||
data object Anonymous : Principal(ActorId.ghost, null, null)
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
package dev.usbharu.hideout.core.domain.model.support.principal
|
||||
|
||||
import dev.usbharu.hideout.core.domain.model.actor.ActorId
|
||||
import dev.usbharu.hideout.core.domain.model.support.acct.Acct
|
||||
import dev.usbharu.hideout.core.domain.model.userdetails.UserDetailId
|
||||
|
||||
class LocalUser(
|
||||
actorId: ActorId,
|
||||
override val userDetailId: UserDetailId,
|
||||
override val acct: Acct
|
||||
) : Principal(
|
||||
actorId,
|
||||
userDetailId,
|
||||
acct
|
||||
)
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
package dev.usbharu.hideout.core.domain.model.support.principal
|
||||
|
||||
interface PrincipalContextHolder {
|
||||
suspend fun getPrincipal(): Principal
|
||||
}
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
package dev.usbharu.hideout.core.domain.model.timeline
|
||||
|
||||
@JvmInline
|
||||
value class TimelineId(val value: Long)
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
package dev.usbharu.hideout.core.domain.model.timeline
|
||||
|
||||
@JvmInline
|
||||
value class TimelineName(val value: String)
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
package dev.usbharu.hideout.core.domain.model.timeline
|
||||
|
||||
import dev.usbharu.hideout.core.domain.model.userdetails.UserDetailId
|
||||
|
||||
interface TimelineRepository {
|
||||
suspend fun save(timeline: Timeline): Timeline
|
||||
suspend fun delete(timeline: Timeline)
|
||||
|
||||
suspend fun findByIds(ids: List<TimelineId>): List<Timeline>
|
||||
|
||||
suspend fun findById(id: TimelineId): Timeline?
|
||||
|
||||
@Suppress("FunctionMaxLength")
|
||||
suspend fun findAllByUserDetailIdAndVisibilityIn(
|
||||
userDetailId: UserDetailId,
|
||||
visibility: List<TimelineVisibility>
|
||||
): List<Timeline>
|
||||
}
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
package dev.usbharu.hideout.core.domain.model.timeline
|
||||
|
||||
enum class TimelineVisibility {
|
||||
PRIVATE,
|
||||
UNLISTED,
|
||||
PUBLIC
|
||||
}
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
package dev.usbharu.hideout.core.domain.model.timelineobject
|
||||
|
||||
@JvmInline
|
||||
value class TimelineObjectId(val value: Long)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user