this repo has no description
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

updates and bugfixes

+59 -29
+3 -11
README.md
··· 23 23 ## Quick Start 24 24 25 25 ```bash 26 - # 1. Configure OAuth (one-time setup) 27 - blup configure 28 - 29 26 # 2. Authenticate 30 27 blup auth 31 28 ··· 34 31 ``` 35 32 36 33 ## Commands 37 - 38 - ### ```blup configure``` 39 - Set up OAuth client credentials (one-time setup) 40 - 41 34 ### ```blup auth``` 42 35 Authenticate with your AT Protocol account via OAuth 43 36 ··· 84 77 85 78 blup uses OAuth for secure authentication: 86 79 87 - 1. Run ```blup configure``` to set up OAuth client 88 - 2. Run ```blup auth``` to authenticate 89 - 3. Your browser will open for authorization 90 - 4. You're ready to upload! 80 + 1. Run ```blup auth``` to authenticate 81 + 2. Your browser will open for authorization 82 + 3. You're ready to upload! 91 83 92 84 ## Building from source 93 85
-11
cmd/cli/main.go
··· 15 15 "github.com/bluesky-social/indigo/xrpc" 16 16 oauth "github.com/haileyok/atproto-oauth-golang" 17 17 "github.com/spf13/cobra" 18 - "golang.design/x/clipboard" 19 18 "tangled.sh/evan.jarrett.net/blup/internal/auth" 20 19 "tangled.sh/evan.jarrett.net/blup/internal/config" 21 20 "tangled.sh/evan.jarrett.net/blup/internal/util" ··· 258 257 } 259 258 compressedUrl := fmt.Sprintf("%s/%s/%s\n", CDN, cfg.Handle, converted) 260 259 261 - fmt.Printf("%s/%s/%s\n", CDN, authArgs.Did, blobCID) 262 260 fmt.Println(compressedUrl) 263 - 264 - // Initialize clipboard 265 - err = clipboard.Init() 266 - if err != nil { 267 - fmt.Printf("Warning: Could not initialize clipboard: %v\n", err) 268 - } else { 269 - clipboard.Write(clipboard.FmtText, []byte(compressedUrl)) 270 - fmt.Println("URL copied to clipboard") 271 - } 272 261 return nil 273 262 } 274 263
-2
go.mod
··· 4 4 5 5 require ( 6 6 github.com/bluesky-social/indigo v0.0.0-20250621010046-488d1b91889b 7 - github.com/gen2brain/beeep v0.11.1 8 7 github.com/golang-jwt/jwt/v5 v5.2.2 9 8 github.com/haileyok/atproto-oauth-golang v0.0.3-0.20250622200753-e07caa5274a7 10 9 github.com/ipfs/go-cid v0.5.0 ··· 12 11 github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c 13 12 github.com/spf13/cobra v1.9.1 14 13 github.com/zalando/go-keyring v0.2.6 15 - golang.design/x/clipboard v0.7.1 16 14 ) 17 15 18 16 require (
+19
internal/auth/client-metadata.json
··· 1 + { 2 + "client_id": "https://blup.imgs.blue/oauth/client-metadata.json", 3 + "client_name": "Blup", 4 + "client_uri": "https://blup.imgs.blue", 5 + "grant_types": [ 6 + "authorization_code", 7 + "refresh_token" 8 + ], 9 + "scope": "atproto transition:generic", 10 + "response_types": [ 11 + "code" 12 + ], 13 + "redirect_uris": [ 14 + "https://blup.imgs.blue/oauth/callback" 15 + ], 16 + "dpop_bound_access_tokens": true, 17 + "token_endpoint_auth_method": "none", 18 + "application_type": "native" 19 + }
+32
internal/auth/metadata.go
··· 1 + package auth 2 + 3 + import ( 4 + _ "embed" 5 + "encoding/json" 6 + ) 7 + 8 + // NOTE: if the server-side metadata changes, this file will also need to change. 9 + //go:embed client-metadata.json 10 + var metadataJson []byte 11 + type ClientMetadata struct { 12 + ClientID string `json:"client_id"` 13 + ClientName string `json:"client_name"` 14 + SubjectType string `json:"subject_type"` 15 + ClientURI string `json:"client_uri"` 16 + RedirectURIs []string `json:"redirect_uris"` 17 + GrantTypes []string `json:"grant_types"` 18 + ResponseTypes []string `json:"response_types"` 19 + ApplicationType string `json:"application_type"` 20 + DpopBoundAccessTokens bool `json:"dpop_bound_access_tokens"` 21 + JwksURI string `json:"jwks_uri"` 22 + Scope string `json:"scope"` 23 + TokenEndpointAuthMethod string `json:"token_endpoint_auth_method"` 24 + TokenEndpointAuthSigningAlg string `json:"token_endpoint_auth_signing_alg"` 25 + } 26 + 27 + 28 + func GetClientMetadata() ClientMetadata { 29 + var cm ClientMetadata 30 + json.Unmarshal(metadataJson, &cm) 31 + return cm 32 + }
+5 -5
internal/config/config.go
··· 14 14 } 15 15 16 16 func LoadConfig() (*Config, error) { 17 - configPath := getConfigFile() 17 + configPath := GetConfigFile() 18 18 19 19 // Default configuration 20 20 cfg := &Config{ ··· 38 38 cfg.Handle = strings.TrimPrefix(cfg.Handle, "@") 39 39 } 40 40 41 - configPath := getConfigFile() 41 + configPath := GetConfigFile() 42 42 data, err := json.MarshalIndent(cfg, "", " ") 43 43 if err != nil { 44 44 return cfg, err ··· 47 47 return cfg, os.WriteFile(configPath, data, 0600) 48 48 } 49 49 50 - func getConfigFile() string { 51 - home, _ := os.UserHomeDir() 52 - return filepath.Join(home, ".blup.conf") 50 + func GetConfigFile() string { 51 + config, _ := os.UserConfigDir() 52 + return filepath.Join(config, ".blup.json") 53 53 }