Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
61f6027a64 |
15
CLAUDE.md
15
CLAUDE.md
@@ -130,6 +130,21 @@ if timeout > DefaultTimeoutSeconds {
|
||||
- Provide public API methods (`IsEnabled()`, `CheckPolicy()`)
|
||||
- Never change unexported→exported to fix bugs
|
||||
|
||||
### 6. Auth-Required Configuration (CAUTION)
|
||||
|
||||
**Be extremely careful when modifying auth-related settings in deployment configs.**
|
||||
|
||||
The `ORLY_AUTH_REQUIRED` and `ORLY_AUTH_TO_WRITE` settings control whether clients must authenticate via NIP-42 before interacting with the relay. Changing these on a production relay can:
|
||||
|
||||
- **Lock out all existing clients** if they don't support NIP-42 auth
|
||||
- **Break automated systems** (bots, bridges, scrapers) that depend on anonymous access
|
||||
- **Cause data sync issues** if upstream relays can't push events
|
||||
|
||||
Before enabling auth-required on any deployment:
|
||||
1. Verify all expected clients support NIP-42
|
||||
2. Ensure the relay identity key is properly configured
|
||||
3. Test with a non-production instance first
|
||||
|
||||
## Database Backends
|
||||
|
||||
| Backend | Use Case | Build |
|
||||
|
||||
2
app/web/dist/bundle.js
vendored
2
app/web/dist/bundle.js
vendored
File diff suppressed because one or more lines are too long
2
app/web/dist/bundle.js.map
vendored
2
app/web/dist/bundle.js.map
vendored
File diff suppressed because one or more lines are too long
@@ -480,14 +480,9 @@ export async function fetchUserProfile(pubkey) {
|
||||
console.warn("Failed to fetch profile from fallback relays:", error);
|
||||
}
|
||||
|
||||
// 4) No profile found anywhere - create a default profile for new users
|
||||
console.log("No profile found for pubkey, creating default:", pubkey);
|
||||
try {
|
||||
return await createDefaultProfile(pubkey);
|
||||
} catch (e) {
|
||||
console.error("Failed to create default profile:", e);
|
||||
return null;
|
||||
}
|
||||
// 4) No profile found anywhere
|
||||
console.log("No profile found for pubkey:", pubkey);
|
||||
return null;
|
||||
}
|
||||
|
||||
// Helper to fetch profile from fallback relays
|
||||
@@ -561,57 +556,6 @@ async function processProfileEvent(profileEvent, pubkey) {
|
||||
return profile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a default profile for new users
|
||||
* @param {string} pubkey - The user's public key (hex)
|
||||
* @returns {Promise<Object>} - The created profile
|
||||
*/
|
||||
async function createDefaultProfile(pubkey) {
|
||||
// Generate name from first 6 chars of pubkey
|
||||
const shortId = pubkey.slice(0, 6);
|
||||
const defaultName = `testuser${shortId}`;
|
||||
|
||||
// Get the current origin for the logo URL
|
||||
const logoUrl = `${window.location.origin}/orly.png`;
|
||||
|
||||
const profileContent = {
|
||||
name: defaultName,
|
||||
display_name: defaultName,
|
||||
picture: logoUrl,
|
||||
about: "New ORLY user"
|
||||
};
|
||||
|
||||
const profile = {
|
||||
name: defaultName,
|
||||
displayName: defaultName,
|
||||
picture: logoUrl,
|
||||
about: "New ORLY user",
|
||||
pubkey: pubkey
|
||||
};
|
||||
|
||||
// Try to publish the profile if we have a signer
|
||||
if (nostrClient.signer) {
|
||||
try {
|
||||
const event = {
|
||||
kind: 0,
|
||||
content: JSON.stringify(profileContent),
|
||||
tags: [],
|
||||
created_at: Math.floor(Date.now() / 1000)
|
||||
};
|
||||
|
||||
// Sign and publish using the websocket-auth client
|
||||
const signedEvent = await nostrClient.signer.signEvent(event);
|
||||
await nostrClient.publish(signedEvent);
|
||||
console.log("Default profile published:", signedEvent.id);
|
||||
} catch (e) {
|
||||
console.warn("Failed to publish default profile:", e);
|
||||
// Still return the profile even if publishing fails
|
||||
}
|
||||
}
|
||||
|
||||
return profile;
|
||||
}
|
||||
|
||||
// Fetch events
|
||||
export async function fetchEvents(filters, options = {}) {
|
||||
console.log(`Starting event fetch with filters:`, JSON.stringify(filters, null, 2));
|
||||
|
||||
@@ -1 +1 @@
|
||||
v0.48.10
|
||||
v0.48.11
|
||||
|
||||
Reference in New Issue
Block a user