mirror of
https://github.com/usbharu/Hideout.git
synced 2026-07-07 05:58:23 +00:00
Compare commits
502 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
|
|||
| 1e0407c16f | |||
| 4c879e3e04 | |||
| d8961464cc | |||
| 4c6c8f5938 | |||
|
39ad5a3125
|
|||
| ff49f371af | |||
|
1544a161e6
|
|||
| 2e0f0c77bf | |||
| 91848717fe | |||
| 2b2d9046d8 | |||
| 2a1486cb4d | |||
|
3b57786984
|
|||
|
3612a78115
|
|||
|
021f6b0d45
|
|||
|
7665286270
|
|||
|
5eb3bc3704
|
|||
|
8c3ff077d8
|
|||
|
d4aaad3fb6
|
|||
|
e42919ce3c
|
|||
|
2b567bb1d5
|
|||
|
1b4dbc8566
|
|||
|
daf676503d
|
|||
|
72c9b8b7c5
|
|||
| 6c83306f0d | |||
| cf1327eae4 | |||
|
0c3e69a7e4
|
|||
|
b3a5749b54
|
|||
|
cf0b0017f6
|
|||
|
8c5c2abb3f
|
|||
| 2e836c228f | |||
| cc0e14f00b | |||
|
c26e8aea4b
|
|||
|
e8724f333d
|
|||
| 7e535ebcf9 | |||
| 96dd11292f | |||
| ebef329120 | |||
| c7742914ef | |||
| 4bc0dc6927 | |||
|
96af8fa144
|
|||
| 20a762b8f4 | |||
|
da106a6922
|
|||
|
ee23ce8b82
|
|||
|
4acc1653d1
|
|||
|
4d86cc0e41
|
|||
| 92b6418202 | |||
| f86a224ed2 | |||
| 5036e01c89 | |||
| ed41c025cf | |||
|
c8a8e77021
|
|||
|
48d325deed
|
|||
|
df6d2940ed
|
|||
|
aa34fb0370
|
|||
|
7b77b097ca
|
|||
| fc8cb156da | |||
|
15cb1375c8
|
|||
|
4f9c431d9b
|
|||
|
fec59ab622
|
|||
|
975fd5160b
|
|||
| 57afdcdd7b | |||
| ec565039d1 | |||
| 4c5344426b | |||
| 0cf8185e50 | |||
| 140351f5e7 | |||
| 9c445fba8c | |||
| 79a10a27fc | |||
| baba7e8c0e | |||
|
0463ad6b69
|
|||
| c94bb81fb2 | |||
| 8f3008b96c | |||
| e9bac27608 | |||
| 37de9ccd00 | |||
| efb07f5927 | |||
|
992cc18c62
|
|||
| b7caf11e3e | |||
| f0d8ee979d | |||
|
c48694ab0b
|
|||
|
533582534f
|
|||
| bd219b62e1 | |||
|
92a9bbcfdb
|
|||
| 623e56bb91 | |||
|
3b8156e16d
|
|||
|
a60b709cb0
|
|||
|
1115590ab2
|
|||
|
456df222f2
|
|||
|
e054e47453
|
|||
| dd9749a536 | |||
| ac5d6800e1 | |||
|
eed5e8a75a
|
|||
|
0c9faa509b
|
|||
|
e4947ce5a9
|
|||
|
9b60099ad9
|
|||
|
7362d20565
|
|||
|
457b6a12be
|
|||
|
c872a837eb
|
|||
| 4dcec9e806 | |||
| 8e0aedf0db | |||
| 406668e958 | |||
| 9663cba4af | |||
|
e2c633a917
|
|||
|
d5805089f5
|
|||
| f9c10eeb7a | |||
| 896e7de1ec | |||
| 486268609b | |||
| 2f0b5915fc | |||
|
ca92ce71b6
|
|||
|
de56fa0547
|
|||
|
da1235f95c
|
|||
|
fd0d6b9625
|
|||
| 76abc69c6c | |||
|
e15380c96c
|
|||
|
aa476256ac
|
|||
|
7e8d066144
|
|||
| e21552df97 | |||
| fb3f3ddd4b | |||
| d4b9b67f08 | |||
| 1d131e71c5 | |||
| 7cb3a48e46 | |||
| b3d4ad8546 | |||
| ddc559807a | |||
| 7120e82827 | |||
| 15b8e65d2d | |||
| 6758105394 | |||
| b248258808 | |||
|
9efbf457a4
|
|||
| 65d8502a18 | |||
| 29ff1269ce | |||
| 3105c6cf65 | |||
|
11e2eb1e10
|
|||
| 3d638a4d63 | |||
| 77f72178dc | |||
|
d53cdca9e5
|
|||
|
e1787423e8
|
|||
|
e9d776f71a
|
|||
| 707e4aef65 | |||
|
8d244b74c1
|
|||
|
711084e366
|
|||
| 31bee9b15a | |||
|
88a61ba97f
|
|||
| 04a0059fb2 | |||
| 1df1aae880 | |||
| 60d71e1eb2 | |||
|
6c91b77eeb
|
|||
|
f6fec05667
|
|||
|
b2d59f619b
|
|||
| 6f11d1cd4e | |||
| c71ad2a28e | |||
| 6d997e8012 | |||
|
d5f08ef710
|
|||
| 17bf2aade6 | |||
|
4e8581ca94
|
|||
|
2db668e6ff
|
|||
| 475efbe99a | |||
|
91573c0b2e
|
|||
| 3794ac2d3c | |||
|
1fc6a1fa38
|
|||
|
2bc9b17cdc
|
|||
|
be07a89b7f
|
|||
|
f4d30e837e
|
|||
|
ced41e64fd
|
|||
| 42b9d4e64b | |||
| 7f1f566924 | |||
|
7ec997c1d5
|
|||
|
94f790d039
|
|||
|
ed3b3f07fb
|
|||
|
146b907c69
|
|||
|
540fe0eaa5
|
|||
|
1a3fc05dad
|
|||
|
507c1d8932
|
|||
| 4fb32d7928 | |||
| e082b0b7b9 | |||
| 700a8d8ed1 | |||
| cb408fd192 | |||
|
2e38c64a3d
|
|||
|
4a665029ec
|
|||
|
a1b4631a13
|
|||
| 86c8fb0bad | |||
| 96e2f9b420 | |||
| ecd59cd886 | |||
|
0983f39a17
|
|||
|
0d671b2557
|
|||
|
7b1e99095b
|
@@ -19,7 +19,7 @@ jobs:
|
||||
|
||||
- name: Check diff
|
||||
id: check-diff
|
||||
uses: actions/github-script@v3
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
result-encoding: 'json'
|
||||
script: |
|
||||
@@ -75,4 +75,8 @@ jobs:
|
||||
- name: Publish OWL Gitea
|
||||
|
||||
if: ${{ github.base_ref == 'master' && contains( needs.release-diff-check.outputs.diff , 'owl')}}
|
||||
run: ./owl/gradlew :owl:publishMavenPublicationToGiteaRepository
|
||||
run: ./owl/gradlew :owl:publishMavenPublicationToGiteaRepository
|
||||
env:
|
||||
USERNAME: ${{ github.actor }}
|
||||
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITEA: ${{ secrets.GITEA }}
|
||||
@@ -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,13 +20,75 @@ 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
|
||||
with:
|
||||
token: ${{ secrets.PAT }}
|
||||
|
||||
- name: Gradle Wrapper Validation
|
||||
uses: gradle/actions/wrapper-validation@v4
|
||||
@@ -46,57 +106,31 @@ jobs:
|
||||
gradle-home-cache-cleanup: true
|
||||
|
||||
- name: Build
|
||||
run: ./gradlew :hideout-core:classes
|
||||
|
||||
unit-test:
|
||||
name: Unit Test
|
||||
needs: [ setup ]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@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: Unit Test
|
||||
run: ./gradlew :hideout-core:koverXmlReport
|
||||
|
||||
- name: Add coverage report to PR
|
||||
if: always()
|
||||
id: kover
|
||||
uses: madrapps/jacoco-report@v1.6.1
|
||||
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
|
||||
run: ./gradlew :owl:test
|
||||
|
||||
- name: JUnit Test Report
|
||||
uses: mikepenz/action-junit-report@v4
|
||||
if: ${{ always() }}
|
||||
uses: mikepenz/action-junit-report@v5
|
||||
with:
|
||||
report_paths: '**/TEST-*.xml'
|
||||
check_name: 'owl JUnit Test Report'
|
||||
|
||||
|
||||
lint:
|
||||
name: Lint
|
||||
needs: [ setup ]
|
||||
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
|
||||
uses: actions/setup-java@v4
|
||||
@@ -110,8 +144,8 @@ jobs:
|
||||
cache-read-only: false
|
||||
gradle-home-cache-cleanup: true
|
||||
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew :hideout-core:detektMain
|
||||
- name: Lint
|
||||
run: ./gradlew :hideout:detekt :owl:detektMain
|
||||
|
||||
- name: Auto Commit
|
||||
if: ${{ always() }}
|
||||
|
||||
+4
-1
@@ -42,9 +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/
|
||||
/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,57 +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")
|
||||
}
|
||||
}
|
||||
}
|
||||
configurations {
|
||||
all {
|
||||
exclude("org.springframework.boot", "spring-boot-starter-logging")
|
||||
exclude("ch.qos.logback", "logback-classic")
|
||||
}
|
||||
}
|
||||
|
||||
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>
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"dev": {
|
||||
"name": "value",
|
||||
"Security": {
|
||||
"Auth": {
|
||||
"auth-id": {
|
||||
"Type": "OAuth2",
|
||||
"Grant Type": "Authorization Code",
|
||||
"Client ID": "{{client_id}}",
|
||||
"Client Secret": "{{client_secret}}",
|
||||
"Redirect URL": "https://example.com",
|
||||
"Token URL": "http://{{host}}/oauth/token",
|
||||
"Auth URL": "http://{{host}}/oauth/authorize",
|
||||
"Scope": "write read"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
POST http://{{host}}/api/v1/apps
|
||||
Accept: application/json
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"client_name": "test-client",
|
||||
"redirect_uris": "https://example.com",
|
||||
"scopes": "write read"
|
||||
}
|
||||
|
||||
###
|
||||
|
||||
GET http://{{host}}/api/v1/accounts/verify_credentials
|
||||
Authorization: Bearer {{$auth.token("auth-id")}}
|
||||
@@ -1,11 +0,0 @@
|
||||
version: "3"
|
||||
|
||||
services:
|
||||
db:
|
||||
image: postgres:16
|
||||
ports:
|
||||
- "5432:5432"
|
||||
environment:
|
||||
POSTGRES_USER: "postgres"
|
||||
POSTGRES_PASSWORD: "password"
|
||||
POSTGRES_DB: "hideout"
|
||||
+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 -XX:TieredStopAtLevel=1 -noverify
|
||||
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.9-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.9-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,22 +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
|
||||
org.gradle.configuration-cache=true
|
||||
org.gradle.configuration-cache.problems=warn
|
||||
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,18 +0,0 @@
|
||||
plugins {
|
||||
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
|
||||
}
|
||||
rootProject.name = "hideout-core"
|
||||
|
||||
includeBuild("../owl")
|
||||
|
||||
dependencyResolutionManagement {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
versionCatalogs {
|
||||
create("libs") {
|
||||
from(files("../libs.versions.toml"))
|
||||
}
|
||||
}
|
||||
}
|
||||
-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)
|
||||
-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>)
|
||||
}
|
||||
-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
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.domainevent.subscribers
|
||||
|
||||
interface Subscriber
|
||||
-11
@@ -1,11 +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(subscribers: List<Subscriber>) : ApplicationRunner {
|
||||
override fun run(args: ApplicationArguments?) {
|
||||
}
|
||||
}
|
||||
-22
@@ -1,22 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.domainevent.subscribers
|
||||
|
||||
import dev.usbharu.hideout.core.domain.event.post.PostEvent
|
||||
import dev.usbharu.hideout.core.domain.event.post.PostEventBody
|
||||
import org.slf4j.LoggerFactory
|
||||
import org.springframework.stereotype.Component
|
||||
|
||||
@Component
|
||||
class TimelinePostCreateSubscriber(domainEventSubscriber: DomainEventSubscriber) : Subscriber {
|
||||
init {
|
||||
domainEventSubscriber.subscribe<PostEventBody>(PostEvent.CREATE.eventName) {
|
||||
val post = it.body.getPost()
|
||||
val actor = it.body.getActor()
|
||||
|
||||
logger.info("New Post! : {}", post)
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val logger = LoggerFactory.getLogger(TimelinePostCreateSubscriber::class.java)
|
||||
}
|
||||
}
|
||||
-50
@@ -1,50 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.domainevent.subscribers
|
||||
|
||||
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.TimelineRelationship
|
||||
import dev.usbharu.hideout.core.domain.model.timelinerelationship.TimelineRelationshipId
|
||||
import dev.usbharu.hideout.core.domain.model.timelinerelationship.Visible
|
||||
import dev.usbharu.hideout.core.domain.model.userdetails.UserDetailRepository
|
||||
import dev.usbharu.hideout.core.domain.shared.id.IdGenerateService
|
||||
import org.slf4j.LoggerFactory
|
||||
import org.springframework.stereotype.Component
|
||||
|
||||
@Component
|
||||
class TimelineRelationshipFollowSubscriber(
|
||||
private val userAddTimelineRelationshipApplicationService: UserAddTimelineRelationshipApplicationService,
|
||||
private val idGenerateService: IdGenerateService,
|
||||
private val userDetailRepository: UserDetailRepository,
|
||||
domainEventSubscriber: DomainEventSubscriber
|
||||
) : Subscriber {
|
||||
|
||||
init {
|
||||
domainEventSubscriber.subscribe<RelationshipEventBody>(RelationshipEvent.FOLLOW.eventName) {
|
||||
val relationship = it.body.getRelationship()
|
||||
val userDetail = userDetailRepository.findByActorId(relationship.actorId.id) ?: throw Exception()
|
||||
if (userDetail.homeTimelineId == null) {
|
||||
logger.warn("Home timeline for ${relationship.actorId} is not found")
|
||||
return@subscribe
|
||||
}
|
||||
userAddTimelineRelationshipApplicationService.execute(
|
||||
AddTimelineRelationship(
|
||||
TimelineRelationship(
|
||||
TimelineRelationshipId(idGenerateService.generateId()),
|
||||
userDetail.homeTimelineId,
|
||||
relationship.targetActorId,
|
||||
Visible.FOLLOWERS
|
||||
)
|
||||
), it.body.principal
|
||||
)
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val logger = LoggerFactory.getLogger(TimelineRelationshipFollowSubscriber::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
|
||||
)
|
||||
}
|
||||
@@ -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
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.post
|
||||
|
||||
data class DeleteLocalPost(val postId: Long)
|
||||
-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>
|
||||
)
|
||||
-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)
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.shared
|
||||
|
||||
import dev.usbharu.hideout.core.domain.model.support.principal.FromApi
|
||||
import dev.usbharu.hideout.core.domain.model.support.principal.Principal
|
||||
import org.slf4j.Logger
|
||||
|
||||
abstract class LocalUserAbstractApplicationService<T : Any, R>(transaction: Transaction, logger: Logger) :
|
||||
AbstractApplicationService<T, R>(transaction, logger) {
|
||||
override suspend fun internalExecute(command: T, principal: Principal): R {
|
||||
require(principal is FromApi)
|
||||
return internalExecute(command, principal)
|
||||
}
|
||||
|
||||
protected abstract suspend fun internalExecute(command: T, principal: FromApi): R
|
||||
}
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.timeline
|
||||
|
||||
import dev.usbharu.hideout.core.domain.model.timelinerelationship.TimelineRelationship
|
||||
|
||||
data class AddTimelineRelationship(
|
||||
val timelineRelationship: TimelineRelationship
|
||||
)
|
||||
-26
@@ -1,26 +0,0 @@
|
||||
package dev.usbharu.hideout.core.application.timeline
|
||||
|
||||
import dev.usbharu.hideout.core.application.shared.AbstractApplicationService
|
||||
import dev.usbharu.hideout.core.application.shared.Transaction
|
||||
import dev.usbharu.hideout.core.domain.model.support.principal.Principal
|
||||
import dev.usbharu.hideout.core.domain.model.timelinerelationship.TimelineRelationshipRepository
|
||||
import org.slf4j.LoggerFactory
|
||||
import org.springframework.stereotype.Service
|
||||
|
||||
@Service
|
||||
class UserAddTimelineRelationshipApplicationService(
|
||||
private val timelineRelationshipRepository: TimelineRelationshipRepository,
|
||||
transaction: Transaction
|
||||
) :
|
||||
AbstractApplicationService<AddTimelineRelationship, Unit>(
|
||||
transaction, logger
|
||||
) {
|
||||
override suspend fun internalExecute(command: AddTimelineRelationship, principal: Principal) {
|
||||
timelineRelationshipRepository.save(command.timelineRelationship)
|
||||
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val logger = LoggerFactory.getLogger(UserAddTimelineRelationshipApplicationService::class.java)
|
||||
}
|
||||
}
|
||||
-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"
|
||||
)
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
package dev.usbharu.hideout.core.domain.event.timeline
|
||||
|
||||
import dev.usbharu.hideout.core.domain.model.timeline.Timeline
|
||||
import dev.usbharu.hideout.core.domain.shared.domainevent.DomainEvent
|
||||
import dev.usbharu.hideout.core.domain.shared.domainevent.DomainEventBody
|
||||
|
||||
class TimelineEventFactory(private val timeline: Timeline) {
|
||||
fun createEvent(timelineEvent: TimelineEvent): DomainEvent<TimelineEventBody> =
|
||||
DomainEvent.create(timelineEvent.eventName, TimelineEventBody(timeline))
|
||||
}
|
||||
|
||||
class TimelineEventBody(timeline: Timeline) : DomainEventBody(mapOf("timeline" to timeline))
|
||||
|
||||
enum class TimelineEvent(val eventName: String) {
|
||||
CHANGE_VISIBILITY("ChangeVisibility")
|
||||
}
|
||||
-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
|
||||
}
|
||||
}
|
||||
-13
@@ -1,13 +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)
|
||||
}
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
package dev.usbharu.hideout.core.domain.model.support.acct
|
||||
|
||||
data class Acct(
|
||||
val userpart: String,
|
||||
val host: String
|
||||
) {
|
||||
override fun toString(): String {
|
||||
return "acct:$userpart@$host"
|
||||
}
|
||||
}
|
||||
-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 FromApi(
|
||||
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
|
||||
}
|
||||
-56
@@ -1,56 +0,0 @@
|
||||
package dev.usbharu.hideout.core.domain.model.support.timelineobjectdetail
|
||||
|
||||
import dev.usbharu.hideout.core.domain.model.actor.Actor
|
||||
import dev.usbharu.hideout.core.domain.model.post.Post
|
||||
import dev.usbharu.hideout.core.domain.model.post.PostId
|
||||
import dev.usbharu.hideout.core.domain.model.timelineobject.TimelineObject
|
||||
import dev.usbharu.hideout.core.domain.model.timelineobject.TimelineObjectId
|
||||
import dev.usbharu.hideout.core.domain.model.timelineobject.TimelineObjectWarnFilter
|
||||
import dev.usbharu.hideout.core.domain.model.userdetails.UserDetail
|
||||
import java.time.Instant
|
||||
|
||||
data class TimelineObjectDetail(
|
||||
val id: TimelineObjectId,
|
||||
val postId: PostId,
|
||||
val timelineUserDetail: UserDetail,
|
||||
val post: Post,
|
||||
val postActor: Actor,
|
||||
val replyPost: Post?,
|
||||
val replyPostActor: Actor?,
|
||||
val repostPost: Post?,
|
||||
val repostPostActor: Actor?,
|
||||
val isPureRepost: Boolean,
|
||||
val lastUpdateAt: Instant,
|
||||
val hasMediaInRepost: Boolean,
|
||||
val warnFilter: List<TimelineObjectWarnFilter>
|
||||
) {
|
||||
companion object {
|
||||
fun of(
|
||||
timelineObject: TimelineObject,
|
||||
timelineUserDetail: UserDetail,
|
||||
post: Post,
|
||||
postActor: Actor,
|
||||
replyPost: Post?,
|
||||
replyPostActor: Actor?,
|
||||
repostPost: Post?,
|
||||
repostPostActor: Actor?,
|
||||
warnFilter: List<TimelineObjectWarnFilter>
|
||||
): TimelineObjectDetail {
|
||||
return TimelineObjectDetail(
|
||||
timelineObject.id,
|
||||
post.id,
|
||||
timelineUserDetail,
|
||||
post,
|
||||
postActor,
|
||||
replyPost,
|
||||
replyPostActor,
|
||||
repostPost,
|
||||
repostPostActor,
|
||||
timelineObject.isPureRepost,
|
||||
timelineObject.lastUpdatedAt,
|
||||
timelineObject.hasMediaInRepost,
|
||||
warnFilter
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
-28
@@ -1,28 +0,0 @@
|
||||
package dev.usbharu.hideout.core.domain.model.timeline
|
||||
|
||||
import dev.usbharu.hideout.core.domain.event.timeline.TimelineEvent
|
||||
import dev.usbharu.hideout.core.domain.event.timeline.TimelineEventFactory
|
||||
import dev.usbharu.hideout.core.domain.model.userdetails.UserDetail
|
||||
import dev.usbharu.hideout.core.domain.model.userdetails.UserDetailId
|
||||
import dev.usbharu.hideout.core.domain.shared.domainevent.DomainEventStorable
|
||||
|
||||
class Timeline(
|
||||
val id: TimelineId,
|
||||
val userDetailId: UserDetailId,
|
||||
name: TimelineName,
|
||||
visibility: TimelineVisibility,
|
||||
val isSystem: Boolean
|
||||
) : DomainEventStorable() {
|
||||
var visibility = visibility
|
||||
private set
|
||||
|
||||
fun setVisibility(visibility: TimelineVisibility, userDetail: UserDetail) {
|
||||
check(isSystem.not())
|
||||
require(userDetailId == userDetail.id)
|
||||
this.visibility = visibility
|
||||
addDomainEvent(TimelineEventFactory(this).createEvent(TimelineEvent.CHANGE_VISIBILITY))
|
||||
}
|
||||
|
||||
var name = name
|
||||
private set
|
||||
}
|
||||
-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)
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
package dev.usbharu.hideout.core.domain.model.timeline
|
||||
|
||||
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?
|
||||
}
|
||||
-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)
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
package dev.usbharu.hideout.core.domain.model.timelineobject
|
||||
|
||||
import dev.usbharu.hideout.core.domain.model.filter.FilterId
|
||||
|
||||
data class TimelineObjectWarnFilter(val filterId: FilterId, val matchedKeyword: String)
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
package dev.usbharu.hideout.core.domain.model.timelinerelationship
|
||||
|
||||
import dev.usbharu.hideout.core.domain.model.actor.ActorId
|
||||
import dev.usbharu.hideout.core.domain.model.timeline.TimelineId
|
||||
|
||||
class TimelineRelationship(
|
||||
val id: TimelineRelationshipId,
|
||||
val timelineId: TimelineId,
|
||||
val actorId: ActorId,
|
||||
val visible: Visible
|
||||
)
|
||||
|
||||
enum class Visible {
|
||||
PUBLIC,
|
||||
UNLISTED,
|
||||
FOLLOWERS,
|
||||
DIRECT
|
||||
}
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
package dev.usbharu.hideout.core.domain.model.timelinerelationship
|
||||
|
||||
@JvmInline
|
||||
value class TimelineRelationshipId(val value: Long)
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
package dev.usbharu.hideout.core.domain.model.timelinerelationship
|
||||
|
||||
import dev.usbharu.hideout.core.domain.model.actor.ActorId
|
||||
|
||||
interface TimelineRelationshipRepository {
|
||||
suspend fun save(timelineRelationship: TimelineRelationship): TimelineRelationship
|
||||
suspend fun delete(timelineRelationship: TimelineRelationship)
|
||||
|
||||
suspend fun findByActorId(actorId: ActorId): List<TimelineRelationship>
|
||||
}
|
||||
-54
@@ -1,54 +0,0 @@
|
||||
package dev.usbharu.hideout.core.domain.service.post
|
||||
|
||||
import dev.usbharu.hideout.core.domain.model.post.Post
|
||||
import dev.usbharu.hideout.core.domain.model.post.Visibility
|
||||
import dev.usbharu.hideout.core.domain.model.relationship.Relationship
|
||||
import dev.usbharu.hideout.core.domain.model.relationship.RelationshipRepository
|
||||
import dev.usbharu.hideout.core.domain.model.support.principal.Anonymous
|
||||
import dev.usbharu.hideout.core.domain.model.support.principal.Principal
|
||||
import org.springframework.stereotype.Component
|
||||
|
||||
interface IPostReadAccessControl {
|
||||
suspend fun isAllow(post: Post, principal: Principal): Boolean
|
||||
}
|
||||
|
||||
@Component
|
||||
class DefaultPostReadAccessControl(private val relationshipRepository: RelationshipRepository) :
|
||||
IPostReadAccessControl {
|
||||
override suspend fun isAllow(post: Post, principal: Principal): Boolean {
|
||||
val relationship = (relationshipRepository.findByActorIdAndTargetId(post.actorId, principal.actorId)
|
||||
?: Relationship.default(post.actorId, principal.actorId))
|
||||
|
||||
//ブロックされてたら見れない
|
||||
if (relationship.blocking) {
|
||||
return false
|
||||
}
|
||||
|
||||
//PublicかUnlistedなら見れる
|
||||
if (post.visibility == Visibility.PUBLIC || post.visibility == Visibility.UNLISTED) {
|
||||
return true
|
||||
}
|
||||
|
||||
//principalがAnonymousなら見れない
|
||||
if (principal is Anonymous) {
|
||||
return false
|
||||
}
|
||||
|
||||
//DirectでvisibleActorsに含まれていたら見れる
|
||||
if (post.visibility == Visibility.DIRECT && post.visibleActors.contains(principal.actorId)) {
|
||||
return true
|
||||
}
|
||||
|
||||
//Followersでフォロワーなら見れる
|
||||
if (post.visibility == Visibility.FOLLOWERS) {
|
||||
val inverseRelationship =
|
||||
relationshipRepository.findByActorIdAndTargetId(principal.actorId, post.actorId) ?: return false
|
||||
|
||||
return inverseRelationship.following
|
||||
}
|
||||
|
||||
//その他の場合は見れない
|
||||
return false
|
||||
}
|
||||
|
||||
}
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
package dev.usbharu.hideout.core.domain.shared.domainevent
|
||||
|
||||
interface DomainEventPublisher {
|
||||
suspend fun publishEvent(domainEvent: DomainEvent<*>)
|
||||
}
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
package dev.usbharu.hideout.core.external.media
|
||||
|
||||
import dev.usbharu.hideout.core.domain.model.media.MimeType
|
||||
import java.nio.file.Path
|
||||
|
||||
interface FileTypeDeterminer {
|
||||
fun fileType(path: Path, filename: String): MimeType
|
||||
}
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
package dev.usbharu.hideout.core.external.mediastore
|
||||
|
||||
import java.net.URI
|
||||
import java.nio.file.Path
|
||||
|
||||
interface MediaStore {
|
||||
suspend fun upload(path: Path, id: String): URI
|
||||
}
|
||||
Vendored
-7
@@ -1,7 +0,0 @@
|
||||
package dev.usbharu.hideout.core.external.timeline
|
||||
|
||||
data class ReadTimelineOption(
|
||||
val mediaOnly: Boolean = false,
|
||||
val local: Boolean = false,
|
||||
val remote: Boolean = false,
|
||||
)
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
package dev.usbharu.hideout.core.infrastructure.media.common
|
||||
|
||||
import java.awt.image.BufferedImage
|
||||
|
||||
interface GenerateBlurhash {
|
||||
fun generateBlurhash(bufferedImage: BufferedImage): String
|
||||
}
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
package dev.usbharu.hideout.core.infrastructure.media.common
|
||||
|
||||
import io.trbl.blurhash.BlurHash
|
||||
import org.springframework.stereotype.Component
|
||||
import java.awt.image.BufferedImage
|
||||
|
||||
@Component
|
||||
class GenerateBlurhashImpl : GenerateBlurhash {
|
||||
override fun generateBlurhash(bufferedImage: BufferedImage): String = BlurHash.encode(bufferedImage)
|
||||
}
|
||||
-28
@@ -1,28 +0,0 @@
|
||||
package dev.usbharu.hideout.core.infrastructure.springframework.domainevent
|
||||
|
||||
import dev.usbharu.hideout.core.application.domainevent.subscribers.DomainEventConsumer
|
||||
import dev.usbharu.hideout.core.application.domainevent.subscribers.DomainEventSubscriber
|
||||
import dev.usbharu.hideout.core.domain.shared.domainevent.DomainEvent
|
||||
import dev.usbharu.hideout.core.domain.shared.domainevent.DomainEventBody
|
||||
import org.springframework.context.event.EventListener
|
||||
import org.springframework.stereotype.Component
|
||||
|
||||
@Component
|
||||
class SpringFrameworkDomainEventSubscriber : DomainEventSubscriber {
|
||||
|
||||
val map = mutableMapOf<String, MutableList<DomainEventConsumer<*>>>()
|
||||
|
||||
override fun <T : DomainEventBody> subscribe(eventName: String, domainEventConsumer: DomainEventConsumer<T>) {
|
||||
map.getOrPut(eventName) { mutableListOf() }.add(domainEventConsumer as DomainEventConsumer<*>)
|
||||
}
|
||||
|
||||
@EventListener
|
||||
suspend fun onDomainEventPublished(domainEvent: DomainEvent<*>) {
|
||||
map[domainEvent.name]?.forEach {
|
||||
try {
|
||||
it.invoke(domainEvent)
|
||||
} catch (e: Exception) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
-27
@@ -1,27 +0,0 @@
|
||||
package dev.usbharu.hideout.core.infrastructure.springframework.oauth2
|
||||
|
||||
import dev.usbharu.hideout.core.domain.model.support.acct.Acct
|
||||
import dev.usbharu.hideout.core.domain.model.support.principal.FromApi
|
||||
import dev.usbharu.hideout.core.domain.model.support.principal.PrincipalContextHolder
|
||||
import dev.usbharu.hideout.core.domain.model.userdetails.UserDetailId
|
||||
import dev.usbharu.hideout.core.query.principal.PrincipalQueryService
|
||||
import org.springframework.security.core.context.SecurityContextHolder
|
||||
import org.springframework.security.oauth2.jwt.Jwt
|
||||
import org.springframework.stereotype.Component
|
||||
|
||||
@Component
|
||||
class SpringSecurityOauth2PrincipalContextHolder(private val principalQueryService: PrincipalQueryService) :
|
||||
PrincipalContextHolder {
|
||||
override suspend fun getPrincipal(): FromApi {
|
||||
val principal = SecurityContextHolder.getContext().authentication?.principal as Jwt
|
||||
|
||||
val id = principal.getClaim<String>("uid").toLong()
|
||||
val userDetail = principalQueryService.findByUserDetailId(UserDetailId(id))
|
||||
|
||||
return FromApi(
|
||||
userDetail.actorId,
|
||||
userDetail.userDetailId,
|
||||
Acct(userDetail.username, userDetail.host)
|
||||
)
|
||||
}
|
||||
}
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
package dev.usbharu.hideout.core.interfaces.api.auth
|
||||
|
||||
data class SignUpForm(
|
||||
val username: String,
|
||||
val password: String,
|
||||
// val recaptchaResponse: String
|
||||
)
|
||||
@@ -1,6 +0,0 @@
|
||||
package dev.usbharu.hideout.core.query.principal
|
||||
|
||||
import dev.usbharu.hideout.core.domain.model.actor.ActorId
|
||||
import dev.usbharu.hideout.core.domain.model.userdetails.UserDetailId
|
||||
|
||||
data class PrincipalDTO(val userDetailId: UserDetailId, val actorId: ActorId, val username: String, val host: String)
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
package dev.usbharu.hideout.core.query.principal
|
||||
|
||||
import dev.usbharu.hideout.core.domain.model.userdetails.UserDetailId
|
||||
|
||||
interface PrincipalQueryService {
|
||||
suspend fun findByUserDetailId(userDetailId: UserDetailId): PrincipalDTO
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
#file: noinspection SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection,SpellCheckingInspection
|
||||
hideout:
|
||||
url: "https://test-hideout-dev.usbharu.dev"
|
||||
use-mongodb: true
|
||||
owl:
|
||||
producer:
|
||||
standalone: embedded
|
||||
security:
|
||||
jwt:
|
||||
generate: true
|
||||
key-id: a
|
||||
private-key: "MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC7VJTUt9Us8cKjMzEfYyjiWA4R4/M2bS1GB4t7NXp98C3SC6dVMvDuictGeurT8jNbvJZHtCSuYEvuNMoSfm76oqFvAp8Gy0iz5sxjZmSnXyCdPEovGhLa0VzMaQ8s+CLOyS56YyCFGeJZqgtzJ6GR3eqoYSW9b9UMvkBpZODSctWSNGj3P7jRFDO5VoTwCQAWbFnOjDfH5Ulgp2PKSQnSJP3AJLQNFNe7br1XbrhV//eO+t51mIpGSDCUv3E0DDFcWDTH9cXDTTlRZVEiR2BwpZOOkE/Z0/BVnhZYL71oZV34bKfWjQIt6V/isSMahdsAASACp4ZTGtwiVuNd9tybAgMBAAECggEBAKTmjaS6tkK8BlPXClTQ2vpz/N6uxDeS35mXpqasqskVlaAidgg/sWqpjXDbXr93otIMLlWsM+X0CqMDgSXKejLS2jx4GDjI1ZTXg++0AMJ8sJ74pWzVDOfmCEQ/7wXs3+cbnXhKriO8Z036q92Qc1+N87SI38nkGa0ABH9CN83HmQqt4fB7UdHzuIRe/me2PGhIq5ZBzj6h3BpoPGzEP+x3l9YmK8t/1cN0pqI+dQwYdgfGjackLu/2qH80MCF7IyQaseZUOJyKrCLtSD/Iixv/hzDEUPfOCjFDgTpzf3cwta8+oE4wHCo1iI1/4TlPkwmXx4qSXtmw4aQPz7IDQvECgYEA8KNThCO2gsC2I9PQDM/8Cw0O983WCDY+oi+7JPiNAJwv5DYBqEZB1QYdj06YD16XlC/HAZMsMku1na2TN0driwenQQWzoev3g2S7gRDoS/FCJSI3jJ+kjgtaA7Qmzlgk1TxODN+G1H91HW7t0l7VnL27IWyYo2qRRK3jzxqUiPUCgYEAx0oQs2reBQGMVZnApD1jeq7n4MvNLcPvt8b/eU9iUv6Y4Mj0Suo/AU8lYZXm8ubbqAlwz2VSVunD2tOplHyMUrtCtObAfVDUAhCndKaA9gApgfb3xw1IKbuQ1u4IF1FJl3VtumfQn//LiH1B3rXhcdyo3/vIttEk48RakUKClU8CgYEAzV7W3COOlDDcQd935DdtKBFRAPRPAlspQUnzMi5eSHMD/ISLDY5IiQHbIH83D4bvXq0X7qQoSBSNP7Dvv3HYuqMhf0DaegrlBuJllFVVq9qPVRnKxt1Il2HgxOBvbhOT+9in1BzA+YJ99UzC85O0Qz06A+CmtHEy4aZ2kj5hHjECgYEAmNS4+A8Fkss8Js1RieK2LniBxMgmYml3pfVLKGnzmng7H2+cwPLhPIzIuwytXywh2bzbsYEfYx3EoEVgMEpPhoarQnYPukrJO4gwE2o5Te6T5mJSZGlQJQj9q4ZB2Dfzet6INsK0oG8XVGXSpQvQh3RUYekCZQkBBFcpqWpbIEsCgYAnM3DQf3FJoSnXaMhrVBIovic5l0xFkEHskAjFTevO86Fsz1C2aSeRKSqGFoOQ0tmJzBEs1R6KqnHInicDTQrKhArgLXX4v3CddjfTRJkFWDbE/CkvKZNOrcf1nhaGCPspRJj2KUkj1Fhl9Cncdn/RsYEONbwQSjIfMPkvxF+8HQ=="
|
||||
public-key: "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAu1SU1LfVLPHCozMxH2Mo4lgOEePzNm0tRgeLezV6ffAt0gunVTLw7onLRnrq0/IzW7yWR7QkrmBL7jTKEn5u+qKhbwKfBstIs+bMY2Zkp18gnTxKLxoS2tFczGkPLPgizskuemMghRniWaoLcyehkd3qqGElvW/VDL5AaWTg0nLVkjRo9z+40RQzuVaE8AkAFmxZzow3x+VJYKdjykkJ0iT9wCS0DRTXu269V264Vf/3jvredZiKRkgwlL9xNAwxXFg0x/XFw005UWVRIkdgcKWTjpBP2dPwVZ4WWC+9aGVd+Gyn1o0CLelf4rEjGoXbAAEgAqeGUxrcIlbjXfbcmwIDAQAB"
|
||||
private: true
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
spring:
|
||||
jmx:
|
||||
enabled: false
|
||||
jackson:
|
||||
serialization:
|
||||
WRITE_DATES_AS_TIMESTAMPS: false
|
||||
default-property-inclusion: always
|
||||
datasource:
|
||||
driver-class-name: org.postgresql.Driver
|
||||
url: "jdbc:postgresql:hideout"
|
||||
username: "postgres"
|
||||
password: "password"
|
||||
data:
|
||||
mongodb:
|
||||
auto-index-creation: true
|
||||
host: localhost
|
||||
port: 27017
|
||||
database: hideout
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 40MB
|
||||
max-request-size: 40MB
|
||||
h2:
|
||||
console:
|
||||
enabled: true
|
||||
threads:
|
||||
virtual:
|
||||
enabled: true
|
||||
server:
|
||||
tomcat:
|
||||
basedir: tomcat
|
||||
accesslog:
|
||||
enabled: true
|
||||
max-http-form-post-size: 40MB
|
||||
max-swallow-size: 40MB
|
||||
port: 8081
|
||||
@@ -1,16 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Configuration status="WARN">
|
||||
<Appenders>
|
||||
<Console name="Console" target="SYSTEM_OUT">
|
||||
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
|
||||
</Console>
|
||||
</Appenders>
|
||||
<Loggers>
|
||||
<Root level="INFO">
|
||||
<AppenderRef ref="Console"/>
|
||||
</Root>
|
||||
<Logger name="dev.usbharu.owl.broker.service.QueuedTaskAssignerImpl" level="TRACE"/>
|
||||
<Logger name="org.mongodb.driver.cluster" level="WARN"/>
|
||||
<Logger name="org.apache.tomcat.util.net.NioEndpoint" level="INFO"/>
|
||||
</Loggers>
|
||||
</Configuration>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user