diff --git a/github/frontpage/packages-rs/drainpipe/.env.local b/github/frontpage/packages-rs/drainpipe/.env.local deleted file mode 100644 index efa053b..0000000 --- a/github/frontpage/packages-rs/drainpipe/.env.local +++ /dev/null @@ -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 diff --git a/github/frontpage/packages-rs/drainpipe/.keep b/github/frontpage/packages-rs/drainpipe/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/github/frontpage/packages-rs/drainpipe/Dockerfile b/github/frontpage/packages-rs/drainpipe/Dockerfile deleted file mode 100644 index 590140e..0000000 --- a/github/frontpage/packages-rs/drainpipe/Dockerfile +++ /dev/null @@ -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"] diff --git a/github/frontpage/packages-rs/drainpipe/docker-compose.yml b/github/frontpage/packages-rs/drainpipe/docker-compose.yml deleted file mode 100644 index d5e214a..0000000 --- a/github/frontpage/packages-rs/drainpipe/docker-compose.yml +++ /dev/null @@ -1,9 +0,0 @@ -services: - drainpipe: - build: - dockerfile: ./packages-rs/drainpipe/Dockerfile - context: ../../ - env_file: - - ./.env.local - volumes: - - ./drainpipedata:/drainpipedata diff --git a/github/frontpage/packages/atproto-browser/Dockerfile b/github/frontpage/packages/atproto-browser/Dockerfile deleted file mode 100644 index e029727..0000000 --- a/github/frontpage/packages/atproto-browser/Dockerfile +++ /dev/null @@ -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"] diff --git a/github/frontpage/packages/atproto-browser/compose.yml b/github/frontpage/packages/atproto-browser/compose.yml deleted file mode 100644 index 57a2d59..0000000 --- a/github/frontpage/packages/atproto-browser/compose.yml +++ /dev/null @@ -1,8 +0,0 @@ -services: - atbrowser: - build: - context: . - ports: - - "3000:3000" - environment: - - WATCHPACK_POLLING=true diff --git a/github/frontpage/packages/frontpage/.env.local b/github/frontpage/packages/frontpage/.env.local deleted file mode 100644 index 0b2e67f..0000000 --- a/github/frontpage/packages/frontpage/.env.local +++ /dev/null @@ -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 diff --git a/github/frontpage/packages/frontpage/Dockerfile b/github/frontpage/packages/frontpage/Dockerfile deleted file mode 100644 index 66ff8e4..0000000 --- a/github/frontpage/packages/frontpage/Dockerfile +++ /dev/null @@ -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"] diff --git a/github/frontpage/packages/frontpage/compose.yml b/github/frontpage/packages/frontpage/compose.yml deleted file mode 100644 index e1d7db1..0000000 --- a/github/frontpage/packages/frontpage/compose.yml +++ /dev/null @@ -1,8 +0,0 @@ -services: - frontpage: - build: - context: . - ports: - - "3000:3000" - environment: - - WATCHPACK_POLLING=true diff --git a/github/frontpage/packages/frontpage/public/frontpage-logo.svg b/github/frontpage/packages/frontpage/public/frontpage-logo.svg deleted file mode 100644 index bd39143..0000000 --- a/github/frontpage/packages/frontpage/public/frontpage-logo.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/github/frontpage/readme.md b/github/frontpage/readme.md deleted file mode 100644 index e59d560..0000000 --- a/github/frontpage/readme.md +++ /dev/null @@ -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, ctx: &mut Context) -> Result { - 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::>(); - 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 -+
'}} /> -``` - -### 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 -``` - diff --git a/github/pdsls/Dockerfile b/github/pdsls/Dockerfile deleted file mode 100644 index 1dc6678..0000000 --- a/github/pdsls/Dockerfile +++ /dev/null @@ -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"] diff --git a/github/pdsls/compose.yml b/github/pdsls/compose.yml deleted file mode 100644 index 06a46f0..0000000 --- a/github/pdsls/compose.yml +++ /dev/null @@ -1,6 +0,0 @@ -services: - atbrowser: - build: - context: . - ports: - - 3000:13213 diff --git a/github/pdsls/vite.config.ts b/github/pdsls/vite.config.ts deleted file mode 100644 index 97b0ef6..0000000 --- a/github/pdsls/vite.config.ts +++ /dev/null @@ -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", - }, -}); diff --git a/github/python-oauth-web-app/Dockerfile b/github/python-oauth-web-app/Dockerfile deleted file mode 100644 index 42dcf64..0000000 --- a/github/python-oauth-web-app/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM syui/aios - -WORKDIR /app -COPY . . -RUN pacman -Syu rye --noconfirm -RUN rye sync - diff --git a/github/python-oauth-web-app/app_add.py b/github/python-oauth-web-app/app_add.py deleted file mode 100644 index f8e0492..0000000 --- a/github/python-oauth-web-app/app_add.py +++ /dev/null @@ -1,3 +0,0 @@ -@app.route("/about") -def aboutpage(): - return render_template("about.html") diff --git a/github/python-oauth-web-app/compose.yml b/github/python-oauth-web-app/compose.yml deleted file mode 100644 index f915dd5..0000000 --- a/github/python-oauth-web-app/compose.yml +++ /dev/null @@ -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 diff --git a/github/python-oauth-web-app/templates/about.html b/github/python-oauth-web-app/templates/about.html deleted file mode 100644 index f9a1a42..0000000 --- a/github/python-oauth-web-app/templates/about.html +++ /dev/null @@ -1,20 +0,0 @@ -{% extends 'base.html' %} -{% block content %} - -

