Compare commits
772
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f18401c72e | ||
|
|
dade477b32 | ||
|
|
79f88dc3b8 | ||
|
|
4a12f8be61 | ||
|
|
044ad9edf9 | ||
|
|
57d2c6a7e1 | ||
|
|
46f6301fdd | ||
|
|
c3f300d87d | ||
|
|
1de558dd51 | ||
|
|
2711f3db13 | ||
|
|
ff3933b335 | ||
|
|
fa737638a8 | ||
|
|
97b7c417ab | ||
|
|
58d8005d38 | ||
|
|
507ac5181f | ||
|
|
b0cdb81533 | ||
|
|
fc0367a32f | ||
|
|
7cd30b640c | ||
|
|
a9855fe8d3 | ||
|
|
7a1272146c | ||
|
|
db61b6f390 | ||
|
|
887c294191 | ||
|
|
40e53976e5 | ||
|
|
211fd648be | ||
|
|
26702fe078 | ||
|
|
2f2a6291a2 | ||
|
|
1b3353118d | ||
|
|
e03f56ac31 | ||
|
|
d571a7f75e | ||
|
|
e3b765b9bd | ||
|
|
4da313826d | ||
|
|
948ed7a7fa | ||
|
|
f7fc64ebc4 | ||
|
|
b7f51d6f5c | ||
|
|
e185eeb6d7 | ||
|
|
90d703b870 | ||
|
|
75640f21e0 | ||
|
|
4aa43ae27a | ||
|
|
6b67671e29 | ||
|
|
220f361b69 | ||
|
|
a1d6457ced | ||
|
|
f7ade3c676 | ||
|
|
f656d9ca2d | ||
|
|
cefd90385d | ||
|
|
e5021b1d78 | ||
|
|
f0bd5132a3 | ||
|
|
d356fa41a0 | ||
|
|
a9e9ac1cfa | ||
|
|
1b3e720701 | ||
|
|
2461363d4f | ||
|
|
f29e74b6f4 | ||
|
|
89dfe82fe9 | ||
|
|
48a0f75c31 | ||
|
|
37103cf414 | ||
|
|
dec34916b2 | ||
|
|
64a4c196c0 | ||
|
|
41d596a1c9 | ||
|
|
bac0bc7b84 | ||
|
|
1ac6774821 | ||
|
|
7adb21ca59 | ||
|
|
4daf2729e5 | ||
|
|
1942c32128 | ||
|
|
b061a59433 | ||
|
|
ab867a9e50 | ||
|
|
968338aa97 | ||
|
|
b34102a973 | ||
|
|
378d1e1f1f | ||
|
|
3a8abe4415 | ||
|
|
6feb37dfd4 | ||
|
|
8042a18dc1 | ||
|
|
c78bf05fc3 | ||
|
|
4635c51fe1 | ||
|
|
5cc0f97aa2 | ||
|
|
b581f9b11a | ||
|
|
756e8d1724 | ||
|
|
7c64de5cbc | ||
|
|
56af6bcaf0 | ||
|
|
84b269a80d | ||
|
|
4d30a2e8c4 | ||
|
|
2d15b3d407 | ||
|
|
44a2973b1a | ||
|
|
00a055283e | ||
|
|
a474dcd961 | ||
|
|
69fe180968 | ||
|
|
036f6aa185 | ||
|
|
12a1bd7e2e | ||
|
|
c4ec45a9d0 | ||
|
|
b8e0123893 | ||
|
|
df953771a7 | ||
|
|
44bd16d677 | ||
|
|
277a509f49 | ||
|
|
a9ad991892 | ||
|
|
3183914a15 | ||
|
|
62be81ea60 | ||
|
|
ffc292b22a | ||
|
|
c83fdb2a6e | ||
|
|
b5c316b825 | ||
|
|
81fdd90e7a | ||
|
|
831b6221fd | ||
|
|
37edfb2de2 | ||
|
|
43cc68bdd4 | ||
|
|
0937555d49 | ||
|
|
663fe980bf | ||
|
|
9e2c487389 | ||
|
|
698e551790 | ||
|
|
71e4526ad5 | ||
|
|
5ee84f8cf4 | ||
|
|
b07a4a0f3e | ||
|
|
62a476a949 | ||
|
|
6671ac48f9 | ||
|
|
3c7a7615ba | ||
|
|
2f301bb56a | ||
|
|
e06abbc176 | ||
|
|
04daeba089 | ||
|
|
7c83d2cb6e | ||
|
|
2829d145af | ||
|
|
44bf36fff9 | ||
|
|
acd11c3fc1 | ||
|
|
b9c701a71b | ||
|
|
e52ecd64ee | ||
|
|
af77f729ec | ||
|
|
7c39e4de13 | ||
|
|
3e918e5d3d | ||
|
|
9cd45f7832 | ||
|
|
90ca3770a1 | ||
|
|
a183339063 | ||
|
|
0a4e4c3b70 | ||
|
|
b52e664d0f | ||
|
|
9f4634a95d | ||
|
|
a6f6c2e945 | ||
|
|
b6d23e7546 | ||
|
|
b0f2c94674 | ||
|
|
80d18bb10d | ||
|
|
2bb0f61da7 | ||
|
|
24386656fd | ||
|
|
453360fe61 | ||
|
|
beac1ed780 | ||
|
|
aa1b3810f1 | ||
|
|
ce3c1b6cc1 | ||
|
|
3f6b830f9b | ||
|
|
f0cb79799a | ||
|
|
7561462594 | ||
|
|
9cf0070442 | ||
|
|
647afbe2cb | ||
|
|
bfa8566284 | ||
|
|
e31555776e | ||
|
|
3c88ae9023 | ||
|
|
5200c17baf | ||
|
|
97311b338a | ||
|
|
a6b7e9df93 | ||
|
|
a1aa5505a3 | ||
|
|
e9289bd174 | ||
|
|
e8edc203b6 | ||
|
|
ed6680ba6a | ||
|
|
16c6929396 | ||
|
|
dba9efc726 | ||
|
|
ef012981db | ||
|
|
e77b9bb3d2 | ||
|
|
c24f4954ea | ||
|
|
a268fd5a26 | ||
|
|
8094458b10 | ||
|
|
b88a1a771e | ||
|
|
b94d2f15bc | ||
|
|
ce8e330c82 | ||
|
|
0e7b9fa2d4 | ||
|
|
42b108964b | ||
|
|
ff630ea647 | ||
|
|
45e5827872 | ||
|
|
b20e8a1cd1 | ||
|
|
712da837b1 | ||
|
|
424999e13a | ||
|
|
f8ce537dce | ||
|
|
3d202d409f | ||
|
|
1c8fc989da | ||
|
|
a410ee7caf | ||
|
|
03f80e1ee2 | ||
|
|
c04baab4e9 | ||
|
|
feb84c9a62 | ||
|
|
e097aa3ee9 | ||
|
|
a8bf9219a2 | ||
|
|
9199a2b221 | ||
|
|
fda64b36ae | ||
|
|
ad19e4c954 | ||
|
|
d91ca61ff0 | ||
|
|
05c260667a | ||
|
|
fb5b882e28 | ||
|
|
c5e00c2543 | ||
|
|
33964fbfe8 | ||
|
|
abd42de067 | ||
|
|
7852f1d987 | ||
|
|
e4dab4d1b4 | ||
|
|
346f57f3fa | ||
|
|
a4c8d67e92 | ||
|
|
e53cf65054 | ||
|
|
320e88992a | ||
|
|
678e151681 | ||
|
|
5d1517bdf2 | ||
|
|
dc7b1b005e | ||
|
|
9bbc8b4db9 | ||
|
|
0a32fe0967 | ||
|
|
0d0dc6aaa0 | ||
|
|
bd1a15af22 | ||
|
|
841fdbdd78 | ||
|
|
de595b0623 | ||
|
|
9c52a33f3a | ||
|
|
3b14cb0783 | ||
|
|
4a2b221c25 | ||
|
|
3bfa9d669e | ||
|
|
8fdfde4f2f | ||
|
|
7873c175b2 | ||
|
|
e583328e87 | ||
|
|
4d024a2a02 | ||
|
|
051e0c3dc0 | ||
|
|
5114bba2b1 | ||
|
|
ec986147a2 | ||
|
|
cf2e18d248 | ||
|
|
1efe97d8e6 | ||
|
|
469d7bf6fb | ||
|
|
0082984f9c | ||
|
|
2e789795ed | ||
|
|
88591d973f | ||
|
|
6218a401de | ||
|
|
a787e3deca | ||
|
|
d195d260aa | ||
|
|
d0973a9290 | ||
|
|
6866735cc1 | ||
|
|
481999af5c | ||
|
|
6a45645354 | ||
|
|
f22a763d96 | ||
|
|
7dd579d3c0 | ||
|
|
13ea6d08a0 | ||
|
|
8c1e5c8947 | ||
|
|
b397ab72c9 | ||
|
|
792a8bd11e | ||
|
|
f680fd170f | ||
|
|
916a261467 | ||
|
|
72d636c0f0 | ||
|
|
c8a61a9df3 | ||
|
|
0731b7c5ef | ||
|
|
f2437c4731 | ||
|
|
652ed1a5ed | ||
|
|
c48588c6a7 | ||
|
|
ce0c72b008 | ||
|
|
1057b478c3 | ||
|
|
4d53193fcc | ||
|
|
95abd2c9d3 | ||
|
|
f88984cda8 | ||
|
|
0927f45b25 | ||
|
|
ed24ce6381 | ||
|
|
24607e266b | ||
|
|
9cdf2aa1f2 | ||
|
|
74611b75a7 | ||
|
|
cf131c5c51 | ||
|
|
efd8a55b6e | ||
|
|
c0c16be9e4 | ||
|
|
327611dfc6 | ||
|
|
c5149d4262 | ||
|
|
3f039bf57d | ||
|
|
053cb8bec3 | ||
|
|
813f2fa5ef | ||
|
|
3d0c9fde0c | ||
|
|
c74367e564 | ||
|
|
5e2b693f6a | ||
|
|
8df71f7695 | ||
|
|
db6bb870e3 | ||
|
|
dc44fac42a | ||
|
|
26c2fa555b | ||
|
|
3ce3d221cd | ||
|
|
62e9bb0c49 | ||
|
|
b11eaff043 | ||
|
|
845f11526e | ||
|
|
7982def853 | ||
|
|
13e13ba352 | ||
|
|
55b743496b | ||
|
|
4a6aecceea | ||
|
|
2454cac7be | ||
|
|
41a03ef4e0 | ||
|
|
7879b31630 | ||
|
|
57ea82f088 | ||
|
|
22d599c0cf | ||
|
|
c861878058 | ||
|
|
9f5ae31222 | ||
|
|
6ec058c835 | ||
|
|
faffb818f9 | ||
|
|
bdf9439e49 | ||
|
|
75b36bb160 | ||
|
|
43587656bb | ||
|
|
8cab4b0333 | ||
|
|
154ad1e01e | ||
|
|
cd2d0ba53f | ||
|
|
37d7c8535f | ||
|
|
a0e0083b16 | ||
|
|
5317a25cfb | ||
|
|
b619ba1d46 | ||
|
|
2baab5402d | ||
|
|
174851bd19 | ||
|
|
a7b195d2cb | ||
|
|
0ab78142b3 | ||
|
|
3f73474d31 | ||
|
|
f2f5128cbd | ||
|
|
50bf7cdf19 | ||
|
|
ec15529ca4 | ||
|
|
db8a3291da | ||
|
|
e2410f143c | ||
|
|
cb2862bc79 | ||
|
|
dbe8d84202 | ||
|
|
612038ad07 | ||
|
|
72ad935ddf | ||
|
|
859747037b | ||
|
|
dfa87939f2 | ||
|
|
402d948fe7 | ||
|
|
d8480c05a6 | ||
|
|
6047eb4477 | ||
|
|
8b1e3babc0 | ||
|
|
1e869f6a96 | ||
|
|
7607140f94 | ||
|
|
f037da5831 | ||
|
|
f0ef4729bf | ||
|
|
ab1418514d | ||
|
|
a5b6c120dd | ||
|
|
9e7d5ad629 | ||
|
|
a86cdb9fb9 | ||
|
|
270fce6a0e | ||
|
|
2680255f44 | ||
|
|
ddf87d278e | ||
|
|
822d2c194b | ||
|
|
f5f7f3e433 | ||
|
|
b1b3b79cd9 | ||
|
|
35d40d0dea | ||
|
|
abb2dfc92a | ||
|
|
279d830b79 | ||
|
|
72a93e681f | ||
|
|
c977b84e2d | ||
|
|
e92c407beb | ||
|
|
05af82bc02 | ||
|
|
531bfd6fcf | ||
|
|
fa40b6b647 | ||
|
|
c363cf8457 | ||
|
|
0a78e3f12a | ||
|
|
f380b383a3 | ||
|
|
b30dbafbbb | ||
|
|
a9bcc9d04b | ||
|
|
451e68ab57 | ||
|
|
a7ed7a4592 | ||
|
|
2dd3c906c4 | ||
|
|
6a200c39af | ||
|
|
e88e3d17c0 | ||
|
|
46db8b6ab3 | ||
|
|
545dba0c8f | ||
|
|
cbb85159d6 | ||
|
|
ff07658212 | ||
|
|
a9582f04ed | ||
|
|
2b4c83dcca | ||
|
|
336c55b3e9 | ||
|
|
eb5dd3628a | ||
|
|
c19766e53f | ||
|
|
cc153fff10 | ||
|
|
b71718be09 | ||
|
|
b07c545f17 | ||
|
|
4aff9819e5 | ||
|
|
9e0c3c0117 | ||
|
|
107ec7737a | ||
|
|
d4177afc18 | ||
|
|
7679553f16 | ||
|
|
4f2cc9af2a | ||
|
|
6820f8afea | ||
|
|
4a5bafa790 | ||
|
|
8d1ff4065d | ||
|
|
14d87178b5 | ||
|
|
c2b54ddfaa | ||
|
|
cefbf0e271 | ||
|
|
189806b5a2 | ||
|
|
9c134c5ceb | ||
|
|
682099189b | ||
|
|
32218beb7e | ||
|
|
332b6b4f42 | ||
|
|
aca893254c | ||
|
|
2fb2981d2f | ||
|
|
5d84888a33 | ||
|
|
728f7e489a | ||
|
|
0e3ac069d9 | ||
|
|
505a6b3a89 | ||
|
|
7c8adab061 | ||
|
|
b11bf367d0 | ||
|
|
15c2037230 | ||
|
|
3735c998e4 | ||
|
|
192a43a031 | ||
|
|
e9c908b317 | ||
|
|
49d9394cd7 | ||
|
|
798293813c | ||
|
|
42a3791e6b | ||
|
|
3d8e22574e | ||
|
|
531d87a83b | ||
|
|
929a803965 | ||
|
|
003dac4744 | ||
|
|
d7f0596db8 | ||
|
|
dec490365a | ||
|
|
1639da5779 | ||
|
|
d53c922688 | ||
|
|
22f5d3b959 | ||
|
|
8d64cb8a5e | ||
|
|
bbd42600aa | ||
|
|
8859923bb7 | ||
|
|
e23a397a80 | ||
|
|
f88bf9582e | ||
|
|
22bbef9d8e | ||
|
|
4f2b8217f8 | ||
|
|
2fefd9da01 | ||
|
|
b3e9b3351b | ||
|
|
d4e4c9669d | ||
|
|
1db20df19c | ||
|
|
feaf022965 | ||
|
|
5b4e6fcc11 | ||
|
|
20a9b3d556 | ||
|
|
47b2d36f7a | ||
|
|
2336f9ee5e | ||
|
|
6fa6ba385e | ||
|
|
dadf596a31 | ||
|
|
7537184a81 | ||
|
|
5a81d035cf | ||
|
|
b0b6fbd315 | ||
|
|
883161357d | ||
|
|
24694b9241 | ||
|
|
13b99d021b | ||
|
|
94dfddf8bd | ||
|
|
b6b11c39d2 | ||
|
|
369b4d4863 | ||
|
|
6f8e62963a | ||
|
|
991044ebd7 | ||
|
|
b3f012226b | ||
|
|
63c55cec57 | ||
|
|
c009dd7de6 | ||
|
|
62764499e7 | ||
|
|
09227a3884 | ||
|
|
37bafaa71a | ||
|
|
237d11d2c0 | ||
|
|
4efe7496a5 | ||
|
|
c3fa4e866c | ||
|
|
1938798ba1 | ||
|
|
4fb48c23a2 | ||
|
|
e13afb721e | ||
|
|
3ed31d8f59 | ||
|
|
1d5b4fd7fb | ||
|
|
55cf3c72a3 | ||
|
|
9648d9e99f | ||
|
|
0e0b857905 | ||
|
|
7d93b10032 | ||
|
|
6fa9087a11 | ||
|
|
d2f438f294 | ||
|
|
2423ecdce5 | ||
|
|
7094110da2 | ||
|
|
72ec253644 | ||
|
|
3bbde3cbb8 | ||
|
|
6f85b2161f | ||
|
|
c85910d24f | ||
|
|
397c1d3dbc | ||
|
|
078fb6de93 | ||
|
|
8159b4f146 | ||
|
|
e8f6876d24 | ||
|
|
615062c6b1 | ||
|
|
d9294ed4bf | ||
|
|
d1d8659f95 | ||
|
|
ac80008ce0 | ||
|
|
13853f2981 | ||
|
|
f995cba157 | ||
|
|
91a9b6bec9 | ||
|
|
314ab3a28e | ||
|
|
7841b58f0f | ||
|
|
63f91b6352 | ||
|
|
4fd8ac9118 | ||
|
|
1bd924ea99 | ||
|
|
1040ecac04 | ||
|
|
729b49ffa9 | ||
|
|
dbf5b375f5 | ||
|
|
7e8723ce57 | ||
|
|
c5e83943a4 | ||
|
|
d3424ec71b | ||
|
|
9bfcb04aa2 | ||
|
|
ec24fe22f9 | ||
|
|
f68600150a | ||
|
|
d3c2ad134f | ||
|
|
25f3b074ee | ||
|
|
ba9c3f3e27 | ||
|
|
3daadec358 | ||
|
|
21225c979e | ||
|
|
3091ed6358 | ||
|
|
451602d1e6 | ||
|
|
745121c4b4 | ||
|
|
0bd3a8728a | ||
|
|
8ee05e0d49 | ||
|
|
5c4f394501 | ||
|
|
85c460190c | ||
|
|
7c10becc74 | ||
|
|
5723da21aa | ||
|
|
a9085399c0 | ||
|
|
aa36ce3c47 | ||
|
|
12ad241406 | ||
|
|
22fd8e9b95 | ||
|
|
c12f1bf2b3 | ||
|
|
1c6e23a4b6 | ||
|
|
c7fa5cdbb3 | ||
|
|
bece83eb8b | ||
|
|
00dd32bbe1 | ||
|
|
d941ed58fa | ||
|
|
324bfd90d1 | ||
|
|
b02e8cc875 | ||
|
|
7b207cc83b | ||
|
|
4b8f8a1785 | ||
|
|
bbf0adf31a | ||
|
|
8b79e54245 | ||
|
|
2c9b47bc0b | ||
|
|
217a9fe864 | ||
|
|
4a2cfcd8b5 | ||
|
|
a682cc430b | ||
|
|
dabe96bd5e | ||
|
|
04e7a202d0 | ||
|
|
5159d9f0e7 | ||
|
|
3778338e34 | ||
|
|
9a878af414 | ||
|
|
4eece0d607 | ||
|
|
cdd90b8aa0 | ||
|
|
6aaaf31d8b | ||
|
|
df08046cdf | ||
|
|
340399597b | ||
|
|
671e5621ad | ||
|
|
4da8734ff3 | ||
|
|
9807afcec7 | ||
|
|
c2f2f96bc7 | ||
|
|
bc2a532a03 | ||
|
|
905b7954ca | ||
|
|
e248db4508 | ||
|
|
2893152377 | ||
|
|
751fb35f90 | ||
|
|
58a90d3fc5 | ||
|
|
ff1159943c | ||
|
|
663789c891 | ||
|
|
91015484bd | ||
|
|
ec45aacc63 | ||
|
|
1c06e562c3 | ||
|
|
4717a5724d | ||
|
|
8f86944014 | ||
|
|
0e29a2fce1 | ||
|
|
249a9264e6 | ||
|
|
4763908b5d | ||
|
|
8bf2a43e06 | ||
|
|
bcb626600b | ||
|
|
be543dadb6 | ||
|
|
eb2f85f6f8 | ||
|
|
a10807a6c4 | ||
|
|
3df52f4013 | ||
|
|
0b0fb1c579 | ||
|
|
5971af91a8 | ||
|
|
ac3b4e7de0 | ||
|
|
52792af186 | ||
|
|
66ad67eced | ||
|
|
1161bbd038 | ||
|
|
3322e82aab | ||
|
|
b6aa3afc6f | ||
|
|
b959cac88f | ||
|
|
91fc5a5c74 | ||
|
|
fce970c706 | ||
|
|
9c6b2505a4 | ||
|
|
d999f37975 | ||
|
|
91846bc000 | ||
|
|
c75c38e391 | ||
|
|
cc63edf400 | ||
|
|
2ba6620343 | ||
|
|
9c79a3bbcd | ||
|
|
cfaf82cd04 | ||
|
|
3f01d59180 | ||
|
|
12ba14bb3f | ||
|
|
f72ffb6558 | ||
|
|
7ca38c3a78 | ||
|
|
51585c6413 | ||
|
|
6861839b65 | ||
|
|
98488b55cd | ||
|
|
c3a4051007 | ||
|
|
ba860193d7 | ||
|
|
908bced0df | ||
|
|
42e53261ef | ||
|
|
4aad0873ba | ||
|
|
fef3d8eac2 | ||
|
|
e3c8174bdc | ||
|
|
3d2bc82a33 | ||
|
|
61118d7a5e | ||
|
|
02ec0898ef | ||
|
|
ea0a411c81 | ||
|
|
210d46b43f | ||
|
|
8bac6e1c5a | ||
|
|
15c7fc5ae8 | ||
|
|
ee6266707f | ||
|
|
dacbcce179 | ||
|
|
d67c2db886 | ||
|
|
193d4d2e2a | ||
|
|
53d46257ce | ||
|
|
b8f9b4cf1d | ||
|
|
37cfc75e51 | ||
|
|
e714ebf87d | ||
|
|
8c4be2fbe8 | ||
|
|
24560cb93f | ||
|
|
4183ea67c8 | ||
|
|
98662a5daa | ||
|
|
840d1107ec | ||
|
|
ac5bc70a5d | ||
|
|
6be7cb6d1a | ||
|
|
b4186a3d0a | ||
|
|
8fcd73ff08 | ||
|
|
bb9da3007e | ||
|
|
475f14dc31 | ||
|
|
46ba48fb20 | ||
|
|
bd6b0d7e5e | ||
|
|
dcae437fc5 | ||
|
|
7e8f7447a5 | ||
|
|
1e822fbe0c | ||
|
|
4e1baa5703 | ||
|
|
c6c48ea6e5 | ||
|
|
ba0ed77bb0 | ||
|
|
1b8dde98d2 | ||
|
|
71fbb512f4 | ||
|
|
211a4dea05 | ||
|
|
fcb020c191 | ||
|
|
50601d5379 | ||
|
|
b04aa81490 | ||
|
|
db14d98d19 | ||
|
|
d4188120e1 | ||
|
|
c36e947935 | ||
|
|
56ecce2541 | ||
|
|
116eafa361 | ||
|
|
bc7ec63f85 | ||
|
|
80fbbda111 | ||
|
|
72fcae1b85 | ||
|
|
be1a26a98d | ||
|
|
30f561f85a | ||
|
|
661d738302 | ||
|
|
8002882979 | ||
|
|
5bd6cceaf1 | ||
|
|
60fcb71bd2 | ||
|
|
175d7d6324 | ||
|
|
9e8701171b | ||
|
|
6568c22d86 | ||
|
|
e1a79afaaa | ||
|
|
e561fc550f | ||
|
|
f2f16f0502 | ||
|
|
c92fd3a9ca | ||
|
|
4dc04bb58b | ||
|
|
d694b1a541 | ||
|
|
0fff39ee1c | ||
|
|
6efabd4368 | ||
|
|
18e16d687f | ||
|
|
e8c7f45476 | ||
|
|
7bf5bbd035 | ||
|
|
29d9a9d288 | ||
|
|
69d90c1ece | ||
|
|
5946e6c719 | ||
|
|
74753c8918 | ||
|
|
ef4ed16dc4 | ||
|
|
49570417d4 | ||
|
|
98283ff526 | ||
|
|
da965668d0 | ||
|
|
c92d487cea | ||
|
|
81cecbfb57 | ||
|
|
f1d2f07f38 | ||
|
|
04b35980f5 | ||
|
|
3b21c3ef76 | ||
|
|
ad41a918ef | ||
|
|
0b654aeafa | ||
|
|
9e9b904f69 | ||
|
|
b479fea6eb | ||
|
|
4a86361134 | ||
|
|
b67fecd396 | ||
|
|
075ddb7a83 | ||
|
|
c3932b18f0 | ||
|
|
6dd13f6dea | ||
|
|
129d96f607 | ||
|
|
0fafa505ac | ||
|
|
5e085b0da0 | ||
|
|
c2d9f18e4e | ||
|
|
4209f7c70e | ||
|
|
10848db595 | ||
|
|
43b6246876 | ||
|
|
bd07570c8d | ||
|
|
62b6939b92 | ||
|
|
c3071a3c95 | ||
|
|
1115ad1364 | ||
|
|
4cfd2aca94 | ||
|
|
460d53cafa | ||
|
|
0b88d5703e | ||
|
|
054ca57188 | ||
|
|
c3a7ab52ee | ||
|
|
8ee1e32e83 | ||
|
|
24e24dc634 | ||
|
|
6303aec209 | ||
|
|
7c3fe3d6d4 | ||
|
|
e67483fea5 | ||
|
|
d1f7e04a2a | ||
|
|
0a2f71bd31 | ||
|
|
aeb6e0f406 | ||
|
|
df264f58d0 | ||
|
|
71aa5b660b | ||
|
|
5c6eafb272 | ||
|
|
e88d126355 | ||
|
|
d3e0b47875 | ||
|
|
ec40309cde | ||
|
|
a3ba70177b | ||
|
|
0eab26cdac | ||
|
|
a9db68bd3e | ||
|
|
d2c075517f | ||
|
|
fab80d5ab2 | ||
|
|
8811af5e6e | ||
|
|
9ba82133da | ||
|
|
67e1b9bdc3 | ||
|
|
08711a551f | ||
|
|
ef1197b382 | ||
|
|
26144e22f4 | ||
|
|
e078237e31 | ||
|
|
1a33d8ccee | ||
|
|
b354085c7a | ||
|
|
a43429b351 | ||
|
|
203ebbbd4e | ||
|
|
0bdc76cc23 | ||
|
|
840940bab6 | ||
|
|
d03026187c | ||
|
|
aeb1df1229 | ||
|
|
dea3f02e6f | ||
|
|
6fd0fb5508 | ||
|
|
ce72b21a04 | ||
|
|
b1658a5d01 | ||
|
|
4df63eacc5 | ||
|
|
3cca339881 | ||
|
|
fd18cf79cc | ||
|
|
a727b8e323 | ||
|
|
21c3882189 | ||
|
|
d0c27b22ef | ||
|
|
a50a29a778 | ||
|
|
23545101b6 | ||
|
|
f2eec74849 | ||
|
|
99a2574d80 | ||
|
|
66bde23667 | ||
|
|
c58da00957 | ||
|
|
6700124ccd | ||
|
|
f428abc0ce | ||
|
|
16e3e5b90b | ||
|
|
86b6c1a788 | ||
|
|
4648741bcc | ||
|
|
5da5a83a41 | ||
|
|
ff338e20a5 | ||
|
|
81dac58005 | ||
|
|
0ef3046d65 | ||
|
|
62caa71a48 | ||
|
|
15119b66e9 | ||
|
|
41b02b63d9 | ||
|
|
63a0793c6e | ||
|
|
101c1fd819 | ||
|
|
09006c3169 | ||
|
|
5a8e864630 | ||
|
|
fa84bd569f | ||
|
|
e50ed15eb3 | ||
|
|
c847f6004d | ||
|
|
40ee667832 | ||
|
|
02e722aa45 | ||
|
|
416e31fab6 | ||
|
|
e3ba1ee931 | ||
|
|
fcd417198f | ||
|
|
b9bc9dd38d | ||
|
|
3ade915d35 | ||
|
|
c6be8c5475 | ||
|
|
1623fbaaeb | ||
|
|
b923891fac | ||
|
|
624bd55b11 | ||
|
|
9d4fb9eb46 | ||
|
|
fa64b2c525 | ||
|
|
2e58acc3bd |
No files matched your search
@@ -0,0 +1,191 @@
|
|||||||
|
---
|
||||||
|
description: Comprehensive Homarr codebase architecture and conventions reference
|
||||||
|
alwaysApply: true
|
||||||
|
---
|
||||||
|
|
||||||
|
# Homarr Codebase Context
|
||||||
|
|
||||||
|
Homarr is an open-source, self-hosted dashboard for managing homelab services. It integrates with 50+ self-hosted apps (media servers, download clients, DNS, NAS, etc.) and provides a drag-and-drop widget-based UI.
|
||||||
|
|
||||||
|
## Tech Stack
|
||||||
|
|
||||||
|
- **Monorepo**: pnpm workspaces + Turborepo
|
||||||
|
- **Framework**: Next.js (App Router, `output: "standalone"`) — T3 Stack
|
||||||
|
- **Language**: TypeScript throughout
|
||||||
|
- **ORM**: Drizzle (supports SQLite via better-sqlite3, MySQL, PostgreSQL)
|
||||||
|
- **API**: tRPC (HTTP + WebSocket subscriptions) with superjson + OpenAPI bridge via `trpc-to-openapi`
|
||||||
|
- **Auth**: NextAuth v5 (database sessions, Credentials/LDAP/OIDC providers)
|
||||||
|
- **UI**: Mantine v7 (not Tailwind) + Tabler icons
|
||||||
|
- **State**: Jotai (atoms), TanStack Query (server state via tRPC)
|
||||||
|
- **Realtime**: WebSocket server (`ws`) for tRPC subscriptions, backed by Redis pub/sub
|
||||||
|
- **Cron**: `node-cron` in a standalone Fastify service (`apps/tasks`)
|
||||||
|
- **i18n**: next-intl with `[locale]` dynamic segment (prefix mode: `"never"`, locale from cookie)
|
||||||
|
- **Testing**: Vitest + jsdom, Playwright for E2E
|
||||||
|
- **Package manager**: pnpm 10.33.2, Node >= 24.15.0
|
||||||
|
|
||||||
|
## Repository Structure
|
||||||
|
|
||||||
|
```
|
||||||
|
homarr/
|
||||||
|
├── apps/
|
||||||
|
│ ├── nextjs/ # Main Next.js application (port 3000)
|
||||||
|
│ ├── tasks/ # Cron job runner + Fastify tRPC API (port 3002)
|
||||||
|
│ └── websocket/ # Standalone tRPC WebSocket server (port 3001)
|
||||||
|
├── packages/
|
||||||
|
│ ├── api/ # tRPC appRouter, procedures, OpenAPI
|
||||||
|
│ ├── auth/ # NextAuth config, providers, session, API keys
|
||||||
|
│ ├── db/ # Drizzle schema (3 DB drivers), migrations, queries
|
||||||
|
│ ├── core/ # Env validation, DB/Redis driver factories, logging
|
||||||
|
│ ├── definitions/ # Domain enums: WidgetKind, IntegrationKind, permissions
|
||||||
|
│ ├── widgets/ # All 39 dashboard widgets (definitions + components)
|
||||||
|
│ ├── integrations/ # Integration classes (HTTP clients to external apps)
|
||||||
|
│ ├── redis/ # Redis pub/sub channels, caching abstractions
|
||||||
|
│ ├── translation/ # next-intl setup, locale configs, lang JSON files
|
||||||
|
│ ├── ui/ # Shared Mantine components, theme, hooks
|
||||||
|
│ ├── validation/ # Shared zod schemas for API/forms
|
||||||
|
│ ├── common/ # Shared utilities, IDs, errors
|
||||||
|
│ ├── cron-jobs/ # Cron job implementations (25+ jobs)
|
||||||
|
│ ├── cron-jobs-core/ # Cron scheduling primitives
|
||||||
|
│ ├── cron-job-api/ # tRPC router for job management (start/stop/trigger)
|
||||||
|
│ ├── cron-job-status/ # Cron status via Redis
|
||||||
|
│ ├── boards/ # Board context, edit mode, cache updater
|
||||||
|
│ ├── modals/ # Modal primitives on Mantine
|
||||||
|
│ ├── modals-collection/ # Feature modals (apps, boards, docker, etc.)
|
||||||
|
│ ├── form/ # useZodForm (Mantine + zod resolver)
|
||||||
|
│ ├── forms-collection/# Reusable form UIs (new app, icon picker, upload)
|
||||||
|
│ ├── spotlight/ # Command palette / search with multiple modes
|
||||||
|
│ ├── request-handler/ # Server request handlers (feeds, integrations)
|
||||||
|
│ ├── notifications/ # Mantine notifications wrapper
|
||||||
|
│ ├── docker/ # Dockerode-based Docker access
|
||||||
|
│ ├── icons/ # Icon DB/repo integration
|
||||||
|
│ ├── image-proxy/ # Image proxy + caching
|
||||||
|
│ ├── ping/ # Reachability / ping utilities
|
||||||
|
│ ├── analytics/ # Server-side analytics (Umami)
|
||||||
|
│ ├── server-settings/ # Server setting keys/types
|
||||||
|
│ ├── settings/ # User-facing settings UI context
|
||||||
|
│ ├── old-import/ # Legacy Homarr import
|
||||||
|
│ ├── old-schema/ # Legacy Homarr zod schemas
|
||||||
|
│ └── cli/ # Node CLI for ops (brocli)
|
||||||
|
├── tooling/
|
||||||
|
│ ├── eslint/ # Shared ESLint configs
|
||||||
|
│ ├── prettier/ # Shared Prettier config
|
||||||
|
│ ├── typescript/ # Base tsconfig
|
||||||
|
│ └── github/ # CI setup action
|
||||||
|
├── development/ # Dev docker-compose (Redis, MySQL, PostgreSQL)
|
||||||
|
├── e2e/ # E2E test specs
|
||||||
|
└── Dockerfile # Multi-stage production build
|
||||||
|
```
|
||||||
|
|
||||||
|
## Three Runtime Services
|
||||||
|
|
||||||
|
| Service | Port | Role |
|
||||||
|
|---------|------|------|
|
||||||
|
| Next.js | 3000 | Main web app (SSR + API routes) |
|
||||||
|
| WebSocket | 3001 | tRPC subscriptions via `ws` |
|
||||||
|
| Tasks | 3002 | Cron job runner + management API via Fastify |
|
||||||
|
|
||||||
|
In Docker, nginx listens on **7575** and proxies to all three. The tasks service authenticates via `CRON_JOB_API_KEY` header.
|
||||||
|
|
||||||
|
## Package Dependency Layers
|
||||||
|
|
||||||
|
1. **Foundation**: `core` (env, DB drivers, Redis client, logging) → no `@homarr` deps
|
||||||
|
2. **Domain**: `definitions` → `common` → `core`
|
||||||
|
3. **Data**: `db` → `core`, `definitions`, `common`
|
||||||
|
4. **Auth**: `auth` → `db`, `definitions`, `core`, `validation`
|
||||||
|
5. **Cross-cutting**: `translation`, `validation`, `redis`, `server-settings`
|
||||||
|
6. **Feature backends**: `integrations`, `request-handler`, `cron-jobs`, `docker`, `ping`
|
||||||
|
7. **API surface**: `api` → pulls in auth, db, redis, integrations, etc.
|
||||||
|
8. **UI stack**: `ui`, `modals`, `form`, `notifications`, `boards`, `spotlight`
|
||||||
|
9. **Composed features**: `widgets`, `modals-collection`, `forms-collection`
|
||||||
|
|
||||||
|
## Key Patterns
|
||||||
|
|
||||||
|
### tRPC
|
||||||
|
|
||||||
|
- **Server caller** (RSC): `import { api } from "@homarr/api/server"` → cached caller with auth context
|
||||||
|
- **Client hooks**: `import { clientApi } from "@homarr/api/client"` → React Query hooks
|
||||||
|
- **Router structure**: `packages/api/src/root.ts` defines top-level namespaces (`user`, `board`, `widget`, `integration`, `docker`, `kubernetes`, etc.)
|
||||||
|
- **Procedures**: `publicProcedure`, `protectedProcedure`, `permissionRequiredProcedure`, `onboardingProcedure`
|
||||||
|
- **WebSocket subscriptions**: Client uses `wsLink` when `type === "subscription"`, connects to port 3001
|
||||||
|
|
||||||
|
### Multi-Database Support
|
||||||
|
|
||||||
|
Drizzle schemas exist in three parallel implementations:
|
||||||
|
- `packages/db/schema/sqlite.ts`
|
||||||
|
- `packages/db/schema/mysql.ts`
|
||||||
|
- `packages/db/schema/postgresql.ts`
|
||||||
|
|
||||||
|
Selected at runtime via `DB_DRIVER` env (`better-sqlite3` | `mysql2` | `node-postgres`). Migrations are per-engine in `packages/db/migrations/{sqlite,mysql,postgresql}/`.
|
||||||
|
|
||||||
|
### Widget System
|
||||||
|
|
||||||
|
Widgets are registered in `packages/widgets/src/index.tsx` as `widgetImports` (must satisfy `Record<WidgetKind, ...>`). Each widget:
|
||||||
|
- Has a `definition` created via `createWidgetDefinition(kind, { icon, createOptions, supportedIntegrations? })`
|
||||||
|
- Uses `optionsBuilder.from(factory => ({ ... }))` for typed options
|
||||||
|
- Loads dynamically via `next/dynamic`
|
||||||
|
- Fetches data via tRPC client hooks (backed by cron job caches)
|
||||||
|
|
||||||
|
### Integration System
|
||||||
|
|
||||||
|
Integrations are defined in `packages/definitions/src/integration.ts` (`integrationDefs`) and instantiated via `createIntegrationAsync` in `packages/integrations/src/base/creator.ts`. Each extends abstract `Integration` class with `testConnectionAsync` and typed methods.
|
||||||
|
|
||||||
|
### Cron Job System
|
||||||
|
|
||||||
|
Jobs defined in `packages/cron-jobs/src/jobs/`. Each job:
|
||||||
|
- Uses `createCronJob` with a cron expression
|
||||||
|
- Publishes results to Redis channels
|
||||||
|
- Widget subscriptions consume those channels via tRPC subscriptions
|
||||||
|
- Job management (start/stop/trigger) via `cronJobApi` HTTP client to port 3002
|
||||||
|
|
||||||
|
### Modals
|
||||||
|
|
||||||
|
Created with `createModal(component).withOptions({ defaultTitle })` from `@homarr/modals`. Opened via `useModalAction(SomeModal)`. Feature modals live in `packages/modals-collection/`.
|
||||||
|
|
||||||
|
### Forms
|
||||||
|
|
||||||
|
`useZodForm` from `@homarr/form` wraps Mantine `useForm` with zod validation. Shared form UIs in `packages/forms-collection/`.
|
||||||
|
|
||||||
|
### Routing (App Router)
|
||||||
|
|
||||||
|
- `apps/nextjs/src/app/[locale]/` — all UI routes under locale segment
|
||||||
|
- Route groups: `(home)`, `(content)`, `(board)` — don't affect URLs
|
||||||
|
- Key routes: `boards/[name]`, `manage/...` (admin), `auth/login`, `init` (onboarding), `widgets/[kind]`
|
||||||
|
- Locale driven by cookie (no URL prefix)
|
||||||
|
|
||||||
|
### Auth Providers
|
||||||
|
|
||||||
|
Configured via `AUTH_PROVIDERS` env. Supports: `credentials` (local), `ldap`, `oidc`. Database sessions with httpOnly cookies. API key auth for programmatic access.
|
||||||
|
|
||||||
|
## Environment Variables
|
||||||
|
|
||||||
|
Key env vars (from `.env.example`):
|
||||||
|
- `DB_DRIVER`: `better-sqlite3` | `mysql2` | `node-postgres`
|
||||||
|
- `DB_URL`: Database connection string
|
||||||
|
- `AUTH_SECRET`: NextAuth secret
|
||||||
|
- `SECRET_ENCRYPTION_KEY`: AES-256-CBC for integration secrets
|
||||||
|
- `AUTH_PROVIDERS`: Comma-separated (`credentials`, `ldap`, `oidc`)
|
||||||
|
- `CRON_JOB_API_KEY`: Shared key between Next.js and tasks service
|
||||||
|
- `REDIS_*`: Redis connection (host, port, password)
|
||||||
|
- `ENABLE_KUBERNETES`: Optional Kubernetes integration
|
||||||
|
|
||||||
|
## Development Commands
|
||||||
|
|
||||||
|
- `pnpm dev` — runs all three services in parallel via Turborepo
|
||||||
|
- `pnpm docker:dev` — starts Redis + MySQL + PostgreSQL containers
|
||||||
|
- `pnpm db:push` — push schema to SQLite (dev)
|
||||||
|
- `pnpm db:studio` — Drizzle Studio
|
||||||
|
- `pnpm test` — Vitest unit tests
|
||||||
|
- `pnpm test:e2e` — Playwright E2E
|
||||||
|
- `pnpm lint` / `pnpm format` — ESLint + Prettier
|
||||||
|
- `pnpm typecheck` — tsc --noEmit across all packages
|
||||||
|
|
||||||
|
## Conventions
|
||||||
|
|
||||||
|
- Workspace packages use `@homarr/` scope
|
||||||
|
- All versions managed via pnpm `catalog:` in workspace
|
||||||
|
- Path alias `~/*` → `./src/*` in Next.js app
|
||||||
|
- Mantine for all UI (no Tailwind) — primary color is red, `autoContrast: true`
|
||||||
|
- Icons from `@tabler/icons-react`
|
||||||
|
- Drag-and-drop via `@dnd-kit/*`
|
||||||
|
- `typescript.ignoreBuildErrors: true` in next.config (types checked separately via `typecheck`)
|
||||||
|
- `serverExternalPackages`: `dockerode`, `isomorphic-dompurify`, `jsdom`
|
||||||
@@ -5,7 +5,12 @@ node_modules
|
|||||||
npm-debug.log
|
npm-debug.log
|
||||||
README.md
|
README.md
|
||||||
.next
|
.next
|
||||||
|
.turbo
|
||||||
.git
|
.git
|
||||||
dev
|
dev
|
||||||
.build
|
.build
|
||||||
e2e
|
e2e
|
||||||
|
apps/nextjs/.next
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
!.env.example
|
||||||
+14
-4
@@ -12,10 +12,6 @@ AUTH_SECRET="supersecret"
|
|||||||
# or starting the project without any (which will show a randomly generated one).
|
# or starting the project without any (which will show a randomly generated one).
|
||||||
SECRET_ENCRYPTION_KEY=0000000000000000000000000000000000000000000000000000000000000000
|
SECRET_ENCRYPTION_KEY=0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
|
||||||
# Cron job API key is generated every time the container starts as it is required for communication between nextjs-api and tasks-api
|
|
||||||
# export CRON_JOB_API_KEY=$(openssl rand -base64 32)
|
|
||||||
# CRON_JOB_API_KEY="your-generated-api-key"
|
|
||||||
|
|
||||||
LOG_LEVEL='info'
|
LOG_LEVEL='info'
|
||||||
|
|
||||||
# This is how you can use the sqlite driver:
|
# This is how you can use the sqlite driver:
|
||||||
@@ -45,6 +41,20 @@ DB_URL='FULL_PATH_TO_YOUR_SQLITE_DB_FILE'
|
|||||||
|
|
||||||
TURBO_TELEMETRY_DISABLED=1
|
TURBO_TELEMETRY_DISABLED=1
|
||||||
|
|
||||||
|
# Turborepo remote cache (optional, for faster CI/local builds)
|
||||||
|
# Uncomment and fill in to enable remote caching locally.
|
||||||
|
# CI uses GitHub secrets for these values automatically.
|
||||||
|
# TURBO_API=https://your-cache-worker.workers.dev
|
||||||
|
# TURBO_TEAM=team_your_team
|
||||||
|
# TURBO_TOKEN=your-turbo-token
|
||||||
|
# TURBO_REMOTE_CACHE_SIGNATURE_KEY=your-signature-key
|
||||||
|
|
||||||
|
# Comma-separated paths to Docker-compatible Unix sockets.
|
||||||
|
# Useful for connecting to multiple runtimes (Docker + Podman) simultaneously.
|
||||||
|
# When unset and no TCP hosts configured, defaults to /var/run/docker.sock.
|
||||||
|
# Example: DOCKER_SOCKET_PATHS=/var/run/docker.sock,/run/user/1000/podman/podman.sock
|
||||||
|
# DOCKER_SOCKET_PATHS=
|
||||||
|
|
||||||
# Enable kubernetes tool
|
# Enable kubernetes tool
|
||||||
# ENABLE_KUBERNETES=true
|
# ENABLE_KUBERNETES=true
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,27 @@ body:
|
|||||||
options:
|
options:
|
||||||
# The below comment is used to insert a new version with on-release.yml
|
# The below comment is used to insert a new version with on-release.yml
|
||||||
#NEXT_VERSION#
|
#NEXT_VERSION#
|
||||||
|
- 1.61.0
|
||||||
|
- 1.60.1-beta.1
|
||||||
|
- 1.60.0
|
||||||
|
- 1.59.3
|
||||||
|
- 1.59.2
|
||||||
|
- 1.59.1
|
||||||
|
- 1.59.0
|
||||||
|
- 1.58.1
|
||||||
|
- 1.58.0
|
||||||
|
- 1.57.1
|
||||||
|
- 1.57.0
|
||||||
|
- 1.56.1
|
||||||
|
- 1.56.0
|
||||||
|
- 1.55.0
|
||||||
|
- 1.54.0
|
||||||
|
- 1.53.0
|
||||||
|
- 1.52.0
|
||||||
|
- 1.51.0
|
||||||
|
- 1.50.1
|
||||||
|
- 1.50.0
|
||||||
|
- 1.49.1
|
||||||
- 1.49.0
|
- 1.49.0
|
||||||
- 1.48.0
|
- 1.48.0
|
||||||
- 1.47.0
|
- 1.47.0
|
||||||
|
|||||||
@@ -25,16 +25,16 @@ body:
|
|||||||
label: Public API available?
|
label: Public API available?
|
||||||
description: Is there a public API available, that we can consume in Homarr?
|
description: Is there a public API available, that we can consume in Homarr?
|
||||||
options:
|
options:
|
||||||
- Yes, available on a website
|
- "Yes, available on a website"
|
||||||
- Yes, available in the application itself
|
- "Yes, available in the application itself"
|
||||||
- No
|
- "No"
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: dropdown
|
- type: dropdown
|
||||||
attributes:
|
attributes:
|
||||||
label: Are you willing to contribute this yourself?
|
label: Are you willing to contribute this yourself?
|
||||||
options:
|
options:
|
||||||
- Yes
|
- "Yes"
|
||||||
- No
|
- "No"
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
@@ -24,7 +24,7 @@ body:
|
|||||||
attributes:
|
attributes:
|
||||||
label: Are you willing to contribute this yourself?
|
label: Are you willing to contribute this yourself?
|
||||||
options:
|
options:
|
||||||
- Yes
|
- "Yes"
|
||||||
- No
|
- "No"
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
@@ -19,6 +19,11 @@ inputs:
|
|||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
|
- name: Prebuilt debian dependencies
|
||||||
|
uses: homarr-labs/homarr/.github/actions/prebuilt-debian@dev
|
||||||
|
id: prebuilt-debian
|
||||||
|
with:
|
||||||
|
architecture: ${{ inputs.architecture }}
|
||||||
- name: Start docker container for ${{ inputs.architecture }}
|
- name: Start docker container for ${{ inputs.architecture }}
|
||||||
run: |
|
run: |
|
||||||
docker run --name homarr \
|
docker run --name homarr \
|
||||||
@@ -36,9 +41,12 @@ runs:
|
|||||||
docker cp homarr:/app/extraction-alpine.tar.gz ${{ runner.temp }}/extraction/${{ inputs.architecture }}/build-alpine-${{ inputs.architecture }}.tar.gz && \
|
docker cp homarr:/app/extraction-alpine.tar.gz ${{ runner.temp }}/extraction/${{ inputs.architecture }}/build-alpine-${{ inputs.architecture }}.tar.gz && \
|
||||||
docker exec homarr rm /app/extraction-alpine.tar.gz
|
docker exec homarr rm /app/extraction-alpine.tar.gz
|
||||||
shell: bash
|
shell: bash
|
||||||
- name: Copy source for debian build artifact
|
- name: Extract source from ${{ inputs.architecture }} container (debian)
|
||||||
run: |
|
run: |
|
||||||
cp ${{ runner.temp }}/extraction/${{ inputs.architecture }}/build-alpine-${{ inputs.architecture }}.tar.gz ${{ runner.temp }}/extraction/${{ inputs.architecture }}/build-debian-${{ inputs.architecture }}.tar.gz
|
docker cp ${{ steps.prebuilt-debian.outputs.path }}/. homarr:/app/build && \
|
||||||
|
docker cp ${{ steps.prebuilt-debian.outputs.path }}/. homarr:/app/node_modules/better-sqlite3/build/Release && \
|
||||||
|
docker exec homarr tar -czf extraction-debian.tar.gz -C /app . && \
|
||||||
|
docker cp homarr:/app/extraction-debian.tar.gz ${{ runner.temp }}/extraction/${{ inputs.architecture }}/build-debian-${{ inputs.architecture }}.tar.gz
|
||||||
shell: bash
|
shell: bash
|
||||||
- name: Stop ${{ inputs.architecture }} container
|
- name: Stop ${{ inputs.architecture }} container
|
||||||
if: always()
|
if: always()
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
name: Prebuilt dependencies for debian
|
||||||
|
description: Provides prebuilt dependencies for debian based docker images
|
||||||
|
inputs:
|
||||||
|
architecture:
|
||||||
|
description: Name of architecture, will be used to build docker image (e.g. amd64, arm64)
|
||||||
|
required: true
|
||||||
|
outputs:
|
||||||
|
path:
|
||||||
|
description: Path to extracted prebuilt dependencies
|
||||||
|
value: ${{ runner.temp }}/prebuilts
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v4
|
||||||
|
|
||||||
|
- name: Build docker image for ${{ inputs.architecture }}
|
||||||
|
id: build
|
||||||
|
uses: docker/build-push-action@v7
|
||||||
|
with:
|
||||||
|
push: false
|
||||||
|
load: true
|
||||||
|
context: ./deployments/prebuilt-debian
|
||||||
|
platforms: linux/${{ inputs.architecture }}
|
||||||
|
tags: prebuilt-debian
|
||||||
|
- name: Start docker container for ${{ inputs.architecture }}
|
||||||
|
run: |
|
||||||
|
docker run --name prebuilt-debian \
|
||||||
|
--detach --rm prebuilt-debian
|
||||||
|
shell: bash
|
||||||
|
- name: Extract prebuilt dependencies from ${{ inputs.architecture }} container
|
||||||
|
run: |
|
||||||
|
mkdir -p ${{ runner.temp }}/prebuilts && \
|
||||||
|
docker cp prebuilt-debian:/app/node_modules/better-sqlite3/build/Release/better_sqlite3.node ${{ runner.temp }}/prebuilts/better_sqlite3.node
|
||||||
|
shell: bash
|
||||||
|
- name: Stop ${{ inputs.architecture }} container
|
||||||
|
if: always()
|
||||||
|
run: docker container remove --force --volumes prebuilt-debian
|
||||||
|
shell: bash
|
||||||
@@ -11,6 +11,12 @@
|
|||||||
matchPackageNames: ["tsx"],
|
matchPackageNames: ["tsx"],
|
||||||
enabled: false,
|
enabled: false,
|
||||||
},
|
},
|
||||||
|
// Reenable once bug with undici v8 is fixed (https://github.com/homarr-labs/homarr/issues/5467)
|
||||||
|
{
|
||||||
|
matchPackageNames: ["undici"],
|
||||||
|
matchNewValue: "8.*",
|
||||||
|
enabled: false,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
matchUpdateTypes: ["minor", "patch", "pin", "digest"],
|
matchUpdateTypes: ["minor", "patch", "pin", "digest"],
|
||||||
automerge: true,
|
automerge: true,
|
||||||
@@ -20,6 +26,7 @@
|
|||||||
matchPackageNames: [
|
matchPackageNames: [
|
||||||
"@tree-sitter-grammars/tree-sitter-yaml",
|
"@tree-sitter-grammars/tree-sitter-yaml",
|
||||||
"bcrypt",
|
"bcrypt",
|
||||||
|
"better-sqlite3",
|
||||||
"cpu-features",
|
"cpu-features",
|
||||||
"esbuild",
|
"esbuild",
|
||||||
"sharp",
|
"sharp",
|
||||||
@@ -30,6 +37,12 @@
|
|||||||
automerge: false,
|
automerge: false,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
// Updates lockfile for prebuilt-debian after if package.json is updated, otherwise only root lockfile is updated
|
||||||
|
postUpgradeTasks: {
|
||||||
|
commands: ["cd deployments/prebuilt-debian && pnpm install --ignore-workspace --lockfile-only"],
|
||||||
|
fileFilters: ["deployments/prebuilt-debian/pnpm-lock.yaml"],
|
||||||
|
executionMode: "update",
|
||||||
|
},
|
||||||
updateInternalDeps: true,
|
updateInternalDeps: true,
|
||||||
rangeStrategy: "bump",
|
rangeStrategy: "bump",
|
||||||
automerge: false,
|
automerge: false,
|
||||||
|
|||||||
@@ -9,16 +9,21 @@ jobs:
|
|||||||
approve-automatic-prs:
|
approve-automatic-prs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 2
|
timeout-minutes: 2
|
||||||
if: github.actor_id == 158783068 || github.actor_id == 190541745 || github.actor_id == 210161987 # Id of renovate bot and crowdin bot see https://api.github.com/users/homarr-renovate%5Bbot%5D and https://api.github.com/users/homarr-crowdin%5Bbot%5D and https://api.github.com/users/homarr-update-contributors%5Bbot%5D
|
# 158783068: homarr-renovate[bot]
|
||||||
|
# 190541745: homarr-crowdin[bot]
|
||||||
|
# 210161987: homarr-update-contributors[bot]
|
||||||
|
# 175486441: homarr-releases[bot]
|
||||||
|
# Extracted from https://api.github.com/users/<username>
|
||||||
|
if: github.actor_id == 158783068 || github.actor_id == 190541745 || github.actor_id == 210161987 || github.actor_id == 175486441
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
- name: Obtain token
|
- name: Obtain token
|
||||||
id: obtainToken
|
id: obtainToken
|
||||||
uses: actions/create-github-app-token@v2
|
uses: actions/create-github-app-token@v3
|
||||||
with:
|
with:
|
||||||
private-key: ${{ secrets.RENOVATE_APPROVE_PRIVATE_KEY }}
|
private-key: ${{ secrets.RENOVATE_APPROVE_PRIVATE_KEY }}
|
||||||
app-id: ${{ secrets.RENOVATE_APPROVE_APP_ID }}
|
client-id: ${{ secrets.RENOVATE_APPROVE_APP_ID }}
|
||||||
permission-pull-requests: write # required to approve pull request
|
permission-pull-requests: write # required to approve pull request
|
||||||
|
|
||||||
- name: Install GitHub CLI
|
- name: Install GitHub CLI
|
||||||
|
|||||||
@@ -11,14 +11,17 @@ on:
|
|||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: "${{ github.workflow }}-${{ github.ref }}"
|
group: "${{ github.workflow }}-${{ github.ref }}"
|
||||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
||||||
|
|
||||||
# You can leverage Vercel Remote Caching with Turbo to speed up your builds
|
|
||||||
# @link https://turborepo.org/docs/core-concepts/remote-caching#remote-caching-on-vercel-builds
|
|
||||||
env:
|
env:
|
||||||
FORCE_COLOR: 3
|
FORCE_COLOR: 3
|
||||||
|
SKIP_ENV_VALIDATION: true
|
||||||
|
TURBO_API: ${{ secrets.TURBO_API }}
|
||||||
|
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
||||||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
||||||
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
|
TURBO_REMOTE_CACHE_SIGNATURE_KEY: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }}
|
||||||
|
TURBO_SCM_BASE: ${{ github.event.pull_request.base.sha || github.event.before || 'HEAD~1' }}
|
||||||
|
TURBO_SCM_HEAD: ${{ github.sha }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
@@ -26,6 +29,8 @@ jobs:
|
|||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Setup
|
- name: Setup
|
||||||
uses: ./tooling/github/setup
|
uses: ./tooling/github/setup
|
||||||
@@ -35,31 +40,35 @@ jobs:
|
|||||||
run: cp .env.example .env
|
run: cp .env.example .env
|
||||||
|
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: pnpm lint && pnpm lint:ws
|
run: pnpm turbo lint --affected && pnpm lint:ws
|
||||||
|
|
||||||
format:
|
format:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Setup
|
- name: Setup
|
||||||
uses: ./tooling/github/setup
|
uses: ./tooling/github/setup
|
||||||
|
|
||||||
- name: Format
|
- name: Format
|
||||||
run: pnpm format
|
run: pnpm turbo format --affected --continue -- --cache --cache-location node_modules/.cache/.prettiercache
|
||||||
|
|
||||||
typecheck:
|
typecheck:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Setup
|
- name: Setup
|
||||||
uses: ./tooling/github/setup
|
uses: ./tooling/github/setup
|
||||||
|
|
||||||
- name: Typecheck
|
- name: Typecheck
|
||||||
run: turbo typecheck
|
run: pnpm turbo typecheck --affected
|
||||||
|
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -82,20 +91,24 @@ jobs:
|
|||||||
e2e:
|
e2e:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
- name: Setup
|
- name: Setup
|
||||||
uses: ./tooling/github/setup
|
uses: ./tooling/github/setup
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v4
|
||||||
- name: Build docker image
|
- name: Build docker image
|
||||||
id: build-docker-image
|
id: build-docker-image
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v7
|
||||||
with:
|
with:
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
context: .
|
context: .
|
||||||
push: false
|
push: false
|
||||||
|
load: true
|
||||||
tags: homarr-e2e
|
tags: homarr-e2e
|
||||||
network: host
|
network: host
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
env:
|
env:
|
||||||
SKIP_ENV_VALIDATION: true
|
SKIP_ENV_VALIDATION: true
|
||||||
- name: Install playwright browsers
|
- name: Install playwright browsers
|
||||||
@@ -109,10 +122,12 @@ jobs:
|
|||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
- name: Setup
|
- name: Setup
|
||||||
uses: ./tooling/github/setup
|
uses: ./tooling/github/setup
|
||||||
- name: Copy env
|
- name: Copy env
|
||||||
shell: bash
|
shell: bash
|
||||||
run: cp .env.example .env
|
run: cp .env.example .env
|
||||||
- name: Build
|
- name: Build
|
||||||
run: pnpm build
|
run: pnpm turbo build --affected
|
||||||
@@ -19,10 +19,10 @@ jobs:
|
|||||||
|
|
||||||
- name: Obtain token
|
- name: Obtain token
|
||||||
id: obtainToken
|
id: obtainToken
|
||||||
uses: actions/create-github-app-token@v2
|
uses: actions/create-github-app-token@v3
|
||||||
with:
|
with:
|
||||||
private-key: ${{ secrets.CROWDIN_APP_PRIVATE_KEY }}
|
private-key: ${{ secrets.CROWDIN_APP_PRIVATE_KEY }}
|
||||||
app-id: ${{ secrets.CROWDIN_APP_ID }}
|
client-id: ${{ secrets.CROWDIN_APP_ID }}
|
||||||
permission-contents: write # required to commit to crowdin branch
|
permission-contents: write # required to commit to crowdin branch
|
||||||
permission-pull-requests: write # required to create pull request
|
permission-pull-requests: write # required to create pull request
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,104 @@
|
|||||||
|
name: "[Deployment] Beta Release"
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
send-notifications:
|
||||||
|
type: boolean
|
||||||
|
required: false
|
||||||
|
default: true
|
||||||
|
description: Send notifications
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
create-and-merge-pr:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 2
|
||||||
|
steps:
|
||||||
|
- name: Discord notification
|
||||||
|
if: ${{ github.event.inputs.send-notifications }}
|
||||||
|
env:
|
||||||
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
|
uses: Ilshidur/action-discord@0.4.0
|
||||||
|
with:
|
||||||
|
args: "Beta release has been triggered: [run ${{ github.run_number }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})"
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Get Next Version
|
||||||
|
id: semver
|
||||||
|
uses: ietf-tools/semver-action@v1
|
||||||
|
with:
|
||||||
|
token: ${{ github.token }}
|
||||||
|
branch: next
|
||||||
|
- name: Create pull request
|
||||||
|
id: create-pull-request
|
||||||
|
run: 'gh pr create --title "chore(release): release ${{ steps.semver.outputs.next }}-beta" --body "Detected change to be ``${{ steps.semver.outputs.bump }}``<br/>Bump version from ``${{ steps.semver.outputs.current }}`` to ``${{ steps.semver.outputs.next }}-beta``" --base beta --head next --label automerge'
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
|
- name: Discord notification
|
||||||
|
if: ${{ github.event.inputs.send-notifications }}
|
||||||
|
env:
|
||||||
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
|
uses: Ilshidur/action-discord@0.4.0
|
||||||
|
with:
|
||||||
|
args: "Created a release PR ${{ steps.create-pull-request.outputs.url }} for version ${{ steps.semver.outputs.next }}-beta (new behaviour: ${{ steps.semver.outputs.bump }})"
|
||||||
|
- name: Obtain token
|
||||||
|
id: obtainApprovalToken
|
||||||
|
uses: actions/create-github-app-token@v3
|
||||||
|
with:
|
||||||
|
private-key: ${{ secrets.RENOVATE_APPROVE_PRIVATE_KEY }}
|
||||||
|
client-id: ${{ secrets.RENOVATE_APPROVE_APP_ID }}
|
||||||
|
permission-pull-requests: write
|
||||||
|
- name: Approve PR
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ steps.obtainApprovalToken.outputs.token }}
|
||||||
|
run: |
|
||||||
|
gh pr review --approve --body "Automatically approved by GitHub Action"
|
||||||
|
- name: Obtain token
|
||||||
|
id: obtainMergeToken
|
||||||
|
uses: actions/create-github-app-token@v3
|
||||||
|
with:
|
||||||
|
private-key: ${{ secrets.RENOVATE_MERGE_PRIVATE_KEY }}
|
||||||
|
client-id: ${{ secrets.RENOVATE_MERGE_APP_ID }}
|
||||||
|
permission-contents: write # write to beta branch (due to merge)
|
||||||
|
permission-pull-requests: write # merge pull request
|
||||||
|
- id: automerge
|
||||||
|
if: ${{ steps.semver.outputs.bump != 'major' }}
|
||||||
|
name: automerge
|
||||||
|
uses: "pascalgn/automerge-action@v0.16.4"
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ steps.obtainMergeToken.outputs.token }}
|
||||||
|
MERGE_METHOD: merge # we prefer merge commits for merging to beta
|
||||||
|
MERGE_COMMIT_MESSAGE: "chore(release): release ${{ steps.semver.outputs.next }}-beta"
|
||||||
|
MERGE_DELETE_BRANCH: false # never set to true!
|
||||||
|
PULL_REQUEST: "${{ steps.create-pull-request.outputs.pr_number }}"
|
||||||
|
MERGE_RETRIES: 20 # 20 retries * MERGE_RETRY_SLEEP until step fails
|
||||||
|
MERGE_RETRY_SLEEP: 10000 # 10 seconds * MERGE_RETRIES until step fails
|
||||||
|
MERGE_REQUIRED_APPROVALS: 0 # do not require approvals
|
||||||
|
|
||||||
|
- name: Merged Discord notification
|
||||||
|
if: ${{ steps.automerge.outputs.mergeResult == 'merged' && github.event.inputs.send-notifications }}
|
||||||
|
env:
|
||||||
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
|
uses: Ilshidur/action-discord@0.4.0
|
||||||
|
with:
|
||||||
|
args: "Merged PR ${{ steps.create-pull-request.outputs.url }} for release ${{ steps.semver.outputs.next }}-beta"
|
||||||
|
- name: Major Bump Discord notification
|
||||||
|
if: ${{ steps.semver.outputs.bump == 'major' && github.event.inputs.send-notifications }}
|
||||||
|
env:
|
||||||
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
|
uses: Ilshidur/action-discord@0.4.0
|
||||||
|
with:
|
||||||
|
args: "The release PR must be manually merged because the next version is a major version: ${{ steps.create-pull-request.outputs.url }} for release ${{ steps.semver.outputs.next }}-beta"
|
||||||
|
- name: Discord Fail Notification
|
||||||
|
if: failure() && github.event.inputs.send-notifications
|
||||||
|
env:
|
||||||
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
|
uses: Ilshidur/action-discord@0.4.0
|
||||||
|
with:
|
||||||
|
args: "The beta release workflow [run ${{ github.run_number }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) has failed"
|
||||||
@@ -5,6 +5,7 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- beta
|
- beta
|
||||||
|
- next
|
||||||
- dev
|
- dev
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
@@ -34,7 +35,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
env:
|
env:
|
||||||
SKIP_RELEASE: ${{ github.event_name == 'workflow_dispatch' || github.ref_name == 'dev' }}
|
SKIP_RELEASE: ${{ github.event_name == 'workflow_dispatch' || github.ref_name == 'dev' || github.ref_name == 'next' }}
|
||||||
outputs:
|
outputs:
|
||||||
version: ${{ steps.read-semver.outputs.version || steps.version-fallback.outputs.version }}
|
version: ${{ steps.read-semver.outputs.version || steps.version-fallback.outputs.version }}
|
||||||
git_ref: ${{ steps.read-git-ref.outputs.ref || github.ref }}
|
git_ref: ${{ steps.read-git-ref.outputs.ref || github.ref }}
|
||||||
@@ -50,23 +51,23 @@ jobs:
|
|||||||
- name: Obtain token
|
- name: Obtain token
|
||||||
if: env.SKIP_RELEASE == 'false'
|
if: env.SKIP_RELEASE == 'false'
|
||||||
id: obtainToken
|
id: obtainToken
|
||||||
uses: actions/create-github-app-token@v2
|
uses: actions/create-github-app-token@v3
|
||||||
with:
|
with:
|
||||||
private-key: ${{ secrets.RENOVATE_MERGE_PRIVATE_KEY }}
|
private-key: ${{ secrets.RENOVATE_MERGE_PRIVATE_KEY }}
|
||||||
app-id: ${{ secrets.RENOVATE_MERGE_APP_ID }}
|
client-id: ${{ secrets.RENOVATE_MERGE_APP_ID }}
|
||||||
permission-contents: write # required to commit package.json & changelog changes, merge them to dev and publish the release
|
permission-contents: write # required to commit package.json & changelog changes, merge them to dev / next and publish the release
|
||||||
|
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
if: env.SKIP_RELEASE == 'false'
|
if: env.SKIP_RELEASE == 'false'
|
||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- uses: pnpm/action-setup@v4
|
- uses: pnpm/action-setup@v6
|
||||||
if: env.SKIP_RELEASE == 'false'
|
if: env.SKIP_RELEASE == 'false'
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6
|
||||||
if: env.SKIP_RELEASE == 'false'
|
if: env.SKIP_RELEASE == 'false'
|
||||||
with:
|
with:
|
||||||
node-version: 24.12.0
|
node-version: 24.15.0
|
||||||
cache: "pnpm"
|
package-manager-cache: false
|
||||||
- run: npm i -g pnpm
|
- run: npm i -g pnpm
|
||||||
if: env.SKIP_RELEASE == 'false'
|
if: env.SKIP_RELEASE == 'false'
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
@@ -95,20 +96,21 @@ jobs:
|
|||||||
id: read-git-ref
|
id: read-git-ref
|
||||||
run: |
|
run: |
|
||||||
echo "ref=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
|
echo "ref=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
|
||||||
- name: Update dev branch
|
- name: Update dev / next branch
|
||||||
if: env.SKIP_RELEASE == 'false'
|
if: env.SKIP_RELEASE == 'false'
|
||||||
continue-on-error: true # Prevent pipeline from failing when merge fails
|
continue-on-error: true # Prevent pipeline from failing when merge fails
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ steps.obtainToken.outputs.token }}
|
GITHUB_TOKEN: ${{ steps.obtainToken.outputs.token }}
|
||||||
|
UPSTREAM_BRANCH: ${{ github.ref_name == 'main' && 'dev' || 'next' }}
|
||||||
run: |
|
run: |
|
||||||
git config user.name "Releases Homarr"
|
git config user.name "Releases Homarr"
|
||||||
git config user.email "175486441+homarr-releases[bot]@users.noreply.github.com"
|
git config user.email "175486441+homarr-releases[bot]@users.noreply.github.com"
|
||||||
git remote set-url origin https://x-access-token:${{ steps.obtainToken.outputs.token }}@github.com/${{ github.repository }}.git
|
git remote set-url origin https://x-access-token:${{ steps.obtainToken.outputs.token }}@github.com/${{ github.repository }}.git
|
||||||
git fetch origin dev
|
git fetch origin ${{ env.UPSTREAM_BRANCH }}
|
||||||
git checkout dev
|
git checkout ${{ env.UPSTREAM_BRANCH }}
|
||||||
git pull origin dev
|
git pull origin ${{ env.UPSTREAM_BRANCH }}
|
||||||
git rebase ${{ github.ref_name }}
|
git rebase ${{ github.ref_name }}
|
||||||
git push origin dev
|
git push origin ${{ env.UPSTREAM_BRANCH }}
|
||||||
build-amd64:
|
build-amd64:
|
||||||
name: Build docker image for amd64
|
name: Build docker image for amd64
|
||||||
needs: release
|
needs: release
|
||||||
@@ -123,23 +125,23 @@ jobs:
|
|||||||
|
|
||||||
- name: Docker meta
|
- name: Docker meta
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v6
|
||||||
with:
|
with:
|
||||||
images: "${{ env.GHCR_REPO }}"
|
images: "${{ env.GHCR_REPO }}"
|
||||||
|
|
||||||
- name: Log in to the Container registry
|
- name: Log in to the Container registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v4
|
||||||
with:
|
with:
|
||||||
registry: ${{ env.REGISTRY }}
|
registry: ${{ env.REGISTRY }}
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v4
|
||||||
|
|
||||||
- name: Build and push by digest
|
- name: Build and push by digest
|
||||||
id: build
|
id: build
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v7
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
network: host
|
network: host
|
||||||
@@ -162,23 +164,23 @@ jobs:
|
|||||||
|
|
||||||
- name: Docker meta
|
- name: Docker meta
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v6
|
||||||
with:
|
with:
|
||||||
images: "${{ env.GHCR_REPO }}"
|
images: "${{ env.GHCR_REPO }}"
|
||||||
|
|
||||||
- name: Log in to the Container registry
|
- name: Log in to the Container registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v4
|
||||||
with:
|
with:
|
||||||
registry: ${{ env.REGISTRY }}
|
registry: ${{ env.REGISTRY }}
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v4
|
||||||
|
|
||||||
- name: Build and push by digest
|
- name: Build and push by digest
|
||||||
id: build
|
id: build
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v7
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
network: host
|
network: host
|
||||||
@@ -191,7 +193,7 @@ jobs:
|
|||||||
name: Extract amd64 asset from docker image
|
name: Extract amd64 asset from docker image
|
||||||
needs: [release, build-amd64]
|
needs: [release, build-amd64]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 2
|
timeout-minutes: 5
|
||||||
steps:
|
steps:
|
||||||
- name: Extract amd64
|
- name: Extract amd64
|
||||||
if: needs.release.outputs.skipped == 'false'
|
if: needs.release.outputs.skipped == 'false'
|
||||||
@@ -207,7 +209,7 @@ jobs:
|
|||||||
name: Extract arm64 asset from docker image
|
name: Extract arm64 asset from docker image
|
||||||
needs: [release, build-arm64]
|
needs: [release, build-arm64]
|
||||||
runs-on: ubuntu-24.04-arm
|
runs-on: ubuntu-24.04-arm
|
||||||
timeout-minutes: 2
|
timeout-minutes: 5
|
||||||
steps:
|
steps:
|
||||||
- name: Extract arm64
|
- name: Extract arm64
|
||||||
if: needs.release.outputs.skipped == 'false'
|
if: needs.release.outputs.skipped == 'false'
|
||||||
@@ -228,8 +230,17 @@ jobs:
|
|||||||
DEPLOY_LATEST: ${{ github.ref_name == 'main' }}
|
DEPLOY_LATEST: ${{ github.ref_name == 'main' }}
|
||||||
DEPLOY_BETA: ${{ github.ref_name == 'beta' }}
|
DEPLOY_BETA: ${{ github.ref_name == 'beta' }}
|
||||||
steps:
|
steps:
|
||||||
|
- name: Obtain token
|
||||||
|
if: needs.release.outputs.skipped == 'false'
|
||||||
|
id: obtainToken
|
||||||
|
uses: actions/create-github-app-token@v3
|
||||||
|
with:
|
||||||
|
private-key: ${{ secrets.RENOVATE_MERGE_PRIVATE_KEY }}
|
||||||
|
client-id: ${{ secrets.RENOVATE_MERGE_APP_ID }}
|
||||||
|
permission-contents: write # required to publish the release
|
||||||
|
|
||||||
- name: Log in to the Container registry
|
- name: Log in to the Container registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v4
|
||||||
with:
|
with:
|
||||||
registry: ${{ env.REGISTRY }}
|
registry: ${{ env.REGISTRY }}
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
@@ -258,13 +269,13 @@ jobs:
|
|||||||
- name: Publish release
|
- name: Publish release
|
||||||
if: needs.release.outputs.skipped == 'false'
|
if: needs.release.outputs.skipped == 'false'
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ steps.obtainToken.outputs.token }}
|
||||||
run: |
|
run: |
|
||||||
gh release edit --repo ${{ github.repository }} ${{ needs.release.outputs.version }} --draft=false
|
gh release edit --repo ${{ github.repository }} ${{ needs.release.outputs.version }} --draft=false
|
||||||
|
|
||||||
- name: Discord notification
|
- name: Discord notification
|
||||||
env:
|
env:
|
||||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
uses: Ilshidur/action-discord@master
|
uses: Ilshidur/action-discord@0.4.0
|
||||||
with:
|
with:
|
||||||
args: "Successfully deployed images for branch **${{ github.ref_name }}**. Tagged as **${{env.NEXT_VERSION}}**."
|
args: "Successfully deployed images for branch **${{ github.ref_name }}**. Tagged as **${{env.NEXT_VERSION}}**."
|
||||||
@@ -21,10 +21,10 @@ jobs:
|
|||||||
timeout-minutes: 2
|
timeout-minutes: 2
|
||||||
steps:
|
steps:
|
||||||
- name: Discord notification
|
- name: Discord notification
|
||||||
if: ${{ github.events.inputs.send-notifications }}
|
if: ${{ github.event.inputs.send-notifications }}
|
||||||
env:
|
env:
|
||||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
uses: Ilshidur/action-discord@master
|
uses: Ilshidur/action-discord@0.4.0
|
||||||
with:
|
with:
|
||||||
args: "Automatic release has been triggered: [run ${{ github.run_number }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})"
|
args: "Automatic release has been triggered: [run ${{ github.run_number }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})"
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
@@ -38,22 +38,23 @@ jobs:
|
|||||||
token: ${{ github.token }}
|
token: ${{ github.token }}
|
||||||
branch: dev
|
branch: dev
|
||||||
- name: Create pull request
|
- name: Create pull request
|
||||||
|
id: create-pull-request
|
||||||
run: 'gh pr create --title "chore(release): automatic release ${{ steps.semver.outputs.next }}" --body "**This is an automatic release**.<br/>Manual action may be required for major bumps.<br/>Detected change to be ``${{ steps.semver.outputs.bump }}``<br/>Bump version from ``${{ steps.semver.outputs.current }}`` to ``${{ steps.semver.outputs.next }}``" --base main --head dev --label automerge'
|
run: 'gh pr create --title "chore(release): automatic release ${{ steps.semver.outputs.next }}" --body "**This is an automatic release**.<br/>Manual action may be required for major bumps.<br/>Detected change to be ``${{ steps.semver.outputs.bump }}``<br/>Bump version from ``${{ steps.semver.outputs.current }}`` to ``${{ steps.semver.outputs.next }}``" --base main --head dev --label automerge'
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
- name: Discord notification
|
- name: Discord notification
|
||||||
if: ${{ github.events.inputs.send-notifications }}
|
if: ${{ github.event.inputs.send-notifications }}
|
||||||
env:
|
env:
|
||||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
uses: Ilshidur/action-discord@master
|
uses: Ilshidur/action-discord@0.4.0
|
||||||
with:
|
with:
|
||||||
args: "Created a release PR ${{ steps.create-pull-request.outputs.url }} for version ${{ steps.semver.outputs.next }} (new behaviour: ${{ steps.semver.outputs.bump }})"
|
args: "Created a release PR ${{ steps.create-pull-request.outputs.url }} for version ${{ steps.semver.outputs.next }} (new behaviour: ${{ steps.semver.outputs.bump }})"
|
||||||
- name: Obtain token
|
- name: Obtain token
|
||||||
id: obtainApprovalToken
|
id: obtainApprovalToken
|
||||||
uses: actions/create-github-app-token@v2
|
uses: actions/create-github-app-token@v3
|
||||||
with:
|
with:
|
||||||
private-key: ${{ secrets.RENOVATE_APPROVE_PRIVATE_KEY }}
|
private-key: ${{ secrets.RENOVATE_APPROVE_PRIVATE_KEY }}
|
||||||
app-id: ${{ secrets.RENOVATE_APPROVE_APP_ID }}
|
client-id: ${{ secrets.RENOVATE_APPROVE_APP_ID }}
|
||||||
permission-pull-requests: write
|
permission-pull-requests: write
|
||||||
- name: Approve PR
|
- name: Approve PR
|
||||||
env:
|
env:
|
||||||
@@ -62,10 +63,10 @@ jobs:
|
|||||||
gh pr review --approve --body "Automatically approved by GitHub Action"
|
gh pr review --approve --body "Automatically approved by GitHub Action"
|
||||||
- name: Obtain token
|
- name: Obtain token
|
||||||
id: obtainMergeToken
|
id: obtainMergeToken
|
||||||
uses: actions/create-github-app-token@v2
|
uses: actions/create-github-app-token@v3
|
||||||
with:
|
with:
|
||||||
private-key: ${{ secrets.RENOVATE_MERGE_PRIVATE_KEY }}
|
private-key: ${{ secrets.RENOVATE_MERGE_PRIVATE_KEY }}
|
||||||
app-id: ${{ secrets.RENOVATE_MERGE_APP_ID }}
|
client-id: ${{ secrets.RENOVATE_MERGE_APP_ID }}
|
||||||
permission-contents: write # write to main branch (due to merge)
|
permission-contents: write # write to main branch (due to merge)
|
||||||
permission-pull-requests: write # merge pull request
|
permission-pull-requests: write # merge pull request
|
||||||
- id: automerge
|
- id: automerge
|
||||||
@@ -74,7 +75,7 @@ jobs:
|
|||||||
uses: "pascalgn/automerge-action@v0.16.4"
|
uses: "pascalgn/automerge-action@v0.16.4"
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ steps.obtainMergeToken.outputs.token }}
|
GITHUB_TOKEN: ${{ steps.obtainMergeToken.outputs.token }}
|
||||||
MERGE_METHOD: merge # we prefer merge commits for merging to master
|
MERGE_METHOD: merge # we prefer merge commits for merging to main
|
||||||
MERGE_COMMIT_MESSAGE: "chore(release): automatic release ${{ steps.semver.outputs.next }}"
|
MERGE_COMMIT_MESSAGE: "chore(release): automatic release ${{ steps.semver.outputs.next }}"
|
||||||
MERGE_DELETE_BRANCH: false # never set to true!
|
MERGE_DELETE_BRANCH: false # never set to true!
|
||||||
PULL_REQUEST: "${{ steps.create-pull-request.outputs.pr_number }}"
|
PULL_REQUEST: "${{ steps.create-pull-request.outputs.pr_number }}"
|
||||||
@@ -83,23 +84,23 @@ jobs:
|
|||||||
MERGE_REQUIRED_APPROVALS: 0 # do not require approvals
|
MERGE_REQUIRED_APPROVALS: 0 # do not require approvals
|
||||||
|
|
||||||
- name: Merged Discord notification
|
- name: Merged Discord notification
|
||||||
if: ${{ steps.automerge.outputs.mergeResult == 'merged' && github.events.inputs.send-notifications }}
|
if: ${{ steps.automerge.outputs.mergeResult == 'merged' && github.event.inputs.send-notifications }}
|
||||||
env:
|
env:
|
||||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
uses: Ilshidur/action-discord@master
|
uses: Ilshidur/action-discord@0.4.0
|
||||||
with:
|
with:
|
||||||
args: "Merged PR ${{ steps.create-pull-request.outputs.url }} for release ${{ steps.semver.outputs.next }}"
|
args: "Merged PR ${{ steps.create-pull-request.outputs.url }} for release ${{ steps.semver.outputs.next }}"
|
||||||
- name: Major Bump Discord notification
|
- name: Major Bump Discord notification
|
||||||
if: ${{ steps.semver.outputs.bump == 'major' && github.events.inputs.send-notifications }}
|
if: ${{ steps.semver.outputs.bump == 'major' && github.event.inputs.send-notifications }}
|
||||||
env:
|
env:
|
||||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
uses: Ilshidur/action-discord@master
|
uses: Ilshidur/action-discord@0.4.0
|
||||||
with:
|
with:
|
||||||
args: "The release PR must be manually merged because the next version is a major version: ${{ steps.create-pull-request.outputs.url }} for release ${{ steps.semver.outputs.next }}"
|
args: "The release PR must be manually merged because the next version is a major version: ${{ steps.create-pull-request.outputs.url }} for release ${{ steps.semver.outputs.next }}"
|
||||||
- name: Discord Fail Notification
|
- name: Discord Fail Notification
|
||||||
if: failure() && github.events.inputs.send-notifications
|
if: failure() && github.event.inputs.send-notifications
|
||||||
env:
|
env:
|
||||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
uses: Ilshidur/action-discord@master
|
uses: Ilshidur/action-discord@0.4.0
|
||||||
with:
|
with:
|
||||||
args: "The automatic release workflow [run ${{ github.run_number }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) has failed"
|
args: "The automatic release workflow [run ${{ github.run_number }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) has failed"
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
name: "[Deployments] Validate prebuilt debian dependencies"
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches: ["*"]
|
||||||
|
paths: [".github/actions/prebuilt-debian/**", "deployments/prebuilt-debian/**"]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
prebuilt-debian-validate-amd64:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 5
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
- name: Validate prebuilt dependencies for amd64
|
||||||
|
id: validate-amd64
|
||||||
|
uses: ./.github/actions/prebuilt-debian
|
||||||
|
with:
|
||||||
|
architecture: amd64
|
||||||
|
|
||||||
|
- name: Check extracted files for amd64
|
||||||
|
run: |
|
||||||
|
if [ ! -f "${{ steps.validate-amd64.outputs.path }}/better_sqlite3.node" ]; then
|
||||||
|
echo "better_sqlite3.node not found for amd64!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
prebuilt-debian-validate-arm64:
|
||||||
|
runs-on: ubuntu-24.04-arm
|
||||||
|
timeout-minutes: 5
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
- name: Validate prebuilt dependencies for arm64
|
||||||
|
id: validate-arm64
|
||||||
|
uses: ./.github/actions/prebuilt-debian
|
||||||
|
with:
|
||||||
|
architecture: arm64
|
||||||
|
|
||||||
|
- name: Check extracted files for arm64
|
||||||
|
run: |
|
||||||
|
if [ ! -f "${{ steps.validate-arm64.outputs.path }}/better_sqlite3.node" ]; then
|
||||||
|
echo "better_sqlite3.node not found for arm64!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
@@ -2,7 +2,7 @@ permissions: {}
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
types: [published]
|
types: [released]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
trigger-docs-release:
|
trigger-docs-release:
|
||||||
@@ -12,10 +12,10 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Obtain token
|
- name: Obtain token
|
||||||
id: obtainToken
|
id: obtainToken
|
||||||
uses: actions/create-github-app-token@v2
|
uses: actions/create-github-app-token@v3
|
||||||
with:
|
with:
|
||||||
private-key: ${{ secrets.HOMARR_DOCS_RELEASE_APP_PRIVATE_KEY }}
|
private-key: ${{ secrets.HOMARR_DOCS_RELEASE_APP_PRIVATE_KEY }}
|
||||||
app-id: ${{ vars.HOMARR_DOCS_RELEASE_APP_ID }}
|
client-id: ${{ vars.HOMARR_DOCS_RELEASE_APP_ID }}
|
||||||
owner: homarr-labs
|
owner: homarr-labs
|
||||||
repositories: |
|
repositories: |
|
||||||
documentation
|
documentation
|
||||||
@@ -37,6 +37,7 @@ jobs:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
update-bug-report-template:
|
update-bug-report-template:
|
||||||
name: Update Bug Report Template
|
name: Update Bug Report Template
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -44,33 +45,30 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Obtain token
|
- name: Obtain token
|
||||||
id: obtainToken
|
id: obtainToken
|
||||||
uses: actions/create-github-app-token@v2
|
uses: actions/create-github-app-token@v3
|
||||||
with:
|
with:
|
||||||
private-key: ${{ secrets.RENOVATE_MERGE_PRIVATE_KEY }}
|
private-key: ${{ secrets.RENOVATE_MERGE_PRIVATE_KEY }}
|
||||||
app-id: ${{ secrets.RENOVATE_MERGE_APP_ID }}
|
client-id: ${{ secrets.RENOVATE_MERGE_APP_ID }}
|
||||||
permission-contents: write # required to commit to branch
|
permission-contents: write # required to commit to branch
|
||||||
permission-pull-requests: write # required to create pr & enable automerge
|
permission-pull-requests: write # required to create pr & enable automerge
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
token: ${{ steps.obtainToken.outputs.token }}
|
token: ${{ steps.obtainToken.outputs.token }}
|
||||||
|
ref: dev
|
||||||
- name: Setup
|
- name: Setup
|
||||||
uses: ./tooling/github/setup
|
uses: ./tooling/github/setup
|
||||||
- run: pnpm run scripts:update-bug-report-template
|
- run: pnpm run scripts:update-bug-report-template
|
||||||
env:
|
env:
|
||||||
NEXT_VERSION: ${{ github.event.release.tag_name }}
|
NEXT_VERSION: ${{ github.event.release.tag_name }}
|
||||||
- name: Commit changes
|
|
||||||
run: |
|
|
||||||
git config --global user.email "175486441+homarr-releases[bot]@users.noreply.github.com"
|
|
||||||
git config --global user.name "Releases Homarr"
|
|
||||||
git checkout -b update-bug-report-template
|
|
||||||
git add .
|
|
||||||
git commit -m "chore: update bug report template"
|
|
||||||
|
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
id: create-pull-request
|
id: create-pull-request
|
||||||
uses: peter-evans/create-pull-request@v8
|
uses: peter-evans/create-pull-request@v8
|
||||||
with:
|
with:
|
||||||
|
add-paths: .github/ISSUE_TEMPLATE/bug_report.yml
|
||||||
|
commit-message: "chore: update bug report template"
|
||||||
|
author: Releases Homarr <175486441+homarr-releases[bot]@users.noreply.github.com>
|
||||||
token: ${{ steps.obtainToken.outputs.token }}
|
token: ${{ steps.obtainToken.outputs.token }}
|
||||||
branch: update-bug-report-template
|
branch: update-bug-report-template
|
||||||
base: dev
|
base: dev
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
skip-stability-days:
|
skip-stability-days:
|
||||||
if: ${{ !startsWith(github.head_ref, 'renovate/') }}
|
if: ${{ !startsWith(github.head_ref, 'renovate/') && github.event.pull_request.head.repo.full_name == github.repository }}
|
||||||
name: Skip Stability Days
|
name: Skip Stability Days
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 1
|
timeout-minutes: 1
|
||||||
|
|||||||
@@ -21,10 +21,10 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Obtain token
|
- name: Obtain token
|
||||||
id: obtainToken
|
id: obtainToken
|
||||||
uses: actions/create-github-app-token@v2
|
uses: actions/create-github-app-token@v3
|
||||||
with:
|
with:
|
||||||
private-key: ${{ secrets.HOMARR_UPDATE_CONTRIBUTORS_PRIVATE_KEY }}
|
private-key: ${{ secrets.HOMARR_UPDATE_CONTRIBUTORS_PRIVATE_KEY }}
|
||||||
app-id: ${{ vars.HOMARR_UPDATE_CONTRIBUTORS_APP_ID }}
|
client-id: ${{ vars.HOMARR_UPDATE_CONTRIBUTORS_APP_ID }}
|
||||||
permission-contents: write # required to commit to branch
|
permission-contents: write # required to commit to branch
|
||||||
permission-pull-requests: write # required to create pr & enable automerge
|
permission-pull-requests: write # required to create pr & enable automerge
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ steps.obtainToken.outputs.token }}
|
GITHUB_TOKEN: ${{ steps.obtainToken.outputs.token }}
|
||||||
|
|
||||||
- uses: pnpm/action-setup@v4
|
- uses: pnpm/action-setup@v6
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
- name: Use Node.js ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -21,10 +21,10 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Obtain token
|
- name: Obtain token
|
||||||
id: obtainToken
|
id: obtainToken
|
||||||
uses: actions/create-github-app-token@v2
|
uses: actions/create-github-app-token@v3
|
||||||
with:
|
with:
|
||||||
private-key: ${{ secrets.HOMARR_UPDATE_CONTRIBUTORS_PRIVATE_KEY }}
|
private-key: ${{ secrets.HOMARR_UPDATE_CONTRIBUTORS_PRIVATE_KEY }}
|
||||||
app-id: ${{ vars.HOMARR_UPDATE_CONTRIBUTORS_APP_ID }}
|
client-id: ${{ vars.HOMARR_UPDATE_CONTRIBUTORS_APP_ID }}
|
||||||
permission-contents: write # required to commit to branch
|
permission-contents: write # required to commit to branch
|
||||||
permission-pull-requests: write # required to create pr & enable automerge
|
permission-pull-requests: write # required to create pr & enable automerge
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
|
|||||||
@@ -68,3 +68,7 @@ apps/nextjs/public/images/background.png
|
|||||||
|
|
||||||
# next-intl
|
# next-intl
|
||||||
en.d.json.ts
|
en.d.json.ts
|
||||||
|
|
||||||
|
# personal agent config
|
||||||
|
AGENTS.md
|
||||||
|
.opencode
|
||||||
+4013
-3525
File diff suppressed because it is too large.
Load diff
@@ -3,7 +3,11 @@
|
|||||||
|
|
||||||
# Exempt Renovate‑managed files (no owners)
|
# Exempt Renovate‑managed files (no owners)
|
||||||
package.json
|
package.json
|
||||||
|
**/package.json
|
||||||
package-lock.json
|
package-lock.json
|
||||||
|
**/package-lock.json
|
||||||
pnpm-lock.yaml
|
pnpm-lock.yaml
|
||||||
|
**/pnpm-lock.yaml
|
||||||
|
pnpm-workspace.yaml
|
||||||
Dockerfile
|
Dockerfile
|
||||||
docker-compose.yml
|
docker-compose.yml
|
||||||
+2
-3
@@ -1,4 +1,4 @@
|
|||||||
FROM node:24.12.0-alpine AS base
|
FROM node:24.15.0-alpine AS base
|
||||||
|
|
||||||
FROM base AS builder
|
FROM base AS builder
|
||||||
RUN apk add --no-cache libc6-compat
|
RUN apk add --no-cache libc6-compat
|
||||||
@@ -43,8 +43,7 @@ RUN mkdir -p /var/cache/nginx && \
|
|||||||
COPY --from=builder /app/apps/nextjs/next.config.ts .
|
COPY --from=builder /app/apps/nextjs/next.config.ts .
|
||||||
COPY --from=builder /app/apps/nextjs/package.json .
|
COPY --from=builder /app/apps/nextjs/package.json .
|
||||||
|
|
||||||
COPY --from=builder /app/apps/tasks/tasks.cjs ./apps/tasks/tasks.cjs
|
COPY --from=builder /app/node_modules/better-sqlite3/build/Release/better_sqlite3.node /app/build/better_sqlite3.node
|
||||||
COPY --from=builder /app/apps/websocket/wssServer.cjs ./apps/websocket/wssServer.cjs
|
|
||||||
|
|
||||||
COPY --from=builder /app/packages/db/migrations ./db/migrations
|
COPY --from=builder /app/packages/db/migrations ./db/migrations
|
||||||
|
|
||||||
|
|||||||
@@ -10,4 +10,21 @@ export default [
|
|||||||
...baseConfig,
|
...baseConfig,
|
||||||
...reactConfig,
|
...reactConfig,
|
||||||
...nextjsConfig,
|
...nextjsConfig,
|
||||||
|
{
|
||||||
|
files: ["public/sw.js"],
|
||||||
|
languageOptions: {
|
||||||
|
globals: {
|
||||||
|
self: "readonly",
|
||||||
|
clients: "readonly",
|
||||||
|
skipWaiting: "readonly",
|
||||||
|
importScripts: "readonly",
|
||||||
|
caches: "readonly",
|
||||||
|
fetch: "readonly",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
"@typescript-eslint/no-unsafe-call": "off",
|
||||||
|
"@typescript-eslint/no-unsafe-member-access": "off",
|
||||||
|
},
|
||||||
|
},
|
||||||
];
|
];
|
||||||
@@ -6,7 +6,6 @@ import "@homarr/core/infrastructure/logs/env";
|
|||||||
import "@homarr/docker/env";
|
import "@homarr/docker/env";
|
||||||
|
|
||||||
import type { NextConfig } from "next";
|
import type { NextConfig } from "next";
|
||||||
import MillionLint from "@million/lint";
|
|
||||||
import createNextIntlPlugin from "next-intl/plugin";
|
import createNextIntlPlugin from "next-intl/plugin";
|
||||||
|
|
||||||
// Package path does not work... so we need to use relative path
|
// Package path does not work... so we need to use relative path
|
||||||
@@ -32,6 +31,8 @@ const nextConfig: NextConfig = {
|
|||||||
experimental: {
|
experimental: {
|
||||||
optimizePackageImports: ["@mantine/core", "@mantine/hooks", "@tabler/icons-react"],
|
optimizePackageImports: ["@mantine/core", "@mantine/hooks", "@tabler/icons-react"],
|
||||||
turbopackFileSystemCacheForDev: true,
|
turbopackFileSystemCacheForDev: true,
|
||||||
|
preloadEntriesOnStart: false,
|
||||||
|
webpackMemoryOptimizations: true,
|
||||||
},
|
},
|
||||||
transpilePackages: ["@homarr/ui", "@homarr/notifications", "@homarr/modals", "@homarr/spotlight", "@homarr/widgets"],
|
transpilePackages: ["@homarr/ui", "@homarr/notifications", "@homarr/modals", "@homarr/spotlight", "@homarr/widgets"],
|
||||||
images: {
|
images: {
|
||||||
@@ -42,9 +43,18 @@ const nextConfig: NextConfig = {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
// skipcq: JS-0116
|
||||||
// eslint-disable-next-line @typescript-eslint/require-await,no-restricted-syntax
|
// eslint-disable-next-line @typescript-eslint/require-await,no-restricted-syntax
|
||||||
async headers() {
|
async headers() {
|
||||||
return [
|
return [
|
||||||
|
{
|
||||||
|
source: "/sw.js",
|
||||||
|
headers: [
|
||||||
|
{ key: "Content-Type", value: "application/javascript; charset=utf-8" },
|
||||||
|
{ key: "Cache-Control", value: "no-cache, no-store, must-revalidate" },
|
||||||
|
{ key: "Content-Security-Policy", value: "default-src 'self'; script-src 'self'" },
|
||||||
|
],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
source: "/(.*)", // Apply CSP to all routes
|
source: "/(.*)", // Apply CSP to all routes
|
||||||
headers: [
|
headers: [
|
||||||
@@ -74,8 +84,4 @@ const nextConfig: NextConfig = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// Skip transform is used because of webpack loader, without it for example 'Tooltip.Floating' will not work and show an error
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
||||||
const withMillionLint = MillionLint.next({ rsc: true, skipTransform: true, telemetry: false });
|
|
||||||
|
|
||||||
export default withNextIntl(nextConfig);
|
export default withNextIntl(nextConfig);
|
||||||
+58
-56
@@ -15,10 +15,10 @@
|
|||||||
},
|
},
|
||||||
"prettier": "@homarr/prettier-config",
|
"prettier": "@homarr/prettier-config",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@dnd-kit/core": "^6.3.1",
|
"@dnd-kit/core": "catalog:",
|
||||||
"@dnd-kit/modifiers": "^9.0.0",
|
"@dnd-kit/modifiers": "catalog:",
|
||||||
"@dnd-kit/sortable": "^10.0.0",
|
"@dnd-kit/sortable": "catalog:",
|
||||||
"@dnd-kit/utilities": "^3.2.2",
|
"@dnd-kit/utilities": "catalog:",
|
||||||
"@homarr/analytics": "workspace:^0.1.0",
|
"@homarr/analytics": "workspace:^0.1.0",
|
||||||
"@homarr/api": "workspace:^0.1.0",
|
"@homarr/api": "workspace:^0.1.0",
|
||||||
"@homarr/auth": "workspace:^0.1.0",
|
"@homarr/auth": "workspace:^0.1.0",
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
"@homarr/docker": "workspace:^0.1.0",
|
"@homarr/docker": "workspace:^0.1.0",
|
||||||
"@homarr/form": "workspace:^0.1.0",
|
"@homarr/form": "workspace:^0.1.0",
|
||||||
"@homarr/forms-collection": "workspace:^0.1.0",
|
"@homarr/forms-collection": "workspace:^0.1.0",
|
||||||
"@homarr/gridstack": "^1.12.0",
|
"@homarr/gridstack": "catalog:",
|
||||||
"@homarr/icons": "workspace:^0.1.0",
|
"@homarr/icons": "workspace:^0.1.0",
|
||||||
"@homarr/image-proxy": "workspace:^0.1.0",
|
"@homarr/image-proxy": "workspace:^0.1.0",
|
||||||
"@homarr/integrations": "workspace:^0.1.0",
|
"@homarr/integrations": "workspace:^0.1.0",
|
||||||
@@ -44,65 +44,67 @@
|
|||||||
"@homarr/server-settings": "workspace:^0.1.0",
|
"@homarr/server-settings": "workspace:^0.1.0",
|
||||||
"@homarr/settings": "workspace:^0.1.0",
|
"@homarr/settings": "workspace:^0.1.0",
|
||||||
"@homarr/spotlight": "workspace:^0.1.0",
|
"@homarr/spotlight": "workspace:^0.1.0",
|
||||||
|
"@homarr/tasks": "workspace:^0.1.0",
|
||||||
"@homarr/translation": "workspace:^0.1.0",
|
"@homarr/translation": "workspace:^0.1.0",
|
||||||
"@homarr/ui": "workspace:^0.1.0",
|
"@homarr/ui": "workspace:^0.1.0",
|
||||||
"@homarr/validation": "workspace:^0.1.0",
|
"@homarr/validation": "workspace:^0.1.0",
|
||||||
|
"@homarr/websocket": "workspace:^0.1.0",
|
||||||
"@homarr/widgets": "workspace:^0.1.0",
|
"@homarr/widgets": "workspace:^0.1.0",
|
||||||
"@mantine/colors-generator": "^8.3.12",
|
"@mantine/colors-generator": "catalog:",
|
||||||
"@mantine/core": "^8.3.12",
|
"@mantine/core": "catalog:",
|
||||||
"@mantine/dropzone": "^8.3.12",
|
"@mantine/dropzone": "catalog:",
|
||||||
"@mantine/hooks": "^8.3.12",
|
"@mantine/hooks": "catalog:",
|
||||||
"@mantine/modals": "^8.3.12",
|
"@mantine/modals": "catalog:",
|
||||||
"@mantine/tiptap": "^8.3.12",
|
"@mantine/tiptap": "catalog:",
|
||||||
"@million/lint": "1.0.14",
|
"@tabler/icons-react": "catalog:",
|
||||||
"@tabler/icons-react": "^3.36.1",
|
"@tanstack/react-query": "catalog:",
|
||||||
"@tanstack/react-query": "^5.90.16",
|
"@tanstack/react-query-devtools": "catalog:",
|
||||||
"@tanstack/react-query-devtools": "^5.91.2",
|
"@tanstack/react-query-next-experimental": "catalog:",
|
||||||
"@tanstack/react-query-next-experimental": "^5.91.0",
|
"@trpc/client": "catalog:",
|
||||||
"@trpc/client": "^11.8.1",
|
"@trpc/next": "catalog:",
|
||||||
"@trpc/next": "^11.8.1",
|
"@trpc/react-query": "catalog:",
|
||||||
"@trpc/react-query": "^11.8.1",
|
"@trpc/server": "catalog:",
|
||||||
"@trpc/server": "^11.8.1",
|
"@xterm/addon-canvas": "catalog:",
|
||||||
"@xterm/addon-canvas": "^0.7.0",
|
"@xterm/addon-fit": "catalog:",
|
||||||
"@xterm/addon-fit": "0.11.0",
|
"@xterm/xterm": "catalog:",
|
||||||
"@xterm/xterm": "^6.0.0",
|
"babel-plugin-react-compiler": "catalog:",
|
||||||
"babel-plugin-react-compiler": "^1.0.0",
|
"chroma-js": "catalog:",
|
||||||
"chroma-js": "^3.2.0",
|
"clsx": "catalog:",
|
||||||
"clsx": "^2.1.1",
|
"dayjs": "catalog:",
|
||||||
"dayjs": "^1.11.19",
|
"dotenv": "catalog:",
|
||||||
"dotenv": "^17.2.3",
|
"flag-icons": "catalog:",
|
||||||
"flag-icons": "^7.5.0",
|
"glob": "catalog:",
|
||||||
"glob": "^13.0.0",
|
"isomorphic-dompurify": "catalog:",
|
||||||
"isomorphic-dompurify": "^2.35.0",
|
"jotai": "catalog:",
|
||||||
"jotai": "^2.16.1",
|
"mantine-react-table": "catalog:",
|
||||||
"mantine-react-table": "2.0.0-beta.9",
|
"next": "catalog:",
|
||||||
"next": "16.1.1",
|
"postcss-preset-mantine": "catalog:",
|
||||||
"postcss-preset-mantine": "^1.18.0",
|
"prismjs": "catalog:",
|
||||||
"prismjs": "^1.30.0",
|
"react": "catalog:",
|
||||||
"react": "19.2.3",
|
"react-dom": "catalog:",
|
||||||
"react-dom": "19.2.3",
|
"react-error-boundary": "catalog:",
|
||||||
"react-error-boundary": "^6.0.3",
|
"react-simple-code-editor": "catalog:",
|
||||||
"react-simple-code-editor": "^0.14.1",
|
"sass": "catalog:",
|
||||||
"sass": "^1.97.2",
|
"superjson": "catalog:",
|
||||||
"superjson": "2.2.6",
|
"swagger-ui-react": "catalog:",
|
||||||
"swagger-ui-react": "^5.31.0",
|
"use-deep-compare-effect": "catalog:",
|
||||||
"use-deep-compare-effect": "^1.8.1",
|
"yaml": "catalog:",
|
||||||
"zod": "^4.2.1"
|
"zod": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
"@homarr/eslint-config": "workspace:^0.2.0",
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
"@homarr/prettier-config": "workspace:^0.1.0",
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"@types/chroma-js": "3.1.2",
|
"@types/chroma-js": "catalog:",
|
||||||
"@types/node": "^24.10.7",
|
"@types/node": "catalog:",
|
||||||
"@types/prismjs": "^1.26.5",
|
"@types/prismjs": "catalog:",
|
||||||
"@types/react": "19.2.8",
|
"@types/react": "catalog:",
|
||||||
"@types/react-dom": "19.2.3",
|
"@types/react-dom": "catalog:",
|
||||||
"@types/swagger-ui-react": "^5.18.0",
|
"@types/swagger-ui-react": "catalog:",
|
||||||
"concurrently": "^9.2.1",
|
"concurrently": "catalog:",
|
||||||
"eslint": "^9.39.2",
|
"eslint": "catalog:",
|
||||||
"node-loader": "^2.1.0",
|
"node-loader": "catalog:",
|
||||||
"prettier": "^3.7.4",
|
"prettier": "catalog:",
|
||||||
"typescript": "^5.9.3"
|
"typescript": "catalog:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
self.addEventListener("install", () => {
|
||||||
|
self.skipWaiting();
|
||||||
|
});
|
||||||
|
|
||||||
|
self.addEventListener("activate", (event) => {
|
||||||
|
event.waitUntil(self.clients.claim());
|
||||||
|
});
|
||||||
@@ -8,13 +8,12 @@ import dayjs from "dayjs";
|
|||||||
import { clientApi } from "@homarr/api/client";
|
import { clientApi } from "@homarr/api/client";
|
||||||
import { useSession } from "@homarr/auth/client";
|
import { useSession } from "@homarr/auth/client";
|
||||||
import { parseCookies, setClientCookie } from "@homarr/common";
|
import { parseCookies, setClientCookie } from "@homarr/common";
|
||||||
import type { ColorScheme } from "@homarr/definitions";
|
|
||||||
import { colorSchemeCookieKey } from "@homarr/definitions";
|
import { colorSchemeCookieKey } from "@homarr/definitions";
|
||||||
|
|
||||||
export const CustomMantineProvider = ({
|
export const CustomMantineProvider = ({
|
||||||
children,
|
children,
|
||||||
defaultColorScheme,
|
defaultColorScheme,
|
||||||
}: PropsWithChildren<{ defaultColorScheme: ColorScheme }>) => {
|
}: PropsWithChildren<{ defaultColorScheme: MantineColorScheme }>) => {
|
||||||
const manager = useColorSchemeManager();
|
const manager = useColorSchemeManager();
|
||||||
return (
|
return (
|
||||||
<DirectionProvider>
|
<DirectionProvider>
|
||||||
@@ -35,7 +34,7 @@ export const CustomMantineProvider = ({
|
|||||||
export function useColorSchemeManager(): MantineColorSchemeManager {
|
export function useColorSchemeManager(): MantineColorSchemeManager {
|
||||||
const { data: session } = useSession();
|
const { data: session } = useSession();
|
||||||
|
|
||||||
const updateCookieValue = (value: Exclude<MantineColorScheme, "auto">) => {
|
const updateCookieValue = (value: MantineColorScheme) => {
|
||||||
setClientCookie(colorSchemeCookieKey, value, { expires: dayjs().add(1, "year").toDate(), path: "/" });
|
setClientCookie(colorSchemeCookieKey, value, { expires: dayjs().add(1, "year").toDate(), path: "/" });
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -60,7 +59,6 @@ export function useColorSchemeManager(): MantineColorSchemeManager {
|
|||||||
},
|
},
|
||||||
|
|
||||||
set: (value) => {
|
set: (value) => {
|
||||||
if (value === "auto") return;
|
|
||||||
try {
|
try {
|
||||||
if (session) {
|
if (session) {
|
||||||
mutateColorScheme({ colorScheme: value });
|
mutateColorScheme({ colorScheme: value });
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import type { useForm } from "@homarr/form";
|
|||||||
import { useZodForm } from "@homarr/form";
|
import { useZodForm } from "@homarr/form";
|
||||||
import { showErrorNotification, showSuccessNotification } from "@homarr/notifications";
|
import { showErrorNotification, showSuccessNotification } from "@homarr/notifications";
|
||||||
import { useScopedI18n } from "@homarr/translation/client";
|
import { useScopedI18n } from "@homarr/translation/client";
|
||||||
|
import { sanitizeRedirectionUrl } from "@homarr/validation/redirection-url";
|
||||||
import { userSignInSchema } from "@homarr/validation/user";
|
import { userSignInSchema } from "@homarr/validation/user";
|
||||||
|
|
||||||
type Provider = "credentials" | "ldap" | "oidc";
|
type Provider = "credentials" | "ldap" | "oidc";
|
||||||
@@ -70,7 +71,7 @@ export const LoginForm = ({ providers, oidcClientName, isOidcAutoLoginEnabled, c
|
|||||||
|
|
||||||
// Redirect to the callback URL if the response is defined and comes from a credentials provider (ldap or credentials). oidc is redirected automatically.
|
// Redirect to the callback URL if the response is defined and comes from a credentials provider (ldap or credentials). oidc is redirected automatically.
|
||||||
await revalidatePathActionAsync("/");
|
await revalidatePathActionAsync("/");
|
||||||
router.push(callbackUrl);
|
router.push(sanitizeRedirectionUrl(callbackUrl));
|
||||||
},
|
},
|
||||||
[t, router, callbackUrl],
|
[t, router, callbackUrl],
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { Card, Center, Stack, Text, Title } from "@mantine/core";
|
|||||||
import { env } from "@homarr/auth/env";
|
import { env } from "@homarr/auth/env";
|
||||||
import { auth } from "@homarr/auth/next";
|
import { auth } from "@homarr/auth/next";
|
||||||
import { getScopedI18n } from "@homarr/translation/server";
|
import { getScopedI18n } from "@homarr/translation/server";
|
||||||
|
import { sanitizeRedirectionUrl } from "@homarr/validation/redirection-url";
|
||||||
|
|
||||||
import { HomarrLogoWithTitle } from "~/components/layout/logo/homarr-logo";
|
import { HomarrLogoWithTitle } from "~/components/layout/logo/homarr-logo";
|
||||||
import { LoginForm } from "./_login-form";
|
import { LoginForm } from "./_login-form";
|
||||||
@@ -19,7 +20,7 @@ export default async function Login(props: LoginProps) {
|
|||||||
const session = await auth();
|
const session = await auth();
|
||||||
|
|
||||||
if (session) {
|
if (session) {
|
||||||
redirect(searchParams.callbackUrl ?? "/");
|
redirect(sanitizeRedirectionUrl(searchParams.callbackUrl));
|
||||||
}
|
}
|
||||||
|
|
||||||
const t = await getScopedI18n("user.page.login");
|
const t = await getScopedI18n("user.page.login");
|
||||||
|
|||||||
@@ -1,70 +1,27 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useCallback, useRef } from "react";
|
import { Box, Stack } from "@mantine/core";
|
||||||
import { Box, LoadingOverlay, Stack } from "@mantine/core";
|
|
||||||
|
|
||||||
import type { RouterOutputs } from "@homarr/api";
|
|
||||||
import { clientApi } from "@homarr/api/client";
|
|
||||||
import { useCurrentLayout, useRequiredBoard } from "@homarr/boards/context";
|
import { useCurrentLayout, useRequiredBoard } from "@homarr/boards/context";
|
||||||
|
|
||||||
import { BoardCategorySection } from "~/components/board/sections/category-section";
|
import { BoardCategorySection } from "~/components/board/sections/category-section";
|
||||||
import { BoardEmptySection } from "~/components/board/sections/empty-section";
|
import { BoardEmptySection } from "~/components/board/sections/empty-section";
|
||||||
import { BoardBackgroundVideo } from "~/components/layout/background";
|
import { BoardBackgroundVideo } from "~/components/layout/background";
|
||||||
import { fullHeightWithoutHeaderAndFooter } from "~/constants";
|
|
||||||
import { useIsBoardReady } from "./_ready-context";
|
|
||||||
|
|
||||||
let boardName: string | null = null;
|
|
||||||
|
|
||||||
export const updateBoardName = (name: string | null) => {
|
|
||||||
boardName = name;
|
|
||||||
};
|
|
||||||
|
|
||||||
type UpdateCallback = (prev: RouterOutputs["board"]["getHomeBoard"]) => RouterOutputs["board"]["getHomeBoard"];
|
|
||||||
|
|
||||||
export const useUpdateBoard = () => {
|
|
||||||
const utils = clientApi.useUtils();
|
|
||||||
|
|
||||||
const updateBoard = useCallback(
|
|
||||||
(updaterWithoutUndefined: UpdateCallback) => {
|
|
||||||
if (!boardName) {
|
|
||||||
throw new Error("Board name is not set");
|
|
||||||
}
|
|
||||||
utils.board.getBoardByName.setData({ name: boardName }, (previous) =>
|
|
||||||
previous ? updaterWithoutUndefined(previous) : previous,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
[utils],
|
|
||||||
);
|
|
||||||
|
|
||||||
return {
|
|
||||||
updateBoard,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export const ClientBoard = () => {
|
export const ClientBoard = () => {
|
||||||
const board = useRequiredBoard();
|
const board = useRequiredBoard();
|
||||||
const currentLayoutId = useCurrentLayout();
|
const currentLayoutId = useCurrentLayout();
|
||||||
const isReady = useIsBoardReady();
|
|
||||||
|
|
||||||
const fullWidthSortedSections = board.sections
|
const fullWidthSortedSections = board.sections
|
||||||
.filter((section) => section.kind === "empty" || section.kind === "category")
|
.filter((section) => section.kind === "empty" || section.kind === "category")
|
||||||
.sort((sectionA, sectionB) => sectionA.yOffset - sectionB.yOffset);
|
.sort((sectionA, sectionB) => sectionA.yOffset - sectionB.yOffset);
|
||||||
|
|
||||||
const ref = useRef<HTMLDivElement>(null);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box h="100%" pos="relative">
|
<Box h="100%" pos="relative">
|
||||||
<BoardBackgroundVideo />
|
<BoardBackgroundVideo />
|
||||||
<LoadingOverlay
|
<Stack h="100%">
|
||||||
visible={!isReady}
|
|
||||||
transitionProps={{ duration: 500 }}
|
|
||||||
loaderProps={{ size: "lg" }}
|
|
||||||
h={fullHeightWithoutHeaderAndFooter}
|
|
||||||
/>
|
|
||||||
<Stack ref={ref} h="100%" style={{ visibility: isReady ? "visible" : "hidden" }}>
|
|
||||||
{fullWidthSortedSections.map((section) =>
|
{fullWidthSortedSections.map((section) =>
|
||||||
section.kind === "empty" ? (
|
section.kind === "empty" ? (
|
||||||
// Unique keys per layout to always reinitialize the gridstack
|
|
||||||
<BoardEmptySection key={`${currentLayoutId}-${section.id}`} section={section} />
|
<BoardEmptySection key={`${currentLayoutId}-${section.id}`} section={section} />
|
||||||
) : (
|
) : (
|
||||||
<BoardCategorySection key={`${currentLayoutId}-${section.id}`} section={section} />
|
<BoardCategorySection key={`${currentLayoutId}-${section.id}`} section={section} />
|
||||||
|
|||||||
@@ -264,6 +264,5 @@ const usePreventLeaveWithDirty = (isDirty: boolean) => {
|
|||||||
window.removeEventListener("popstate", handlePopState);
|
window.removeEventListener("popstate", handlePopState);
|
||||||
window.removeEventListener("beforeunload", handleBeforeUnload);
|
window.removeEventListener("beforeunload", handleBeforeUnload);
|
||||||
};
|
};
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
||||||
}, [isDirty]);
|
}, [isDirty]);
|
||||||
};
|
};
|
||||||
@@ -1,43 +1,19 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import type { PropsWithChildren } from "react";
|
import type { PropsWithChildren } from "react";
|
||||||
import { createContext, useCallback, useContext, useEffect, useState } from "react";
|
import { createContext, useCallback, useContext } from "react";
|
||||||
import { usePathname } from "next/navigation";
|
|
||||||
|
|
||||||
import { clientApi } from "@homarr/api/client";
|
|
||||||
import { useRequiredBoard } from "@homarr/boards/context";
|
|
||||||
|
|
||||||
const BoardReadyContext = createContext<{
|
const BoardReadyContext = createContext<{
|
||||||
isReady: boolean;
|
|
||||||
markAsReady: (id: string) => void;
|
markAsReady: (id: string) => void;
|
||||||
} | null>(null);
|
} | null>(null);
|
||||||
|
|
||||||
export const BoardReadyProvider = ({ children }: PropsWithChildren) => {
|
export const BoardReadyProvider = ({ children }: PropsWithChildren) => {
|
||||||
const pathname = usePathname();
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||||
const utils = clientApi.useUtils();
|
const markAsReady = useCallback((_id: string) => {}, []);
|
||||||
const board = useRequiredBoard();
|
|
||||||
const [readySections, setReadySections] = useState<string[]>([]);
|
|
||||||
|
|
||||||
// Reset sections required for ready state
|
|
||||||
useEffect(() => {
|
|
||||||
return () => {
|
|
||||||
setReadySections([]);
|
|
||||||
};
|
|
||||||
}, [pathname, utils]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
setReadySections((previous) => previous.filter((id) => board.sections.some((section) => section.id === id)));
|
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
||||||
}, [board.sections.length, setReadySections]);
|
|
||||||
|
|
||||||
const markAsReady = useCallback((id: string) => {
|
|
||||||
setReadySections((previous) => (previous.includes(id) ? previous : [...previous, id]));
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<BoardReadyContext.Provider
|
<BoardReadyContext.Provider
|
||||||
value={{
|
value={{
|
||||||
isReady: board.sections.length === readySections.length,
|
|
||||||
markAsReady,
|
markAsReady,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -55,13 +31,3 @@ export const useMarkSectionAsReady = () => {
|
|||||||
|
|
||||||
return context.markAsReady;
|
return context.markAsReady;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const useIsBoardReady = () => {
|
|
||||||
const context = useContext(BoardReadyContext);
|
|
||||||
|
|
||||||
if (!context) {
|
|
||||||
throw new Error("BoardReadyProvider is required");
|
|
||||||
}
|
|
||||||
|
|
||||||
return context.isReady;
|
|
||||||
};
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import { useEffect, useRef } from "react";
|
import { useEffect, useRef } from "react";
|
||||||
import { Button, Grid, Group, Loader, Stack, TextInput } from "@mantine/core";
|
import { Button, Grid, Group, Loader, Stack, TextInput } from "@mantine/core";
|
||||||
import { useDebouncedValue, useDocumentTitle, useFavicon } from "@mantine/hooks";
|
import { useDebouncedValue, useDocumentTitle } from "@mantine/hooks";
|
||||||
|
|
||||||
import { useUpdateBoard } from "@homarr/boards/updater";
|
import { useUpdateBoard } from "@homarr/boards/updater";
|
||||||
import { useZodForm } from "@homarr/form";
|
import { useZodForm } from "@homarr/form";
|
||||||
@@ -10,6 +10,7 @@ import { IconPicker } from "@homarr/forms-collection";
|
|||||||
import { useI18n } from "@homarr/translation/client";
|
import { useI18n } from "@homarr/translation/client";
|
||||||
import { boardSavePartialSettingsSchema } from "@homarr/validation/board";
|
import { boardSavePartialSettingsSchema } from "@homarr/validation/board";
|
||||||
|
|
||||||
|
import { homarrLogoPath } from "~/components/layout/logo/homarr-logo";
|
||||||
import { createMetaTitle } from "~/metadata";
|
import { createMetaTitle } from "~/metadata";
|
||||||
import type { Board } from "../../_types";
|
import type { Board } from "../../_types";
|
||||||
import { useSavePartialSettingsMutation } from "./_shared";
|
import { useSavePartialSettingsMutation } from "./_shared";
|
||||||
@@ -53,7 +54,6 @@ export const GeneralSettingsContent = ({ board }: Props) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
useLogoPreview(form.values.logoImageUrl);
|
useLogoPreview(form.values.logoImageUrl);
|
||||||
useFaviconPreview(form.values.faviconImageUrl);
|
|
||||||
const metaTitleStatus = useMetaTitlePreview(form.values.metaTitle);
|
const metaTitleStatus = useMetaTitlePreview(form.values.metaTitle);
|
||||||
|
|
||||||
// Cleanup for not applied changes of the page title and logo image URL
|
// Cleanup for not applied changes of the page title and logo image URL
|
||||||
@@ -75,6 +75,7 @@ export const GeneralSettingsContent = ({ board }: Props) => {
|
|||||||
pageTitle: values.pageTitle,
|
pageTitle: values.pageTitle,
|
||||||
logoImageUrl: values.logoImageUrl,
|
logoImageUrl: values.logoImageUrl,
|
||||||
};
|
};
|
||||||
|
updateFavicon(values.faviconImageUrl ?? homarrLogoPath);
|
||||||
savePartialSettings({
|
savePartialSettings({
|
||||||
id: board.id,
|
id: board.id,
|
||||||
...values,
|
...values,
|
||||||
@@ -146,7 +147,13 @@ const useMetaTitlePreview = (title: string | null) => {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const useFaviconPreview = (url: string | null) => {
|
// Previously we used the useFavicon hook from Mantine
|
||||||
const [faviconDebounced] = useDebouncedValue(url ?? "", 500);
|
// However if the user tried to click on a link to a different page
|
||||||
useFavicon(faviconDebounced);
|
// it caused an error "Cannot read properties of null (reading 'removeChild')"
|
||||||
|
// Probably because the head element was null (https://github.com/mantinedev/mantine/blob/b90d9b81031f45f5d15e75f25138ed6477f65bce/packages/%40mantine/hooks/src/use-favicon/use-favicon.ts#L21)
|
||||||
|
// See https://github.com/homarr-labs/homarr/issues/4905
|
||||||
|
const updateFavicon = (url: string) => {
|
||||||
|
const link: HTMLLinkElement | null = document.querySelector('link[rel="icon"]');
|
||||||
|
if (!link) return;
|
||||||
|
link.href = url;
|
||||||
};
|
};
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { startTransition } from "react";
|
|
||||||
import { Button, Card, Group, Stack, Switch, Text } from "@mantine/core";
|
import { Button, Card, Group, Stack, Switch, Text } from "@mantine/core";
|
||||||
import { IconArrowRight } from "@tabler/icons-react";
|
import { IconArrowRight } from "@tabler/icons-react";
|
||||||
import type { z } from "zod/v4";
|
import type { z } from "zod/v4";
|
||||||
@@ -24,16 +23,6 @@ export const InitSettings = () => {
|
|||||||
});
|
});
|
||||||
const form = useZodForm(settingsInitSchema, { initialValues: defaultServerSettings });
|
const form = useZodForm(settingsInitSchema, { initialValues: defaultServerSettings });
|
||||||
|
|
||||||
form.watch("analytics.enableGeneral", ({ value }) => {
|
|
||||||
if (!value) {
|
|
||||||
startTransition(() => {
|
|
||||||
form.setFieldValue("analytics.enableWidgetData", false);
|
|
||||||
form.setFieldValue("analytics.enableIntegrationData", false);
|
|
||||||
form.setFieldValue("analytics.enableUserData", false);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const handleSubmitAsync = async (values: z.infer<typeof settingsInitSchema>) => {
|
const handleSubmitAsync = async (values: z.infer<typeof settingsInitSchema>) => {
|
||||||
await mutateAsync(values);
|
await mutateAsync(values);
|
||||||
};
|
};
|
||||||
@@ -47,24 +36,6 @@ export const InitSettings = () => {
|
|||||||
|
|
||||||
<Stack gap="xs">
|
<Stack gap="xs">
|
||||||
<AnalyticsRow kind="general" {...form.getInputProps("analytics.enableGeneral", { type: "checkbox" })} />
|
<AnalyticsRow kind="general" {...form.getInputProps("analytics.enableGeneral", { type: "checkbox" })} />
|
||||||
|
|
||||||
<Stack gap="xs" ps="md" w="100%">
|
|
||||||
<AnalyticsRow
|
|
||||||
kind="integrationData"
|
|
||||||
disabled={!form.values.analytics.enableGeneral}
|
|
||||||
{...form.getInputProps("analytics.enableWidgetData", { type: "checkbox" })}
|
|
||||||
/>
|
|
||||||
<AnalyticsRow
|
|
||||||
kind="widgetData"
|
|
||||||
disabled={!form.values.analytics.enableGeneral}
|
|
||||||
{...form.getInputProps("analytics.enableIntegrationData", { type: "checkbox" })}
|
|
||||||
/>
|
|
||||||
<AnalyticsRow
|
|
||||||
kind="usersData"
|
|
||||||
disabled={!form.values.analytics.enableGeneral}
|
|
||||||
{...form.getInputProps("analytics.enableUserData", { type: "checkbox" })}
|
|
||||||
/>
|
|
||||||
</Stack>
|
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { Inter } from "next/font/google";
|
|||||||
import "@homarr/notifications/styles.css";
|
import "@homarr/notifications/styles.css";
|
||||||
import "@homarr/spotlight/styles.css";
|
import "@homarr/spotlight/styles.css";
|
||||||
import "@homarr/ui/styles.css";
|
import "@homarr/ui/styles.css";
|
||||||
|
import "~/styles/color-scheme.scss";
|
||||||
import "~/styles/scroll-area.scss";
|
import "~/styles/scroll-area.scss";
|
||||||
|
|
||||||
import { notFound } from "next/navigation";
|
import { notFound } from "next/navigation";
|
||||||
@@ -25,6 +26,7 @@ import { isLocaleRTL, isLocaleSupported } from "@homarr/translation";
|
|||||||
import { Analytics } from "~/components/layout/analytics";
|
import { Analytics } from "~/components/layout/analytics";
|
||||||
import { CrowdinLiveTranslation } from "~/components/layout/crowdin-live-translation";
|
import { CrowdinLiveTranslation } from "~/components/layout/crowdin-live-translation";
|
||||||
import { SearchEngineOptimization } from "~/components/layout/search-engine-optimization";
|
import { SearchEngineOptimization } from "~/components/layout/search-engine-optimization";
|
||||||
|
import { ServiceWorkerRegistration } from "~/components/layout/service-worker-registration";
|
||||||
import { getCurrentColorSchemeAsync } from "~/theme/color-scheme";
|
import { getCurrentColorSchemeAsync } from "~/theme/color-scheme";
|
||||||
import { DayJsLoader } from "./_client-providers/dayjs-loader";
|
import { DayJsLoader } from "./_client-providers/dayjs-loader";
|
||||||
import { JotaiProvider } from "./_client-providers/jotai";
|
import { JotaiProvider } from "./_client-providers/jotai";
|
||||||
@@ -129,7 +131,7 @@ export default async function Layout(props: {
|
|||||||
dir={direction}
|
dir={direction}
|
||||||
data-mantine-color-scheme={colorScheme}
|
data-mantine-color-scheme={colorScheme}
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: colorScheme === "dark" ? "#242424" : "#fff",
|
backgroundColor: colorScheme === "dark" ? "#242424" : colorScheme === "auto" ? undefined : "#fff",
|
||||||
}}
|
}}
|
||||||
suppressHydrationWarning
|
suppressHydrationWarning
|
||||||
>
|
>
|
||||||
@@ -141,6 +143,7 @@ export default async function Layout(props: {
|
|||||||
<body className={["font-sans", fontSans.variable].join(" ")}>
|
<body className={["font-sans", fontSans.variable].join(" ")}>
|
||||||
<StackedProvider>
|
<StackedProvider>
|
||||||
<Notifications />
|
<Notifications />
|
||||||
|
<ServiceWorkerRegistration />
|
||||||
{props.children}
|
{props.children}
|
||||||
</StackedProvider>
|
</StackedProvider>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
.contributorCard {
|
.contributorCard {
|
||||||
background-color: light-dark(var(--mantine-color-gray-1), var(--mantine-color-dark-5));
|
background-color: light-dark(var(--mantine-color-gray-1), var(--mantine-color-dark-5));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.dependencyCard:hover {
|
||||||
|
background-color: light-dark(var(--mantine-color-gray-1), var(--mantine-color-dark-5));
|
||||||
|
}
|
||||||
@@ -12,8 +12,7 @@ import {
|
|||||||
Flex,
|
Flex,
|
||||||
Group,
|
Group,
|
||||||
Kbd,
|
Kbd,
|
||||||
List,
|
SimpleGrid,
|
||||||
ListItem,
|
|
||||||
Stack,
|
Stack,
|
||||||
Table,
|
Table,
|
||||||
TableTbody,
|
TableTbody,
|
||||||
@@ -22,9 +21,18 @@ import {
|
|||||||
TableThead,
|
TableThead,
|
||||||
TableTr,
|
TableTr,
|
||||||
Text,
|
Text,
|
||||||
|
ThemeIcon,
|
||||||
Title,
|
Title,
|
||||||
|
UnstyledButton,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { IconKeyboard, IconLanguage, IconLibrary, IconUsers } from "@tabler/icons-react";
|
import {
|
||||||
|
IconKeyboard,
|
||||||
|
IconLanguage,
|
||||||
|
IconLibrary,
|
||||||
|
IconMoneybagHeart,
|
||||||
|
IconPackage,
|
||||||
|
IconUsers,
|
||||||
|
} from "@tabler/icons-react";
|
||||||
|
|
||||||
import { capitalize, objectEntries } from "@homarr/common";
|
import { capitalize, objectEntries } from "@homarr/common";
|
||||||
import { hotkeys } from "@homarr/definitions";
|
import { hotkeys } from "@homarr/definitions";
|
||||||
@@ -33,8 +41,10 @@ import { getScopedI18n } from "@homarr/translation/server";
|
|||||||
import { homarrLogoPath } from "~/components/layout/logo/homarr-logo";
|
import { homarrLogoPath } from "~/components/layout/logo/homarr-logo";
|
||||||
import { DynamicBreadcrumb } from "~/components/navigation/dynamic-breadcrumb";
|
import { DynamicBreadcrumb } from "~/components/navigation/dynamic-breadcrumb";
|
||||||
import { createMetaTitle } from "~/metadata";
|
import { createMetaTitle } from "~/metadata";
|
||||||
import { getPackageAttributesAsync } from "~/versions/package-reader";
|
import type { PackageJsonDependencies } from "~/versions/package-reader";
|
||||||
|
import { getPackageVersion } from "~/versions/package-reader";
|
||||||
import type githubContributorsJson from "../../../../../../../static-data/contributors.json";
|
import type githubContributorsJson from "../../../../../../../static-data/contributors.json";
|
||||||
|
import type openCollectiveContributorsJson from "../../../../../../../static-data/opencollective-contributors.json";
|
||||||
import type crowdinContributorsJson from "../../../../../../../static-data/translators.json";
|
import type crowdinContributorsJson from "../../../../../../../static-data/translators.json";
|
||||||
import classes from "./about.module.css";
|
import classes from "./about.module.css";
|
||||||
|
|
||||||
@@ -57,7 +67,10 @@ const getHostAsync = async () => {
|
|||||||
export default async function AboutPage() {
|
export default async function AboutPage() {
|
||||||
const baseServerUrl = `http://${await getHostAsync()}`;
|
const baseServerUrl = `http://${await getHostAsync()}`;
|
||||||
const t = await getScopedI18n("management.page.about");
|
const t = await getScopedI18n("management.page.about");
|
||||||
const attributes = await getPackageAttributesAsync();
|
const version = getPackageVersion();
|
||||||
|
const dependencies = (await fetch(`${baseServerUrl}/api/about/dependencies`).then((res) =>
|
||||||
|
res.json(),
|
||||||
|
)) as PackageJsonDependencies;
|
||||||
const githubContributors = (await fetch(`${baseServerUrl}/api/about/contributors/github`).then((res) =>
|
const githubContributors = (await fetch(`${baseServerUrl}/api/about/contributors/github`).then((res) =>
|
||||||
res.json(),
|
res.json(),
|
||||||
)) as typeof githubContributorsJson;
|
)) as typeof githubContributorsJson;
|
||||||
@@ -66,6 +79,10 @@ export default async function AboutPage() {
|
|||||||
res.json(),
|
res.json(),
|
||||||
)) as typeof crowdinContributorsJson;
|
)) as typeof crowdinContributorsJson;
|
||||||
|
|
||||||
|
const openCollectiveContributors = (await fetch(`${baseServerUrl}/api/about/contributors/opencollective`).then(
|
||||||
|
(res) => res.json(),
|
||||||
|
)) as typeof openCollectiveContributorsJson;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<DynamicBreadcrumb />
|
<DynamicBreadcrumb />
|
||||||
@@ -76,7 +93,7 @@ export default async function AboutPage() {
|
|||||||
<Title order={1} tt="uppercase">
|
<Title order={1} tt="uppercase">
|
||||||
Homarr
|
Homarr
|
||||||
</Title>
|
</Title>
|
||||||
<Title order={2}>{t("version", { version: attributes.version })}</Title>
|
<Title order={2}>{t("version", { version })}</Title>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Group>
|
</Group>
|
||||||
</Center>
|
</Center>
|
||||||
@@ -131,31 +148,72 @@ export default async function AboutPage() {
|
|||||||
</Flex>
|
</Flex>
|
||||||
</AccordionPanel>
|
</AccordionPanel>
|
||||||
</AccordionItem>
|
</AccordionItem>
|
||||||
|
<AccordionItem value="sponsors">
|
||||||
|
<AccordionControl icon={<IconMoneybagHeart size="1rem" />}>
|
||||||
|
<Stack gap={0}>
|
||||||
|
<Text>{t("accordion.sponsors.title")}</Text>
|
||||||
|
<Text size="sm" c="dimmed">
|
||||||
|
{t("accordion.sponsors.subtitle", {
|
||||||
|
count: String(openCollectiveContributors.length),
|
||||||
|
})}
|
||||||
|
</Text>
|
||||||
|
</Stack>
|
||||||
|
</AccordionControl>
|
||||||
|
<AccordionPanel>
|
||||||
|
<Flex wrap="wrap" gap="xs">
|
||||||
|
{openCollectiveContributors.map((sponsor) => (
|
||||||
|
<GenericContributorLinkCard
|
||||||
|
key={sponsor.slug}
|
||||||
|
link={`https://opencollective.com/${sponsor.slug}`}
|
||||||
|
image={sponsor.imageUrl}
|
||||||
|
name={sponsor.name}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</Flex>
|
||||||
|
</AccordionPanel>
|
||||||
|
</AccordionItem>
|
||||||
<AccordionItem value="libraries">
|
<AccordionItem value="libraries">
|
||||||
<AccordionControl icon={<IconLibrary size="1rem" />}>
|
<AccordionControl icon={<IconLibrary size="1rem" />}>
|
||||||
<Stack gap={0}>
|
<Stack gap={0}>
|
||||||
<Text>{t("accordion.libraries.title")}</Text>
|
<Text>{t("accordion.libraries.title")}</Text>
|
||||||
<Text size="sm" c="dimmed">
|
<Text size="sm" c="dimmed">
|
||||||
{t("accordion.libraries.subtitle", {
|
{t("accordion.libraries.subtitle", {
|
||||||
count: String(Object.keys(attributes.dependencies).length),
|
count: String(Object.keys(dependencies).length),
|
||||||
})}
|
})}
|
||||||
</Text>
|
</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
</AccordionControl>
|
</AccordionControl>
|
||||||
<AccordionPanel>
|
<AccordionPanel>
|
||||||
<List>
|
<SimpleGrid cols={{ xs: 1, sm: 2, md: 3, lg: 4, xl: 5 }} spacing="md">
|
||||||
{Object.entries(attributes.dependencies)
|
{Object.entries(dependencies)
|
||||||
|
.filter(([, value]) => !value.includes("workspace:"))
|
||||||
.sort(([key1], [key2]) => key1.localeCompare(key2))
|
.sort(([key1], [key2]) => key1.localeCompare(key2))
|
||||||
.map(([key, value]) => (
|
.map(([name, version]) => (
|
||||||
<ListItem key={key}>
|
<UnstyledButton
|
||||||
{value.includes("workspace:") ? (
|
key={name}
|
||||||
<Text>{key}</Text>
|
component="a"
|
||||||
) : (
|
href={`https://www.npmjs.com/package/${name}`}
|
||||||
<a href={`https://www.npmjs.com/package/${key}`}>{key}</a>
|
target="_blank"
|
||||||
)}
|
>
|
||||||
</ListItem>
|
<Card withBorder radius="md" p="xs" className={classes.dependencyCard}>
|
||||||
|
<Group gap="sm" wrap="nowrap">
|
||||||
|
<ThemeIcon variant="light" size="lg" radius="md">
|
||||||
|
<IconPackage size="1.5rem" stroke={1.5} />
|
||||||
|
</ThemeIcon>
|
||||||
|
|
||||||
|
<Stack gap={0}>
|
||||||
|
<Text size="sm" fw="bold" lineClamp={1} title={name}>
|
||||||
|
{name}
|
||||||
|
</Text>
|
||||||
|
<Text size="sm" c="dimmed">
|
||||||
|
v{version.replace("^", "").replace("~", "")}
|
||||||
|
</Text>
|
||||||
|
</Stack>
|
||||||
|
</Group>
|
||||||
|
</Card>
|
||||||
|
</UnstyledButton>
|
||||||
))}
|
))}
|
||||||
</List>
|
</SimpleGrid>
|
||||||
</AccordionPanel>
|
</AccordionPanel>
|
||||||
</AccordionItem>
|
</AccordionItem>
|
||||||
<AccordionItem value="hotkeys">
|
<AccordionItem value="hotkeys">
|
||||||
|
|||||||
@@ -24,15 +24,6 @@ export const AnalyticsSettings = ({ initialData }: AnalyticsSettingsProps) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
|
||||||
!updatedValues.enableGeneral &&
|
|
||||||
(updatedValues.enableWidgetData || updatedValues.enableIntegrationData || updatedValues.enableUserData)
|
|
||||||
) {
|
|
||||||
updatedValues.enableIntegrationData = false;
|
|
||||||
updatedValues.enableUserData = false;
|
|
||||||
updatedValues.enableWidgetData = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void mutateAsync({
|
void mutateAsync({
|
||||||
settingsKey: "analytics",
|
settingsKey: "analytics",
|
||||||
value: updatedValues,
|
value: updatedValues,
|
||||||
@@ -54,30 +45,6 @@ export const AnalyticsSettings = ({ initialData }: AnalyticsSettingsProps) => {
|
|||||||
<LoadingOverlay visible={isPending} zIndex={1000} overlayProps={{ radius: "sm", blur: 2 }} />
|
<LoadingOverlay visible={isPending} zIndex={1000} overlayProps={{ radius: "sm", blur: 2 }} />
|
||||||
<Stack>
|
<Stack>
|
||||||
<SwitchSetting form={form} formKey="enableGeneral" title={t("general.title")} text={t("general.text")} />
|
<SwitchSetting form={form} formKey="enableGeneral" title={t("general.title")} text={t("general.text")} />
|
||||||
<SwitchSetting
|
|
||||||
form={form}
|
|
||||||
formKey="enableIntegrationData"
|
|
||||||
ms="xl"
|
|
||||||
title={t("integrationData.title")}
|
|
||||||
text={t("integrationData.text")}
|
|
||||||
disabled={!form.values.enableGeneral}
|
|
||||||
/>
|
|
||||||
<SwitchSetting
|
|
||||||
form={form}
|
|
||||||
formKey="enableWidgetData"
|
|
||||||
ms="xl"
|
|
||||||
title={t("widgetData.title")}
|
|
||||||
text={t("widgetData.text")}
|
|
||||||
disabled={!form.values.enableGeneral}
|
|
||||||
/>
|
|
||||||
<SwitchSetting
|
|
||||||
form={form}
|
|
||||||
formKey="enableUserData"
|
|
||||||
ms="xl"
|
|
||||||
title={t("usersData.title")}
|
|
||||||
text={t("usersData.text")}
|
|
||||||
disabled={!form.values.enableGeneral}
|
|
||||||
/>
|
|
||||||
</Stack>
|
</Stack>
|
||||||
</Card>
|
</Card>
|
||||||
</>
|
</>
|
||||||
|
|||||||
+2
-1
@@ -1,7 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { Group, Text } from "@mantine/core";
|
import { Group, Text } from "@mantine/core";
|
||||||
import { IconMoon, IconSun } from "@tabler/icons-react";
|
import { IconDeviceDesktop, IconMoon, IconSun } from "@tabler/icons-react";
|
||||||
|
|
||||||
import type { ColorScheme } from "@homarr/definitions";
|
import type { ColorScheme } from "@homarr/definitions";
|
||||||
import { colorSchemes } from "@homarr/definitions";
|
import { colorSchemes } from "@homarr/definitions";
|
||||||
@@ -34,6 +34,7 @@ export const AppearanceSettingsForm = ({ defaultValues }: { defaultValues: Serve
|
|||||||
};
|
};
|
||||||
|
|
||||||
const appearanceIcons = {
|
const appearanceIcons = {
|
||||||
|
auto: IconDeviceDesktop,
|
||||||
light: IconSun,
|
light: IconSun,
|
||||||
dark: IconMoon,
|
dark: IconMoon,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { headers } from "next/headers";
|
|||||||
import { notFound } from "next/navigation";
|
import { notFound } from "next/navigation";
|
||||||
import { Stack, Tabs, TabsList, TabsPanel, TabsTab } from "@mantine/core";
|
import { Stack, Tabs, TabsList, TabsPanel, TabsTab } from "@mantine/core";
|
||||||
|
|
||||||
import { openApiDocument } from "@homarr/api";
|
import { openApiDocument } from "@homarr/api/open-api";
|
||||||
import { api } from "@homarr/api/server";
|
import { api } from "@homarr/api/server";
|
||||||
import { auth } from "@homarr/auth/next";
|
import { auth } from "@homarr/auth/next";
|
||||||
import { extractBaseUrlFromHeaders } from "@homarr/common";
|
import { extractBaseUrlFromHeaders } from "@homarr/common";
|
||||||
@@ -14,7 +14,7 @@ import { ApiKeysManagement } from "./components/api-keys";
|
|||||||
|
|
||||||
export async function generateMetadata() {
|
export async function generateMetadata() {
|
||||||
const session = await auth();
|
const session = await auth();
|
||||||
if (!session?.user || !session.user.permissions.includes("admin")) {
|
if (!session?.user.permissions.includes("admin")) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@ export async function generateMetadata() {
|
|||||||
|
|
||||||
export default async function ApiPage() {
|
export default async function ApiPage() {
|
||||||
const session = await auth();
|
const session = await auth();
|
||||||
if (!session?.user || !session.user.permissions.includes("admin")) {
|
if (!session?.user.permissions.includes("admin")) {
|
||||||
notFound();
|
notFound();
|
||||||
}
|
}
|
||||||
const document = openApiDocument(extractBaseUrlFromHeaders(await headers()));
|
const document = openApiDocument(extractBaseUrlFromHeaders(await headers()));
|
||||||
|
|||||||
@@ -58,6 +58,18 @@ const createColumns = (
|
|||||||
return <ContainerStateBadge state={cell.row.original.state} />;
|
return <ContainerStateBadge state={cell.row.original.state} />;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "host",
|
||||||
|
header: t("docker.field.host.label"),
|
||||||
|
size: 140,
|
||||||
|
Cell({ row }) {
|
||||||
|
return (
|
||||||
|
<Text truncate="end" title={row.original.host}>
|
||||||
|
{row.original.host}
|
||||||
|
</Text>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
accessorKey: "image",
|
accessorKey: "image",
|
||||||
header: t("docker.field.containerImage.label"),
|
header: t("docker.field.containerImage.label"),
|
||||||
@@ -76,6 +88,7 @@ const createColumns = (
|
|||||||
accessorKey: "ports",
|
accessorKey: "ports",
|
||||||
header: t("docker.field.ports.label"),
|
header: t("docker.field.ports.label"),
|
||||||
Cell({ cell }) {
|
Cell({ cell }) {
|
||||||
|
if (!cell.row.original.ports) return null;
|
||||||
if (!cell.row.original.ports.length) return null;
|
if (!cell.row.original.ports.length) return null;
|
||||||
return (
|
return (
|
||||||
<OverflowBadge overflowCount={1} data={cell.row.original.ports.map((port) => port.PrivatePort.toString())} />
|
<OverflowBadge overflowCount={1} data={cell.row.original.ports.map((port) => port.PrivatePort.toString())} />
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import { LogContextProvider } from "./log-context";
|
|||||||
|
|
||||||
export async function generateMetadata() {
|
export async function generateMetadata() {
|
||||||
const session = await auth();
|
const session = await auth();
|
||||||
if (!session?.user || !session.user.permissions.includes("admin")) {
|
if (!session?.user.permissions.includes("admin")) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
const t = await getScopedI18n("management");
|
const t = await getScopedI18n("management");
|
||||||
@@ -30,7 +30,7 @@ export async function generateMetadata() {
|
|||||||
|
|
||||||
export default async function LogsManagementPage() {
|
export default async function LogsManagementPage() {
|
||||||
const session = await auth();
|
const session = await auth();
|
||||||
if (!session?.user || !session.user.permissions.includes("other-view-logs")) {
|
if (!session?.user.permissions.includes("other-view-logs")) {
|
||||||
notFound();
|
notFound();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -117,6 +117,8 @@ const createColumns = (
|
|||||||
header: tTasks("field.interval.label"),
|
header: tTasks("field.interval.label"),
|
||||||
size: 200,
|
size: 200,
|
||||||
Cell({ row }) {
|
Cell({ row }) {
|
||||||
|
if (row.original.preventCustomInterval) return null;
|
||||||
|
|
||||||
const handleIntervalChange = (newCron: string | null) => {
|
const handleIntervalChange = (newCron: string | null) => {
|
||||||
if (!newCron || newCron === row.original.cron) return;
|
if (!newCron || newCron === row.original.cron) return;
|
||||||
|
|
||||||
|
|||||||
+6
@@ -26,6 +26,7 @@ export const ChangeSearchPreferencesForm = ({ user, searchEnginesData }: ChangeS
|
|||||||
form.setInitialValues({
|
form.setInitialValues({
|
||||||
defaultSearchEngineId: variables.defaultSearchEngineId,
|
defaultSearchEngineId: variables.defaultSearchEngineId,
|
||||||
openInNewTab: variables.openInNewTab,
|
openInNewTab: variables.openInNewTab,
|
||||||
|
ddgBangsEnabled: variables.ddgBangsEnabled,
|
||||||
});
|
});
|
||||||
showSuccessNotification({
|
showSuccessNotification({
|
||||||
message: t("user.action.changeSearchPreferences.notification.success.message"),
|
message: t("user.action.changeSearchPreferences.notification.success.message"),
|
||||||
@@ -41,6 +42,7 @@ export const ChangeSearchPreferencesForm = ({ user, searchEnginesData }: ChangeS
|
|||||||
initialValues: {
|
initialValues: {
|
||||||
defaultSearchEngineId: user.defaultSearchEngineId,
|
defaultSearchEngineId: user.defaultSearchEngineId,
|
||||||
openInNewTab: user.openSearchInNewTab,
|
openInNewTab: user.openSearchInNewTab,
|
||||||
|
ddgBangsEnabled: user.ddgBangs,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -64,6 +66,10 @@ export const ChangeSearchPreferencesForm = ({ user, searchEnginesData }: ChangeS
|
|||||||
label={t("user.field.openSearchInNewTab.label")}
|
label={t("user.field.openSearchInNewTab.label")}
|
||||||
{...form.getInputProps("openInNewTab", { type: "checkbox" })}
|
{...form.getInputProps("openInNewTab", { type: "checkbox" })}
|
||||||
/>
|
/>
|
||||||
|
<Switch
|
||||||
|
label={t("user.field.ddgBangs.label")}
|
||||||
|
{...form.getInputProps("ddgBangsEnabled", { type: "checkbox" })}
|
||||||
|
/>
|
||||||
|
|
||||||
<Group justify="end">
|
<Group justify="end">
|
||||||
<Button type="submit" loading={isPending}>
|
<Button type="submit" loading={isPending}>
|
||||||
|
|||||||
+1
-1
@@ -30,7 +30,7 @@ export const FirstDayOfWeek = ({ user }: FirstDayOfWeekProps) => {
|
|||||||
},
|
},
|
||||||
onSuccess(_, variables) {
|
onSuccess(_, variables) {
|
||||||
form.setInitialValues({
|
form.setInitialValues({
|
||||||
firstDayOfWeek: variables.firstDayOfWeek,
|
firstDayOfWeek: variables.firstDayOfWeek as DayOfWeek,
|
||||||
});
|
});
|
||||||
showSuccessNotification({
|
showSuccessNotification({
|
||||||
message: t("user.action.changeFirstDayOfWeek.notification.success.message"),
|
message: t("user.action.changeFirstDayOfWeek.notification.success.message"),
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ export const WidgetPreviewPageContent = ({ kind, integrationData }: WidgetPrevie
|
|||||||
<ErrorBoundary
|
<ErrorBoundary
|
||||||
onReset={reset}
|
onReset={reset}
|
||||||
fallbackRender={({ resetErrorBoundary, error }) => (
|
fallbackRender={({ resetErrorBoundary, error }) => (
|
||||||
<WidgetError kind={kind} error={error as unknown} resetErrorBoundary={resetErrorBoundary} />
|
<WidgetError kind={kind} error={error} resetErrorBoundary={resetErrorBoundary} />
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<Comp
|
<Comp
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ import type { NextRequest } from "next/server";
|
|||||||
import { userAgent } from "next/server";
|
import { userAgent } from "next/server";
|
||||||
import { createOpenApiFetchHandler } from "trpc-to-openapi";
|
import { createOpenApiFetchHandler } from "trpc-to-openapi";
|
||||||
|
|
||||||
import { appRouter, createTRPCContext } from "@homarr/api";
|
import { createTRPCContext } from "@homarr/api";
|
||||||
|
import { openApiRouter } from "@homarr/api/open-api";
|
||||||
import { API_KEY_HEADER_NAME, getSessionFromApiKeyAsync } from "@homarr/auth/api-key";
|
import { API_KEY_HEADER_NAME, getSessionFromApiKeyAsync } from "@homarr/auth/api-key";
|
||||||
import { ipAddressFromHeaders } from "@homarr/common/server";
|
import { ipAddressFromHeaders } from "@homarr/common/server";
|
||||||
import { createLogger } from "@homarr/core/infrastructure/logs";
|
import { createLogger } from "@homarr/core/infrastructure/logs";
|
||||||
@@ -30,7 +31,7 @@ const handlerAsync = async (req: NextRequest) => {
|
|||||||
return createOpenApiFetchHandler({
|
return createOpenApiFetchHandler({
|
||||||
req,
|
req,
|
||||||
endpoint: "/",
|
endpoint: "/",
|
||||||
router: appRouter,
|
router: openApiRouter,
|
||||||
createContext: () => createTRPCContext({ session, headers: req.headers }),
|
createContext: () => createTRPCContext({ session, headers: req.headers }),
|
||||||
onError({ error, path, type }) {
|
onError({ error, path, type }) {
|
||||||
logger.error(new ErrorWithMetadata("tRPC Error occured", { path, type }, { cause: error }));
|
logger.error(new ErrorWithMetadata("tRPC Error occured", { path, type }, { cause: error }));
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import { NextResponse } from "next/server";
|
||||||
|
|
||||||
|
import openCollectiveContributors from "../../../../../../../../static-data/opencollective-contributors.json";
|
||||||
|
|
||||||
|
export const GET = () => {
|
||||||
|
return NextResponse.json(openCollectiveContributors);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const dynamic = "force-static";
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
import { NextResponse } from "next/server";
|
||||||
|
|
||||||
|
import { getDependenciesAsync } from "../../../../versions/package-reader";
|
||||||
|
|
||||||
|
export const GET = async () => {
|
||||||
|
const dependencies = await getDependenciesAsync();
|
||||||
|
return NextResponse.json(dependencies);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const dynamic = "force-static";
|
||||||
@@ -75,7 +75,6 @@ const executeHealthCheckSafelyAsync = async (
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
||||||
logger.error(new ErrorWithMetadata("Healthcheck failed", { name }, { cause: error }));
|
logger.error(new ErrorWithMetadata("Healthcheck failed", { name }, { cause: error }));
|
||||||
return {
|
return {
|
||||||
status: "unhealthy",
|
status: "unhealthy",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { NextResponse } from "next/server";
|
import { NextResponse } from "next/server";
|
||||||
|
|
||||||
import { openApiDocument } from "@homarr/api";
|
import { openApiDocument } from "@homarr/api/open-api";
|
||||||
import { extractBaseUrlFromHeaders } from "@homarr/common";
|
import { extractBaseUrlFromHeaders } from "@homarr/common";
|
||||||
|
|
||||||
export function GET(request: Request) {
|
export function GET(request: Request) {
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ const InnerContent = ({ item, ...dimensions }: InnerContentProps) => {
|
|||||||
fallbackRender={({ resetErrorBoundary, error }) => (
|
fallbackRender={({ resetErrorBoundary, error }) => (
|
||||||
<>
|
<>
|
||||||
<BoardItemMenu offset={4} item={newItem} resetErrorBoundary={resetErrorBoundary} />
|
<BoardItemMenu offset={4} item={newItem} resetErrorBoundary={resetErrorBoundary} />
|
||||||
<WidgetError kind={item.kind} error={error as unknown} resetErrorBoundary={resetErrorBoundary} />
|
<WidgetError kind={item.kind} error={error} resetErrorBoundary={resetErrorBoundary} />
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
@@ -117,7 +117,6 @@ const InnerContent = ({ item, ...dimensions }: InnerContentProps) => {
|
|||||||
when={
|
when={
|
||||||
widgetSupportsIntegrations &&
|
widgetSupportsIntegrations &&
|
||||||
item.integrationIds.length === 0 &&
|
item.integrationIds.length === 0 &&
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
||||||
(!("integrationsRequired" in definition) || definition.integrationsRequired !== false)
|
(!("integrationsRequired" in definition) || definition.integrationsRequired !== false)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { ActionIcon, Menu } from "@mantine/core";
|
|||||||
import { IconCopy, IconDotsVertical, IconLayoutKanban, IconPencil, IconTrash } from "@tabler/icons-react";
|
import { IconCopy, IconDotsVertical, IconLayoutKanban, IconPencil, IconTrash } from "@tabler/icons-react";
|
||||||
|
|
||||||
import { clientApi } from "@homarr/api/client";
|
import { clientApi } from "@homarr/api/client";
|
||||||
|
import { useSession } from "@homarr/auth/client";
|
||||||
import { useEditMode } from "@homarr/boards/edit-mode";
|
import { useEditMode } from "@homarr/boards/edit-mode";
|
||||||
import { useConfirmModal, useModalAction } from "@homarr/modals";
|
import { useConfirmModal, useModalAction } from "@homarr/modals";
|
||||||
import { useSettings } from "@homarr/settings";
|
import { useSettings } from "@homarr/settings";
|
||||||
@@ -15,15 +16,20 @@ import { useSectionContext } from "../sections/section-context";
|
|||||||
import { useItemActions } from "./item-actions";
|
import { useItemActions } from "./item-actions";
|
||||||
import { ItemMoveModal } from "./item-move-modal";
|
import { ItemMoveModal } from "./item-move-modal";
|
||||||
|
|
||||||
export const BoardItemMenu = ({
|
interface BoardItemMenuProps {
|
||||||
offset,
|
|
||||||
item,
|
|
||||||
resetErrorBoundary,
|
|
||||||
}: {
|
|
||||||
offset: number;
|
offset: number;
|
||||||
item: SectionItem;
|
item: SectionItem;
|
||||||
resetErrorBoundary?: () => void;
|
resetErrorBoundary?: () => void;
|
||||||
}) => {
|
}
|
||||||
|
|
||||||
|
export const BoardItemMenu = (props: BoardItemMenuProps) => {
|
||||||
|
const { data: session } = useSession();
|
||||||
|
if (!session) return null;
|
||||||
|
|
||||||
|
return <BoardItemMenuInner {...props} />;
|
||||||
|
};
|
||||||
|
|
||||||
|
const BoardItemMenuInner = ({ offset, item, resetErrorBoundary }: BoardItemMenuProps) => {
|
||||||
const refResetErrorBoundaryOnNextRender = useRef(false);
|
const refResetErrorBoundaryOnNextRender = useRef(false);
|
||||||
const tItem = useScopedI18n("item");
|
const tItem = useScopedI18n("item");
|
||||||
const t = useI18n();
|
const t = useI18n();
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
import { useMemo, useState } from "react";
|
import { useMemo, useState } from "react";
|
||||||
import { Button, Card, Center, Grid, Input, Stack, Text } from "@mantine/core";
|
import { Avatar, Button, Card, Center, Grid, Group, Input, Stack, Text, Tooltip } from "@mantine/core";
|
||||||
import { IconSearch } from "@tabler/icons-react";
|
import { IconSearch } from "@tabler/icons-react";
|
||||||
|
|
||||||
import { objectEntries } from "@homarr/common";
|
import { objectEntries } from "@homarr/common";
|
||||||
import type { WidgetKind } from "@homarr/definitions";
|
import { getIconUrl, getIntegrationName } from "@homarr/definitions";
|
||||||
|
import type { IntegrationKind, WidgetKind } from "@homarr/definitions";
|
||||||
import { createModal } from "@homarr/modals";
|
import { createModal } from "@homarr/modals";
|
||||||
import { useI18n } from "@homarr/translation/client";
|
import { useI18n } from "@homarr/translation/client";
|
||||||
import type { TablerIcon } from "@homarr/ui";
|
import type { TablerIcon } from "@homarr/ui";
|
||||||
@@ -21,6 +22,10 @@ export const ItemSelectModal = createModal<void>(({ actions }) => {
|
|||||||
objectEntries(widgetImports)
|
objectEntries(widgetImports)
|
||||||
.map(([kind, value]) => ({
|
.map(([kind, value]) => ({
|
||||||
kind,
|
kind,
|
||||||
|
supportedIntegrations:
|
||||||
|
"supportedIntegrations" in value.definition
|
||||||
|
? value.definition.supportedIntegrations.filter((integration) => integration !== "mock")
|
||||||
|
: [],
|
||||||
icon: value.definition.icon,
|
icon: value.definition.icon,
|
||||||
name: t(`widget.${kind}.name`),
|
name: t(`widget.${kind}.name`),
|
||||||
description: t(`widget.${kind}.description`),
|
description: t(`widget.${kind}.description`),
|
||||||
@@ -74,6 +79,7 @@ const WidgetItem = ({
|
|||||||
}: {
|
}: {
|
||||||
item: {
|
item: {
|
||||||
kind: WidgetKind;
|
kind: WidgetKind;
|
||||||
|
supportedIntegrations: IntegrationKind[];
|
||||||
name: string;
|
name: string;
|
||||||
description: string;
|
description: string;
|
||||||
icon: TablerIcon;
|
icon: TablerIcon;
|
||||||
@@ -97,7 +103,8 @@ const WidgetItem = ({
|
|||||||
{item.description}
|
{item.description}
|
||||||
</Text>
|
</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Button onClick={onSelect} variant="light" size="xs" mt="auto" radius="md" fullWidth>
|
<SupportedIntegrations mt="auto" integrations={item.supportedIntegrations} />
|
||||||
|
<Button onClick={onSelect} variant="light" size="xs" radius="md" fullWidth>
|
||||||
{t(`item.create.addToBoard`)}
|
{t(`item.create.addToBoard`)}
|
||||||
</Button>
|
</Button>
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -105,3 +112,48 @@ const WidgetItem = ({
|
|||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
interface SupportedIntegrationsProps {
|
||||||
|
integrations: IntegrationKind[];
|
||||||
|
mt: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const SupportedIntegrations = ({ integrations, mt }: SupportedIntegrationsProps) => {
|
||||||
|
if (integrations.length === 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// When there are 8 or more integrations, we show 6 and a "+X" avatar. Otherwise, we show all integrations.
|
||||||
|
const countToShow = integrations.length >= 8 ? 6 : 7;
|
||||||
|
const moreCount = integrations.length - countToShow;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Center mt={mt}>
|
||||||
|
<Tooltip.Group openDelay={300} closeDelay={100}>
|
||||||
|
<Group gap={2}>
|
||||||
|
{integrations.slice(0, countToShow).map((integration) => (
|
||||||
|
<Tooltip key={integration} label={getIntegrationName(integration)} withArrow>
|
||||||
|
<Avatar src={getIconUrl(integration)} size="xs" radius="xl" />
|
||||||
|
</Tooltip>
|
||||||
|
))}
|
||||||
|
{moreCount > 0 && (
|
||||||
|
<Tooltip
|
||||||
|
withArrow
|
||||||
|
label={
|
||||||
|
<>
|
||||||
|
{integrations.slice(countToShow).map((integration) => (
|
||||||
|
<div key={integration}>{getIntegrationName(integration)}</div>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<Avatar radius="xl" size="xs">
|
||||||
|
+{moreCount}
|
||||||
|
</Avatar>
|
||||||
|
</Tooltip>
|
||||||
|
)}
|
||||||
|
</Group>
|
||||||
|
</Tooltip.Group>
|
||||||
|
</Center>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -58,6 +58,7 @@ export const useCategoryActions = () => {
|
|||||||
...section,
|
...section,
|
||||||
yOffset: section.yOffset + 2,
|
yOffset: section.yOffset + 2,
|
||||||
})),
|
})),
|
||||||
|
...previous.sections.filter((section) => section.kind !== "category" && section.kind !== "empty"),
|
||||||
] satisfies Section[],
|
] satisfies Section[],
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -206,7 +206,6 @@ export const useGridstack = (section: Omit<Section, "items">, itemIds: string[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Only run this effect when the section items change
|
// Only run this effect when the section items change
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
||||||
}, [itemIds.length, columnCount]);
|
}, [itemIds.length, columnCount]);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,94 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import React from "react";
|
||||||
|
import { Combobox, Group, InputBase, Text, useCombobox } from "@mantine/core";
|
||||||
|
import { IconCheck, IconDeviceDesktop, IconMoon, IconSun } from "@tabler/icons-react";
|
||||||
|
|
||||||
|
import type { ColorScheme } from "@homarr/definitions";
|
||||||
|
import { colorSchemes } from "@homarr/definitions";
|
||||||
|
import { useScopedI18n } from "@homarr/translation/client";
|
||||||
|
|
||||||
|
const schemeIcons: Record<ColorScheme, React.ElementType> = {
|
||||||
|
auto: IconDeviceDesktop,
|
||||||
|
light: IconSun,
|
||||||
|
dark: IconMoon,
|
||||||
|
};
|
||||||
|
|
||||||
|
interface ColorSchemeComboboxProps {
|
||||||
|
value: ColorScheme;
|
||||||
|
onChange: (value: ColorScheme) => void;
|
||||||
|
width?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const ColorSchemeCombobox = ({ value, onChange, width }: ColorSchemeComboboxProps) => {
|
||||||
|
const tOptions = useScopedI18n("common.colorScheme.options");
|
||||||
|
|
||||||
|
const combobox = useCombobox({
|
||||||
|
onDropdownClose: () => combobox.resetSelectedOption(),
|
||||||
|
});
|
||||||
|
|
||||||
|
const handleOnOptionSubmit = React.useCallback(
|
||||||
|
(val: string) => {
|
||||||
|
if (!val) return;
|
||||||
|
onChange(val as ColorScheme);
|
||||||
|
combobox.closeDropdown();
|
||||||
|
},
|
||||||
|
[onChange, combobox],
|
||||||
|
);
|
||||||
|
|
||||||
|
const handleOnClick = React.useCallback(() => {
|
||||||
|
combobox.toggleDropdown();
|
||||||
|
}, [combobox]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Combobox store={combobox} onOptionSubmit={handleOnOptionSubmit}>
|
||||||
|
<Combobox.Target>
|
||||||
|
<InputBase
|
||||||
|
component="button"
|
||||||
|
type="button"
|
||||||
|
pointer
|
||||||
|
rightSection={<Combobox.Chevron />}
|
||||||
|
rightSectionPointerEvents="none"
|
||||||
|
onClick={handleOnClick}
|
||||||
|
variant="filled"
|
||||||
|
w={width}
|
||||||
|
>
|
||||||
|
<OptionItem scheme={value} currentScheme={value} tOptions={tOptions} />
|
||||||
|
</InputBase>
|
||||||
|
</Combobox.Target>
|
||||||
|
<Combobox.Dropdown>
|
||||||
|
<Combobox.Options>
|
||||||
|
{colorSchemes.map((scheme) => (
|
||||||
|
<Combobox.Option value={scheme} key={scheme}>
|
||||||
|
<OptionItem scheme={scheme} currentScheme={value} tOptions={tOptions} showCheck />
|
||||||
|
</Combobox.Option>
|
||||||
|
))}
|
||||||
|
</Combobox.Options>
|
||||||
|
</Combobox.Dropdown>
|
||||||
|
</Combobox>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const OptionItem = ({
|
||||||
|
scheme,
|
||||||
|
currentScheme,
|
||||||
|
tOptions,
|
||||||
|
showCheck,
|
||||||
|
}: {
|
||||||
|
scheme: ColorScheme;
|
||||||
|
currentScheme: ColorScheme;
|
||||||
|
tOptions: (key: ColorScheme) => string;
|
||||||
|
showCheck?: boolean;
|
||||||
|
}) => {
|
||||||
|
const Icon = schemeIcons[scheme];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Group wrap="nowrap" justify="space-between">
|
||||||
|
<Group wrap="nowrap">
|
||||||
|
<Icon size={16} stroke={1.5} />
|
||||||
|
<Text>{tOptions(scheme)}</Text>
|
||||||
|
</Group>
|
||||||
|
{showCheck && scheme === currentScheme && <IconCheck color="currentColor" size={16} />}
|
||||||
|
</Group>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -1,49 +1,17 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { Group, Text, useMantineColorScheme } from "@mantine/core";
|
import { useMantineColorScheme } from "@mantine/core";
|
||||||
import { IconMoon, IconSun } from "@tabler/icons-react";
|
|
||||||
|
|
||||||
import type { ColorScheme } from "@homarr/definitions";
|
import type { ColorScheme } from "@homarr/definitions";
|
||||||
import { colorSchemes } from "@homarr/definitions";
|
|
||||||
import { useScopedI18n } from "@homarr/translation/client";
|
import { ColorSchemeCombobox } from "./color-scheme-combobox";
|
||||||
import { SelectWithCustomItems } from "@homarr/ui";
|
|
||||||
|
|
||||||
interface CurrentColorSchemeComboboxProps {
|
interface CurrentColorSchemeComboboxProps {
|
||||||
w?: string;
|
w?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const CurrentColorSchemeCombobox = ({ w }: CurrentColorSchemeComboboxProps) => {
|
export const CurrentColorSchemeCombobox = ({ w }: CurrentColorSchemeComboboxProps) => {
|
||||||
const tOptions = useScopedI18n("common.colorScheme.options");
|
|
||||||
const { colorScheme, setColorScheme } = useMantineColorScheme();
|
const { colorScheme, setColorScheme } = useMantineColorScheme();
|
||||||
|
|
||||||
return (
|
return <ColorSchemeCombobox value={colorScheme as ColorScheme} onChange={setColorScheme} width={w} />;
|
||||||
<SelectWithCustomItems
|
|
||||||
value={colorScheme}
|
|
||||||
onChange={(value) => setColorScheme((value as ColorScheme | null) ?? "light")}
|
|
||||||
data={colorSchemes.map((scheme) => ({
|
|
||||||
value: scheme,
|
|
||||||
label: tOptions(scheme),
|
|
||||||
}))}
|
|
||||||
SelectOption={ColorSchemeCustomOption}
|
|
||||||
w={w}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const appearanceIcons = {
|
|
||||||
light: IconSun,
|
|
||||||
dark: IconMoon,
|
|
||||||
};
|
|
||||||
|
|
||||||
const ColorSchemeCustomOption = ({ value, label }: { value: ColorScheme; label: string }) => {
|
|
||||||
const Icon = appearanceIcons[value];
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Group>
|
|
||||||
<Icon size={16} stroke={1.5} />
|
|
||||||
<Text fz="sm" fw={500}>
|
|
||||||
{label}
|
|
||||||
</Text>
|
|
||||||
</Group>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { useEffect } from "react";
|
||||||
|
|
||||||
|
export const ServiceWorkerRegistration = () => {
|
||||||
|
useEffect(() => {
|
||||||
|
if (!("serviceWorker" in navigator)) return;
|
||||||
|
navigator.serviceWorker.register("/sw.js", { scope: "/", updateViaCache: "none" }).catch((error) => {
|
||||||
|
console.error("Service worker registration failed", error);
|
||||||
|
});
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
};
|
||||||
@@ -5,16 +5,7 @@ import { useCallback, useEffect } from "react";
|
|||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { Center, Menu, Stack, Text, useMantineColorScheme } from "@mantine/core";
|
import { Center, Menu, Stack, Text, useMantineColorScheme } from "@mantine/core";
|
||||||
import { useHotkeys, useTimeout } from "@mantine/hooks";
|
import { useHotkeys, useTimeout } from "@mantine/hooks";
|
||||||
import {
|
import { IconCheck, IconHome, IconLogin, IconLogout, IconSettings, IconTool } from "@tabler/icons-react";
|
||||||
IconCheck,
|
|
||||||
IconHome,
|
|
||||||
IconLogin,
|
|
||||||
IconLogout,
|
|
||||||
IconMoon,
|
|
||||||
IconSettings,
|
|
||||||
IconSun,
|
|
||||||
IconTool,
|
|
||||||
} from "@tabler/icons-react";
|
|
||||||
|
|
||||||
import type { RouterOutputs } from "@homarr/api";
|
import type { RouterOutputs } from "@homarr/api";
|
||||||
import { signOut, useSession } from "@homarr/auth/client";
|
import { signOut, useSession } from "@homarr/auth/client";
|
||||||
@@ -24,6 +15,7 @@ import { useScopedI18n } from "@homarr/translation/client";
|
|||||||
import { Link } from "@homarr/ui";
|
import { Link } from "@homarr/ui";
|
||||||
|
|
||||||
import { useAuthContext } from "~/app/[locale]/_client-providers/session";
|
import { useAuthContext } from "~/app/[locale]/_client-providers/session";
|
||||||
|
import { CurrentColorSchemeCombobox } from "./color-scheme/current-color-scheme-combobox";
|
||||||
import { CurrentLanguageCombobox } from "./language/current-language-combobox";
|
import { CurrentLanguageCombobox } from "./language/current-language-combobox";
|
||||||
import { AvailableUpdatesMenuItem } from "./layout/header/update";
|
import { AvailableUpdatesMenuItem } from "./layout/header/update";
|
||||||
|
|
||||||
@@ -34,13 +26,9 @@ interface UserAvatarMenuProps {
|
|||||||
|
|
||||||
export const UserAvatarMenu = ({ children, availableUpdatesPromise }: UserAvatarMenuProps) => {
|
export const UserAvatarMenu = ({ children, availableUpdatesPromise }: UserAvatarMenuProps) => {
|
||||||
const t = useScopedI18n("common.userAvatar.menu");
|
const t = useScopedI18n("common.userAvatar.menu");
|
||||||
const { colorScheme, toggleColorScheme } = useMantineColorScheme();
|
const { toggleColorScheme } = useMantineColorScheme();
|
||||||
useHotkeys([[hotkeys.toggleColorScheme, toggleColorScheme]]);
|
useHotkeys([[hotkeys.toggleColorScheme, toggleColorScheme]]);
|
||||||
|
|
||||||
const ColorSchemeIcon = colorScheme === "dark" ? IconSun : IconMoon;
|
|
||||||
|
|
||||||
const colorSchemeText = colorScheme === "dark" ? t("switchToLightMode") : t("switchToDarkMode");
|
|
||||||
|
|
||||||
const session = useSession();
|
const session = useSession();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
@@ -67,14 +55,14 @@ export const UserAvatarMenu = ({ children, availableUpdatesPromise }: UserAvatar
|
|||||||
<Menu width={300} withArrow withinPortal keepMounted>
|
<Menu width={300} withArrow withinPortal keepMounted>
|
||||||
<Menu.Dropdown>
|
<Menu.Dropdown>
|
||||||
<AvailableUpdatesMenuItem availableUpdatesPromise={availableUpdatesPromise} />
|
<AvailableUpdatesMenuItem availableUpdatesPromise={availableUpdatesPromise} />
|
||||||
<Menu.Item onClick={toggleColorScheme} leftSection={<ColorSchemeIcon size="1rem" />}>
|
|
||||||
{colorSchemeText}
|
|
||||||
</Menu.Item>
|
|
||||||
<Menu.Item component={Link} href="/boards" leftSection={<IconHome size="1rem" />}>
|
<Menu.Item component={Link} href="/boards" leftSection={<IconHome size="1rem" />}>
|
||||||
{t("homeBoard")}
|
{t("homeBoard")}
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
<Menu.Divider />
|
<Menu.Divider />
|
||||||
|
|
||||||
|
<Menu.Item p={0} closeMenuOnClick={false} component="div">
|
||||||
|
<CurrentColorSchemeCombobox />
|
||||||
|
</Menu.Item>
|
||||||
<Menu.Item p={0} closeMenuOnClick={false} component="div">
|
<Menu.Item p={0} closeMenuOnClick={false} component="div">
|
||||||
<CurrentLanguageCombobox />
|
<CurrentLanguageCombobox />
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
export async function register() {
|
||||||
|
if (process.env.NEXT_RUNTIME === "nodejs") {
|
||||||
|
await import("@homarr/tasks");
|
||||||
|
await import("@homarr/websocket");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
// Prevent flash of white background when color scheme is "auto" and OS prefers dark.
|
||||||
|
// CSS media queries are evaluated synchronously during the browser's initial paint,
|
||||||
|
// before any JavaScript executes, so this eliminates the white→dark flicker.
|
||||||
|
html[data-mantine-color-scheme="auto"] {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-color-scheme: dark) {
|
||||||
|
html[data-mantine-color-scheme="auto"] {
|
||||||
|
background-color: #242424;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,12 +1,16 @@
|
|||||||
import fsPromises from "fs/promises";
|
import fsPromises from "fs/promises";
|
||||||
|
import path from "path";
|
||||||
|
import { fileURLToPath } from "url";
|
||||||
import { glob } from "glob";
|
import { glob } from "glob";
|
||||||
|
import { parse as parseYaml } from "yaml";
|
||||||
|
import z from "zod";
|
||||||
|
|
||||||
import packageJson from "../../../../package.json";
|
import packageJson from "../../../../package.json";
|
||||||
|
|
||||||
const getPackageVersion = () => packageJson.version;
|
export const getPackageVersion = () => packageJson.version;
|
||||||
const getDependenciesAsync = async (): Promise<PackageJsonDependencies> => {
|
export const getDependenciesAsync = async (): Promise<PackageJsonDependencies> => {
|
||||||
const pathNames = await glob("**/package.json", {
|
const pathNames = await glob("**/package.json", {
|
||||||
ignore: "node_modules/**",
|
ignore: "**/node_modules/**",
|
||||||
cwd: "../../",
|
cwd: "../../",
|
||||||
absolute: true,
|
absolute: true,
|
||||||
});
|
});
|
||||||
@@ -15,21 +19,37 @@ const getDependenciesAsync = async (): Promise<PackageJsonDependencies> => {
|
|||||||
.map((packageContent) => (JSON.parse(packageContent) as PackageJson).dependencies)
|
.map((packageContent) => (JSON.parse(packageContent) as PackageJson).dependencies)
|
||||||
.filter((dependencies) => dependencies !== undefined);
|
.filter((dependencies) => dependencies !== undefined);
|
||||||
|
|
||||||
|
const catalog = await parseDependencyCatalogsAsync();
|
||||||
|
|
||||||
let dependencies = {};
|
let dependencies = {};
|
||||||
for (const dependenciesOfPackage of packageDependencies) {
|
for (const dependenciesOfPackage of packageDependencies) {
|
||||||
dependencies = { ...dependencies, ...dependenciesOfPackage };
|
const resolvedDependencies = Object.entries(dependenciesOfPackage).map(([name, version]) => {
|
||||||
|
const catalogVersion = catalog.get(name);
|
||||||
|
return [name, catalogVersion ?? version] as const;
|
||||||
|
});
|
||||||
|
dependencies = { ...dependencies, ...Object.fromEntries(resolvedDependencies) };
|
||||||
}
|
}
|
||||||
return dependencies;
|
return dependencies;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getPackageAttributesAsync = async () => {
|
type DependencyCatalog = Map<string, string>;
|
||||||
return {
|
const parseDependencyCatalogsAsync = async (): Promise<DependencyCatalog> => {
|
||||||
version: getPackageVersion(),
|
const currentDir = path.dirname(fileURLToPath(import.meta.url));
|
||||||
dependencies: await getDependenciesAsync(),
|
const workspaceConfigContent = await fsPromises.readFile(
|
||||||
};
|
path.join(currentDir, "..", "..", "..", "..", "pnpm-workspace.yaml"),
|
||||||
|
"utf-8",
|
||||||
|
);
|
||||||
|
const workspaceConfig: unknown = parseYaml(workspaceConfigContent);
|
||||||
|
const parseResult = workspaceConfigCatalogSchema.parse(workspaceConfig);
|
||||||
|
|
||||||
|
return new Map(Object.entries(parseResult.catalog ?? {}));
|
||||||
};
|
};
|
||||||
|
|
||||||
type PackageJsonDependencies = Record<string, string>;
|
const workspaceConfigCatalogSchema = z.object({
|
||||||
|
catalog: z.record(z.string(), z.string()).optional(),
|
||||||
|
});
|
||||||
|
|
||||||
|
export type PackageJsonDependencies = Record<string, string>;
|
||||||
interface PackageJson {
|
interface PackageJson {
|
||||||
dependencies: PackageJsonDependencies | undefined;
|
dependencies: PackageJsonDependencies | undefined;
|
||||||
}
|
}
|
||||||
+14
-15
@@ -5,12 +5,11 @@
|
|||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/main.ts"
|
||||||
},
|
},
|
||||||
"main": "./src/main.ts",
|
"main": "./src/main.ts",
|
||||||
"types": "./src/main.ts",
|
"types": "./src/main.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "esbuild src/main.ts --bundle --platform=node --loader:.scss=text --external:*.node --external:@opentelemetry/api --external:deasync --external:bcrypt --outfile=tasks.cjs",
|
|
||||||
"clean": "rm -rf .turbo node_modules",
|
"clean": "rm -rf .turbo node_modules",
|
||||||
"dev": "pnpm with-env tsx ./src/main.ts",
|
"dev": "pnpm with-env tsx ./src/main.ts",
|
||||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||||
@@ -24,7 +23,6 @@
|
|||||||
"@homarr/auth": "workspace:^0.1.0",
|
"@homarr/auth": "workspace:^0.1.0",
|
||||||
"@homarr/common": "workspace:^0.1.0",
|
"@homarr/common": "workspace:^0.1.0",
|
||||||
"@homarr/core": "workspace:^",
|
"@homarr/core": "workspace:^",
|
||||||
"@homarr/cron-job-api": "workspace:^0.1.0",
|
|
||||||
"@homarr/cron-jobs": "workspace:^0.1.0",
|
"@homarr/cron-jobs": "workspace:^0.1.0",
|
||||||
"@homarr/cron-jobs-core": "workspace:^0.1.0",
|
"@homarr/cron-jobs-core": "workspace:^0.1.0",
|
||||||
"@homarr/db": "workspace:^0.1.0",
|
"@homarr/db": "workspace:^0.1.0",
|
||||||
@@ -37,22 +35,23 @@
|
|||||||
"@homarr/server-settings": "workspace:^0.1.0",
|
"@homarr/server-settings": "workspace:^0.1.0",
|
||||||
"@homarr/validation": "workspace:^0.1.0",
|
"@homarr/validation": "workspace:^0.1.0",
|
||||||
"@homarr/widgets": "workspace:^0.1.0",
|
"@homarr/widgets": "workspace:^0.1.0",
|
||||||
"dayjs": "^1.11.19",
|
"croner": "catalog:",
|
||||||
"dotenv": "^17.2.3",
|
"dayjs": "catalog:",
|
||||||
"fastify": "^5.6.2",
|
"dotenv": "catalog:",
|
||||||
"superjson": "2.2.6",
|
"fastify": "catalog:",
|
||||||
"undici": "7.18.2"
|
"superjson": "catalog:",
|
||||||
|
"undici": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
"@homarr/eslint-config": "workspace:^0.2.0",
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
"@homarr/prettier-config": "workspace:^0.1.0",
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"@types/node": "^24.10.7",
|
"@types/node": "catalog:",
|
||||||
"dotenv-cli": "^11.0.0",
|
"dotenv-cli": "catalog:",
|
||||||
"esbuild": "^0.27.2",
|
"esbuild": "catalog:",
|
||||||
"eslint": "^9.39.2",
|
"eslint": "catalog:",
|
||||||
"prettier": "^3.7.4",
|
"prettier": "catalog:",
|
||||||
"tsx": "4.20.4",
|
"tsx": "catalog:",
|
||||||
"typescript": "^5.9.3"
|
"typescript": "catalog:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,52 +1,12 @@
|
|||||||
// This import has to be the first import in the file so that the agent is overridden before any other modules are imported.
|
// This import has to be the first import in the file so that the agent is overridden before any other modules are imported.
|
||||||
import "./overrides";
|
import "./overrides";
|
||||||
|
|
||||||
import type { FastifyTRPCPluginOptions } from "@trpc/server/adapters/fastify";
|
|
||||||
import { fastifyTRPCPlugin } from "@trpc/server/adapters/fastify";
|
|
||||||
import fastify from "fastify";
|
|
||||||
|
|
||||||
import { createLogger } from "@homarr/core/infrastructure/logs";
|
|
||||||
import { ErrorWithMetadata } from "@homarr/core/infrastructure/logs/error";
|
|
||||||
import type { JobRouter } from "@homarr/cron-job-api";
|
|
||||||
import { jobRouter } from "@homarr/cron-job-api";
|
|
||||||
import { CRON_JOB_API_KEY_HEADER, CRON_JOB_API_PATH, CRON_JOB_API_PORT } from "@homarr/cron-job-api/constants";
|
|
||||||
import { jobGroup } from "@homarr/cron-jobs";
|
import { jobGroup } from "@homarr/cron-jobs";
|
||||||
import { db } from "@homarr/db";
|
|
||||||
|
|
||||||
import { JobManager } from "./job-manager";
|
|
||||||
import { onStartAsync } from "./on-start";
|
import { onStartAsync } from "./on-start";
|
||||||
|
|
||||||
const logger = createLogger({ module: "tasksMain" });
|
|
||||||
|
|
||||||
const server = fastify({
|
|
||||||
maxParamLength: 5000,
|
|
||||||
});
|
|
||||||
server.register(fastifyTRPCPlugin, {
|
|
||||||
prefix: CRON_JOB_API_PATH,
|
|
||||||
trpcOptions: {
|
|
||||||
router: jobRouter,
|
|
||||||
createContext: ({ req }) => ({
|
|
||||||
manager: new JobManager(db, jobGroup),
|
|
||||||
apiKey: req.headers[CRON_JOB_API_KEY_HEADER] as string | undefined,
|
|
||||||
}),
|
|
||||||
onError({ path, error }) {
|
|
||||||
logger.error(new ErrorWithMetadata("Error in tasks tRPC handler", { path }, { cause: error }));
|
|
||||||
},
|
|
||||||
} satisfies FastifyTRPCPluginOptions<JobRouter>["trpcOptions"],
|
|
||||||
});
|
|
||||||
|
|
||||||
void (async () => {
|
void (async () => {
|
||||||
await onStartAsync();
|
await onStartAsync();
|
||||||
await jobGroup.initializeAsync();
|
await jobGroup.initializeAsync();
|
||||||
await jobGroup.startAllAsync();
|
await jobGroup.startAllAsync();
|
||||||
|
|
||||||
try {
|
|
||||||
await server.listen({ port: CRON_JOB_API_PORT });
|
|
||||||
logger.info("Tasks web server started successfully", { port: CRON_JOB_API_PORT });
|
|
||||||
} catch (err) {
|
|
||||||
logger.error(
|
|
||||||
new ErrorWithMetadata("Failed to start tasks web server", { port: CRON_JOB_API_PORT }, { cause: err }),
|
|
||||||
);
|
|
||||||
process.exit(1);
|
|
||||||
}
|
|
||||||
})();
|
})();
|
||||||
@@ -9,5 +9,5 @@
|
|||||||
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
|
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
|
||||||
},
|
},
|
||||||
"include": ["."],
|
"include": ["."],
|
||||||
"exclude": ["node_modules"]
|
"exclude": ["node_modules", "*.cjs", "*.css"]
|
||||||
}
|
}
|
||||||
@@ -4,10 +4,12 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
"exports": {
|
||||||
|
".": "./src/main.ts"
|
||||||
|
},
|
||||||
"main": "./src/main.ts",
|
"main": "./src/main.ts",
|
||||||
"types": "./src/main.ts",
|
"types": "./src/main.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "esbuild src/main.ts --bundle --platform=node --outfile=wssServer.cjs --external:bcrypt --external:@opentelemetry/api --external:deasync --external:cpu-features --loader:.html=text --loader:.scss=text --loader:.node=text",
|
|
||||||
"clean": "rm -rf .turbo node_modules",
|
"clean": "rm -rf .turbo node_modules",
|
||||||
"dev": "pnpm with-env tsx ./src/main.ts",
|
"dev": "pnpm with-env tsx ./src/main.ts",
|
||||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||||
@@ -25,18 +27,18 @@
|
|||||||
"@homarr/definitions": "workspace:^0.1.0",
|
"@homarr/definitions": "workspace:^0.1.0",
|
||||||
"@homarr/redis": "workspace:^0.1.0",
|
"@homarr/redis": "workspace:^0.1.0",
|
||||||
"@homarr/validation": "workspace:^0.1.0",
|
"@homarr/validation": "workspace:^0.1.0",
|
||||||
"dotenv": "^17.2.3",
|
"dotenv": "catalog:",
|
||||||
"tsx": "4.20.4",
|
"tsx": "catalog:",
|
||||||
"ws": "^8.19.0"
|
"ws": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
"@homarr/eslint-config": "workspace:^0.2.0",
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
"@homarr/prettier-config": "workspace:^0.1.0",
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"@types/ws": "^8.18.1",
|
"@types/ws": "catalog:",
|
||||||
"esbuild": "^0.27.2",
|
"esbuild": "catalog:",
|
||||||
"eslint": "^9.39.2",
|
"eslint": "catalog:",
|
||||||
"prettier": "^3.7.4",
|
"prettier": "catalog:",
|
||||||
"typescript": "^5.9.3"
|
"typescript": "catalog:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -9,5 +9,5 @@
|
|||||||
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
|
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
|
||||||
},
|
},
|
||||||
"include": ["."],
|
"include": ["."],
|
||||||
"exclude": ["node_modules"]
|
"exclude": ["node_modules", "*.cjs", "*.css"]
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
FROM node:24.15.0-trixie AS base
|
||||||
|
WORKDIR /app
|
||||||
|
COPY package.json .
|
||||||
|
COPY pnpm-lock.yaml .
|
||||||
|
RUN corepack enable pnpm && pnpm install --frozen-lockfile
|
||||||
|
CMD ["sleep", "60s"]
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"name": "homarr-prebuilt-debian",
|
||||||
|
"private": true,
|
||||||
|
"dependencies": {
|
||||||
|
"better-sqlite3": "^12.10.0"
|
||||||
|
},
|
||||||
|
"packageManager": "pnpm@10.33.4",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=24.15.0",
|
||||||
|
"pnpm": ">=10.33.4"
|
||||||
|
},
|
||||||
|
"pnpm": {
|
||||||
|
"onlyBuiltDependencies": [
|
||||||
|
"better-sqlite3"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
+287
@@ -0,0 +1,287 @@
|
|||||||
|
lockfileVersion: '9.0'
|
||||||
|
|
||||||
|
settings:
|
||||||
|
autoInstallPeers: true
|
||||||
|
excludeLinksFromLockfile: false
|
||||||
|
|
||||||
|
importers:
|
||||||
|
|
||||||
|
.:
|
||||||
|
dependencies:
|
||||||
|
better-sqlite3:
|
||||||
|
specifier: ^12.10.0
|
||||||
|
version: 12.10.0
|
||||||
|
|
||||||
|
packages:
|
||||||
|
|
||||||
|
base64-js@1.5.1:
|
||||||
|
resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==}
|
||||||
|
|
||||||
|
better-sqlite3@12.10.0:
|
||||||
|
resolution: {integrity: sha512-CyzaZRQKyHkB2ZInfTTl2nvT33EbDpjkLEbE8/Zck3Ll6O0qqvuGdrJ45HgtH+HykRg88ITY3AdreBGN70aBSQ==}
|
||||||
|
engines: {node: 20.x || 22.x || 23.x || 24.x || 25.x || 26.x}
|
||||||
|
|
||||||
|
bindings@1.5.0:
|
||||||
|
resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==}
|
||||||
|
|
||||||
|
bl@4.1.0:
|
||||||
|
resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==}
|
||||||
|
|
||||||
|
buffer@5.7.1:
|
||||||
|
resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==}
|
||||||
|
|
||||||
|
chownr@1.1.4:
|
||||||
|
resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==}
|
||||||
|
|
||||||
|
decompress-response@6.0.0:
|
||||||
|
resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==}
|
||||||
|
engines: {node: '>=10'}
|
||||||
|
|
||||||
|
deep-extend@0.6.0:
|
||||||
|
resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==}
|
||||||
|
engines: {node: '>=4.0.0'}
|
||||||
|
|
||||||
|
detect-libc@2.1.2:
|
||||||
|
resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==}
|
||||||
|
engines: {node: '>=8'}
|
||||||
|
|
||||||
|
end-of-stream@1.4.5:
|
||||||
|
resolution: {integrity: sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==}
|
||||||
|
|
||||||
|
expand-template@2.0.3:
|
||||||
|
resolution: {integrity: sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==}
|
||||||
|
engines: {node: '>=6'}
|
||||||
|
|
||||||
|
file-uri-to-path@1.0.0:
|
||||||
|
resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==}
|
||||||
|
|
||||||
|
fs-constants@1.0.0:
|
||||||
|
resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==}
|
||||||
|
|
||||||
|
github-from-package@0.0.0:
|
||||||
|
resolution: {integrity: sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==}
|
||||||
|
|
||||||
|
ieee754@1.2.1:
|
||||||
|
resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==}
|
||||||
|
|
||||||
|
inherits@2.0.4:
|
||||||
|
resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==}
|
||||||
|
|
||||||
|
ini@1.3.8:
|
||||||
|
resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==}
|
||||||
|
|
||||||
|
mimic-response@3.1.0:
|
||||||
|
resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==}
|
||||||
|
engines: {node: '>=10'}
|
||||||
|
|
||||||
|
minimist@1.2.8:
|
||||||
|
resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==}
|
||||||
|
|
||||||
|
mkdirp-classic@0.5.3:
|
||||||
|
resolution: {integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==}
|
||||||
|
|
||||||
|
napi-build-utils@2.0.0:
|
||||||
|
resolution: {integrity: sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==}
|
||||||
|
|
||||||
|
node-abi@3.85.0:
|
||||||
|
resolution: {integrity: sha512-zsFhmbkAzwhTft6nd3VxcG0cvJsT70rL+BIGHWVq5fi6MwGrHwzqKaxXE+Hl2GmnGItnDKPPkO5/LQqjVkIdFg==}
|
||||||
|
engines: {node: '>=10'}
|
||||||
|
|
||||||
|
once@1.4.0:
|
||||||
|
resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==}
|
||||||
|
|
||||||
|
prebuild-install@7.1.3:
|
||||||
|
resolution: {integrity: sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug==}
|
||||||
|
engines: {node: '>=10'}
|
||||||
|
deprecated: No longer maintained. Please contact the author of the relevant native addon; alternatives are available.
|
||||||
|
hasBin: true
|
||||||
|
|
||||||
|
pump@3.0.3:
|
||||||
|
resolution: {integrity: sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA==}
|
||||||
|
|
||||||
|
rc@1.2.8:
|
||||||
|
resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==}
|
||||||
|
hasBin: true
|
||||||
|
|
||||||
|
readable-stream@3.6.2:
|
||||||
|
resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==}
|
||||||
|
engines: {node: '>= 6'}
|
||||||
|
|
||||||
|
safe-buffer@5.2.1:
|
||||||
|
resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==}
|
||||||
|
|
||||||
|
semver@7.7.3:
|
||||||
|
resolution: {integrity: sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==}
|
||||||
|
engines: {node: '>=10'}
|
||||||
|
hasBin: true
|
||||||
|
|
||||||
|
simple-concat@1.0.1:
|
||||||
|
resolution: {integrity: sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==}
|
||||||
|
|
||||||
|
simple-get@4.0.1:
|
||||||
|
resolution: {integrity: sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==}
|
||||||
|
|
||||||
|
string_decoder@1.3.0:
|
||||||
|
resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==}
|
||||||
|
|
||||||
|
strip-json-comments@2.0.1:
|
||||||
|
resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==}
|
||||||
|
engines: {node: '>=0.10.0'}
|
||||||
|
|
||||||
|
tar-fs@2.1.4:
|
||||||
|
resolution: {integrity: sha512-mDAjwmZdh7LTT6pNleZ05Yt65HC3E+NiQzl672vQG38jIrehtJk/J3mNwIg+vShQPcLF/LV7CMnDW6vjj6sfYQ==}
|
||||||
|
|
||||||
|
tar-stream@2.2.0:
|
||||||
|
resolution: {integrity: sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==}
|
||||||
|
engines: {node: '>=6'}
|
||||||
|
|
||||||
|
tunnel-agent@0.6.0:
|
||||||
|
resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==}
|
||||||
|
|
||||||
|
util-deprecate@1.0.2:
|
||||||
|
resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
|
||||||
|
|
||||||
|
wrappy@1.0.2:
|
||||||
|
resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
|
||||||
|
|
||||||
|
snapshots:
|
||||||
|
|
||||||
|
base64-js@1.5.1: {}
|
||||||
|
|
||||||
|
better-sqlite3@12.10.0:
|
||||||
|
dependencies:
|
||||||
|
bindings: 1.5.0
|
||||||
|
prebuild-install: 7.1.3
|
||||||
|
|
||||||
|
bindings@1.5.0:
|
||||||
|
dependencies:
|
||||||
|
file-uri-to-path: 1.0.0
|
||||||
|
|
||||||
|
bl@4.1.0:
|
||||||
|
dependencies:
|
||||||
|
buffer: 5.7.1
|
||||||
|
inherits: 2.0.4
|
||||||
|
readable-stream: 3.6.2
|
||||||
|
|
||||||
|
buffer@5.7.1:
|
||||||
|
dependencies:
|
||||||
|
base64-js: 1.5.1
|
||||||
|
ieee754: 1.2.1
|
||||||
|
|
||||||
|
chownr@1.1.4: {}
|
||||||
|
|
||||||
|
decompress-response@6.0.0:
|
||||||
|
dependencies:
|
||||||
|
mimic-response: 3.1.0
|
||||||
|
|
||||||
|
deep-extend@0.6.0: {}
|
||||||
|
|
||||||
|
detect-libc@2.1.2: {}
|
||||||
|
|
||||||
|
end-of-stream@1.4.5:
|
||||||
|
dependencies:
|
||||||
|
once: 1.4.0
|
||||||
|
|
||||||
|
expand-template@2.0.3: {}
|
||||||
|
|
||||||
|
file-uri-to-path@1.0.0: {}
|
||||||
|
|
||||||
|
fs-constants@1.0.0: {}
|
||||||
|
|
||||||
|
github-from-package@0.0.0: {}
|
||||||
|
|
||||||
|
ieee754@1.2.1: {}
|
||||||
|
|
||||||
|
inherits@2.0.4: {}
|
||||||
|
|
||||||
|
ini@1.3.8: {}
|
||||||
|
|
||||||
|
mimic-response@3.1.0: {}
|
||||||
|
|
||||||
|
minimist@1.2.8: {}
|
||||||
|
|
||||||
|
mkdirp-classic@0.5.3: {}
|
||||||
|
|
||||||
|
napi-build-utils@2.0.0: {}
|
||||||
|
|
||||||
|
node-abi@3.85.0:
|
||||||
|
dependencies:
|
||||||
|
semver: 7.7.3
|
||||||
|
|
||||||
|
once@1.4.0:
|
||||||
|
dependencies:
|
||||||
|
wrappy: 1.0.2
|
||||||
|
|
||||||
|
prebuild-install@7.1.3:
|
||||||
|
dependencies:
|
||||||
|
detect-libc: 2.1.2
|
||||||
|
expand-template: 2.0.3
|
||||||
|
github-from-package: 0.0.0
|
||||||
|
minimist: 1.2.8
|
||||||
|
mkdirp-classic: 0.5.3
|
||||||
|
napi-build-utils: 2.0.0
|
||||||
|
node-abi: 3.85.0
|
||||||
|
pump: 3.0.3
|
||||||
|
rc: 1.2.8
|
||||||
|
simple-get: 4.0.1
|
||||||
|
tar-fs: 2.1.4
|
||||||
|
tunnel-agent: 0.6.0
|
||||||
|
|
||||||
|
pump@3.0.3:
|
||||||
|
dependencies:
|
||||||
|
end-of-stream: 1.4.5
|
||||||
|
once: 1.4.0
|
||||||
|
|
||||||
|
rc@1.2.8:
|
||||||
|
dependencies:
|
||||||
|
deep-extend: 0.6.0
|
||||||
|
ini: 1.3.8
|
||||||
|
minimist: 1.2.8
|
||||||
|
strip-json-comments: 2.0.1
|
||||||
|
|
||||||
|
readable-stream@3.6.2:
|
||||||
|
dependencies:
|
||||||
|
inherits: 2.0.4
|
||||||
|
string_decoder: 1.3.0
|
||||||
|
util-deprecate: 1.0.2
|
||||||
|
|
||||||
|
safe-buffer@5.2.1: {}
|
||||||
|
|
||||||
|
semver@7.7.3: {}
|
||||||
|
|
||||||
|
simple-concat@1.0.1: {}
|
||||||
|
|
||||||
|
simple-get@4.0.1:
|
||||||
|
dependencies:
|
||||||
|
decompress-response: 6.0.0
|
||||||
|
once: 1.4.0
|
||||||
|
simple-concat: 1.0.1
|
||||||
|
|
||||||
|
string_decoder@1.3.0:
|
||||||
|
dependencies:
|
||||||
|
safe-buffer: 5.2.1
|
||||||
|
|
||||||
|
strip-json-comments@2.0.1: {}
|
||||||
|
|
||||||
|
tar-fs@2.1.4:
|
||||||
|
dependencies:
|
||||||
|
chownr: 1.1.4
|
||||||
|
mkdirp-classic: 0.5.3
|
||||||
|
pump: 3.0.3
|
||||||
|
tar-stream: 2.2.0
|
||||||
|
|
||||||
|
tar-stream@2.2.0:
|
||||||
|
dependencies:
|
||||||
|
bl: 4.1.0
|
||||||
|
end-of-stream: 1.4.5
|
||||||
|
fs-constants: 1.0.0
|
||||||
|
inherits: 2.0.4
|
||||||
|
readable-stream: 3.6.2
|
||||||
|
|
||||||
|
tunnel-agent@0.6.0:
|
||||||
|
dependencies:
|
||||||
|
safe-buffer: 5.2.1
|
||||||
|
|
||||||
|
util-deprecate@1.0.2: {}
|
||||||
|
|
||||||
|
wrappy@1.0.2: {}
|
||||||
+90
-20
@@ -64,6 +64,13 @@
|
|||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
|
<a href="https://homarr.dev/docs/integrations/anchor" target="_blank" rel="noreferrer noopener">
|
||||||
|
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/anchor.svg" alt="Anchor" width="90" height="90" />
|
||||||
|
<br/>
|
||||||
|
<p align="center">Anchor</p>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td align="center">
|
||||||
<a href="https://homarr.dev/docs/integrations/aria2" target="_blank" rel="noreferrer noopener">
|
<a href="https://homarr.dev/docs/integrations/aria2" target="_blank" rel="noreferrer noopener">
|
||||||
<img src="https://cdn.jsdelivr.net/gh/PapirusDevelopmentTeam/papirus_icons@latest/src/system_downloads_3.svg" alt="Aria2" width="90" height="90" />
|
<img src="https://cdn.jsdelivr.net/gh/PapirusDevelopmentTeam/papirus_icons@latest/src/system_downloads_3.svg" alt="Aria2" width="90" height="90" />
|
||||||
<br/>
|
<br/>
|
||||||
@@ -78,6 +85,13 @@
|
|||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
|
<a href="https://homarr.dev/docs/integrations/coolify" target="_blank" rel="noreferrer noopener">
|
||||||
|
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/coolify.svg" alt="Coolify" width="90" height="90" />
|
||||||
|
<br/>
|
||||||
|
<p align="center">Coolify</p>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td align="center">
|
||||||
<a href="https://homarr.dev/docs/integrations/dash-dot" target="_blank" rel="noreferrer noopener">
|
<a href="https://homarr.dev/docs/integrations/dash-dot" target="_blank" rel="noreferrer noopener">
|
||||||
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/png/dashdot.png" alt="Dash." width="90" height="90" />
|
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/png/dashdot.png" alt="Dash." width="90" height="90" />
|
||||||
<br/>
|
<br/>
|
||||||
@@ -90,8 +104,8 @@
|
|||||||
<br/>
|
<br/>
|
||||||
<p align="center">Deluge</p>
|
<p align="center">Deluge</p>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td></tr>
|
||||||
<td align="center">
|
<tr><td align="center">
|
||||||
<a href="https://homarr.dev/docs/integrations/docker-hub" target="_blank" rel="noreferrer noopener">
|
<a href="https://homarr.dev/docs/integrations/docker-hub" target="_blank" rel="noreferrer noopener">
|
||||||
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/docker.svg" alt="Docker Hub" width="90" height="90" />
|
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/docker.svg" alt="Docker Hub" width="90" height="90" />
|
||||||
<br/>
|
<br/>
|
||||||
@@ -104,8 +118,8 @@
|
|||||||
<br/>
|
<br/>
|
||||||
<p align="center">Emby</p>
|
<p align="center">Emby</p>
|
||||||
</a>
|
</a>
|
||||||
</td></tr>
|
</td>
|
||||||
<tr><td align="center">
|
<td align="center">
|
||||||
<a href="https://homarr.dev/docs/integrations/github" target="_blank" rel="noreferrer noopener">
|
<a href="https://homarr.dev/docs/integrations/github" target="_blank" rel="noreferrer noopener">
|
||||||
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/github.svg" alt="Github" width="90" height="90" />
|
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/github.svg" alt="Github" width="90" height="90" />
|
||||||
<br/>
|
<br/>
|
||||||
@@ -127,13 +141,20 @@
|
|||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
|
<a href="null" target="_blank" rel="noreferrer noopener">
|
||||||
|
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/glances.svg" alt="Glances" width="90" height="90" />
|
||||||
|
<br/>
|
||||||
|
<p align="center">Glances</p>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td align="center">
|
||||||
<a href="https://homarr.dev/docs/integrations/home-assistant" target="_blank" rel="noreferrer noopener">
|
<a href="https://homarr.dev/docs/integrations/home-assistant" target="_blank" rel="noreferrer noopener">
|
||||||
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/home-assistant.svg" alt="Home Assistant" width="90" height="90" />
|
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/home-assistant.svg" alt="Home Assistant" width="90" height="90" />
|
||||||
<br/>
|
<br/>
|
||||||
<p align="center">Home<br/>Assistant</p>
|
<p align="center">Home<br/>Assistant</p>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td></tr>
|
||||||
<td align="center">
|
<tr><td align="center">
|
||||||
<a href="https://homarr.dev/docs/integrations/ical" target="_blank" rel="noreferrer noopener">
|
<a href="https://homarr.dev/docs/integrations/ical" target="_blank" rel="noreferrer noopener">
|
||||||
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/ical.svg" alt="iCal" width="90" height="90" />
|
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/ical.svg" alt="iCal" width="90" height="90" />
|
||||||
<br/>
|
<br/>
|
||||||
@@ -141,6 +162,13 @@
|
|||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
|
<a href="https://homarr.dev/docs/integrations/immich" target="_blank" rel="noreferrer noopener">
|
||||||
|
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/immich.svg" alt="Immich" width="90" height="90" />
|
||||||
|
<br/>
|
||||||
|
<p align="center">Immich</p>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td align="center">
|
||||||
<a href="https://homarr.dev/docs/integrations/jellyfin" target="_blank" rel="noreferrer noopener">
|
<a href="https://homarr.dev/docs/integrations/jellyfin" target="_blank" rel="noreferrer noopener">
|
||||||
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/jellyfin.svg" alt="Jellyfin" width="90" height="90" />
|
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/jellyfin.svg" alt="Jellyfin" width="90" height="90" />
|
||||||
<br/>
|
<br/>
|
||||||
@@ -153,8 +181,8 @@
|
|||||||
<br/>
|
<br/>
|
||||||
<p align="center">Jellyseerr</p>
|
<p align="center">Jellyseerr</p>
|
||||||
</a>
|
</a>
|
||||||
</td></tr>
|
</td>
|
||||||
<tr><td align="center">
|
<td align="center">
|
||||||
<a href="https://homarr.dev/docs/integrations/lidarr" target="_blank" rel="noreferrer noopener">
|
<a href="https://homarr.dev/docs/integrations/lidarr" target="_blank" rel="noreferrer noopener">
|
||||||
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/lidarr.svg" alt="Lidarr" width="90" height="90" />
|
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/lidarr.svg" alt="Lidarr" width="90" height="90" />
|
||||||
<br/>
|
<br/>
|
||||||
@@ -174,8 +202,8 @@
|
|||||||
<br/>
|
<br/>
|
||||||
<p align="center">Nextcloud</p>
|
<p align="center">Nextcloud</p>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td></tr>
|
||||||
<td align="center">
|
<tr><td align="center">
|
||||||
<a href="https://homarr.dev/docs/integrations/npm" target="_blank" rel="noreferrer noopener">
|
<a href="https://homarr.dev/docs/integrations/npm" target="_blank" rel="noreferrer noopener">
|
||||||
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/npm.svg" alt="NPM" width="90" height="90" />
|
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/npm.svg" alt="NPM" width="90" height="90" />
|
||||||
<br/>
|
<br/>
|
||||||
@@ -202,8 +230,8 @@
|
|||||||
<br/>
|
<br/>
|
||||||
<p align="center">OpenMediaVault</p>
|
<p align="center">OpenMediaVault</p>
|
||||||
</a>
|
</a>
|
||||||
</td></tr>
|
</td>
|
||||||
<tr><td align="center">
|
<td align="center">
|
||||||
<a href="https://homarr.dev/docs/integrations/opnsense" target="_blank" rel="noreferrer noopener">
|
<a href="https://homarr.dev/docs/integrations/opnsense" target="_blank" rel="noreferrer noopener">
|
||||||
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/opnsense.svg" alt="OPNsense" width="90" height="90" />
|
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/opnsense.svg" alt="OPNsense" width="90" height="90" />
|
||||||
<br/>
|
<br/>
|
||||||
@@ -223,8 +251,8 @@
|
|||||||
<br/>
|
<br/>
|
||||||
<p align="center">Pi-hole</p>
|
<p align="center">Pi-hole</p>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td></tr>
|
||||||
<td align="center">
|
<tr><td align="center">
|
||||||
<a href="https://homarr.dev/docs/integrations/plex" target="_blank" rel="noreferrer noopener">
|
<a href="https://homarr.dev/docs/integrations/plex" target="_blank" rel="noreferrer noopener">
|
||||||
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/plex.svg" alt="Plex" width="90" height="90" />
|
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/plex.svg" alt="Plex" width="90" height="90" />
|
||||||
<br/>
|
<br/>
|
||||||
@@ -251,8 +279,8 @@
|
|||||||
<br/>
|
<br/>
|
||||||
<p align="center">qBittorrent</p>
|
<p align="center">qBittorrent</p>
|
||||||
</a>
|
</a>
|
||||||
</td></tr>
|
</td>
|
||||||
<tr><td align="center">
|
<td align="center">
|
||||||
<a href="https://homarr.dev/docs/integrations/quay" target="_blank" rel="noreferrer noopener">
|
<a href="https://homarr.dev/docs/integrations/quay" target="_blank" rel="noreferrer noopener">
|
||||||
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/png/quay.png" alt="Quay" width="90" height="90" />
|
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/png/quay.png" alt="Quay" width="90" height="90" />
|
||||||
<br/>
|
<br/>
|
||||||
@@ -272,8 +300,8 @@
|
|||||||
<br/>
|
<br/>
|
||||||
<p align="center">Readarr</p>
|
<p align="center">Readarr</p>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td></tr>
|
||||||
<td align="center">
|
<tr><td align="center">
|
||||||
<a href="https://homarr.dev/docs/integrations/sabnzbd" target="_blank" rel="noreferrer noopener">
|
<a href="https://homarr.dev/docs/integrations/sabnzbd" target="_blank" rel="noreferrer noopener">
|
||||||
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/sabnzbd.svg" alt="SABnzbd" width="90" height="90" />
|
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/sabnzbd.svg" alt="SABnzbd" width="90" height="90" />
|
||||||
<br/>
|
<br/>
|
||||||
@@ -281,6 +309,27 @@
|
|||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
|
<a href="https://homarr.dev/docs/integrations/search-ch" target="_blank" rel="noreferrer noopener">
|
||||||
|
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/search-ch.png" alt="Search.ch" width="90" height="90" />
|
||||||
|
<br/>
|
||||||
|
<p align="center">Search.ch</p>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td align="center">
|
||||||
|
<a href="https://homarr.dev/docs/integrations/seerr" target="_blank" rel="noreferrer noopener">
|
||||||
|
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/seerr.svg" alt="Seerr" width="90" height="90" />
|
||||||
|
<br/>
|
||||||
|
<p align="center">Seerr</p>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td align="center">
|
||||||
|
<a href="https://homarr.dev/docs/integrations/slskd" target="_blank" rel="noreferrer noopener">
|
||||||
|
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/slskd.svg" alt="Slskd" width="90" height="90" />
|
||||||
|
<br/>
|
||||||
|
<p align="center">Slskd</p>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td align="center">
|
||||||
<a href="https://homarr.dev/docs/integrations/sonarr" target="_blank" rel="noreferrer noopener">
|
<a href="https://homarr.dev/docs/integrations/sonarr" target="_blank" rel="noreferrer noopener">
|
||||||
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/sonarr.svg" alt="Sonarr" width="90" height="90" />
|
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/sonarr.svg" alt="Sonarr" width="90" height="90" />
|
||||||
<br/>
|
<br/>
|
||||||
@@ -288,11 +337,25 @@
|
|||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
|
<a href="https://homarr.dev/docs/integrations/speedtest-tracker" target="_blank" rel="noreferrer noopener">
|
||||||
|
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/speedtest-tracker.png" alt="Speedtest Tracker" width="90" height="90" />
|
||||||
|
<br/>
|
||||||
|
<p align="center">Speedtest<br/>Tracker</p>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td align="center">
|
||||||
<a href="https://homarr.dev/docs/integrations/tdarr" target="_blank" rel="noreferrer noopener">
|
<a href="https://homarr.dev/docs/integrations/tdarr" target="_blank" rel="noreferrer noopener">
|
||||||
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/png/tdarr.png" alt="Tdarr" width="90" height="90" />
|
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/png/tdarr.png" alt="Tdarr" width="90" height="90" />
|
||||||
<br/>
|
<br/>
|
||||||
<p align="center">Tdarr</p>
|
<p align="center">Tdarr</p>
|
||||||
</a>
|
</a>
|
||||||
|
</td></tr>
|
||||||
|
<tr><td align="center">
|
||||||
|
<a href="https://homarr.dev/docs/integrations/tracearr" target="_blank" rel="noreferrer noopener">
|
||||||
|
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/tracearr.svg" alt="Tracearr" width="90" height="90" />
|
||||||
|
<br/>
|
||||||
|
<p align="center">Tracearr</p>
|
||||||
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
<a href="https://homarr.dev/docs/integrations/transmission" target="_blank" rel="noreferrer noopener">
|
<a href="https://homarr.dev/docs/integrations/transmission" target="_blank" rel="noreferrer noopener">
|
||||||
@@ -300,8 +363,8 @@
|
|||||||
<br/>
|
<br/>
|
||||||
<p align="center">Transmission</p>
|
<p align="center">Transmission</p>
|
||||||
</a>
|
</a>
|
||||||
</td></tr>
|
</td>
|
||||||
<tr><td align="center">
|
<td align="center">
|
||||||
<a href="https://homarr.dev/docs/integrations/truenas" target="_blank" rel="noreferrer noopener">
|
<a href="https://homarr.dev/docs/integrations/truenas" target="_blank" rel="noreferrer noopener">
|
||||||
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/truenas.svg" alt="TrueNAS" width="90" height="90" />
|
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/truenas.svg" alt="TrueNAS" width="90" height="90" />
|
||||||
<br/>
|
<br/>
|
||||||
@@ -309,6 +372,13 @@
|
|||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
|
<a href="https://homarr.dev/docs/integrations/umami" target="_blank" rel="noreferrer noopener">
|
||||||
|
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/umami.svg" alt="Umami" width="90" height="90" />
|
||||||
|
<br/>
|
||||||
|
<p align="center">Umami</p>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td align="center">
|
||||||
<a href="https://homarr.dev/docs/integrations/unifi-controller" target="_blank" rel="noreferrer noopener">
|
<a href="https://homarr.dev/docs/integrations/unifi-controller" target="_blank" rel="noreferrer noopener">
|
||||||
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/png/unifi.png" alt="Unifi Controller" width="90" height="90" />
|
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/png/unifi.png" alt="Unifi Controller" width="90" height="90" />
|
||||||
<br/>
|
<br/>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ describe("Health checks", () => {
|
|||||||
// Assert
|
// Assert
|
||||||
expect(readyResponse.status).toBe(200);
|
expect(readyResponse.status).toBe(200);
|
||||||
expect(liveResponse.status).toBe(200);
|
expect(liveResponse.status).toBe(200);
|
||||||
}, 20_000);
|
}, 60_000);
|
||||||
|
|
||||||
test("ready and live should return 200 OK with external redis", async () => {
|
test("ready and live should return 200 OK with external redis", async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
@@ -42,5 +42,5 @@ describe("Health checks", () => {
|
|||||||
liveResponse.status,
|
liveResponse.status,
|
||||||
`Expected live to return OK statusCode=${liveResponse.status} content=${await liveResponse.text()}`,
|
`Expected live to return OK statusCode=${liveResponse.status} content=${await liveResponse.text()}`,
|
||||||
).toBe(200);
|
).toBe(200);
|
||||||
}, 20_000);
|
}, 60_000);
|
||||||
});
|
});
|
||||||
+1
-1
@@ -12,5 +12,5 @@ describe("Home", () => {
|
|||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
expect(homeResponse.status).toBe(200);
|
expect(homeResponse.status).toBe(200);
|
||||||
}, 20_000);
|
}, 60_000);
|
||||||
});
|
});
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
import { chromium } from "playwright";
|
import { chromium } from "@playwright/test";
|
||||||
import { GenericContainer } from "testcontainers";
|
import { GenericContainer } from "testcontainers";
|
||||||
import { describe, expect, test } from "vitest";
|
import { describe, expect, test } from "vitest";
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { chromium } from "playwright";
|
import { chromium } from "@playwright/test";
|
||||||
import { describe, test } from "vitest";
|
import { describe, test } from "vitest";
|
||||||
|
|
||||||
import { OnboardingActions } from "./shared/actions/onboarding-actions";
|
import { OnboardingActions } from "./shared/actions/onboarding-actions";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { createId } from "@paralleldrive/cuid2";
|
import { createId } from "@paralleldrive/cuid2";
|
||||||
import type { Page } from "playwright";
|
import type { Page } from "@playwright/test";
|
||||||
|
|
||||||
import * as sqliteSchema from "../../../packages/db/schema/sqlite";
|
import * as sqliteSchema from "../../../packages/db/schema/sqlite";
|
||||||
import type { SqliteDatabase } from "../e2e-db";
|
import type { SqliteDatabase } from "../e2e-db";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
import type { Page } from "@playwright/test";
|
||||||
import { eq } from "drizzle-orm";
|
import { eq } from "drizzle-orm";
|
||||||
import type { Page } from "playwright";
|
|
||||||
import { expect } from "vitest";
|
import { expect } from "vitest";
|
||||||
|
|
||||||
import * as sqliteSchema from "../../../packages/db/schema/sqlite";
|
import * as sqliteSchema from "../../../packages/db/schema/sqlite";
|
||||||
|
|||||||
@@ -18,6 +18,11 @@ export const createHomarrContainer = (
|
|||||||
.withExposedPorts(7575)
|
.withExposedPorts(7575)
|
||||||
.withEnvironment({
|
.withEnvironment({
|
||||||
...options.environment,
|
...options.environment,
|
||||||
|
// We disable external connections due to the following reasons:
|
||||||
|
// - No icons have to be downloaded (11k)
|
||||||
|
// - No analytics data is sent
|
||||||
|
// - It is just faster and makes the tests more reliable (better performance)
|
||||||
|
NO_EXTERNAL_CONNECTION: true.toString(),
|
||||||
SECRET_ENCRYPTION_KEY: "0".repeat(64),
|
SECRET_ENCRYPTION_KEY: "0".repeat(64),
|
||||||
})
|
})
|
||||||
.withBindMounts(
|
.withBindMounts(
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { mkdir } from "fs/promises";
|
import { mkdir } from "fs/promises";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import { createClient } from "@libsql/client/node";
|
|
||||||
import { createId } from "@paralleldrive/cuid2";
|
import { createId } from "@paralleldrive/cuid2";
|
||||||
import { drizzle, LibSQLDatabase } from "drizzle-orm/libsql";
|
import Database from "better-sqlite3";
|
||||||
import { migrate } from "drizzle-orm/libsql/migrator";
|
import { BetterSQLite3Database, drizzle } from "drizzle-orm/better-sqlite3";
|
||||||
|
import { migrate } from "drizzle-orm/better-sqlite3/migrator";
|
||||||
|
|
||||||
import { DB_CASING } from "../../packages/core/src/infrastructure/db/constants";
|
import { DB_CASING } from "../../packages/core/src/infrastructure/db/constants";
|
||||||
import * as sqliteSchema from "../../packages/db/schema/sqlite";
|
import * as sqliteSchema from "../../packages/db/schema/sqlite";
|
||||||
@@ -14,10 +14,7 @@ export const createSqliteDbFileAsync = async () => {
|
|||||||
|
|
||||||
const localDbUrl = path.join(localMountPath, "db", "db.sqlite");
|
const localDbUrl = path.join(localMountPath, "db", "db.sqlite");
|
||||||
|
|
||||||
const connection = createClient({
|
const connection = new Database(localDbUrl);
|
||||||
url: `file:${localDbUrl}`,
|
|
||||||
});
|
|
||||||
|
|
||||||
const db = drizzle(connection, {
|
const db = drizzle(connection, {
|
||||||
schema: sqliteSchema,
|
schema: sqliteSchema,
|
||||||
casing: DB_CASING,
|
casing: DB_CASING,
|
||||||
@@ -33,4 +30,4 @@ export const createSqliteDbFileAsync = async () => {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export type SqliteDatabase = LibSQLDatabase<typeof sqliteSchema>;
|
export type SqliteDatabase = BetterSQLite3Database<typeof sqliteSchema>;
|
||||||
+45
-42
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "homarr",
|
"name": "homarr",
|
||||||
"version": "1.50.1",
|
"version": "1.61.1-beta.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "cross-env CI=true turbo build",
|
"build": "cross-env CI=true turbo build",
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
"db:migration:sqlite:run": "pnpm -F db migration:sqlite:run",
|
"db:migration:sqlite:run": "pnpm -F db migration:sqlite:run",
|
||||||
"db:push": "pnpm -F db push:sqlite",
|
"db:push": "pnpm -F db push:sqlite",
|
||||||
"db:studio": "pnpm -F db studio",
|
"db:studio": "pnpm -F db studio",
|
||||||
"dev": "turbo dev --parallel",
|
"dev": "pnpm -F nextjs dev",
|
||||||
"docker:dev": "docker compose -f ./development/development.docker-compose.yml up",
|
"docker:dev": "docker compose -f ./development/development.docker-compose.yml up",
|
||||||
"format": "turbo format --continue -- --cache --cache-location node_modules/.cache/.prettiercache",
|
"format": "turbo format --continue -- --cache --cache-location node_modules/.cache/.prettiercache",
|
||||||
"format:fix": "turbo format --continue -- --write --cache --cache-location node_modules/.cache/.prettiercache",
|
"format:fix": "turbo format --continue -- --write --cache --cache-location node_modules/.cache/.prettiercache",
|
||||||
@@ -36,38 +36,40 @@
|
|||||||
"prettier": "@homarr/prettier-config",
|
"prettier": "@homarr/prettier-config",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
"@homarr/prettier-config": "workspace:^0.1.0",
|
||||||
"@semantic-release/changelog": "^6.0.3",
|
"@playwright/test": "catalog:",
|
||||||
"@semantic-release/commit-analyzer": "^13.0.1",
|
"@semantic-release/changelog": "catalog:",
|
||||||
"@semantic-release/git": "^10.0.1",
|
"@semantic-release/commit-analyzer": "catalog:",
|
||||||
"@semantic-release/github": "^12.0.2",
|
"@semantic-release/git": "catalog:",
|
||||||
"@semantic-release/npm": "^13.1.3",
|
"@semantic-release/github": "catalog:",
|
||||||
"@semantic-release/release-notes-generator": "^14.1.0",
|
"@semantic-release/npm": "catalog:",
|
||||||
"@testcontainers/redis": "^11.11.0",
|
"@semantic-release/release-notes-generator": "catalog:",
|
||||||
"@turbo/gen": "^2.7.4",
|
"@testcontainers/redis": "catalog:",
|
||||||
"@vitejs/plugin-react": "^5.1.2",
|
"@turbo/gen": "catalog:",
|
||||||
"@vitest/coverage-v8": "^4.0.17",
|
"@vitejs/plugin-react": "catalog:",
|
||||||
"@vitest/ui": "^4.0.17",
|
"@vitest/coverage-v8": "catalog:",
|
||||||
"conventional-changelog-conventionalcommits": "^9.1.0",
|
"@vitest/ui": "catalog:",
|
||||||
"cross-env": "^10.1.0",
|
"conventional-changelog-conventionalcommits": "catalog:",
|
||||||
"jsdom": "^27.4.0",
|
"cross-env": "catalog:",
|
||||||
"json5": "^2.2.3",
|
"jsdom": "catalog:",
|
||||||
"prettier": "^3.7.4",
|
"json5": "catalog:",
|
||||||
"semantic-release": "^25.0.2",
|
"prettier": "catalog:",
|
||||||
"testcontainers": "^11.11.0",
|
"semantic-release": "catalog:",
|
||||||
"turbo": "^2.7.4",
|
"testcontainers": "catalog:",
|
||||||
"typescript": "^5.9.3",
|
"turbo": "catalog:",
|
||||||
"vite-tsconfig-paths": "^6.0.4",
|
"typescript": "catalog:",
|
||||||
"vitest": "^4.0.17"
|
"vite-tsconfig-paths": "catalog:",
|
||||||
|
"vitest": "catalog:"
|
||||||
},
|
},
|
||||||
"packageManager": "pnpm@10.28.0",
|
"packageManager": "pnpm@10.33.4",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=24.12.0",
|
"node": ">=24.15.0",
|
||||||
"pnpm": ">=10.28.0"
|
"pnpm": ">=10.33.4"
|
||||||
},
|
},
|
||||||
"pnpm": {
|
"pnpm": {
|
||||||
"onlyBuiltDependencies": [
|
"onlyBuiltDependencies": [
|
||||||
"@tree-sitter-grammars/tree-sitter-yaml",
|
"@tree-sitter-grammars/tree-sitter-yaml",
|
||||||
"bcrypt",
|
"bcrypt",
|
||||||
|
"better-sqlite3",
|
||||||
"cpu-features",
|
"cpu-features",
|
||||||
"esbuild",
|
"esbuild",
|
||||||
"sharp",
|
"sharp",
|
||||||
@@ -76,25 +78,25 @@
|
|||||||
"tree-sitter-json"
|
"tree-sitter-json"
|
||||||
],
|
],
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"@babel/helpers@<7.26.10": ">=7.28.6",
|
"@babel/helpers@<7.26.10": ">=7.29.2",
|
||||||
"@babel/runtime@<7.26.10": ">=7.28.6",
|
"@babel/runtime@<7.26.10": ">=7.29.2",
|
||||||
"axios@>=1.0.0 <1.8.2": ">=1.13.2",
|
"axios@>=1.0.0 <1.8.2": ">=1.16.1",
|
||||||
"brace-expansion@>=2.0.0 <=2.0.1": ">=4.0.1",
|
"brace-expansion@>=2.0.0 <=2.0.1": ">=5.0.6",
|
||||||
"brace-expansion@>=1.0.0 <=1.1.11": ">=4.0.1",
|
"brace-expansion@>=1.0.0 <=1.1.11": ">=5.0.6",
|
||||||
"esbuild@<=0.24.2": ">=0.27.2",
|
"esbuild@<=0.24.2": ">=0.28.0",
|
||||||
"form-data@>=4.0.0 <4.0.4": ">=4.0.5",
|
"form-data@>=4.0.0 <4.0.4": ">=4.0.5",
|
||||||
"hono@<4.6.5": ">=4.11.4",
|
"hono@<4.6.5": ">=4.12.19",
|
||||||
"linkifyjs@<4.3.2": ">=4.3.2",
|
"linkifyjs@<4.3.2": ">=4.3.3",
|
||||||
"nanoid@>=4.0.0 <5.0.9": ">=5.1.6",
|
"nanoid@>=4.0.0 <5.0.9": ">=5.1.11",
|
||||||
"prismjs@<1.30.0": ">=1.30.0",
|
"prismjs@<1.30.0": ">=1.30.0",
|
||||||
"proxmox-api>undici": "7.18.2",
|
"proxmox-api>undici": "7.24.6",
|
||||||
"react-is": "^19.2.3",
|
"react-is": "^19.2.6",
|
||||||
"rollup@>=4.0.0 <4.22.4": ">=4.55.1",
|
"rollup@>=4.0.0 <4.22.4": ">=4.60.4",
|
||||||
"sha.js@<=2.4.11": ">=2.4.12",
|
"sha.js@<=2.4.11": ">=2.4.12",
|
||||||
"tar-fs@>=3.0.0 <3.0.9": ">=3.1.1",
|
"tar-fs@>=3.0.0 <3.0.9": ">=3.1.2",
|
||||||
"tar-fs@>=2.0.0 <2.1.3": ">=3.1.1",
|
"tar-fs@>=2.0.0 <2.1.3": ">=3.1.2",
|
||||||
"tmp@<=0.2.3": ">=0.2.5",
|
"tmp@<=0.2.3": ">=0.2.5",
|
||||||
"vite@>=5.0.0 <=5.4.18": ">=7.3.1"
|
"vite@>=5.0.0 <=5.4.18": ">=8.0.13"
|
||||||
},
|
},
|
||||||
"patchedDependencies": {
|
"patchedDependencies": {
|
||||||
"@types/node-unifi": "patches/@types__node-unifi.patch",
|
"@types/node-unifi": "patches/@types__node-unifi.patch",
|
||||||
@@ -103,6 +105,7 @@
|
|||||||
"allowUnusedPatches": true,
|
"allowUnusedPatches": true,
|
||||||
"ignoredBuiltDependencies": [
|
"ignoredBuiltDependencies": [
|
||||||
"@scarf/scarf",
|
"@scarf/scarf",
|
||||||
|
"@swc/core",
|
||||||
"core-js-pure",
|
"core-js-pure",
|
||||||
"protobufjs"
|
"protobufjs"
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -22,17 +22,20 @@
|
|||||||
},
|
},
|
||||||
"prettier": "@homarr/prettier-config",
|
"prettier": "@homarr/prettier-config",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@homarr/auth": "workspace:^0.1.0",
|
||||||
|
"@homarr/common": "workspace:^0.1.0",
|
||||||
"@homarr/core": "workspace:^0.1.0",
|
"@homarr/core": "workspace:^0.1.0",
|
||||||
"@homarr/db": "workspace:^0.1.0",
|
"@homarr/db": "workspace:^0.1.0",
|
||||||
|
"@homarr/docker": "workspace:^0.1.0",
|
||||||
"@homarr/server-settings": "workspace:^0.1.0",
|
"@homarr/server-settings": "workspace:^0.1.0",
|
||||||
"@umami/node": "^0.4.0",
|
"@umami/node": "catalog:",
|
||||||
"superjson": "2.2.6"
|
"superjson": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
"@homarr/eslint-config": "workspace:^0.2.0",
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
"@homarr/prettier-config": "workspace:^0.1.0",
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"eslint": "^9.39.2",
|
"eslint": "catalog:",
|
||||||
"typescript": "^5.9.3"
|
"typescript": "catalog:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,17 +1,52 @@
|
|||||||
import type { UmamiEventData } from "@umami/node";
|
import type { UmamiEventData } from "@umami/node";
|
||||||
import { Umami } from "@umami/node";
|
import { Umami } from "@umami/node";
|
||||||
|
|
||||||
|
import { isProviderEnabled } from "@homarr/auth/server";
|
||||||
|
import { Stopwatch } from "@homarr/common";
|
||||||
import { createLogger } from "@homarr/core/infrastructure/logs";
|
import { createLogger } from "@homarr/core/infrastructure/logs";
|
||||||
import { count, db } from "@homarr/db";
|
import { count, db } from "@homarr/db";
|
||||||
|
import { isMysql, isPostgresql } from "@homarr/db/collection";
|
||||||
import { getServerSettingByKeyAsync } from "@homarr/db/queries";
|
import { getServerSettingByKeyAsync } from "@homarr/db/queries";
|
||||||
import { integrations, items, users } from "@homarr/db/schema";
|
import {
|
||||||
import type { defaultServerSettings } from "@homarr/server-settings";
|
apiKeys,
|
||||||
|
apps,
|
||||||
|
boards,
|
||||||
|
cronJobConfigurations,
|
||||||
|
groups,
|
||||||
|
iconRepositories,
|
||||||
|
icons,
|
||||||
|
integrations,
|
||||||
|
invites,
|
||||||
|
itemLayouts,
|
||||||
|
items,
|
||||||
|
layouts,
|
||||||
|
medias,
|
||||||
|
searchEngines,
|
||||||
|
sectionLayouts,
|
||||||
|
sections,
|
||||||
|
users,
|
||||||
|
} from "@homarr/db/schema";
|
||||||
|
import { env as dockerEnv } from "@homarr/docker/env";
|
||||||
|
|
||||||
import { Stopwatch } from "../../common/src";
|
import packageJson from "../../../package.json";
|
||||||
import { UMAMI_HOST_URL, UMAMI_WEBSITE_ID } from "./constants";
|
import { UMAMI_HOST_URL, UMAMI_WEBSITE_ID } from "./constants";
|
||||||
|
|
||||||
const logger = createLogger({ module: "analytics" });
|
const logger = createLogger({ module: "analytics" });
|
||||||
|
|
||||||
|
const getDatabaseType = (): "mysql" | "postgresql" | "sqlite" => {
|
||||||
|
if (isMysql()) return "mysql";
|
||||||
|
if (isPostgresql()) return "postgresql";
|
||||||
|
return "sqlite";
|
||||||
|
};
|
||||||
|
|
||||||
|
const getEnabledAuthProviders = (): string[] => {
|
||||||
|
const providers: string[] = [];
|
||||||
|
if (isProviderEnabled("credentials")) providers.push("credentials");
|
||||||
|
if (isProviderEnabled("oidc")) providers.push("oidc");
|
||||||
|
if (isProviderEnabled("ldap")) providers.push("ldap");
|
||||||
|
return providers;
|
||||||
|
};
|
||||||
|
|
||||||
export const sendServerAnalyticsAsync = async () => {
|
export const sendServerAnalyticsAsync = async () => {
|
||||||
const stopWatch = new Stopwatch();
|
const stopWatch = new Stopwatch();
|
||||||
const analyticsSettings = await getServerSettingByKeyAsync(db, "analytics");
|
const analyticsSettings = await getServerSettingByKeyAsync(db, "analytics");
|
||||||
@@ -27,67 +62,48 @@ export const sendServerAnalyticsAsync = async () => {
|
|||||||
websiteId: UMAMI_WEBSITE_ID,
|
websiteId: UMAMI_WEBSITE_ID,
|
||||||
});
|
});
|
||||||
|
|
||||||
await sendIntegrationDataAsync(umamiInstance, analyticsSettings);
|
const enabledAuthProviders = getEnabledAuthProviders();
|
||||||
await sendWidgetDataAsync(umamiInstance, analyticsSettings);
|
|
||||||
await sendUserDataAsync(umamiInstance, analyticsSettings);
|
|
||||||
|
|
||||||
logger.info(`Sent all analytics in ${stopWatch.getElapsedInHumanWords()}`);
|
const analyticsData: UmamiEventData = {
|
||||||
};
|
homarrVersion: packageJson.version,
|
||||||
|
databaseType: getDatabaseType(),
|
||||||
|
dockerEnabled: dockerEnv.ENABLE_DOCKER ? 1 : 0,
|
||||||
|
kubernetesEnabled: dockerEnv.ENABLE_KUBERNETES ? 1 : 0,
|
||||||
|
authCredentials: enabledAuthProviders.includes("credentials") ? 1 : 0,
|
||||||
|
authOidc: enabledAuthProviders.includes("oidc") ? 1 : 0,
|
||||||
|
authLdap: enabledAuthProviders.includes("ldap") ? 1 : 0,
|
||||||
|
countUsers: await db.$count(users),
|
||||||
|
countBoards: await db.$count(boards),
|
||||||
|
countGroups: await db.$count(groups),
|
||||||
|
countApps: await db.$count(apps),
|
||||||
|
countWidgets: await db.$count(items),
|
||||||
|
countSections: await db.$count(sections),
|
||||||
|
countIntegrations: await db.$count(integrations),
|
||||||
|
countSearchEngines: await db.$count(searchEngines),
|
||||||
|
countIconRepositories: await db.$count(iconRepositories),
|
||||||
|
countIcons: await db.$count(icons),
|
||||||
|
countApiKeys: await db.$count(apiKeys),
|
||||||
|
countInvites: await db.$count(invites),
|
||||||
|
countMedias: await db.$count(medias),
|
||||||
|
countLayouts: await db.$count(layouts),
|
||||||
|
countItemLayouts: await db.$count(itemLayouts),
|
||||||
|
countSectionLayouts: await db.$count(sectionLayouts),
|
||||||
|
countCronJobConfigs: await db.$count(cronJobConfigurations),
|
||||||
|
};
|
||||||
|
|
||||||
const sendWidgetDataAsync = async (umamiInstance: Umami, analyticsSettings: typeof defaultServerSettings.analytics) => {
|
|
||||||
if (!analyticsSettings.enableWidgetData) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const widgetCount = await db.$count(items);
|
|
||||||
|
|
||||||
const response = await umamiInstance.track("server-widget-data", {
|
|
||||||
countWidgets: widgetCount,
|
|
||||||
});
|
|
||||||
if (response.ok) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
logger.warn("Unable to send track event data to Umami instance");
|
|
||||||
};
|
|
||||||
|
|
||||||
const sendUserDataAsync = async (umamiInstance: Umami, analyticsSettings: typeof defaultServerSettings.analytics) => {
|
|
||||||
if (!analyticsSettings.enableUserData) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const userCount = await db.$count(users);
|
|
||||||
|
|
||||||
const response = await umamiInstance.track("server-user-data", {
|
|
||||||
countUsers: userCount,
|
|
||||||
});
|
|
||||||
if (response.ok) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
logger.warn("Unable to send track event data to Umami instance");
|
|
||||||
};
|
|
||||||
|
|
||||||
const sendIntegrationDataAsync = async (
|
|
||||||
umamiInstance: Umami,
|
|
||||||
analyticsSettings: typeof defaultServerSettings.analytics,
|
|
||||||
) => {
|
|
||||||
if (!analyticsSettings.enableIntegrationData) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const integrationKinds = await db
|
const integrationKinds = await db
|
||||||
.select({ kind: integrations.kind, count: count(integrations.id) })
|
.select({ kind: integrations.kind, count: count(integrations.id) })
|
||||||
.from(integrations)
|
.from(integrations)
|
||||||
.groupBy(integrations.kind);
|
.groupBy(integrations.kind);
|
||||||
|
|
||||||
const map: UmamiEventData = {};
|
|
||||||
|
|
||||||
integrationKinds.forEach((integrationKind) => {
|
integrationKinds.forEach((integrationKind) => {
|
||||||
map[integrationKind.kind] = integrationKind.count;
|
analyticsData[`integration_${integrationKind.kind}`] = integrationKind.count;
|
||||||
});
|
});
|
||||||
|
|
||||||
const response = await umamiInstance.track("server-integration-data-kind", map);
|
const response = await umamiInstance.track("server-analytics-v2", analyticsData);
|
||||||
if (response.ok) {
|
if (!response.ok) {
|
||||||
return;
|
logger.warn("Unable to send analytics to Umami instance");
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.warn("Unable to send track event data to Umami instance");
|
logger.info(`Sent analytics in ${stopWatch.getElapsedInHumanWords()}`);
|
||||||
};
|
};
|
||||||
+18
-18
@@ -9,7 +9,8 @@
|
|||||||
"./client": "./src/client.ts",
|
"./client": "./src/client.ts",
|
||||||
"./server": "./src/server.ts",
|
"./server": "./src/server.ts",
|
||||||
"./websocket": "./src/websocket.ts",
|
"./websocket": "./src/websocket.ts",
|
||||||
"./shared": "./src/shared.ts"
|
"./shared": "./src/shared.ts",
|
||||||
|
"./open-api": "./src/open-api.ts"
|
||||||
},
|
},
|
||||||
"main": "./index.ts",
|
"main": "./index.ts",
|
||||||
"types": "./index.ts",
|
"types": "./index.ts",
|
||||||
@@ -24,7 +25,6 @@
|
|||||||
"@homarr/auth": "workspace:^0.1.0",
|
"@homarr/auth": "workspace:^0.1.0",
|
||||||
"@homarr/common": "workspace:^0.1.0",
|
"@homarr/common": "workspace:^0.1.0",
|
||||||
"@homarr/core": "workspace:^0.1.0",
|
"@homarr/core": "workspace:^0.1.0",
|
||||||
"@homarr/cron-job-api": "workspace:^0.1.0",
|
|
||||||
"@homarr/cron-job-status": "workspace:^0.1.0",
|
"@homarr/cron-job-status": "workspace:^0.1.0",
|
||||||
"@homarr/cron-jobs": "workspace:^0.1.0",
|
"@homarr/cron-jobs": "workspace:^0.1.0",
|
||||||
"@homarr/db": "workspace:^0.1.0",
|
"@homarr/db": "workspace:^0.1.0",
|
||||||
@@ -40,26 +40,26 @@
|
|||||||
"@homarr/server-settings": "workspace:^0.1.0",
|
"@homarr/server-settings": "workspace:^0.1.0",
|
||||||
"@homarr/translation": "workspace:^0.1.0",
|
"@homarr/translation": "workspace:^0.1.0",
|
||||||
"@homarr/validation": "workspace:^0.1.0",
|
"@homarr/validation": "workspace:^0.1.0",
|
||||||
"@kubernetes/client-node": "^1.4.0",
|
"@kubernetes/client-node": "catalog:",
|
||||||
"@tanstack/react-query": "^5.90.16",
|
"@tanstack/react-query": "catalog:",
|
||||||
"@trpc/client": "^11.8.1",
|
"@trpc/client": "catalog:",
|
||||||
"@trpc/react-query": "^11.8.1",
|
"@trpc/react-query": "catalog:",
|
||||||
"@trpc/server": "^11.8.1",
|
"@trpc/server": "catalog:",
|
||||||
"@trpc/tanstack-react-query": "^11.8.1",
|
"@trpc/tanstack-react-query": "catalog:",
|
||||||
"lodash.clonedeep": "^4.5.0",
|
"lodash.clonedeep": "catalog:",
|
||||||
"next": "16.1.1",
|
"next": "catalog:",
|
||||||
"react": "19.2.3",
|
"react": "catalog:",
|
||||||
"react-dom": "19.2.3",
|
"react-dom": "catalog:",
|
||||||
"superjson": "2.2.6",
|
"superjson": "catalog:",
|
||||||
"trpc-to-openapi": "^3.1.0",
|
"trpc-to-openapi": "catalog:",
|
||||||
"zod": "^4.2.1"
|
"zod": "catalog:"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
"@homarr/eslint-config": "workspace:^0.2.0",
|
||||||
"@homarr/prettier-config": "workspace:^0.1.0",
|
"@homarr/prettier-config": "workspace:^0.1.0",
|
||||||
"@homarr/tsconfig": "workspace:^0.1.0",
|
"@homarr/tsconfig": "workspace:^0.1.0",
|
||||||
"eslint": "^9.39.2",
|
"eslint": "catalog:",
|
||||||
"prettier": "^3.7.4",
|
"prettier": "catalog:",
|
||||||
"typescript": "^5.9.3"
|
"typescript": "catalog:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
import type { inferRouterInputs, inferRouterOutputs } from "@trpc/server";
|
import type { inferRouterInputs, inferRouterOutputs } from "@trpc/server";
|
||||||
|
|
||||||
import { openApiDocument } from "./open-api";
|
|
||||||
import type { AppRouter } from "./root";
|
import type { AppRouter } from "./root";
|
||||||
import { appRouter } from "./root";
|
import { appRouter } from "./root";
|
||||||
import { createCallerFactory, createTRPCContext } from "./trpc";
|
import { createCallerFactory, createTRPCContext } from "./trpc";
|
||||||
@@ -30,5 +29,5 @@ type RouterInputs = inferRouterInputs<AppRouter>;
|
|||||||
**/
|
**/
|
||||||
type RouterOutputs = inferRouterOutputs<AppRouter>;
|
type RouterOutputs = inferRouterOutputs<AppRouter>;
|
||||||
|
|
||||||
export { createTRPCContext, appRouter, createCaller, openApiDocument };
|
export { createTRPCContext, appRouter, createCaller };
|
||||||
export type { AppRouter, RouterInputs, RouterOutputs };
|
export type { AppRouter, RouterInputs, RouterOutputs };
|
||||||
@@ -2,10 +2,21 @@ import { generateOpenApiDocument } from "trpc-to-openapi";
|
|||||||
|
|
||||||
import { API_KEY_HEADER_NAME } from "@homarr/auth/api-key";
|
import { API_KEY_HEADER_NAME } from "@homarr/auth/api-key";
|
||||||
|
|
||||||
import { appRouter } from "./root";
|
import { appRouter } from "./router/app";
|
||||||
|
import { infoRouter } from "./router/info";
|
||||||
|
import { inviteRouter } from "./router/invite";
|
||||||
|
import { userRouter } from "./router/user";
|
||||||
|
import { createTRPCRouter } from "./trpc";
|
||||||
|
|
||||||
|
export const openApiRouter = createTRPCRouter({
|
||||||
|
appRouter,
|
||||||
|
infoRouter,
|
||||||
|
inviteRouter,
|
||||||
|
userRouter,
|
||||||
|
});
|
||||||
|
|
||||||
export const openApiDocument = (base: string) =>
|
export const openApiDocument = (base: string) =>
|
||||||
generateOpenApiDocument(appRouter, {
|
generateOpenApiDocument(openApiRouter, {
|
||||||
title: "Homarr API documentation",
|
title: "Homarr API documentation",
|
||||||
version: "1.0.0",
|
version: "1.0.0",
|
||||||
baseUrl: base,
|
baseUrl: base,
|
||||||
|
|||||||
+27
-48
@@ -1,54 +1,33 @@
|
|||||||
import { apiKeysRouter } from "./router/apiKeys";
|
import { lazy } from "@trpc/server";
|
||||||
import { appRouter as innerAppRouter } from "./router/app";
|
|
||||||
import { boardRouter } from "./router/board";
|
|
||||||
import { certificateRouter } from "./router/certificates/certificate-router";
|
|
||||||
import { cronJobsRouter } from "./router/cron-jobs";
|
|
||||||
import { dockerRouter } from "./router/docker/docker-router";
|
|
||||||
import { groupRouter } from "./router/group";
|
|
||||||
import { homeRouter } from "./router/home";
|
|
||||||
import { iconsRouter } from "./router/icons";
|
|
||||||
import { importRouter } from "./router/import/import-router";
|
|
||||||
import { infoRouter } from "./router/info";
|
|
||||||
import { integrationRouter } from "./router/integration/integration-router";
|
|
||||||
import { inviteRouter } from "./router/invite";
|
|
||||||
import { kubernetesRouter } from "./router/kubernetes/router/kubernetes-router";
|
|
||||||
import { locationRouter } from "./router/location";
|
|
||||||
import { logRouter } from "./router/log";
|
|
||||||
import { mediaRouter } from "./router/medias/media-router";
|
|
||||||
import { onboardRouter } from "./router/onboard/onboard-router";
|
|
||||||
import { searchEngineRouter } from "./router/search-engine/search-engine-router";
|
|
||||||
import { sectionRouter } from "./router/section/section-router";
|
|
||||||
import { serverSettingsRouter } from "./router/serverSettings";
|
|
||||||
import { updateCheckerRouter } from "./router/update-checker";
|
|
||||||
import { userRouter } from "./router/user";
|
|
||||||
import { widgetRouter } from "./router/widgets";
|
|
||||||
import { createTRPCRouter } from "./trpc";
|
import { createTRPCRouter } from "./trpc";
|
||||||
|
|
||||||
export const appRouter = createTRPCRouter({
|
export const appRouter = createTRPCRouter({
|
||||||
user: userRouter,
|
user: lazy(() => import("./router/user").then((mod) => mod.userRouter)),
|
||||||
group: groupRouter,
|
group: lazy(() => import("./router/group").then((mod) => mod.groupRouter)),
|
||||||
invite: inviteRouter,
|
invite: lazy(() => import("./router/invite").then((mod) => mod.inviteRouter)),
|
||||||
integration: integrationRouter,
|
integration: lazy(() => import("./router/integration/integration-router").then((mod) => mod.integrationRouter)),
|
||||||
board: boardRouter,
|
board: lazy(() => import("./router/board").then((mod) => mod.boardRouter)),
|
||||||
section: sectionRouter,
|
section: lazy(() => import("./router/section/section-router").then((mod) => mod.sectionRouter)),
|
||||||
app: innerAppRouter,
|
app: lazy(() => import("./router/app").then((mod) => mod.appRouter)),
|
||||||
searchEngine: searchEngineRouter,
|
searchEngine: lazy(() => import("./router/search-engine/search-engine-router").then((mod) => mod.searchEngineRouter)),
|
||||||
widget: widgetRouter,
|
widget: lazy(() => import("./router/widgets").then((mod) => mod.widgetRouter)),
|
||||||
location: locationRouter,
|
location: lazy(() => import("./router/location").then((mod) => mod.locationRouter)),
|
||||||
log: logRouter,
|
log: lazy(() => import("./router/log").then((mod) => mod.logRouter)),
|
||||||
icon: iconsRouter,
|
icon: lazy(() => import("./router/icons").then((mod) => mod.iconsRouter)),
|
||||||
import: importRouter,
|
import: lazy(() => import("./router/import/import-router").then((mod) => mod.importRouter)),
|
||||||
onboard: onboardRouter,
|
onboard: lazy(() => import("./router/onboard/onboard-router").then((mod) => mod.onboardRouter)),
|
||||||
home: homeRouter,
|
home: lazy(() => import("./router/home").then((mod) => mod.homeRouter)),
|
||||||
docker: dockerRouter,
|
docker: lazy(() => import("./router/docker/docker-router").then((mod) => mod.dockerRouter)),
|
||||||
kubernetes: kubernetesRouter,
|
kubernetes: lazy(() => import("./router/kubernetes/router/kubernetes-router").then((mod) => mod.kubernetesRouter)),
|
||||||
serverSettings: serverSettingsRouter,
|
serverSettings: lazy(() => import("./router/serverSettings").then((mod) => mod.serverSettingsRouter)),
|
||||||
cronJobs: cronJobsRouter,
|
cronJobs: lazy(() => import("./router/cron-jobs").then((mod) => mod.cronJobsRouter)),
|
||||||
apiKeys: apiKeysRouter,
|
apiKeys: lazy(() => import("./router/apiKeys").then((mod) => mod.apiKeysRouter)),
|
||||||
media: mediaRouter,
|
media: lazy(() => import("./router/medias/media-router").then((mod) => mod.mediaRouter)),
|
||||||
updateChecker: updateCheckerRouter,
|
updateChecker: lazy(() => import("./router/update-checker").then((mod) => mod.updateCheckerRouter)),
|
||||||
certificates: certificateRouter,
|
certificates: lazy(() => import("./router/certificates/certificate-router").then((mod) => mod.certificateRouter)),
|
||||||
info: infoRouter,
|
bangs: lazy(() => import("./router/bangs/bangs-router").then((mod) => mod.bangsRouter)),
|
||||||
|
info: lazy(() => import("./router/info").then((mod) => mod.infoRouter)),
|
||||||
});
|
});
|
||||||
|
|
||||||
// export type definition of API
|
// export type definition of API
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { z } from "zod/v4";
|
import { z } from "zod/v4";
|
||||||
|
|
||||||
import { createSaltAsync, hashPasswordAsync } from "@homarr/auth";
|
import { hashPasswordAsync } from "@homarr/auth";
|
||||||
import { createId } from "@homarr/common";
|
import { createId } from "@homarr/common";
|
||||||
import { generateSecureRandomToken } from "@homarr/common/server";
|
import { generateSecureRandomToken } from "@homarr/common/server";
|
||||||
import { db, eq } from "@homarr/db";
|
import { db, eq } from "@homarr/db";
|
||||||
@@ -14,7 +14,6 @@ export const apiKeysRouter = createTRPCRouter({
|
|||||||
columns: {
|
columns: {
|
||||||
id: true,
|
id: true,
|
||||||
apiKey: false,
|
apiKey: false,
|
||||||
salt: false,
|
|
||||||
},
|
},
|
||||||
with: {
|
with: {
|
||||||
user: {
|
user: {
|
||||||
@@ -29,14 +28,12 @@ export const apiKeysRouter = createTRPCRouter({
|
|||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
create: permissionRequiredProcedure.requiresPermission("admin").mutation(async ({ ctx }) => {
|
create: permissionRequiredProcedure.requiresPermission("admin").mutation(async ({ ctx }) => {
|
||||||
const salt = await createSaltAsync();
|
|
||||||
const randomToken = generateSecureRandomToken(64);
|
const randomToken = generateSecureRandomToken(64);
|
||||||
const hashedRandomToken = await hashPasswordAsync(randomToken, salt);
|
const hashedRandomToken = await hashPasswordAsync(randomToken);
|
||||||
const id = createId();
|
const id = createId();
|
||||||
await db.insert(apiKeys).values({
|
await db.insert(apiKeys).values({
|
||||||
id,
|
id,
|
||||||
apiKey: hashedRandomToken,
|
apiKey: hashedRandomToken,
|
||||||
salt,
|
|
||||||
userId: ctx.session.user.id,
|
userId: ctx.session.user.id,
|
||||||
});
|
});
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
import { TRPCError } from "@trpc/server";
|
import { TRPCError } from "@trpc/server";
|
||||||
import { z } from "zod/v4";
|
import { z } from "zod/v4";
|
||||||
|
|
||||||
|
import type { Session } from "@homarr/auth";
|
||||||
import { createId } from "@homarr/common";
|
import { createId } from "@homarr/common";
|
||||||
|
import type { Database, InferSelectModel } from "@homarr/db";
|
||||||
import { asc, eq, inArray, like } from "@homarr/db";
|
import { asc, eq, inArray, like } from "@homarr/db";
|
||||||
import { apps } from "@homarr/db/schema";
|
import { apps } from "@homarr/db/schema";
|
||||||
import { selectAppSchema } from "@homarr/db/validationSchemas";
|
import { selectAppSchema } from "@homarr/db/validationSchemas";
|
||||||
@@ -11,7 +13,7 @@ import { byIdSchema, paginatedSchema } from "@homarr/validation/common";
|
|||||||
|
|
||||||
import { convertIntersectionToZodObject } from "../schema-merger";
|
import { convertIntersectionToZodObject } from "../schema-merger";
|
||||||
import { createTRPCRouter, permissionRequiredProcedure, protectedProcedure, publicProcedure } from "../trpc";
|
import { createTRPCRouter, permissionRequiredProcedure, protectedProcedure, publicProcedure } from "../trpc";
|
||||||
import { canUserSeeAppAsync } from "./app/app-access-control";
|
import { AppAccessControl } from "./app/app-access-control";
|
||||||
|
|
||||||
const defaultIcon = "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/homarr.svg";
|
const defaultIcon = "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/homarr.svg";
|
||||||
|
|
||||||
@@ -89,9 +91,8 @@ export const appRouter = createTRPCRouter({
|
|||||||
.output(selectAppSchema)
|
.output(selectAppSchema)
|
||||||
.meta({ openapi: { method: "GET", path: "/api/apps/{id}", tags: ["apps"], protect: true } })
|
.meta({ openapi: { method: "GET", path: "/api/apps/{id}", tags: ["apps"], protect: true } })
|
||||||
.query(async ({ ctx, input }) => {
|
.query(async ({ ctx, input }) => {
|
||||||
const app = await ctx.db.query.apps.findFirst({
|
const repository = new AppRepository(ctx.db, ctx.session?.user ?? null);
|
||||||
where: eq(apps.id, input.id),
|
const app = await repository.getByIdAsync(input.id);
|
||||||
});
|
|
||||||
|
|
||||||
if (!app) {
|
if (!app) {
|
||||||
throw new TRPCError({
|
throw new TRPCError({
|
||||||
@@ -100,20 +101,11 @@ export const appRouter = createTRPCRouter({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const canUserSeeApp = await canUserSeeAppAsync(ctx.session?.user ?? null, app.id);
|
|
||||||
if (!canUserSeeApp) {
|
|
||||||
throw new TRPCError({
|
|
||||||
code: "NOT_FOUND",
|
|
||||||
message: "App not found",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return app;
|
return app;
|
||||||
}),
|
}),
|
||||||
byIds: publicProcedure.input(z.array(z.string())).query(async ({ ctx, input }) => {
|
byIds: publicProcedure.input(z.array(z.string())).query(async ({ ctx, input }) => {
|
||||||
return await ctx.db.query.apps.findMany({
|
const repository = new AppRepository(ctx.db, ctx.session?.user ?? null);
|
||||||
where: inArray(apps.id, input),
|
return await repository.getByIdsAsync(input);
|
||||||
});
|
|
||||||
}),
|
}),
|
||||||
create: permissionRequiredProcedure
|
create: permissionRequiredProcedure
|
||||||
.requiresPermission("app-create")
|
.requiresPermission("app-create")
|
||||||
@@ -141,15 +133,13 @@ export const appRouter = createTRPCRouter({
|
|||||||
.output(z.void())
|
.output(z.void())
|
||||||
.mutation(async ({ ctx, input }) => {
|
.mutation(async ({ ctx, input }) => {
|
||||||
await ctx.db.insert(apps).values(
|
await ctx.db.insert(apps).values(
|
||||||
await Promise.all(
|
input.map((app) => ({
|
||||||
input.map(async (app) => ({
|
id: createId(),
|
||||||
id: createId(),
|
name: app.name,
|
||||||
name: app.name,
|
description: app.description,
|
||||||
description: app.description,
|
iconUrl: app.iconUrl ?? getIconForName(ctx.db, app.name).sync()?.url ?? defaultIcon,
|
||||||
iconUrl: app.iconUrl ?? (await getIconForName(ctx.db, app.name))?.url ?? defaultIcon,
|
href: app.href,
|
||||||
href: app.href,
|
})),
|
||||||
})),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
update: permissionRequiredProcedure
|
update: permissionRequiredProcedure
|
||||||
@@ -189,3 +179,30 @@ export const appRouter = createTRPCRouter({
|
|||||||
await ctx.db.delete(apps).where(eq(apps.id, input.id));
|
await ctx.db.delete(apps).where(eq(apps.id, input.id));
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
type App = InferSelectModel<typeof apps>;
|
||||||
|
|
||||||
|
export class AppRepository {
|
||||||
|
private readonly accessControl: AppAccessControl;
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private db: Database,
|
||||||
|
user: Session["user"] | null,
|
||||||
|
) {
|
||||||
|
this.accessControl = new AppAccessControl(db, user);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async getByIdAsync(id: string): Promise<App | null> {
|
||||||
|
const apps = await this.getByIdsAsync([id]);
|
||||||
|
return apps[0] ?? null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async getByIdsAsync(ids: string[]): Promise<App[]> {
|
||||||
|
const canUserSeeApps = await this.accessControl.canUserSeeAppsAsync(ids);
|
||||||
|
const dbApps = await this.db.query.apps.findMany({
|
||||||
|
where: inArray(apps.id, ids),
|
||||||
|
});
|
||||||
|
|
||||||
|
return canUserSeeApps ? dbApps : [];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,45 +1,52 @@
|
|||||||
import SuperJSON from "superjson";
|
import SuperJSON from "superjson";
|
||||||
|
|
||||||
import type { Session } from "@homarr/auth";
|
import type { Session } from "@homarr/auth";
|
||||||
import { db, eq, or } from "@homarr/db";
|
import type { Database } from "@homarr/db";
|
||||||
|
import { eq, or } from "@homarr/db";
|
||||||
import { items } from "@homarr/db/schema";
|
import { items } from "@homarr/db/schema";
|
||||||
|
|
||||||
import type { WidgetComponentProps } from "../../../../widgets/src";
|
import type { WidgetComponentProps } from "../../../../widgets/src";
|
||||||
|
|
||||||
export const canUserSeeAppAsync = async (user: Session["user"] | null, appId: string) => {
|
export class AppAccessControl {
|
||||||
return await canUserSeeAppsAsync(user, [appId]);
|
constructor(
|
||||||
};
|
private db: Database,
|
||||||
|
private user: Session["user"] | null,
|
||||||
|
) {}
|
||||||
|
|
||||||
export const canUserSeeAppsAsync = async (user: Session["user"] | null, appIds: string[]) => {
|
async canUserSeeAppAsync(appId: string) {
|
||||||
if (user) return true;
|
return await this.canUserSeeAppsAsync([appId]);
|
||||||
|
}
|
||||||
|
|
||||||
const appIdsOnPublicBoards = await getAllAppIdsOnPublicBoardsAsync();
|
async canUserSeeAppsAsync(appIds: string[]) {
|
||||||
return appIds.every((appId) => appIdsOnPublicBoards.includes(appId));
|
// Currently any user can see all apps if they are logged in
|
||||||
};
|
if (this.user) return true;
|
||||||
|
|
||||||
const getAllAppIdsOnPublicBoardsAsync = async () => {
|
const appIdsOnPublicBoards = await this.getAllAppIdsOnPublicBoardsAsync();
|
||||||
const itemsWithApps = await db.query.items.findMany({
|
return appIds.every((appId) => appIdsOnPublicBoards.includes(appId));
|
||||||
where: or(eq(items.kind, "app"), eq(items.kind, "bookmarks")),
|
}
|
||||||
with: {
|
|
||||||
board: {
|
private async getAllAppIdsOnPublicBoardsAsync() {
|
||||||
columns: {
|
const itemsWithApps = await this.db.query.items.findMany({
|
||||||
isPublic: true,
|
where: or(eq(items.kind, "app"), eq(items.kind, "bookmarks")),
|
||||||
|
with: {
|
||||||
|
board: {
|
||||||
|
columns: {
|
||||||
|
isPublic: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
});
|
||||||
});
|
|
||||||
|
return itemsWithApps
|
||||||
|
.filter((item) => item.board.isPublic)
|
||||||
|
.flatMap((item) => {
|
||||||
|
if (item.kind === "app") {
|
||||||
|
const parsedOptions = SuperJSON.parse<WidgetComponentProps<"app">["options"]>(item.options);
|
||||||
|
return [parsedOptions.appId];
|
||||||
|
}
|
||||||
|
|
||||||
return itemsWithApps
|
|
||||||
.filter((item) => item.board.isPublic)
|
|
||||||
.flatMap((item) => {
|
|
||||||
if (item.kind === "app") {
|
|
||||||
const parsedOptions = SuperJSON.parse<WidgetComponentProps<"app">["options"]>(item.options);
|
|
||||||
return [parsedOptions.appId];
|
|
||||||
} else if (item.kind === "bookmarks") {
|
|
||||||
const parsedOptions = SuperJSON.parse<WidgetComponentProps<"bookmarks">["options"]>(item.options);
|
const parsedOptions = SuperJSON.parse<WidgetComponentProps<"bookmarks">["options"]>(item.options);
|
||||||
return parsedOptions.items;
|
return parsedOptions.items;
|
||||||
}
|
});
|
||||||
|
}
|
||||||
throw new Error("Failed to get app ids from board. Invalid item kind: 'test'");
|
}
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import { z } from "zod/v4";
|
||||||
|
|
||||||
|
import { searchDuckDuckGoBangsAsync } from "../../services/duckduckgo-bangs";
|
||||||
|
import { createTRPCRouter, publicProcedure } from "../../trpc";
|
||||||
|
|
||||||
|
export const bangsRouter = createTRPCRouter({
|
||||||
|
search: publicProcedure
|
||||||
|
.input(
|
||||||
|
z.object({
|
||||||
|
query: z.string(),
|
||||||
|
limit: z.number().int().min(1).max(50).default(20),
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
.query(async ({ input }) => {
|
||||||
|
return await searchDuckDuckGoBangsAsync({ query: input.query, limit: input.limit });
|
||||||
|
}),
|
||||||
|
});
|
||||||
+543
-226
@@ -6,8 +6,8 @@ import { constructBoardPermissions } from "@homarr/auth/shared";
|
|||||||
import { createId } from "@homarr/common";
|
import { createId } from "@homarr/common";
|
||||||
import type { DeviceType } from "@homarr/common/server";
|
import type { DeviceType } from "@homarr/common/server";
|
||||||
import type { Database, InferInsertModel, InferSelectModel, SQL } from "@homarr/db";
|
import type { Database, InferInsertModel, InferSelectModel, SQL } from "@homarr/db";
|
||||||
import { and, asc, eq, inArray, isNull, like, not, or, sql } from "@homarr/db";
|
import { and, asc, eq, handleTransactionsAsync, inArray, isNull, like, not, or, sql } from "@homarr/db";
|
||||||
import { createDbInsertCollection } from "@homarr/db/collection";
|
import { createDbInsertCollectionWithoutTransaction } from "@homarr/db/collection";
|
||||||
import { getServerSettingByKeyAsync } from "@homarr/db/queries";
|
import { getServerSettingByKeyAsync } from "@homarr/db/queries";
|
||||||
import {
|
import {
|
||||||
boardGroupPermissions,
|
boardGroupPermissions,
|
||||||
@@ -273,7 +273,7 @@ export const boardRouter = createTRPCRouter({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const createBoardCollection = createDbInsertCollection(["boards", "sections", "layouts"]);
|
const createBoardCollection = createDbInsertCollectionWithoutTransaction(["boards", "sections", "layouts"]);
|
||||||
|
|
||||||
createBoardCollection.boards.push({
|
createBoardCollection.boards.push({
|
||||||
id: boardId,
|
id: boardId,
|
||||||
@@ -439,41 +439,86 @@ export const boardRouter = createTRPCRouter({
|
|||||||
})),
|
})),
|
||||||
);
|
);
|
||||||
|
|
||||||
await ctx.db.transaction(async (transaction) => {
|
await handleTransactionsAsync(ctx.db, {
|
||||||
transaction.insert(boards).values({
|
async handleAsync(db, schema) {
|
||||||
...boardProps,
|
await db.transaction(async (transaction) => {
|
||||||
id: newBoardId,
|
await transaction.insert(schema.boards).values({
|
||||||
name: input.name,
|
...boardProps,
|
||||||
creatorId: ctx.session.user.id,
|
id: newBoardId,
|
||||||
});
|
name: input.name,
|
||||||
|
creatorId: ctx.session.user.id,
|
||||||
|
});
|
||||||
|
|
||||||
if (layoutsToInsert.length > 0) {
|
if (layoutsToInsert.length > 0) {
|
||||||
await transaction.insert(layouts).values(layoutsToInsert);
|
await transaction.insert(schema.layouts).values(layoutsToInsert);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sectionsToInsert.length > 0) {
|
if (sectionsToInsert.length > 0) {
|
||||||
await transaction.insert(sections).values(sectionsToInsert);
|
await transaction.insert(schema.sections).values(sectionsToInsert);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sectionLayoutsToInsert.length > 0) {
|
if (sectionLayoutsToInsert.length > 0) {
|
||||||
await transaction.insert(sectionLayouts).values(sectionLayoutsToInsert);
|
await transaction.insert(schema.sectionLayouts).values(sectionLayoutsToInsert);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sectionCollapseStatesToInsert.length > 0) {
|
if (sectionCollapseStatesToInsert.length > 0) {
|
||||||
await transaction.insert(sectionCollapseStates).values(sectionCollapseStatesToInsert);
|
await transaction.insert(schema.sectionCollapseStates).values(sectionCollapseStatesToInsert);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (itemsToInsert.length > 0) {
|
if (itemsToInsert.length > 0) {
|
||||||
await transaction.insert(items).values(itemsToInsert);
|
await transaction.insert(schema.items).values(itemsToInsert);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (itemLayoutsToInsert.length > 0) {
|
if (itemLayoutsToInsert.length > 0) {
|
||||||
await transaction.insert(itemLayouts).values(itemLayoutsToInsert);
|
await transaction.insert(schema.itemLayouts).values(itemLayoutsToInsert);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (itemIntegrationsToInsert.length > 0) {
|
if (itemIntegrationsToInsert.length > 0) {
|
||||||
await transaction.insert(integrationItems).values(itemIntegrationsToInsert);
|
await transaction.insert(schema.integrationItems).values(itemIntegrationsToInsert);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleSync(db) {
|
||||||
|
db.transaction((transaction) => {
|
||||||
|
transaction
|
||||||
|
.insert(boards)
|
||||||
|
.values({
|
||||||
|
...boardProps,
|
||||||
|
id: newBoardId,
|
||||||
|
name: input.name,
|
||||||
|
creatorId: ctx.session.user.id,
|
||||||
|
})
|
||||||
|
.run();
|
||||||
|
|
||||||
|
if (layoutsToInsert.length > 0) {
|
||||||
|
transaction.insert(layouts).values(layoutsToInsert).run();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sectionsToInsert.length > 0) {
|
||||||
|
transaction.insert(sections).values(sectionsToInsert).run();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sectionLayoutsToInsert.length > 0) {
|
||||||
|
transaction.insert(sectionLayouts).values(sectionLayoutsToInsert).run();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sectionCollapseStatesToInsert.length > 0) {
|
||||||
|
transaction.insert(sectionCollapseStates).values(sectionCollapseStatesToInsert).run();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (itemsToInsert.length > 0) {
|
||||||
|
transaction.insert(items).values(itemsToInsert).run();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (itemLayoutsToInsert.length > 0) {
|
||||||
|
transaction.insert(itemLayouts).values(itemLayoutsToInsert).run();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (itemIntegrationsToInsert.length > 0) {
|
||||||
|
transaction.insert(integrationItems).values(itemIntegrationsToInsert).run();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
renameBoard: protectedProcedure.input(boardRenameSchema).mutation(async ({ ctx, input }) => {
|
renameBoard: protectedProcedure.input(boardRenameSchema).mutation(async ({ ctx, input }) => {
|
||||||
@@ -711,189 +756,415 @@ export const boardRouter = createTRPCRouter({
|
|||||||
|
|
||||||
const dbBoard = await getFullBoardWithWhereAsync(ctx.db, eq(boards.id, input.id), ctx.session.user.id);
|
const dbBoard = await getFullBoardWithWhereAsync(ctx.db, eq(boards.id, input.id), ctx.session.user.id);
|
||||||
|
|
||||||
await ctx.db.transaction(async (transaction) => {
|
await handleTransactionsAsync(ctx.db, {
|
||||||
const addedSections = filterAddedItems(input.sections, dbBoard.sections);
|
async handleAsync(db, schema) {
|
||||||
|
await db.transaction(async (transaction) => {
|
||||||
|
const addedSections = filterAddedItems(input.sections, dbBoard.sections);
|
||||||
|
|
||||||
if (addedSections.length > 0) {
|
if (addedSections.length > 0) {
|
||||||
await transaction.insert(sections).values(
|
await transaction.insert(schema.sections).values(
|
||||||
addedSections.map((section) => ({
|
addedSections.map((section) => ({
|
||||||
id: section.id,
|
id: section.id,
|
||||||
kind: section.kind,
|
kind: section.kind,
|
||||||
yOffset: section.kind !== "dynamic" ? section.yOffset : null,
|
yOffset: section.kind !== "dynamic" ? section.yOffset : null,
|
||||||
xOffset: section.kind === "dynamic" ? null : 0,
|
xOffset: section.kind === "dynamic" ? null : 0,
|
||||||
options: section.kind === "dynamic" ? superjson.stringify(section.options) : emptySuperJSON,
|
options: section.kind === "dynamic" ? superjson.stringify(section.options) : emptySuperJSON,
|
||||||
name: "name" in section ? section.name : null,
|
name: "name" in section ? section.name : null,
|
||||||
boardId: dbBoard.id,
|
boardId: dbBoard.id,
|
||||||
})),
|
})),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (addedSections.some((section) => section.kind === "dynamic")) {
|
if (addedSections.some((section) => section.kind === "dynamic")) {
|
||||||
await transaction.insert(sectionLayouts).values(
|
await transaction.insert(schema.sectionLayouts).values(
|
||||||
addedSections
|
addedSections
|
||||||
.filter((section) => section.kind === "dynamic")
|
.filter((section) => section.kind === "dynamic")
|
||||||
.flatMap((section) =>
|
.flatMap((section) =>
|
||||||
section.layouts.map(
|
section.layouts.map(
|
||||||
(sectionLayout): InferInsertModel<typeof sectionLayouts> => ({
|
(sectionLayout): InferInsertModel<typeof schema.sectionLayouts> => ({
|
||||||
layoutId: sectionLayout.layoutId,
|
layoutId: sectionLayout.layoutId,
|
||||||
sectionId: section.id,
|
sectionId: section.id,
|
||||||
parentSectionId: sectionLayout.parentSectionId,
|
parentSectionId: sectionLayout.parentSectionId,
|
||||||
height: sectionLayout.height,
|
height: sectionLayout.height,
|
||||||
width: sectionLayout.width,
|
width: sectionLayout.width,
|
||||||
xOffset: sectionLayout.xOffset,
|
xOffset: sectionLayout.xOffset,
|
||||||
yOffset: sectionLayout.yOffset,
|
yOffset: sectionLayout.yOffset,
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const addedItems = filterAddedItems(input.items, dbBoard.items);
|
||||||
|
|
||||||
|
if (addedItems.length > 0) {
|
||||||
|
await transaction.insert(schema.items).values(
|
||||||
|
addedItems.map((item) => ({
|
||||||
|
id: item.id,
|
||||||
|
kind: item.kind,
|
||||||
|
options: superjson.stringify(item.options),
|
||||||
|
advancedOptions: superjson.stringify(item.advancedOptions),
|
||||||
|
boardId: dbBoard.id,
|
||||||
|
})),
|
||||||
|
);
|
||||||
|
await transaction.insert(schema.itemLayouts).values(
|
||||||
|
addedItems.flatMap((item) =>
|
||||||
|
item.layouts.map(
|
||||||
|
(layoutSection): InferInsertModel<typeof schema.itemLayouts> => ({
|
||||||
|
layoutId: layoutSection.layoutId,
|
||||||
|
sectionId: layoutSection.sectionId,
|
||||||
|
itemId: item.id,
|
||||||
|
height: layoutSection.height,
|
||||||
|
width: layoutSection.width,
|
||||||
|
xOffset: layoutSection.xOffset,
|
||||||
|
yOffset: layoutSection.yOffset,
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const inputIntegrationRelations = input.items.flatMap(({ integrationIds, id: itemId }) =>
|
||||||
|
integrationIds.map((integrationId) => ({
|
||||||
|
integrationId,
|
||||||
|
itemId,
|
||||||
|
})),
|
||||||
);
|
);
|
||||||
}
|
const dbIntegrationRelations = dbBoard.items.flatMap(({ integrationIds, id: itemId }) =>
|
||||||
}
|
integrationIds.map((integrationId) => ({
|
||||||
|
integrationId,
|
||||||
const addedItems = filterAddedItems(input.items, dbBoard.items);
|
itemId,
|
||||||
|
})),
|
||||||
if (addedItems.length > 0) {
|
);
|
||||||
await transaction.insert(items).values(
|
const addedIntegrationRelations = inputIntegrationRelations.filter(
|
||||||
addedItems.map((item) => ({
|
|
||||||
id: item.id,
|
|
||||||
kind: item.kind,
|
|
||||||
options: superjson.stringify(item.options),
|
|
||||||
advancedOptions: superjson.stringify(item.advancedOptions),
|
|
||||||
boardId: dbBoard.id,
|
|
||||||
})),
|
|
||||||
);
|
|
||||||
await transaction.insert(itemLayouts).values(
|
|
||||||
addedItems.flatMap((item) =>
|
|
||||||
item.layouts.map(
|
|
||||||
(layoutSection): InferInsertModel<typeof itemLayouts> => ({
|
|
||||||
layoutId: layoutSection.layoutId,
|
|
||||||
sectionId: layoutSection.sectionId,
|
|
||||||
itemId: item.id,
|
|
||||||
height: layoutSection.height,
|
|
||||||
width: layoutSection.width,
|
|
||||||
xOffset: layoutSection.xOffset,
|
|
||||||
yOffset: layoutSection.yOffset,
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const inputIntegrationRelations = input.items.flatMap(({ integrationIds, id: itemId }) =>
|
|
||||||
integrationIds.map((integrationId) => ({
|
|
||||||
integrationId,
|
|
||||||
itemId,
|
|
||||||
})),
|
|
||||||
);
|
|
||||||
const dbIntegrationRelations = dbBoard.items.flatMap(({ integrationIds, id: itemId }) =>
|
|
||||||
integrationIds.map((integrationId) => ({
|
|
||||||
integrationId,
|
|
||||||
itemId,
|
|
||||||
})),
|
|
||||||
);
|
|
||||||
const addedIntegrationRelations = inputIntegrationRelations.filter(
|
|
||||||
(inputRelation) =>
|
|
||||||
!dbIntegrationRelations.some(
|
|
||||||
(dbRelation) =>
|
|
||||||
dbRelation.itemId === inputRelation.itemId && dbRelation.integrationId === inputRelation.integrationId,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
if (addedIntegrationRelations.length > 0) {
|
|
||||||
await transaction.insert(integrationItems).values(
|
|
||||||
addedIntegrationRelations.map((relation) => ({
|
|
||||||
itemId: relation.itemId,
|
|
||||||
integrationId: relation.integrationId,
|
|
||||||
})),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const updatedItems = filterUpdatedItems(input.items, dbBoard.items);
|
|
||||||
|
|
||||||
for (const item of updatedItems) {
|
|
||||||
await transaction
|
|
||||||
.update(items)
|
|
||||||
.set({
|
|
||||||
kind: item.kind,
|
|
||||||
options: superjson.stringify(item.options),
|
|
||||||
advancedOptions: superjson.stringify(item.advancedOptions),
|
|
||||||
})
|
|
||||||
.where(eq(items.id, item.id));
|
|
||||||
|
|
||||||
for (const itemSectionLayout of item.layouts) {
|
|
||||||
await transaction
|
|
||||||
.update(itemLayouts)
|
|
||||||
.set({
|
|
||||||
height: itemSectionLayout.height,
|
|
||||||
width: itemSectionLayout.width,
|
|
||||||
xOffset: itemSectionLayout.xOffset,
|
|
||||||
yOffset: itemSectionLayout.yOffset,
|
|
||||||
sectionId: itemSectionLayout.sectionId,
|
|
||||||
})
|
|
||||||
.where(and(eq(itemLayouts.itemId, item.id), eq(itemLayouts.layoutId, itemSectionLayout.layoutId)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const updatedSections = filterUpdatedItems(input.sections, dbBoard.sections);
|
|
||||||
|
|
||||||
for (const section of updatedSections) {
|
|
||||||
const prev = dbBoard.sections.find((dbSection) => dbSection.id === section.id);
|
|
||||||
await transaction
|
|
||||||
.update(sections)
|
|
||||||
.set({
|
|
||||||
yOffset: prev?.kind !== "dynamic" && "yOffset" in section ? section.yOffset : null,
|
|
||||||
xOffset: prev?.kind !== "dynamic" && "yOffset" in section ? 0 : null,
|
|
||||||
options: section.kind === "dynamic" ? superjson.stringify(section.options) : emptySuperJSON,
|
|
||||||
name: prev?.kind === "category" && "name" in section ? section.name : null,
|
|
||||||
})
|
|
||||||
.where(eq(sections.id, section.id));
|
|
||||||
|
|
||||||
if (section.kind !== "dynamic") continue;
|
|
||||||
|
|
||||||
for (const sectionLayout of section.layouts) {
|
|
||||||
await transaction
|
|
||||||
.update(sectionLayouts)
|
|
||||||
.set({
|
|
||||||
height: sectionLayout.height,
|
|
||||||
width: sectionLayout.width,
|
|
||||||
xOffset: sectionLayout.xOffset,
|
|
||||||
yOffset: sectionLayout.yOffset,
|
|
||||||
parentSectionId: sectionLayout.parentSectionId,
|
|
||||||
})
|
|
||||||
.where(and(eq(sectionLayouts.sectionId, section.id), eq(sectionLayouts.layoutId, sectionLayout.layoutId)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const removedIntegrationRelations = dbIntegrationRelations.filter(
|
|
||||||
(dbRelation) =>
|
|
||||||
!inputIntegrationRelations.some(
|
|
||||||
(inputRelation) =>
|
(inputRelation) =>
|
||||||
dbRelation.itemId === inputRelation.itemId && dbRelation.integrationId === inputRelation.integrationId,
|
!dbIntegrationRelations.some(
|
||||||
),
|
(dbRelation) =>
|
||||||
);
|
dbRelation.itemId === inputRelation.itemId &&
|
||||||
|
dbRelation.integrationId === inputRelation.integrationId,
|
||||||
for (const relation of removedIntegrationRelations) {
|
),
|
||||||
await transaction
|
|
||||||
.delete(integrationItems)
|
|
||||||
.where(
|
|
||||||
and(
|
|
||||||
eq(integrationItems.itemId, relation.itemId),
|
|
||||||
eq(integrationItems.integrationId, relation.integrationId),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
|
||||||
const removedItems = filterRemovedItems(input.items, dbBoard.items);
|
if (addedIntegrationRelations.length > 0) {
|
||||||
|
await transaction.insert(schema.integrationItems).values(
|
||||||
|
addedIntegrationRelations.map((relation) => ({
|
||||||
|
itemId: relation.itemId,
|
||||||
|
integrationId: relation.integrationId,
|
||||||
|
})),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const itemIds = removedItems.map((item) => item.id);
|
const updatedItems = filterUpdatedItems(input.items, dbBoard.items);
|
||||||
if (itemIds.length > 0) {
|
|
||||||
await transaction.delete(items).where(inArray(items.id, itemIds));
|
|
||||||
}
|
|
||||||
|
|
||||||
const removedSections = filterRemovedItems(input.sections, dbBoard.sections);
|
for (const item of updatedItems) {
|
||||||
const sectionIds = removedSections.map((section) => section.id);
|
await transaction
|
||||||
|
.update(schema.items)
|
||||||
|
.set({
|
||||||
|
kind: item.kind,
|
||||||
|
options: superjson.stringify(item.options),
|
||||||
|
advancedOptions: superjson.stringify(item.advancedOptions),
|
||||||
|
})
|
||||||
|
.where(eq(schema.items.id, item.id));
|
||||||
|
|
||||||
if (sectionIds.length > 0) {
|
for (const itemSectionLayout of item.layouts) {
|
||||||
await transaction.delete(sections).where(inArray(sections.id, sectionIds));
|
await transaction
|
||||||
}
|
.update(schema.itemLayouts)
|
||||||
|
.set({
|
||||||
|
height: itemSectionLayout.height,
|
||||||
|
width: itemSectionLayout.width,
|
||||||
|
xOffset: itemSectionLayout.xOffset,
|
||||||
|
yOffset: itemSectionLayout.yOffset,
|
||||||
|
sectionId: itemSectionLayout.sectionId,
|
||||||
|
})
|
||||||
|
.where(
|
||||||
|
and(
|
||||||
|
eq(schema.itemLayouts.itemId, item.id),
|
||||||
|
eq(schema.itemLayouts.layoutId, itemSectionLayout.layoutId),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const updatedSections = filterUpdatedItems(input.sections, dbBoard.sections);
|
||||||
|
|
||||||
|
for (const section of updatedSections) {
|
||||||
|
const prev = dbBoard.sections.find((dbSection) => dbSection.id === section.id);
|
||||||
|
await transaction
|
||||||
|
.update(schema.sections)
|
||||||
|
.set({
|
||||||
|
yOffset: prev?.kind !== "dynamic" && "yOffset" in section ? section.yOffset : null,
|
||||||
|
xOffset: prev?.kind !== "dynamic" && "yOffset" in section ? 0 : null,
|
||||||
|
options: section.kind === "dynamic" ? superjson.stringify(section.options) : emptySuperJSON,
|
||||||
|
name: prev?.kind === "category" && "name" in section ? section.name : null,
|
||||||
|
})
|
||||||
|
.where(eq(schema.sections.id, section.id));
|
||||||
|
|
||||||
|
if (section.kind !== "dynamic") continue;
|
||||||
|
|
||||||
|
for (const sectionLayout of section.layouts) {
|
||||||
|
await transaction
|
||||||
|
.update(schema.sectionLayouts)
|
||||||
|
.set({
|
||||||
|
height: sectionLayout.height,
|
||||||
|
width: sectionLayout.width,
|
||||||
|
xOffset: sectionLayout.xOffset,
|
||||||
|
yOffset: sectionLayout.yOffset,
|
||||||
|
parentSectionId: sectionLayout.parentSectionId,
|
||||||
|
})
|
||||||
|
.where(
|
||||||
|
and(
|
||||||
|
eq(schema.sectionLayouts.sectionId, section.id),
|
||||||
|
eq(schema.sectionLayouts.layoutId, sectionLayout.layoutId),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const removedIntegrationRelations = dbIntegrationRelations.filter(
|
||||||
|
(dbRelation) =>
|
||||||
|
!inputIntegrationRelations.some(
|
||||||
|
(inputRelation) =>
|
||||||
|
dbRelation.itemId === inputRelation.itemId &&
|
||||||
|
dbRelation.integrationId === inputRelation.integrationId,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
for (const relation of removedIntegrationRelations) {
|
||||||
|
await transaction
|
||||||
|
.delete(schema.integrationItems)
|
||||||
|
.where(
|
||||||
|
and(
|
||||||
|
eq(integrationItems.itemId, relation.itemId),
|
||||||
|
eq(integrationItems.integrationId, relation.integrationId),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const removedItems = filterRemovedItems(input.items, dbBoard.items);
|
||||||
|
|
||||||
|
const itemIds = removedItems.map((item) => item.id);
|
||||||
|
if (itemIds.length > 0) {
|
||||||
|
await transaction.delete(schema.items).where(inArray(schema.items.id, itemIds));
|
||||||
|
}
|
||||||
|
|
||||||
|
const removedSections = filterRemovedItems(input.sections, dbBoard.sections);
|
||||||
|
const sectionIds = removedSections.map((section) => section.id);
|
||||||
|
|
||||||
|
if (sectionIds.length > 0) {
|
||||||
|
await transaction.delete(schema.sections).where(inArray(schema.sections.id, sectionIds));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleSync(db) {
|
||||||
|
db.transaction((transaction) => {
|
||||||
|
const addedSections = filterAddedItems(input.sections, dbBoard.sections);
|
||||||
|
|
||||||
|
if (addedSections.length > 0) {
|
||||||
|
transaction
|
||||||
|
.insert(sections)
|
||||||
|
.values(
|
||||||
|
addedSections.map((section) => ({
|
||||||
|
id: section.id,
|
||||||
|
kind: section.kind,
|
||||||
|
yOffset: section.kind !== "dynamic" ? section.yOffset : null,
|
||||||
|
xOffset: section.kind === "dynamic" ? null : 0,
|
||||||
|
options: section.kind === "dynamic" ? superjson.stringify(section.options) : emptySuperJSON,
|
||||||
|
name: "name" in section ? section.name : null,
|
||||||
|
boardId: dbBoard.id,
|
||||||
|
})),
|
||||||
|
)
|
||||||
|
.run();
|
||||||
|
|
||||||
|
if (addedSections.some((section) => section.kind === "dynamic")) {
|
||||||
|
transaction
|
||||||
|
.insert(sectionLayouts)
|
||||||
|
.values(
|
||||||
|
addedSections
|
||||||
|
.filter((section) => section.kind === "dynamic")
|
||||||
|
.flatMap((section) =>
|
||||||
|
section.layouts.map(
|
||||||
|
(sectionLayout): InferInsertModel<typeof sectionLayouts> => ({
|
||||||
|
layoutId: sectionLayout.layoutId,
|
||||||
|
sectionId: section.id,
|
||||||
|
parentSectionId: sectionLayout.parentSectionId,
|
||||||
|
height: sectionLayout.height,
|
||||||
|
width: sectionLayout.width,
|
||||||
|
xOffset: sectionLayout.xOffset,
|
||||||
|
yOffset: sectionLayout.yOffset,
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.run();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const addedItems = filterAddedItems(input.items, dbBoard.items);
|
||||||
|
|
||||||
|
if (addedItems.length > 0) {
|
||||||
|
transaction
|
||||||
|
.insert(items)
|
||||||
|
.values(
|
||||||
|
addedItems.map((item) => ({
|
||||||
|
id: item.id,
|
||||||
|
kind: item.kind,
|
||||||
|
options: superjson.stringify(item.options),
|
||||||
|
advancedOptions: superjson.stringify(item.advancedOptions),
|
||||||
|
boardId: dbBoard.id,
|
||||||
|
})),
|
||||||
|
)
|
||||||
|
.run();
|
||||||
|
transaction
|
||||||
|
.insert(itemLayouts)
|
||||||
|
.values(
|
||||||
|
addedItems.flatMap((item) =>
|
||||||
|
item.layouts.map(
|
||||||
|
(layoutSection): InferInsertModel<typeof itemLayouts> => ({
|
||||||
|
layoutId: layoutSection.layoutId,
|
||||||
|
sectionId: layoutSection.sectionId,
|
||||||
|
itemId: item.id,
|
||||||
|
height: layoutSection.height,
|
||||||
|
width: layoutSection.width,
|
||||||
|
xOffset: layoutSection.xOffset,
|
||||||
|
yOffset: layoutSection.yOffset,
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.run();
|
||||||
|
}
|
||||||
|
|
||||||
|
const inputIntegrationRelations = input.items.flatMap(({ integrationIds, id: itemId }) =>
|
||||||
|
integrationIds.map((integrationId) => ({
|
||||||
|
integrationId,
|
||||||
|
itemId,
|
||||||
|
})),
|
||||||
|
);
|
||||||
|
const dbIntegrationRelations = dbBoard.items.flatMap(({ integrationIds, id: itemId }) =>
|
||||||
|
integrationIds.map((integrationId) => ({
|
||||||
|
integrationId,
|
||||||
|
itemId,
|
||||||
|
})),
|
||||||
|
);
|
||||||
|
const addedIntegrationRelations = inputIntegrationRelations.filter(
|
||||||
|
(inputRelation) =>
|
||||||
|
!dbIntegrationRelations.some(
|
||||||
|
(dbRelation) =>
|
||||||
|
dbRelation.itemId === inputRelation.itemId &&
|
||||||
|
dbRelation.integrationId === inputRelation.integrationId,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (addedIntegrationRelations.length > 0) {
|
||||||
|
transaction
|
||||||
|
.insert(integrationItems)
|
||||||
|
.values(
|
||||||
|
addedIntegrationRelations.map((relation) => ({
|
||||||
|
itemId: relation.itemId,
|
||||||
|
integrationId: relation.integrationId,
|
||||||
|
})),
|
||||||
|
)
|
||||||
|
.run();
|
||||||
|
}
|
||||||
|
|
||||||
|
const updatedItems = filterUpdatedItems(input.items, dbBoard.items);
|
||||||
|
|
||||||
|
for (const item of updatedItems) {
|
||||||
|
transaction
|
||||||
|
.update(items)
|
||||||
|
.set({
|
||||||
|
kind: item.kind,
|
||||||
|
options: superjson.stringify(item.options),
|
||||||
|
advancedOptions: superjson.stringify(item.advancedOptions),
|
||||||
|
})
|
||||||
|
.where(eq(items.id, item.id))
|
||||||
|
.run();
|
||||||
|
|
||||||
|
for (const itemSectionLayout of item.layouts) {
|
||||||
|
transaction
|
||||||
|
.update(itemLayouts)
|
||||||
|
.set({
|
||||||
|
height: itemSectionLayout.height,
|
||||||
|
width: itemSectionLayout.width,
|
||||||
|
xOffset: itemSectionLayout.xOffset,
|
||||||
|
yOffset: itemSectionLayout.yOffset,
|
||||||
|
sectionId: itemSectionLayout.sectionId,
|
||||||
|
})
|
||||||
|
.where(and(eq(itemLayouts.itemId, item.id), eq(itemLayouts.layoutId, itemSectionLayout.layoutId)))
|
||||||
|
.run();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const updatedSections = filterUpdatedItems(input.sections, dbBoard.sections);
|
||||||
|
|
||||||
|
for (const section of updatedSections) {
|
||||||
|
const prev = dbBoard.sections.find((dbSection) => dbSection.id === section.id);
|
||||||
|
transaction
|
||||||
|
.update(sections)
|
||||||
|
.set({
|
||||||
|
yOffset: prev?.kind !== "dynamic" && "yOffset" in section ? section.yOffset : null,
|
||||||
|
xOffset: prev?.kind !== "dynamic" && "yOffset" in section ? 0 : null,
|
||||||
|
options: section.kind === "dynamic" ? superjson.stringify(section.options) : emptySuperJSON,
|
||||||
|
name: prev?.kind === "category" && "name" in section ? section.name : null,
|
||||||
|
})
|
||||||
|
.where(eq(sections.id, section.id))
|
||||||
|
.run();
|
||||||
|
|
||||||
|
if (section.kind !== "dynamic") continue;
|
||||||
|
|
||||||
|
for (const sectionLayout of section.layouts) {
|
||||||
|
transaction
|
||||||
|
.update(sectionLayouts)
|
||||||
|
.set({
|
||||||
|
height: sectionLayout.height,
|
||||||
|
width: sectionLayout.width,
|
||||||
|
xOffset: sectionLayout.xOffset,
|
||||||
|
yOffset: sectionLayout.yOffset,
|
||||||
|
parentSectionId: sectionLayout.parentSectionId,
|
||||||
|
})
|
||||||
|
.where(
|
||||||
|
and(eq(sectionLayouts.sectionId, section.id), eq(sectionLayouts.layoutId, sectionLayout.layoutId)),
|
||||||
|
)
|
||||||
|
.run();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const removedIntegrationRelations = dbIntegrationRelations.filter(
|
||||||
|
(dbRelation) =>
|
||||||
|
!inputIntegrationRelations.some(
|
||||||
|
(inputRelation) =>
|
||||||
|
dbRelation.itemId === inputRelation.itemId &&
|
||||||
|
dbRelation.integrationId === inputRelation.integrationId,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
for (const relation of removedIntegrationRelations) {
|
||||||
|
transaction
|
||||||
|
.delete(integrationItems)
|
||||||
|
.where(
|
||||||
|
and(
|
||||||
|
eq(integrationItems.itemId, relation.itemId),
|
||||||
|
eq(integrationItems.integrationId, relation.integrationId),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.run();
|
||||||
|
}
|
||||||
|
|
||||||
|
const removedItems = filterRemovedItems(input.items, dbBoard.items);
|
||||||
|
|
||||||
|
const itemIds = removedItems.map((item) => item.id);
|
||||||
|
if (itemIds.length > 0) {
|
||||||
|
transaction.delete(items).where(inArray(items.id, itemIds)).run();
|
||||||
|
}
|
||||||
|
|
||||||
|
const removedSections = filterRemovedItems(input.sections, dbBoard.sections);
|
||||||
|
const sectionIds = removedSections.map((section) => section.id);
|
||||||
|
|
||||||
|
if (sectionIds.length > 0) {
|
||||||
|
transaction.delete(sections).where(inArray(sections.id, sectionIds)).run();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
getBoardPermissions: protectedProcedure.input(byIdSchema).query(async ({ input, ctx }) => {
|
getBoardPermissions: protectedProcedure.input(byIdSchema).query(async ({ input, ctx }) => {
|
||||||
@@ -971,35 +1242,81 @@ export const boardRouter = createTRPCRouter({
|
|||||||
saveUserBoardPermissions: protectedProcedure.input(boardSavePermissionsSchema).mutation(async ({ input, ctx }) => {
|
saveUserBoardPermissions: protectedProcedure.input(boardSavePermissionsSchema).mutation(async ({ input, ctx }) => {
|
||||||
await throwIfActionForbiddenAsync(ctx, eq(boards.id, input.entityId), "full");
|
await throwIfActionForbiddenAsync(ctx, eq(boards.id, input.entityId), "full");
|
||||||
|
|
||||||
await ctx.db.transaction(async (transaction) => {
|
await handleTransactionsAsync(ctx.db, {
|
||||||
await transaction.delete(boardUserPermissions).where(eq(boardUserPermissions.boardId, input.entityId));
|
async handleAsync(db, schema) {
|
||||||
if (input.permissions.length === 0) {
|
await db.transaction(async (transaction) => {
|
||||||
return;
|
await transaction.delete(schema.boardUserPermissions).where(eq(boardUserPermissions.boardId, input.entityId));
|
||||||
}
|
if (input.permissions.length === 0) {
|
||||||
await transaction.insert(boardUserPermissions).values(
|
return;
|
||||||
input.permissions.map((permission) => ({
|
}
|
||||||
userId: permission.principalId,
|
await transaction.insert(schema.boardUserPermissions).values(
|
||||||
permission: permission.permission,
|
input.permissions.map((permission) => ({
|
||||||
boardId: input.entityId,
|
userId: permission.principalId,
|
||||||
})),
|
permission: permission.permission,
|
||||||
);
|
boardId: input.entityId,
|
||||||
|
})),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleSync(db) {
|
||||||
|
db.transaction((transaction) => {
|
||||||
|
transaction.delete(boardUserPermissions).where(eq(boardUserPermissions.boardId, input.entityId)).run();
|
||||||
|
if (input.permissions.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
transaction
|
||||||
|
.insert(boardUserPermissions)
|
||||||
|
.values(
|
||||||
|
input.permissions.map((permission) => ({
|
||||||
|
userId: permission.principalId,
|
||||||
|
permission: permission.permission,
|
||||||
|
boardId: input.entityId,
|
||||||
|
})),
|
||||||
|
)
|
||||||
|
.run();
|
||||||
|
});
|
||||||
|
},
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
saveGroupBoardPermissions: protectedProcedure.input(boardSavePermissionsSchema).mutation(async ({ input, ctx }) => {
|
saveGroupBoardPermissions: protectedProcedure.input(boardSavePermissionsSchema).mutation(async ({ input, ctx }) => {
|
||||||
await throwIfActionForbiddenAsync(ctx, eq(boards.id, input.entityId), "full");
|
await throwIfActionForbiddenAsync(ctx, eq(boards.id, input.entityId), "full");
|
||||||
|
|
||||||
await ctx.db.transaction(async (transaction) => {
|
await handleTransactionsAsync(ctx.db, {
|
||||||
await transaction.delete(boardGroupPermissions).where(eq(boardGroupPermissions.boardId, input.entityId));
|
async handleAsync(db, schema) {
|
||||||
if (input.permissions.length === 0) {
|
await db.transaction(async (transaction) => {
|
||||||
return;
|
await transaction
|
||||||
}
|
.delete(schema.boardGroupPermissions)
|
||||||
await transaction.insert(boardGroupPermissions).values(
|
.where(eq(boardGroupPermissions.boardId, input.entityId));
|
||||||
input.permissions.map((permission) => ({
|
if (input.permissions.length === 0) {
|
||||||
groupId: permission.principalId,
|
return;
|
||||||
permission: permission.permission,
|
}
|
||||||
boardId: input.entityId,
|
await transaction.insert(schema.boardGroupPermissions).values(
|
||||||
})),
|
input.permissions.map((permission) => ({
|
||||||
);
|
groupId: permission.principalId,
|
||||||
|
permission: permission.permission,
|
||||||
|
boardId: input.entityId,
|
||||||
|
})),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleSync(db) {
|
||||||
|
db.transaction((transaction) => {
|
||||||
|
transaction.delete(boardGroupPermissions).where(eq(boardGroupPermissions.boardId, input.entityId)).run();
|
||||||
|
if (input.permissions.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
transaction
|
||||||
|
.insert(boardGroupPermissions)
|
||||||
|
.values(
|
||||||
|
input.permissions.map((permission) => ({
|
||||||
|
groupId: permission.principalId,
|
||||||
|
permission: permission.permission,
|
||||||
|
boardId: input.entityId,
|
||||||
|
})),
|
||||||
|
)
|
||||||
|
.run();
|
||||||
|
});
|
||||||
|
},
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
importOldmarrConfig: permissionRequiredProcedure
|
importOldmarrConfig: permissionRequiredProcedure
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ export const certificateRouter = createTRPCRouter({
|
|||||||
hostname: input.hostname,
|
hostname: input.hostname,
|
||||||
thumbprint: input.thumbprint,
|
thumbprint: input.thumbprint,
|
||||||
});
|
});
|
||||||
await ctx.db
|
const dbResult = await ctx.db
|
||||||
.delete(trustedCertificateHostnames)
|
.delete(trustedCertificateHostnames)
|
||||||
.where(
|
.where(
|
||||||
and(
|
and(
|
||||||
@@ -103,6 +103,7 @@ export const certificateRouter = createTRPCRouter({
|
|||||||
logger.info("Removed trusted hostname", {
|
logger.info("Removed trusted hostname", {
|
||||||
hostname: input.hostname,
|
hostname: input.hostname,
|
||||||
thumbprint: input.thumbprint,
|
thumbprint: input.thumbprint,
|
||||||
|
count: dbResult.changes,
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
removeCertificate: permissionRequiredProcedure
|
removeCertificate: permissionRequiredProcedure
|
||||||
|
|||||||
@@ -2,59 +2,62 @@ import { observable } from "@trpc/server/observable";
|
|||||||
import z from "zod/v4";
|
import z from "zod/v4";
|
||||||
|
|
||||||
import { createLogger } from "@homarr/core/infrastructure/logs";
|
import { createLogger } from "@homarr/core/infrastructure/logs";
|
||||||
import { cronExpressionSchema, jobGroupKeys, jobNameSchema } from "@homarr/cron-job-api";
|
|
||||||
import { cronJobApi } from "@homarr/cron-job-api/client";
|
|
||||||
import type { TaskStatus } from "@homarr/cron-job-status";
|
import type { TaskStatus } from "@homarr/cron-job-status";
|
||||||
import { createCronJobStatusChannel } from "@homarr/cron-job-status";
|
import { createCronJobStatusChannel } from "@homarr/cron-job-status";
|
||||||
|
import { jobGroup } from "@homarr/cron-jobs";
|
||||||
|
import { JobManager } from "@homarr/cron-jobs/job-manager";
|
||||||
|
|
||||||
import { createTRPCRouter, permissionRequiredProcedure } from "../trpc";
|
import { createTRPCRouter, permissionRequiredProcedure } from "../trpc";
|
||||||
|
|
||||||
|
const jobGroupKeys = jobGroup.getKeys();
|
||||||
|
const jobNameSchema = z.enum(jobGroup.getKeys());
|
||||||
|
|
||||||
const logger = createLogger({ module: "cronJobsRouter" });
|
const logger = createLogger({ module: "cronJobsRouter" });
|
||||||
|
|
||||||
export const cronJobsRouter = createTRPCRouter({
|
export const cronJobsRouter = createTRPCRouter({
|
||||||
triggerJob: permissionRequiredProcedure
|
triggerJob: permissionRequiredProcedure
|
||||||
.requiresPermission("admin")
|
.requiresPermission("admin")
|
||||||
.input(jobNameSchema)
|
.input(jobNameSchema)
|
||||||
.mutation(async ({ input }) => {
|
.mutation(async ({ input, ctx }) => {
|
||||||
await cronJobApi.trigger.mutate(input);
|
await new JobManager(ctx.db, jobGroup).triggerAsync(input);
|
||||||
}),
|
}),
|
||||||
startJob: permissionRequiredProcedure
|
startJob: permissionRequiredProcedure
|
||||||
.requiresPermission("admin")
|
.requiresPermission("admin")
|
||||||
.input(jobNameSchema)
|
.input(jobNameSchema)
|
||||||
.mutation(async ({ input }) => {
|
.mutation(async ({ input, ctx }) => {
|
||||||
await cronJobApi.start.mutate(input);
|
await new JobManager(ctx.db, jobGroup).startAsync(input);
|
||||||
}),
|
}),
|
||||||
stopJob: permissionRequiredProcedure
|
stopJob: permissionRequiredProcedure
|
||||||
.requiresPermission("admin")
|
.requiresPermission("admin")
|
||||||
.input(jobNameSchema)
|
.input(jobNameSchema)
|
||||||
.mutation(async ({ input }) => {
|
.mutation(({ input, ctx }) => {
|
||||||
await cronJobApi.stop.mutate(input);
|
new JobManager(ctx.db, jobGroup).stop(input);
|
||||||
}),
|
}),
|
||||||
updateJobInterval: permissionRequiredProcedure
|
updateJobInterval: permissionRequiredProcedure
|
||||||
.requiresPermission("admin")
|
.requiresPermission("admin")
|
||||||
.input(
|
.input(
|
||||||
z.object({
|
z.object({
|
||||||
name: jobNameSchema,
|
name: jobNameSchema,
|
||||||
cron: cronExpressionSchema,
|
cron: z.string(),
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.mutation(async ({ input }) => {
|
.mutation(async ({ input, ctx }) => {
|
||||||
await cronJobApi.updateInterval.mutate(input);
|
await new JobManager(ctx.db, jobGroup).updateIntervalAsync(input.name, input.cron);
|
||||||
}),
|
}),
|
||||||
disableJob: permissionRequiredProcedure
|
disableJob: permissionRequiredProcedure
|
||||||
.requiresPermission("admin")
|
.requiresPermission("admin")
|
||||||
.input(jobNameSchema)
|
.input(jobNameSchema)
|
||||||
.mutation(async ({ input }) => {
|
.mutation(async ({ input, ctx }) => {
|
||||||
await cronJobApi.disable.mutate(input);
|
await new JobManager(ctx.db, jobGroup).disableAsync(input);
|
||||||
}),
|
}),
|
||||||
enableJob: permissionRequiredProcedure
|
enableJob: permissionRequiredProcedure
|
||||||
.requiresPermission("admin")
|
.requiresPermission("admin")
|
||||||
.input(jobNameSchema)
|
.input(jobNameSchema)
|
||||||
.mutation(async ({ input }) => {
|
.mutation(async ({ input, ctx }) => {
|
||||||
await cronJobApi.enable.mutate(input);
|
await new JobManager(ctx.db, jobGroup).enableAsync(input);
|
||||||
}),
|
}),
|
||||||
getJobs: permissionRequiredProcedure.requiresPermission("admin").query(async () => {
|
getJobs: permissionRequiredProcedure.requiresPermission("admin").query(async ({ ctx }) => {
|
||||||
return await cronJobApi.getAll.query();
|
return await new JobManager(ctx.db, jobGroup).getAllAsync();
|
||||||
}),
|
}),
|
||||||
subscribeToStatusUpdates: permissionRequiredProcedure.requiresPermission("admin").subscription(() => {
|
subscribeToStatusUpdates: permissionRequiredProcedure.requiresPermission("admin").subscription(() => {
|
||||||
return observable<TaskStatus>((emit) => {
|
return observable<TaskStatus>((emit) => {
|
||||||
|
|||||||
@@ -138,9 +138,10 @@ const getContainerOrThrowAsync = async (id: string) => {
|
|||||||
interface DockerContainer {
|
interface DockerContainer {
|
||||||
name: string;
|
name: string;
|
||||||
id: string;
|
id: string;
|
||||||
|
host: string;
|
||||||
state: ContainerState;
|
state: ContainerState;
|
||||||
image: string;
|
image: string;
|
||||||
ports: Port[];
|
ports: Port[] | undefined;
|
||||||
iconUrl: string | null;
|
iconUrl: string | null;
|
||||||
cpuUsage: number;
|
cpuUsage: number;
|
||||||
memoryUsage: number;
|
memoryUsage: number;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { z } from "zod/v4";
|
|||||||
|
|
||||||
import { createId } from "@homarr/common";
|
import { createId } from "@homarr/common";
|
||||||
import type { Database } from "@homarr/db";
|
import type { Database } from "@homarr/db";
|
||||||
import { and, eq, like, not } from "@homarr/db";
|
import { and, eq, handleTransactionsAsync, like, not } from "@homarr/db";
|
||||||
import { getMaxGroupPositionAsync } from "@homarr/db/queries";
|
import { getMaxGroupPositionAsync } from "@homarr/db/queries";
|
||||||
import { groupMembers, groupPermissions, groups } from "@homarr/db/schema";
|
import { groupMembers, groupPermissions, groups } from "@homarr/db/schema";
|
||||||
import { everyoneGroup } from "@homarr/definitions";
|
import { everyoneGroup } from "@homarr/definitions";
|
||||||
@@ -252,10 +252,21 @@ export const groupRouter = createTRPCRouter({
|
|||||||
.mutation(async ({ input, ctx }) => {
|
.mutation(async ({ input, ctx }) => {
|
||||||
const positions = input.positions.map((id, index) => ({ id, position: index + 1 }));
|
const positions = input.positions.map((id, index) => ({ id, position: index + 1 }));
|
||||||
|
|
||||||
await ctx.db.transaction(async (trx) => {
|
await handleTransactionsAsync(ctx.db, {
|
||||||
for (const { id, position } of positions) {
|
handleAsync: async (db, schema) => {
|
||||||
await trx.update(groups).set({ position }).where(eq(groups.id, id));
|
await db.transaction(async (trx) => {
|
||||||
}
|
for (const { id, position } of positions) {
|
||||||
|
await trx.update(schema.groups).set({ position }).where(eq(groups.id, id));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleSync: (db) => {
|
||||||
|
db.transaction((trx) => {
|
||||||
|
for (const { id, position } of positions) {
|
||||||
|
trx.update(groups).set({ position }).where(eq(groups.id, id)).run();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
savePermissions: permissionRequiredProcedure
|
savePermissions: permissionRequiredProcedure
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { createId, objectEntries } from "@homarr/common";
|
|||||||
import { decryptSecret, encryptSecret } from "@homarr/common/server";
|
import { decryptSecret, encryptSecret } from "@homarr/common/server";
|
||||||
import { createLogger } from "@homarr/core/infrastructure/logs";
|
import { createLogger } from "@homarr/core/infrastructure/logs";
|
||||||
import type { Database } from "@homarr/db";
|
import type { Database } from "@homarr/db";
|
||||||
import { and, asc, eq, inArray, like, or } from "@homarr/db";
|
import { and, asc, eq, handleTransactionsAsync, inArray, like, or } from "@homarr/db";
|
||||||
import {
|
import {
|
||||||
apps,
|
apps,
|
||||||
groupMembers,
|
groupMembers,
|
||||||
@@ -43,15 +43,15 @@ import { mapTestConnectionError } from "./map-test-connection-error";
|
|||||||
const logger = createLogger({ module: "integrationRouter" });
|
const logger = createLogger({ module: "integrationRouter" });
|
||||||
|
|
||||||
export const integrationRouter = createTRPCRouter({
|
export const integrationRouter = createTRPCRouter({
|
||||||
all: publicProcedure.query(async ({ ctx }) => {
|
all: protectedProcedure.query(async ({ ctx }) => {
|
||||||
const groupsOfCurrentUser = await ctx.db.query.groupMembers.findMany({
|
const groupsOfCurrentUser = await ctx.db.query.groupMembers.findMany({
|
||||||
where: eq(groupMembers.userId, ctx.session?.user.id ?? ""),
|
where: eq(groupMembers.userId, ctx.session.user.id),
|
||||||
});
|
});
|
||||||
|
|
||||||
const integrations = await ctx.db.query.integrations.findMany({
|
const integrations = await ctx.db.query.integrations.findMany({
|
||||||
with: {
|
with: {
|
||||||
userPermissions: {
|
userPermissions: {
|
||||||
where: eq(integrationUserPermissions.userId, ctx.session?.user.id ?? ""),
|
where: eq(integrationUserPermissions.userId, ctx.session.user.id),
|
||||||
},
|
},
|
||||||
groupPermissions: {
|
groupPermissions: {
|
||||||
where: inArray(
|
where: inArray(
|
||||||
@@ -85,15 +85,15 @@ export const integrationRouter = createTRPCRouter({
|
|||||||
integrationKinds.indexOf(integrationA.kind) - integrationKinds.indexOf(integrationB.kind),
|
integrationKinds.indexOf(integrationA.kind) - integrationKinds.indexOf(integrationB.kind),
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
allThatSupportSearch: publicProcedure.query(async ({ ctx }) => {
|
allThatSupportSearch: protectedProcedure.query(async ({ ctx }) => {
|
||||||
const groupsOfCurrentUser = await ctx.db.query.groupMembers.findMany({
|
const groupsOfCurrentUser = await ctx.db.query.groupMembers.findMany({
|
||||||
where: eq(groupMembers.userId, ctx.session?.user.id ?? ""),
|
where: eq(groupMembers.userId, ctx.session.user.id),
|
||||||
});
|
});
|
||||||
|
|
||||||
const integrationsFromDb = await ctx.db.query.integrations.findMany({
|
const integrationsFromDb = await ctx.db.query.integrations.findMany({
|
||||||
with: {
|
with: {
|
||||||
userPermissions: {
|
userPermissions: {
|
||||||
where: eq(integrationUserPermissions.userId, ctx.session?.user.id ?? ""),
|
where: eq(integrationUserPermissions.userId, ctx.session.user.id),
|
||||||
},
|
},
|
||||||
groupPermissions: {
|
groupPermissions: {
|
||||||
where: inArray(
|
where: inArray(
|
||||||
@@ -133,7 +133,7 @@ export const integrationRouter = createTRPCRouter({
|
|||||||
integrationKinds.indexOf(integrationA.kind) - integrationKinds.indexOf(integrationB.kind),
|
integrationKinds.indexOf(integrationA.kind) - integrationKinds.indexOf(integrationB.kind),
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
allOfGivenCategory: publicProcedure
|
allOfGivenCategory: protectedProcedure
|
||||||
.input(
|
.input(
|
||||||
z.object({
|
z.object({
|
||||||
category: z.enum(integrationCategories),
|
category: z.enum(integrationCategories),
|
||||||
@@ -141,7 +141,7 @@ export const integrationRouter = createTRPCRouter({
|
|||||||
)
|
)
|
||||||
.query(async ({ ctx, input }) => {
|
.query(async ({ ctx, input }) => {
|
||||||
const groupsOfCurrentUser = await ctx.db.query.groupMembers.findMany({
|
const groupsOfCurrentUser = await ctx.db.query.groupMembers.findMany({
|
||||||
where: eq(groupMembers.userId, ctx.session?.user.id ?? ""),
|
where: eq(groupMembers.userId, ctx.session.user.id),
|
||||||
});
|
});
|
||||||
|
|
||||||
const intergrationKinds = getIntegrationKindsByCategory(input.category);
|
const intergrationKinds = getIntegrationKindsByCategory(input.category);
|
||||||
@@ -149,7 +149,7 @@ export const integrationRouter = createTRPCRouter({
|
|||||||
const integrationsFromDb = await ctx.db.query.integrations.findMany({
|
const integrationsFromDb = await ctx.db.query.integrations.findMany({
|
||||||
with: {
|
with: {
|
||||||
userPermissions: {
|
userPermissions: {
|
||||||
where: eq(integrationUserPermissions.userId, ctx.session?.user.id ?? ""),
|
where: eq(integrationUserPermissions.userId, ctx.session.user.id),
|
||||||
},
|
},
|
||||||
groupPermissions: {
|
groupPermissions: {
|
||||||
where: inArray(
|
where: inArray(
|
||||||
@@ -524,20 +524,45 @@ export const integrationRouter = createTRPCRouter({
|
|||||||
.mutation(async ({ input, ctx }) => {
|
.mutation(async ({ input, ctx }) => {
|
||||||
await throwIfActionForbiddenAsync(ctx, eq(integrations.id, input.entityId), "full");
|
await throwIfActionForbiddenAsync(ctx, eq(integrations.id, input.entityId), "full");
|
||||||
|
|
||||||
await ctx.db.transaction(async (transaction) => {
|
await handleTransactionsAsync(ctx.db, {
|
||||||
await transaction
|
async handleAsync(db, schema) {
|
||||||
.delete(integrationUserPermissions)
|
await ctx.db.transaction(async (transaction) => {
|
||||||
.where(eq(integrationUserPermissions.integrationId, input.entityId));
|
await transaction
|
||||||
if (input.permissions.length === 0) {
|
.delete(schema.integrationUserPermissions)
|
||||||
return;
|
.where(eq(schema.integrationUserPermissions.integrationId, input.entityId));
|
||||||
}
|
if (input.permissions.length === 0) {
|
||||||
await transaction.insert(integrationUserPermissions).values(
|
return;
|
||||||
input.permissions.map((permission) => ({
|
}
|
||||||
userId: permission.principalId,
|
await transaction.insert(schema.integrationUserPermissions).values(
|
||||||
permission: permission.permission,
|
input.permissions.map((permission) => ({
|
||||||
integrationId: input.entityId,
|
userId: permission.principalId,
|
||||||
})),
|
permission: permission.permission,
|
||||||
);
|
integrationId: input.entityId,
|
||||||
|
})),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleSync(db) {
|
||||||
|
db.transaction((transaction) => {
|
||||||
|
transaction
|
||||||
|
.delete(integrationUserPermissions)
|
||||||
|
.where(eq(integrationUserPermissions.integrationId, input.entityId))
|
||||||
|
.run();
|
||||||
|
if (input.permissions.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
transaction
|
||||||
|
.insert(integrationUserPermissions)
|
||||||
|
.values(
|
||||||
|
input.permissions.map((permission) => ({
|
||||||
|
userId: permission.principalId,
|
||||||
|
permission: permission.permission,
|
||||||
|
integrationId: input.entityId,
|
||||||
|
})),
|
||||||
|
)
|
||||||
|
.run();
|
||||||
|
});
|
||||||
|
},
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
saveGroupIntegrationPermissions: protectedProcedure
|
saveGroupIntegrationPermissions: protectedProcedure
|
||||||
@@ -545,20 +570,45 @@ export const integrationRouter = createTRPCRouter({
|
|||||||
.mutation(async ({ input, ctx }) => {
|
.mutation(async ({ input, ctx }) => {
|
||||||
await throwIfActionForbiddenAsync(ctx, eq(integrations.id, input.entityId), "full");
|
await throwIfActionForbiddenAsync(ctx, eq(integrations.id, input.entityId), "full");
|
||||||
|
|
||||||
await ctx.db.transaction(async (transaction) => {
|
await handleTransactionsAsync(ctx.db, {
|
||||||
await transaction
|
async handleAsync(db, schema) {
|
||||||
.delete(integrationGroupPermissions)
|
await db.transaction(async (transaction) => {
|
||||||
.where(eq(integrationGroupPermissions.integrationId, input.entityId));
|
await transaction
|
||||||
if (input.permissions.length === 0) {
|
.delete(schema.integrationGroupPermissions)
|
||||||
return;
|
.where(eq(schema.integrationGroupPermissions.integrationId, input.entityId));
|
||||||
}
|
if (input.permissions.length === 0) {
|
||||||
await transaction.insert(integrationGroupPermissions).values(
|
return;
|
||||||
input.permissions.map((permission) => ({
|
}
|
||||||
groupId: permission.principalId,
|
await transaction.insert(schema.integrationGroupPermissions).values(
|
||||||
permission: permission.permission,
|
input.permissions.map((permission) => ({
|
||||||
integrationId: input.entityId,
|
groupId: permission.principalId,
|
||||||
})),
|
permission: permission.permission,
|
||||||
);
|
integrationId: input.entityId,
|
||||||
|
})),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleSync(db) {
|
||||||
|
db.transaction((transaction) => {
|
||||||
|
transaction
|
||||||
|
.delete(integrationGroupPermissions)
|
||||||
|
.where(eq(integrationGroupPermissions.integrationId, input.entityId))
|
||||||
|
.run();
|
||||||
|
if (input.permissions.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
transaction
|
||||||
|
.insert(integrationGroupPermissions)
|
||||||
|
.values(
|
||||||
|
input.permissions.map((permission) => ({
|
||||||
|
groupId: permission.principalId,
|
||||||
|
permission: permission.permission,
|
||||||
|
integrationId: input.entityId,
|
||||||
|
})),
|
||||||
|
)
|
||||||
|
.run();
|
||||||
|
});
|
||||||
|
},
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
searchInIntegration: protectedProcedure
|
searchInIntegration: protectedProcedure
|
||||||
|
|||||||
Loaded 100 of 443 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user