Scalable and distributed custom feed generator, ott - on that topic

Small adjustments towards working MVP

+23 -18
+14 -6
crates/ott-xrpc/src/main.rs
··· 18 18 use ott_xrpc::{bsky::BskyClient, key::generate_key}; 19 19 20 20 use tracing::info; 21 + use tracing_subscriber::EnvFilter; 21 22 22 23 async fn handler( 23 24 ExtractServiceAuth(auth): ExtractServiceAuth, ··· 43 44 44 45 #[tokio::main] 45 46 async fn main() { 47 + tracing_subscriber::fmt() 48 + .with_ansi(true) // Colors enabled (default) 49 + .with_max_level(tracing::Level::INFO) 50 + .init(); 51 + 52 + info!("Setup"); 46 53 let did_str = "did:web:ott.aleeve.dev"; 47 54 let did = Did::new_static(did_str); 48 55 49 56 let verification_method = VerificationMethod { 50 - id: "{did}#atproto".into(), 51 - r#type: "Mutlikeybase".into(), 57 + id: format!("{}#atproto", did_str).into(), 58 + r#type: "Mutlikey".into(), 52 59 controller: Some("did:web:ott.aleeve.dev".into()), 53 60 public_key_multibase: Some(generate_key().into()), 54 61 extra_data: BTreeMap::default(), 55 62 }; 56 63 57 64 let service = Service { 58 - id: "".into(), 59 - service_endpoint: Some("".into()), 60 - r#type: "".into(), 65 + id: "#bsky_fg".into(), 66 + service_endpoint: Some("https://ott.aleeve.dev/".into()), 67 + r#type: "BskyFeedGenerator".into(), 61 68 extra_data: BTreeMap::default(), 62 69 }; 63 70 ··· 78 85 .with_state(config) 79 86 .merge(did_web_router(did_doc)); 80 87 81 - let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap(); 88 + let listener = tokio::net::TcpListener::bind("0.0.0.0:8080").await.unwrap(); 89 + info!("Starting service"); 82 90 axum::serve(listener, app).await.unwrap(); 83 91 }
+1 -1
helm/ott/templates/cloudflared_tunnel.yaml
··· 1 - {{- if .Values.cloudflare.enabled }} 1 + {{- if .Values.cloudflared.enabled }} 2 2 apiVersion: v1 3 3 kind: Secret 4 4 metadata:
+2
helm/ott/templates/pg_cluster.yaml
··· 9 9 size: 10Gi 10 10 enableSuperuserAccess: true 11 11 postgresql: 12 + parameters: 13 + cron.database_name: "app" 12 14 shared_preload_libraries: 13 15 - pg_cron
+2 -7
helm/ott/templates/pg_migration.yaml
··· 28 28 key: password 29 29 - name: DATABASE_URL 30 30 value: "postgres://$(DATABASE_USER):$(DATABASE_PASSWORD)@postgres-rw.default.svc.cluster.local:5432/app" 31 - - name: POSTGRES_URL 32 - value: "postgres://$(DATABASE_USER):$(DATABASE_PASSWORD)@postgres-rw.default.svc.cluster.local:5432/postgres" 33 31 command: 34 32 - /bin/sh 35 33 - -c 36 34 - | 37 35 echo "Waiting for database to be ready..." 38 - for i in {1..30}; do 39 - if pg_isready -h $DATABASE_URL; then 36 + for i in $(seq 1 30); do 37 + if pg_isready -d $DATABASE_URL; then 40 38 echo "Database is ready!" 41 39 break 42 40 fi 43 41 echo "Attempt $i/30: Database not ready yet, waiting..." 44 42 sleep 10 45 43 done 46 - 47 - echo "Making sure extensions are installed" 48 - psql "$POSTGRES_URL" -c "CREATE EXTENSION IF NOT EXISTS pg_cron;" 49 44 50 45 echo "Setting up migration" 51 46 ./app
+4 -4
helm/ott/values.yaml
··· 4 4 5 5 cloudflared: 6 6 enabled: true 7 - token: {} 7 + token: null 8 8 9 9 app_auth: 10 - did: {} 11 - key: {} 10 + did: null 11 + key: null 12 12 13 13 services: 14 14 likes_connector: ··· 65 65 valueFrom: 66 66 secretKeyRef: 67 67 name: app-auth 68 - key: KEY 68 + key: key