service

-

This service allows you to comment on live broadcasts using your atproto account.

- -

system

-

Display posts to BBS using atproto oauth.

-

This service is generated using bluesky/cookbook.

-

Authentication information will be deleted periodically.

-
- -

サービス

-

このサービスはlive配信にatprotoアカウントを使ってコメントができます。

-

システム

-

atproto oauthを使用してbbsへの書き込みを許可します。

-

このサービスはbluesky/cookbookを使用して生成されています。

-

認証情報は定期的に削除されます。

- -{% endblock %} diff --git a/github/python-oauth-web-app/templates/base.html b/github/python-oauth-web-app/templates/base.html deleted file mode 100644 index 710fd4d..0000000 --- a/github/python-oauth-web-app/templates/base.html +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - o.syui.ai - - -
-
- {% if g.user %} - {% endif %} -
- -
- -
-
- {% for message in get_flashed_messages() %} -
{{ message }}
- {% endfor %} - {% block content %}{% endblock %} -
-
- - -
©syui
- - diff --git a/github/python-oauth-web-app/templates/bsky_post.html b/github/python-oauth-web-app/templates/bsky_post.html deleted file mode 100644 index acec60e..0000000 --- a/github/python-oauth-web-app/templates/bsky_post.html +++ /dev/null @@ -1,8 +0,0 @@ -{% extends 'base.html' %} - -{% block content %} -
- - -
-{% endblock %} diff --git a/github/python-oauth-web-app/templates/error.html b/github/python-oauth-web-app/templates/error.html deleted file mode 100644 index 76fc860..0000000 --- a/github/python-oauth-web-app/templates/error.html +++ /dev/null @@ -1,13 +0,0 @@ -{% extends 'base.html' %} - -{% block title %}Error{% endblock %} - -{% block content %} -

⚠️ Error {{ status_code }} ⚠️

-{% if err.description %} -

{{ err.description }}

-{% else %} -

Something went wrong!

-{% endif %} -

Start Over

-{% endblock %} diff --git a/github/python-oauth-web-app/templates/favicon.png b/github/python-oauth-web-app/templates/favicon.png deleted file mode 100644 index 6aeb218..0000000 Binary files a/github/python-oauth-web-app/templates/favicon.png and /dev/null differ diff --git a/github/python-oauth-web-app/templates/favicon.svg b/github/python-oauth-web-app/templates/favicon.svg deleted file mode 100644 index bca17d6..0000000 --- a/github/python-oauth-web-app/templates/favicon.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/github/python-oauth-web-app/templates/home.html b/github/python-oauth-web-app/templates/home.html deleted file mode 100644 index 1d56aaf..0000000 --- a/github/python-oauth-web-app/templates/home.html +++ /dev/null @@ -1,29 +0,0 @@ -{% extends 'base.html' %} -{% block content %} - -
-
-
- -
-
-
- {% if g.user %} - @{{ g.user['handle'] }} -
- -
- {% else %} -
- - -
-
-

write comment using oauth atproto.

-
- {% endif %} -
- -
- -{% endblock %} diff --git a/github/python-oauth-web-app/templates/login.html b/github/python-oauth-web-app/templates/login.html deleted file mode 100644 index a000403..0000000 --- a/github/python-oauth-web-app/templates/login.html +++ /dev/null @@ -1,15 +0,0 @@ -{% extends 'base.html' %} - -{% block content %} -
-

Login with atproto

-
-

Provide your handle or DID to authorize an existing account with PDS. -
You can also supply a PDS/entryway URL (eg, https://pds.example.com).

-
- - -
-
-
-{% endblock %}