fix
This commit is contained in:
parent
2982655f0a
commit
4ed958b181
@ -1,5 +0,0 @@
|
|||||||
DATABASE_URL="drainpipe.db"
|
|
||||||
FRONTPAGE_CONSUMER_URL="http://${cloudflared}/api/receive_hook"
|
|
||||||
FRONTPAGE_CONSUMER_SECRET=`openssl ecparam --name secp256k1 --genkey --noout --outform DER | tail --bytes=+8 | head --bytes=32 | xxd --plain --cols 32`
|
|
||||||
|
|
||||||
#RELAY_URL=wss://syu.is
|
|
@ -1,20 +0,0 @@
|
|||||||
FROM rust:1.78-alpine AS builder
|
|
||||||
|
|
||||||
RUN apk add libressl-dev musl-dev sqlite-dev
|
|
||||||
|
|
||||||
WORKDIR /usr/src/unravel
|
|
||||||
COPY . .
|
|
||||||
# TODO: Use cargo-chef to cache dependencies compilation independently of the binary
|
|
||||||
RUN --mount=type=cache,target=/usr/local/cargo/registry \
|
|
||||||
--mount=type=cache,target=/root/target \
|
|
||||||
cargo build --release --package drainpipe && \
|
|
||||||
# Move the release binary to a folder to be copied to the final image. It can't be copied directly from the target folder because it's in a cache mount
|
|
||||||
# See https://gist.github.com/noelbundick/6922d26667616e2ba5c3aff59f0824cd?permalink_comment_id=4379948#gistcomment-4379948
|
|
||||||
mv ./target/release /root
|
|
||||||
|
|
||||||
FROM alpine:3.14
|
|
||||||
COPY --from=builder /root/release/drainpipe /
|
|
||||||
|
|
||||||
ENV DATABASE_URL="/drainpipedata/drainpipe.db"
|
|
||||||
|
|
||||||
ENTRYPOINT ["/drainpipe"]
|
|
@ -1,9 +0,0 @@
|
|||||||
services:
|
|
||||||
drainpipe:
|
|
||||||
build:
|
|
||||||
dockerfile: ./packages-rs/drainpipe/Dockerfile
|
|
||||||
context: ../../
|
|
||||||
env_file:
|
|
||||||
- ./.env.local
|
|
||||||
volumes:
|
|
||||||
- ./drainpipedata:/drainpipedata
|
|
@ -1,10 +0,0 @@
|
|||||||
FROM node:20
|
|
||||||
|
|
||||||
RUN npm install -g pnpm
|
|
||||||
WORKDIR /app
|
|
||||||
RUN git clone https://github.com/likeandscribe/frontpage
|
|
||||||
WORKDIR /app/frontpage/packages/atproto-browser
|
|
||||||
RUN pnpm i
|
|
||||||
RUN pnpm build
|
|
||||||
|
|
||||||
CMD [ "pnpm", "start"]
|
|
@ -1,8 +0,0 @@
|
|||||||
services:
|
|
||||||
atbrowser:
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
ports:
|
|
||||||
- "3000:3000"
|
|
||||||
environment:
|
|
||||||
- WATCHPACK_POLLING=true
|
|
@ -1,14 +0,0 @@
|
|||||||
PRIVATE_JWK=`pnpm exec tsx ./scripts/generate-jwk.mts`
|
|
||||||
PUBLIC_JWK=`pnpm exec tsx ./scripts/generate-jwk.mts`
|
|
||||||
|
|
||||||
TURSO_CONNECTION_URL=libsql://xxx.turso.io
|
|
||||||
#TURSO_CONNECTION_URL=`turso db shell xxx-xxx`
|
|
||||||
TURSO_AUTH_TOKEN=`turso db tokens create xxx-xxx`
|
|
||||||
|
|
||||||
DRAINPIPE_CONSUMER_SECRET=`openssl ecparam --name secp256k1 --genkey --noout --outform DER | tail --bytes=+8 | head --bytes=32 | xxd --plain --cols 32`
|
|
||||||
VERCEL_PROJECT_PRODUCTION_URL=example.com
|
|
||||||
VERCEL_BRANCH_URL=example.com
|
|
||||||
|
|
||||||
#DRAINPIPE_CONSUMER_SECRET=secret
|
|
||||||
#TURSO_CONNECTION_URL=libsql://turso.dev.unravel.fyi
|
|
||||||
#PLC_DIRECTORY_URL=https://plc.dev.unravel.fyi
|
|
@ -1,17 +0,0 @@
|
|||||||
FROM node:20
|
|
||||||
|
|
||||||
RUN npm install -g pnpm
|
|
||||||
WORKDIR /app
|
|
||||||
RUN git clone https://github.com/likeandscribe/frontpage
|
|
||||||
WORKDIR /app/frontpage
|
|
||||||
RUN pnpm i
|
|
||||||
RUN pnpm exec turbo run --affected type-check
|
|
||||||
|
|
||||||
WORKDIR /app/frontpage/packages/frontpage
|
|
||||||
COPY ./.env.local ./.env.local
|
|
||||||
COPY ./app ./app
|
|
||||||
COPY ./lib ./lib
|
|
||||||
RUN pnpm run db:generate
|
|
||||||
RUN pnpm run db:migrate
|
|
||||||
RUN pnpm run build
|
|
||||||
CMD [ "pnpm", "run", "start"]
|
|
@ -1,8 +0,0 @@
|
|||||||
services:
|
|
||||||
frontpage:
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
ports:
|
|
||||||
- "3000:3000"
|
|
||||||
environment:
|
|
||||||
- WATCHPACK_POLLING=true
|
|
@ -1,16 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="1417px" height="1417px" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
||||||
<g><path style="opacity:1" fill="#303030" d="M 717.5,182.5 C 716.773,186.224 718.106,188.891 721.5,190.5C 729.374,205.903 738.541,220.569 749,234.5C 750.399,237.363 751.399,240.363 752,243.5C 755.595,248.061 759.095,252.728 762.5,257.5C 763.792,259.667 764.625,262 765,264.5C 766.697,265.957 768.197,267.623 769.5,269.5C 773.055,277.685 777.722,285.018 783.5,291.5C 790.166,305.134 798.166,318.134 807.5,330.5C 814.742,342.185 821.742,353.852 828.5,365.5C 844.594,370.003 860.427,375.336 876,381.5C 877.169,382.009 878.002,382.842 878.5,384C 882.957,384.143 886.623,385.81 889.5,389C 891.715,390.044 894.048,390.71 896.5,391C 901.981,393.275 906.981,396.275 911.5,400C 913.518,400.505 915.518,401.005 917.5,401.5C 917.414,402.496 917.748,403.329 918.5,404C 923.387,405.947 928.054,408.114 932.5,410.5C 943.583,419.552 955.25,427.885 967.5,435.5C 979.922,445.75 991.922,456.583 1003.5,468C 1004.5,468.333 1005.5,468.667 1006.5,469C 1007.1,472.436 1009.1,474.269 1012.5,474.5C 1015.38,480.22 1019.55,484.887 1025,488.5C 1025.33,489.5 1025.67,490.5 1026,491.5C 1033.43,499.992 1040.6,508.658 1047.5,517.5C 1123.83,622.989 1147.5,739.989 1118.5,868.5C 1118.67,870.167 1118.83,871.833 1119,873.5C 1121.94,879.062 1125.11,884.395 1128.5,889.5C 1157.69,942.876 1187.19,996.21 1217,1049.5C 1218.4,1050.73 1219.57,1052.06 1220.5,1053.5C 1221.61,1056.18 1221.61,1058.84 1220.5,1061.5C 1147.34,1066.45 1074,1069.95 1000.5,1072C 988.536,1079.45 977.536,1088.28 967.5,1098.5C 956.996,1104.65 946.996,1111.65 937.5,1119.5C 930.045,1122.31 923.378,1126.31 917.5,1131.5C 911.537,1133.48 905.87,1135.98 900.5,1139C 898.015,1142.24 894.681,1143.91 890.5,1144C 889.833,1145.33 888.833,1146.33 887.5,1147C 855.91,1161.47 822.91,1171.64 788.5,1177.5C 782.486,1176.22 776.486,1176.39 770.5,1178C 772.5,1178.33 774.5,1178.67 776.5,1179C 774.618,1179.2 772.952,1179.7 771.5,1180.5C 674.89,1194.18 583.89,1177.51 498.5,1130.5C 493.758,1126.48 488.758,1122.98 483.5,1120C 479.247,1119.45 475.914,1117.45 473.5,1114C 461.022,1107.13 449.689,1098.8 439.5,1089C 438.5,1088.67 437.5,1088.33 436.5,1088C 432.5,1084.06 428.5,1080.06 424.5,1076C 421.495,1074.83 418.495,1073.66 415.5,1072.5C 360.479,1070.72 305.479,1068.22 250.5,1065C 236.756,1064.54 223.089,1063.38 209.5,1061.5C 197.677,1066.34 193.843,1063.01 198,1051.5C 201.275,1047.94 203.775,1043.94 205.5,1039.5C 210.672,1031.16 215.338,1022.49 219.5,1013.5C 238.656,980.53 257.323,947.196 275.5,913.5C 284.581,899.014 292.914,884.014 300.5,868.5C 299.933,866.018 299.266,863.684 298.5,861.5C 274.313,753.989 289.313,652.323 343.5,556.5C 347.461,550.306 351.628,544.306 356,538.5C 357.081,533.423 359.748,529.423 364,526.5C 365.839,522.827 368.006,519.494 370.5,516.5C 416.382,456.734 473.715,411.568 542.5,381C 557.672,374.288 573.339,368.955 589.5,365C 597.23,351.414 605.23,337.914 613.5,324.5C 617.425,319.2 621.258,313.867 625,308.5C 629.774,297.927 635.774,288.26 643,279.5C 644.407,276.137 645.907,272.803 647.5,269.5C 654.247,260.916 660.413,251.916 666,242.5C 666.311,240.444 666.811,238.444 667.5,236.5C 681.05,215.925 693.884,194.925 706,173.5C 707.494,172.253 708.994,172.253 710.5,173.5C 713.186,176.311 715.519,179.311 717.5,182.5 Z"/></g>
|
|
||||||
<g><path style="opacity:0.057" fill="#ecdf18" d="M 717.5,182.5 C 715.519,179.311 713.186,176.311 710.5,173.5C 708.994,172.253 707.494,172.253 706,173.5C 693.884,194.925 681.05,215.925 667.5,236.5C 666.811,238.444 666.311,240.444 666,242.5C 660.413,251.916 654.247,260.916 647.5,269.5C 645.907,272.803 644.407,276.137 643,279.5C 635.774,288.26 629.774,297.927 625,308.5C 621.258,313.867 617.425,319.2 613.5,324.5C 605.23,337.914 597.23,351.414 589.5,365C 573.339,368.955 557.672,374.288 542.5,381C 473.715,411.568 416.382,456.734 370.5,516.5C 370.629,514.784 370.962,513.117 371.5,511.5C 411.77,458.386 461.77,417.219 521.5,388C 543.036,378.155 565.036,369.488 587.5,362C 626.95,299.212 665.95,236.046 704.5,172.5C 707.167,171.167 709.833,171.167 712.5,172.5C 715.081,175.404 716.748,178.737 717.5,182.5 Z"/></g>
|
|
||||||
<g><path style="opacity:0.093" fill="#ece018" d="M 717.5,182.5 C 724.112,191.101 730.278,200.101 736,209.5C 766.572,260.563 797.738,311.23 829.5,361.5C 842.569,366.938 855.902,371.772 869.5,376C 886.41,383.122 902.744,391.289 918.5,400.5C 918.5,401.167 918.167,401.5 917.5,401.5C 915.518,401.005 913.518,400.505 911.5,400C 906.981,396.275 901.981,393.275 896.5,391C 894.048,390.71 891.715,390.044 889.5,389C 886.623,385.81 882.957,384.143 878.5,384C 878.002,382.842 877.169,382.009 876,381.5C 860.427,375.336 844.594,370.003 828.5,365.5C 821.742,353.852 814.742,342.185 807.5,330.5C 798.166,318.134 790.166,305.134 783.5,291.5C 777.722,285.018 773.055,277.685 769.5,269.5C 768.197,267.623 766.697,265.957 765,264.5C 764.625,262 763.792,259.667 762.5,257.5C 759.095,252.728 755.595,248.061 752,243.5C 751.399,240.363 750.399,237.363 749,234.5C 738.541,220.569 729.374,205.903 721.5,190.5C 718.106,188.891 716.773,186.224 717.5,182.5 Z"/></g>
|
|
||||||
<g><path style="opacity:1" fill="#fdfd00" d="M 708.5,295.5 C 710.451,296.716 711.951,298.382 713,300.5C 742.151,349.467 771.818,398.134 802,446.5C 904.901,479.736 977.568,546.069 1020,645.5C 1044.44,709.71 1049.1,775.376 1034,842.5C 1033.33,845.5 1033.33,848.5 1034,851.5C 1061.47,900.436 1088.97,949.436 1116.5,998.5C 1116.02,999.478 1115.36,1000.31 1114.5,1001C 1055.46,1003.3 996.464,1006.3 937.5,1010C 842.928,1091.3 734.928,1116.3 613.5,1085C 563.341,1070.08 519.007,1045.08 480.5,1010C 421.531,1006.38 362.531,1003.38 303.5,1001C 301.022,999.062 300.855,996.895 303,994.5C 330.253,946.328 357.253,897.995 384,849.5C 358.519,733.144 384.852,630.477 463,541.5C 505.106,496.852 555.606,465.519 614.5,447.5C 646.288,397.06 677.621,346.394 708.5,295.5 Z"/></g>
|
|
||||||
<g><path style="opacity:0.076" fill="#e2d51a" d="M 918.5,400.5 C 967.206,428.035 1009.04,463.701 1044,507.5C 1045.09,509.078 1045.93,510.745 1046.5,512.5C 1047.04,514.117 1047.37,515.784 1047.5,517.5C 1040.6,508.658 1033.43,499.992 1026,491.5C 1025.67,490.5 1025.33,489.5 1025,488.5C 1019.55,484.887 1015.38,480.22 1012.5,474.5C 1009.1,474.269 1007.1,472.436 1006.5,469C 1005.5,468.667 1004.5,468.333 1003.5,468C 991.922,456.583 979.922,445.75 967.5,435.5C 955.25,427.885 943.583,419.552 932.5,410.5C 928.054,408.114 923.387,405.947 918.5,404C 917.748,403.329 917.414,402.496 917.5,401.5C 918.167,401.5 918.5,401.167 918.5,400.5 Z"/></g>
|
|
||||||
<g><path style="opacity:1" fill="#30302f" d="M 694.5,567.5 C 771.354,565.01 831.521,595.343 875,658.5C 913.837,725.131 915.503,792.798 880,861.5C 836.437,931.265 773.271,964.098 690.5,960C 617.969,951.138 564.802,914.305 531,849.5C 502.746,785.583 505.746,723.25 540,662.5C 576.413,606.246 627.913,574.579 694.5,567.5 Z"/></g>
|
|
||||||
<g><path style="opacity:0.064" fill="#f6e716" d="M 1046.5,512.5 C 1055.58,523.094 1063.74,534.427 1071,546.5C 1129.23,644.638 1146.23,749.971 1122,862.5C 1121.5,863 1121,863.5 1120.5,864C 1129.42,878.329 1137.42,893.163 1144.5,908.5C 1143.18,908.67 1142.01,908.337 1141,907.5C 1140.49,905.122 1139.82,902.788 1139,900.5C 1136.15,896.81 1133.82,892.81 1132,888.5C 1130.99,889.337 1129.82,889.67 1128.5,889.5C 1125.11,884.395 1121.94,879.062 1119,873.5C 1118.83,871.833 1118.67,870.167 1118.5,868.5C 1147.5,739.989 1123.83,622.989 1047.5,517.5C 1047.37,515.784 1047.04,514.117 1046.5,512.5 Z"/></g>
|
|
||||||
<g><path style="opacity:0.239" fill="#dccf1d" d="M 298.5,861.5 C 299.266,863.684 299.933,866.018 300.5,868.5C 292.914,884.014 284.581,899.014 275.5,913.5C 274.782,911.863 274.616,910.197 275,908.5C 276.732,906.717 278.232,904.717 279.5,902.5C 279.291,901.914 278.957,901.414 278.5,901C 281.22,896.324 283.72,891.491 286,886.5C 286.777,888.701 287.944,888.701 289.5,886.5C 288.691,884.929 288.357,883.262 288.5,881.5C 289.552,881.649 290.552,881.483 291.5,881C 292.104,878.532 293.438,876.532 295.5,875C 294.703,872.426 295.537,870.259 298,868.5C 298.497,866.19 298.663,863.857 298.5,861.5 Z"/></g>
|
|
||||||
<g><path style="opacity:0.12" fill="#ecde19" d="M 1144.5,908.5 C 1167.91,948.307 1190.58,988.641 1212.5,1029.5C 1212.34,1032.55 1213.01,1035.38 1214.5,1038C 1214.17,1038.33 1213.83,1038.67 1213.5,1039C 1216.12,1039.58 1216.79,1040.91 1215.5,1043C 1217.86,1043.59 1218.86,1045.09 1218.5,1047.5C 1222.61,1048.49 1223.27,1050.49 1220.5,1053.5C 1219.57,1052.06 1218.4,1050.73 1217,1049.5C 1187.19,996.21 1157.69,942.876 1128.5,889.5C 1129.82,889.67 1130.99,889.337 1132,888.5C 1133.82,892.81 1136.15,896.81 1139,900.5C 1139.82,902.788 1140.49,905.122 1141,907.5C 1142.01,908.337 1143.18,908.67 1144.5,908.5 Z"/></g>
|
|
||||||
<g><path style="opacity:0.282" fill="#d5c91e" d="M 219.5,1013.5 C 215.338,1022.49 210.672,1031.16 205.5,1039.5C 205.756,1037.21 205.423,1035.04 204.5,1033C 209.614,1028.62 213.114,1023.12 215,1016.5C 216.271,1015.12 217.771,1014.12 219.5,1013.5 Z"/></g>
|
|
||||||
<g><path style="opacity:0.03" fill="#f3e517" d="M 371.5,511.5 C 370.962,513.117 370.629,514.784 370.5,516.5C 368.006,519.494 365.839,522.827 364,526.5C 359.748,529.423 357.081,533.423 356,538.5C 351.628,544.306 347.461,550.306 343.5,556.5C 289.313,652.323 274.313,753.989 298.5,861.5C 298.663,863.857 298.497,866.19 298,868.5C 295.537,870.259 294.703,872.426 295.5,875C 293.438,876.532 292.104,878.532 291.5,881C 290.552,881.483 289.552,881.649 288.5,881.5C 288.357,883.262 288.691,884.929 289.5,886.5C 287.944,888.701 286.777,888.701 286,886.5C 283.72,891.491 281.22,896.324 278.5,901C 278.957,901.414 279.291,901.914 279.5,902.5C 278.232,904.717 276.732,906.717 275,908.5C 274.616,910.197 274.782,911.863 275.5,913.5C 257.323,947.196 238.656,980.53 219.5,1013.5C 217.771,1014.12 216.271,1015.12 215,1016.5C 213.114,1023.12 209.614,1028.62 204.5,1033C 205.423,1035.04 205.756,1037.21 205.5,1039.5C 203.775,1043.94 201.275,1047.94 198,1051.5C 193.843,1063.01 197.677,1066.34 209.5,1061.5C 223.089,1063.38 236.756,1064.54 250.5,1065C 305.479,1068.22 360.479,1070.72 415.5,1072.5C 418.495,1073.66 421.495,1074.83 424.5,1076C 428.5,1080.06 432.5,1084.06 436.5,1088C 437.5,1088.33 438.5,1088.67 439.5,1089C 449.689,1098.8 461.022,1107.13 473.5,1114C 475.914,1117.45 479.247,1119.45 483.5,1120C 488.758,1122.98 493.758,1126.48 498.5,1130.5C 583.89,1177.51 674.89,1194.18 771.5,1180.5C 777.4,1180.12 783.067,1179.12 788.5,1177.5C 822.91,1171.64 855.91,1161.47 887.5,1147C 888.833,1146.33 889.833,1145.33 890.5,1144C 894.681,1143.91 898.015,1142.24 900.5,1139C 905.87,1135.98 911.537,1133.48 917.5,1131.5C 923.378,1126.31 930.045,1122.31 937.5,1119.5C 946.996,1111.65 956.996,1104.65 967.5,1098.5C 977.536,1088.28 988.536,1079.45 1000.5,1072C 1074,1069.95 1147.34,1066.45 1220.5,1061.5C 1221.61,1058.84 1221.61,1056.18 1220.5,1053.5C 1223.27,1050.49 1222.61,1048.49 1218.5,1047.5C 1218.86,1045.09 1217.86,1043.59 1215.5,1043C 1216.79,1040.91 1216.12,1039.58 1213.5,1039C 1213.83,1038.67 1214.17,1038.33 1214.5,1038C 1213.01,1035.38 1212.34,1032.55 1212.5,1029.5C 1218.28,1038.74 1223.78,1048.08 1229,1057.5C 1231.4,1062.49 1229.9,1065.99 1224.5,1068C 1221.44,1068.26 1218.44,1068.76 1215.5,1069.5C 1213.83,1068.83 1212.17,1068.17 1210.5,1067.5C 1180.44,1069.63 1150.44,1071.63 1120.5,1073.5C 1110.81,1073.47 1101.15,1073.47 1091.5,1073.5C 1059.05,1075.76 1026.71,1077.6 994.5,1079C 913.217,1150.34 818.05,1186.51 709,1187.5C 599.827,1186.84 504.661,1150.84 423.5,1079.5C 400.74,1077.32 377.74,1076.15 354.5,1076C 336.48,1074.62 318.647,1073.45 301,1072.5C 299.699,1072.96 298.366,1073.29 297,1073.5C 267.186,1071.67 237.353,1069.67 207.5,1067.5C 201.897,1069.4 196.231,1069.24 190.5,1067C 188.406,1065.74 187.406,1063.91 187.5,1061.5C 188.453,1057.6 189.953,1053.93 192,1050.5C 227.124,988.791 261.957,926.791 296.5,864.5C 271.3,753.389 287.133,648.723 344,550.5C 348.667,543.167 353.333,535.833 358,528.5C 362.418,522.603 366.918,516.936 371.5,511.5 Z"/></g>
|
|
||||||
<g><path style="opacity:1" fill="#4a4730" d="M 788.5,1177.5 C 783.067,1179.12 777.4,1180.12 771.5,1180.5C 772.952,1179.7 774.618,1179.2 776.5,1179C 774.5,1178.67 772.5,1178.33 770.5,1178C 776.486,1176.39 782.486,1176.22 788.5,1177.5 Z"/></g>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 12 KiB |
@ -1,226 +0,0 @@
|
|||||||
# frontpage
|
|
||||||
|
|
||||||
- https://frontpage.fyi
|
|
||||||
- https://bsky.app/profile/frontpage.fyi
|
|
||||||
- https://github.com/likeandscribe/frontpage
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ git clone https://github.com/likeandscribe/frontpage
|
|
||||||
$ dir=${0:a:h}/frontpage
|
|
||||||
$ cd $dir
|
|
||||||
```
|
|
||||||
|
|
||||||
## first setting
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ cd $dir
|
|
||||||
$ nvm use 20
|
|
||||||
$ pnpm i
|
|
||||||
$ cat turbo.json
|
|
||||||
$ pnpm exec turbo run --affected type-check
|
|
||||||
```
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ cd $dir/packages/frontpage
|
|
||||||
$ pnpm exec tsx ./scripts/generate-jwk.mts
|
|
||||||
# pnpm run db:generate
|
|
||||||
# pnpm run db:migrate
|
|
||||||
$ cat .env.local
|
|
||||||
```
|
|
||||||
|
|
||||||
```sh
|
|
||||||
# frontpage/.env.local
|
|
||||||
PRIVATE_JWK=`pnpm exec tsx ./scripts/generate-jwk.mts`
|
|
||||||
PUBLIC_JWK=`pnpm exec tsx ./scripts/generate-jwk.mts`
|
|
||||||
|
|
||||||
TURSO_CONNECTION_URL=libsql://xxx.turso.io
|
|
||||||
#TURSO_CONNECTION_URL=`turso db shell xxx-xxx`
|
|
||||||
TURSO_AUTH_TOKEN=`turso db tokens create xxx-xxx`
|
|
||||||
|
|
||||||
DRAINPIPE_CONSUMER_SECRET=`openssl ecparam --name secp256k1 --genkey --noout --outform DER | tail --bytes=+8 | head --bytes=32 | xxd --plain --cols 32`
|
|
||||||
VERCEL_PROJECT_PRODUCTION_URL=example.com
|
|
||||||
VERCEL_BRANCH_URL=example.com
|
|
||||||
|
|
||||||
#DRAINPIPE_CONSUMER_SECRET=secret
|
|
||||||
#TURSO_CONNECTION_URL=libsql://turso.dev.unravel.fyi
|
|
||||||
#PLC_DIRECTORY_URL=https://plc.dev.unravel.fyi
|
|
||||||
```
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ cd $dir/packages-rs/drainpipe
|
|
||||||
$ cargo install diesel_cli --no-default-features --features sqlite
|
|
||||||
$ diesel setup
|
|
||||||
$ diesel migration run
|
|
||||||
$ ls drainpipe.db
|
|
||||||
$ cat .env.local
|
|
||||||
```
|
|
||||||
|
|
||||||
```sh
|
|
||||||
# drainpipe/.env.local
|
|
||||||
DATABASE_URL="drainpipe.db"
|
|
||||||
FRONTPAGE_CONSUMER_URL="http://${cloudflared}/api/receive_hook"
|
|
||||||
FRONTPAGE_CONSUMER_SECRET=`openssl ecparam --name secp256k1 --genkey --noout --outform DER | tail --bytes=+8 | head --bytes=32 | xxd --plain --cols 32`
|
|
||||||
#RELAY_URL=wss://bsky.network
|
|
||||||
#FRONTPAGE_CONSUMER_SECRET=secret
|
|
||||||
```
|
|
||||||
|
|
||||||
## rewrite
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ cd $dir/packages/frontpage
|
|
||||||
$ PUBLIC_URL=example.com
|
|
||||||
$ grep -R frontpage.fyi ./app ./lib |cut -d : -f 1|sed -i "s/frontpage.fyi/$PUBLIC_URL/g"
|
|
||||||
|
|
||||||
$ HOST_REVERT=com.unravel.example
|
|
||||||
$ grep -R unravel.frontpage ./app ./lib |cut -d : -f 1|xargs sed -i "s/fyi.unravel.frontpage/${HOST_REVERT}/g"
|
|
||||||
```
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ cd $dir/packages-rs/drainpipe
|
|
||||||
$ HOST_REVERT=com.unravel.example
|
|
||||||
$ grep -R fyi.unravel.frontpage ./src |cut -d : -f 1|xargs sed -i "s/fyi.unravel.frontpage/${HOST_REVERT}/g"
|
|
||||||
```
|
|
||||||
|
|
||||||
## deploy
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ cd $dir/packages-rs/drainpipe
|
|
||||||
$ docker compose up
|
|
||||||
---
|
|
||||||
$ cd $dir/packages/frontpage
|
|
||||||
$ docker compose up
|
|
||||||
```
|
|
||||||
|
|
||||||
## explanation
|
|
||||||
|
|
||||||
### client-metadata.json
|
|
||||||
|
|
||||||
the `client_id` is different between `pnpm run start` and `pnpm run dev`. see `https://localhost:3000/oauth/client-metadata.json` for this.
|
|
||||||
|
|
||||||
### local-infra
|
|
||||||
|
|
||||||
i think this is the server configuration required for self-hosting.
|
|
||||||
|
|
||||||
https://github.com/likeandscribe/frontpage/tree/main/packages/frontpage/local-infra
|
|
||||||
|
|
||||||
since plc gives an error, do the following. probably a postgres database is required. there is no need to open ports.
|
|
||||||
|
|
||||||
```yml
|
|
||||||
plc:
|
|
||||||
image: ghcr.io/bluesky-social/did-method-plc:plc-f2ab7516bac5bc0f3f86842fa94e996bd1b3815b
|
|
||||||
container_name: plc
|
|
||||||
restart: unless-stopped
|
|
||||||
ports:
|
|
||||||
- '4000:8080'
|
|
||||||
depends_on:
|
|
||||||
- plc_db
|
|
||||||
env_file:
|
|
||||||
- ./plc.env
|
|
||||||
|
|
||||||
plc_db:
|
|
||||||
image: postgres:16-alpine
|
|
||||||
restart: always
|
|
||||||
env_file:
|
|
||||||
- ./postgres.env
|
|
||||||
volumes:
|
|
||||||
- ./configs/postgres/init/:/docker-entrypoint-initdb.d/
|
|
||||||
- ./data/postgres/:/var/lib/postgresql/data/
|
|
||||||
healthcheck:
|
|
||||||
test: "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"
|
|
||||||
interval: 5s
|
|
||||||
retries: 20
|
|
||||||
```
|
|
||||||
|
|
||||||
```sh
|
|
||||||
# plc.env
|
|
||||||
DEBUG_MODE=1
|
|
||||||
LOG_ENABLED=true
|
|
||||||
LOG_LEVEL=debug
|
|
||||||
LOG_DESTINATION=1
|
|
||||||
PORT=8080
|
|
||||||
DATABASE_URL=postgres://postgres:postgres@plc_db/plc
|
|
||||||
DB_CREDS_JSON='{"username":"postgres","password":"postgres","host":"plc_db","port":"5432","database":"plc"}'
|
|
||||||
ENABLE_MIGRATIONS=true
|
|
||||||
DB_MIGRATE_CREDS_JSON='{"username":"postgres","password":"postgres","host":"plc_db","port":"5432","database":"plc"}'
|
|
||||||
```
|
|
||||||
|
|
||||||
```sh
|
|
||||||
# configs/postgres/init/init.sql
|
|
||||||
-- PLC
|
|
||||||
CREATE DATABASE plc;
|
|
||||||
GRANT ALL PRIVILEGES ON DATABASE plc TO postgres;
|
|
||||||
```
|
|
||||||
|
|
||||||
### pds
|
|
||||||
|
|
||||||
first, i think you need to get the pdsurl with oauth(session). if you have a session, you can perform operations such as posting.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ cd $dir/packages/frontpage
|
|
||||||
./lib/data/user.ts: const pdsUrl = await getPdsUrl(session.user.did);
|
|
||||||
```
|
|
||||||
|
|
||||||
it seems that drainpipe searches for `fyi.unravel.frontpage(collection)` in pds and commits it to firehose subscriberepos. if you change these two parts, it will not work with `frontpage.fyi`.
|
|
||||||
|
|
||||||
```rust
|
|
||||||
// https://github.com/likeandscribe/frontpage/blob/e7444ec6c19f0ccef3776f04702c3bb033ed3bfc/packages-rs/drainpipe/src/main.rs#L66-L97
|
|
||||||
// RELAY_URL=wss://bsky.network
|
|
||||||
let mut ws_request = format!(
|
|
||||||
"{}/xrpc/com.atproto.sync.subscribeRepos{}",
|
|
||||||
relay_url, query_string
|
|
||||||
)
|
|
||||||
|
|
||||||
/// Process a message from the firehose. Returns the sequence number of the message or an error.
|
|
||||||
async fn process(message: Vec<u8>, ctx: &mut Context) -> Result<i64, ProcessError> {
|
|
||||||
let (_header, data) = firehose::read(&message).map_err(|e| ProcessError {
|
|
||||||
inner: e.into(),
|
|
||||||
seq: -1,
|
|
||||||
source: message.clone().into(),
|
|
||||||
kind: ProcessErrorKind::DecodeError,
|
|
||||||
})?;
|
|
||||||
let sequence = match data {
|
|
||||||
firehose::SubscribeRepos::Commit(commit) => {
|
|
||||||
let frontpage_ops = commit
|
|
||||||
.operations
|
|
||||||
.iter()
|
|
||||||
.filter(|op| op.path.starts_with("com.unravel.example."))
|
|
||||||
//.filter(|op| op.path.starts_with("fyi.unravel.frontpage."))
|
|
||||||
.collect::<Vec<_>>();
|
|
||||||
if !frontpage_ops.is_empty() {
|
|
||||||
process_frontpage_ops(&frontpage_ops, &commit, &ctx)
|
|
||||||
.map_err(|e| ProcessError {
|
|
||||||
seq: commit.sequence,
|
|
||||||
inner: e,
|
|
||||||
source: message.clone().into(),
|
|
||||||
kind: ProcessErrorKind::ProcessError,
|
|
||||||
})
|
|
||||||
.await?;
|
|
||||||
}
|
|
||||||
commit.sequence
|
|
||||||
}
|
|
||||||
msg => msg.sequence(),
|
|
||||||
};
|
|
||||||
|
|
||||||
Ok(sequence)
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## other
|
|
||||||
|
|
||||||
### license view
|
|
||||||
|
|
||||||
```html
|
|
||||||
// https://github.com/likeandscribe/frontpage/blob/de31aedf73c4e80e7376cf73c7c054437563f2ab/packages/frontpage/app/layout.tsx#L28-L52
|
|
||||||
+ <div dangerouslySetInnerHTML={{__html: '<!-- frontpage | MIT | https://github.com/likeandscribe/frontpage/blob/main/LICENSE -->'}} />
|
|
||||||
```
|
|
||||||
|
|
||||||
### admin view
|
|
||||||
|
|
||||||
```sh
|
|
||||||
# https://github.com/likeandscribe/frontpage/blob/7fccf20fa800ba25fd57db279033ddf2cc92e9ce/packages/frontpage/lib/constants.ts
|
|
||||||
./lib/constants.ts:export const FRONTPAGE_ATPROTO_HANDLE = "admin.example.com";
|
|
||||||
|
|
||||||
# https://github.com/likeandscribe/frontpage/blob/cf8a4cb8bc7bab54407972964f8d39bf5e7c9182/packages/frontpage/app/(app)/layout.tsx#L55-L66
|
|
||||||
./app/\(app\)/layout.tsx:@admin.example.com <OpenInNewWindowIcon className="inline" />
|
|
||||||
```
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
|||||||
FROM node:20
|
|
||||||
|
|
||||||
RUN npm install -g pnpm
|
|
||||||
WORKDIR /app
|
|
||||||
RUN git clone https://github.com/notjuliet/pdsls
|
|
||||||
WORKDIR /app/pdsls
|
|
||||||
COPY ./vite.config.ts ./vite.config.ts
|
|
||||||
RUN pnpm i
|
|
||||||
RUN pnpm build
|
|
||||||
|
|
||||||
CMD [ "pnpm", "start"]
|
|
@ -1,6 +0,0 @@
|
|||||||
services:
|
|
||||||
atbrowser:
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
ports:
|
|
||||||
- 3000:13213
|
|
@ -1,17 +0,0 @@
|
|||||||
import { defineConfig } from "vite";
|
|
||||||
import solidPlugin from "vite-plugin-solid";
|
|
||||||
import UnoCSS from "unocss/vite";
|
|
||||||
|
|
||||||
const SERVER_HOST = "0.0.0.0";
|
|
||||||
const SERVER_PORT = 13213;
|
|
||||||
|
|
||||||
export default defineConfig({
|
|
||||||
plugins: [UnoCSS(), solidPlugin()],
|
|
||||||
server: {
|
|
||||||
host: SERVER_HOST,
|
|
||||||
port: SERVER_PORT,
|
|
||||||
},
|
|
||||||
build: {
|
|
||||||
target: "esnext",
|
|
||||||
},
|
|
||||||
});
|
|
@ -1,7 +0,0 @@
|
|||||||
FROM syui/aios
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
COPY . .
|
|
||||||
RUN pacman -Syu rye --noconfirm
|
|
||||||
RUN rye sync
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
|||||||
@app.route("/about")
|
|
||||||
def aboutpage():
|
|
||||||
return render_template("about.html")
|
|
@ -1,10 +0,0 @@
|
|||||||
services:
|
|
||||||
web:
|
|
||||||
build: .
|
|
||||||
env_file:
|
|
||||||
- ./.env
|
|
||||||
ports:
|
|
||||||
- "5000:5000"
|
|
||||||
volumes:
|
|
||||||
- ./demo.sqlite:/app/demo.sqlite
|
|
||||||
command: rye run flask run --host=0.0.0.0
|
|
@ -1,20 +0,0 @@
|
|||||||
{% extends 'base.html' %}
|
|
||||||
{% block content %}
|
|
||||||
|
|
||||||
<h2>service</h2>
|
|
||||||
<p>This service allows you to comment on live broadcasts using your atproto account.</p>
|
|
||||||
|
|
||||||
<h2>system</h2>
|
|
||||||
<p>Display posts to BBS using atproto oauth.</p>
|
|
||||||
<p>This service is generated using <a href="https://github.com/bluesky-social/cookbook">bluesky/cookbook</a>.</p>
|
|
||||||
<p>Authentication information will be deleted periodically.</p>
|
|
||||||
<hr/>
|
|
||||||
|
|
||||||
<h2>サービス</h2>
|
|
||||||
<p>このサービスはlive配信にatprotoアカウントを使ってコメントができます。</p>
|
|
||||||
<h2>システム</h2>
|
|
||||||
<p>atproto oauthを使用してbbsへの書き込みを許可します。</p>
|
|
||||||
<p>このサービスは<a href="https://github.com/bluesky-social/cookbook">bluesky/cookbook</a>を使用して生成されています。</p>
|
|
||||||
<p>認証情報は定期的に削除されます。</p>
|
|
||||||
|
|
||||||
{% endblock %}
|
|
@ -1,114 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="referrer" content="origin-when-cross-origin">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.classless.blue.min.css">
|
|
||||||
<link rel="stylesheet" href="https://syui.ai/bower_components/font-awesome/css/all.min.css" />
|
|
||||||
<link rel="icon" href="https://live.syui.ai/favicon.ico">
|
|
||||||
<title>o.syui.ai</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<header>
|
|
||||||
<hgroup>
|
|
||||||
{% if g.user %}
|
|
||||||
{% endif %}
|
|
||||||
</hgroup>
|
|
||||||
<nav>
|
|
||||||
<ul>
|
|
||||||
<li><a href="/"><button class="secondary">o</button></a></li>
|
|
||||||
<li>.syui.ai</li>
|
|
||||||
</ul>
|
|
||||||
<ul>
|
|
||||||
{% if g.user %}
|
|
||||||
<li><a href="{{ url_for('bsky_post') }}">post</a>
|
|
||||||
<li><a href="{{ url_for('oauth_refresh') }}">refresh</a>
|
|
||||||
<li><a href="{{ url_for('oauth_logout') }}"><button class="secondary">logout</button></a>
|
|
||||||
{% else %}
|
|
||||||
<li><a href="/about"><i class="fa-solid fa-circle-question"></i></a></li>
|
|
||||||
{% endif %}
|
|
||||||
<!--
|
|
||||||
<li><a href="https://github.com/bluesky-social/cookbook">Code</a>
|
|
||||||
-->
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main class="container">
|
|
||||||
<section class="content">
|
|
||||||
{% for message in get_flashed_messages() %}
|
|
||||||
<article>{{ message }}</article>
|
|
||||||
{% endfor %}
|
|
||||||
{% block content %}{% endblock %}
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
body {
|
|
||||||
background-color: #f1f1f1;
|
|
||||||
}
|
|
||||||
button a {
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
iframe#livechat {
|
|
||||||
width: 100%;
|
|
||||||
min-height: 500px;
|
|
||||||
}
|
|
||||||
iframe#livestream {
|
|
||||||
width: 100%;
|
|
||||||
min-height: 500px;
|
|
||||||
}
|
|
||||||
button.oauth-login {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
footer {
|
|
||||||
text-align:center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.container-1 {
|
|
||||||
display: flex;
|
|
||||||
.right-container {
|
|
||||||
background-color: #fff;
|
|
||||||
position: sticky;
|
|
||||||
top: 0;
|
|
||||||
align-self: flex-start;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: flex-end;
|
|
||||||
padding:10px;
|
|
||||||
margin-left:30px;
|
|
||||||
.content:first-of-type {
|
|
||||||
position: sticky;
|
|
||||||
bottom: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.left-container {
|
|
||||||
padding:10px;
|
|
||||||
background-color: #fff;
|
|
||||||
width: 80%;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media screen and (max-width: 959px) {
|
|
||||||
.left-container {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
iframe#livestream {
|
|
||||||
width: 100%;
|
|
||||||
min-height:300px;
|
|
||||||
height:100%;
|
|
||||||
}
|
|
||||||
.container-1 {
|
|
||||||
display: block;
|
|
||||||
.right-container {
|
|
||||||
margin-left:0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<footer>©syui</footer>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,8 +0,0 @@
|
|||||||
{% extends 'base.html' %}
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
<form method="post">
|
|
||||||
<textarea name="post_text" placeholder="What's up?" id="post_text" required></textarea>
|
|
||||||
<input type="submit" value="Poast!">
|
|
||||||
</form>
|
|
||||||
{% endblock %}
|
|
@ -1,13 +0,0 @@
|
|||||||
{% extends 'base.html' %}
|
|
||||||
|
|
||||||
{% block title %}Error{% endblock %}
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
<h2>⚠️ Error {{ status_code }} ⚠️</h2>
|
|
||||||
{% if err.description %}
|
|
||||||
<p><code>{{ err.description }}</code></p>
|
|
||||||
{% else %}
|
|
||||||
<p>Something went wrong!</p>
|
|
||||||
{% endif %}
|
|
||||||
<p><a href="/">Start Over</a></p>
|
|
||||||
{% endblock %}
|
|
Binary file not shown.
Before Width: | Height: | Size: 14 KiB |
@ -1 +0,0 @@
|
|||||||
<?xml version="1.0" ?><svg height="512" viewBox="0 0 512 512" width="512" xmlns="http://www.w3.org/2000/svg"><title/><path d="M413.48,284.46c58.87,47.24,91.61,89,80.31,108.55-17.85,30.85-138.78-5.48-270.1-81.15S.37,149.84,18.21,119c11.16-19.28,62.58-12.32,131.64,14.09" style="fill:none;stroke:#000;stroke-miterlimit:10;stroke-width:32px"/><circle cx="256" cy="256" r="160" style="fill:none;stroke:#000;stroke-miterlimit:10;stroke-width:32px"/></svg>
|
|
Before Width: | Height: | Size: 450 B |
@ -1,29 +0,0 @@
|
|||||||
{% extends 'base.html' %}
|
|
||||||
{% block content %}
|
|
||||||
|
|
||||||
<div class="container-1">
|
|
||||||
<div class="left-container">
|
|
||||||
<div class="livestream">
|
|
||||||
<iframe id="livestream" title="stream" src="https://live.syui.ai/b9ec42d4-8a4d-4343-99fc-1bd1cdbc5a6f.html"> </iframe>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="right-container">
|
|
||||||
{% if g.user %}
|
|
||||||
<span class="user-handle">@{{ g.user['handle'] }}</span>
|
|
||||||
<div class="livechat">
|
|
||||||
<iframe id="livechat" title="bskychat" src="https://bbs.syui.ai/?handle={{ session['user_handle'] }}"> </iframe>
|
|
||||||
</div>
|
|
||||||
{% else %}
|
|
||||||
<div class="livechat">
|
|
||||||
<a href="{{ url_for('oauth_login') }}"><button class="oauth-login">@</button></a>
|
|
||||||
<iframe id="livechat" title="bskychat" src="https://bbs.syui.ai"> </iframe>
|
|
||||||
</div>
|
|
||||||
<div class="right-container">
|
|
||||||
<p>write comment using oauth atproto.</p>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% endblock %}
|
|
@ -1,15 +0,0 @@
|
|||||||
{% extends 'base.html' %}
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
<article>
|
|
||||||
<h3>Login with atproto</h3>
|
|
||||||
<form method="post">
|
|
||||||
<p>Provide your handle or DID to authorize an existing account with PDS.
|
|
||||||
<br>You can also supply a PDS/entryway URL (eg, <code>https://pds.example.com</code>).</p>
|
|
||||||
<fieldset role="group">
|
|
||||||
<input name="username" id="username" placeholder="handle.example.com" style="font-family: monospace,monospace;" required>
|
|
||||||
<input type="submit" value="Login">
|
|
||||||
</fieldset>
|
|
||||||
</form>
|
|
||||||
</article>
|
|
||||||
{% endblock %}
|
|
Loading…
x
Reference in New Issue
Block a user