Skip to content

Conversation

@tanrax
Copy link

@tanrax tanrax commented Nov 26, 2025

Implements a new strategy to post messages to Org Social, a decentralized social network based on Org Mode files over HTTP.

Configuration:

  • vfile: Virtual file URL with authentication token
  • publicUrl: Public URL of the social.org file
  • host: Optional Org Social Host instance (defaults to host.org-social.org)

All tests passing

Implements a new strategy to post messages to Org Social, a decentralized
social network based on Org Mode files over HTTP.

Features:
- Posts messages to Org Social via host API
- Supports unlimited message length
- Automatic RFC 3339 timestamp generation with unique IDs
- Proper Org Mode post formatting
- Removes empty template markers from host responses
- Appends posts at the end of social.org file
- First post has no blank line, subsequent posts have one blank line separator
- Downloads from public URL, uploads via authenticated vfile

Configuration:
- vfile: Virtual file URL with authentication token
- publicUrl: Public URL of the social.org file
- host: Optional Org Social Host instance (defaults to host.org-social.org)

Tests:
- 22 comprehensive unit tests covering all functionality
- Verified with real API integration tests
- All 346 tests passing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@nzakas
Copy link
Contributor

nzakas commented Nov 26, 2025

Thanks for the contribution. Please provide some documentation around Org Social and its API so I can review.

@tanrax
Copy link
Author

tanrax commented Nov 26, 2025

@nzakas

Endpoint: POST /signup

Request:

curl -X POST https://host.org-social.org/signup \
  -H "Content-Type: application/json" \
  -d '{"nick": "your-nickname"}'

Response (Success):

{
  "type": "Success",
  "errors": [],
  "data": {
    "vfile": "http://host.org-social.org/vfile?token=YOUR_TOKEN&ts=TIMESTAMP&sig=SIGNATURE",
    "public-url": "http://host.org-social.org/your-nickname/social.org"
  }
}

Response (Error):

{
  "type": "Error",
  "errors": ["Nickname already exists"]
}
  1. Upload/Update File

Endpoint: POST /upload

Request:

curl -X POST https://host.org-social.org/upload \
  -F "vfile=http://host.org-social.org/vfile?token=..." \
  -F "file=@social.org"

Response (Success):

{
  "type": "Success",
  "errors": [],
  "data": {
    "message": "File uploaded successfully",
    "public-url": "http://host.org-social.org/your-nickname/social.org"
  }
}
  1. Delete File

Endpoint: POST /delete

Request:

curl -X POST https://host.org-social.org/delete \
  -F "vfile=http://host.org-social.org/vfile?token=..."
  1. Public Routes

Endpoint: GET /public-routes

Lists all active hosted files for community discovery.

How This Implementation Works

The OrgSocialStrategy class implements the following workflow:

  1. Download: Fetches the current social.org file from the user's publicUrl (or creates a minimal template if it
    doesn't exist yet)
  2. Insert Post: Appends the new post at the end of the file after the * Posts heading with:
    - Unique RFC 3339 timestamp ID (waits if duplicate exists)
    - Post content in Org Mode format
    - Proper spacing (first post: no blank line, subsequent posts: one blank line)
  3. Upload: Sends the updated file to the host using the authenticated vfile URL via multipart/form-data

Authentication: The vfile URL contains a token, timestamp, and signature that authenticate the user. This is kept private and never shared.

Public Access: The publicUrl is the public, shareable URL where anyone can read the user's posts.

Testing

All tests are passing with 100% coverage:

  • Unit tests for post insertion logic (orgsocial-insert.test.js)
  • Integration tests with mocked HTTP requests (orgsocial.test.js)
  • Tests for error handling, abort signals, and edge cases

References

Let me know if you need any clarification or would like me to add more documentation!

@nzakas
Copy link
Contributor

nzakas commented Dec 2, 2025

Thanks for the info. Just so I'm understanding what I'm looking at, Org Social is your personal project?

@tanrax
Copy link
Author

tanrax commented Dec 2, 2025

Yes! I'm the founder and I maintain some of the tools. The community and its use are growing steadily.

@nzakas
Copy link
Contributor

nzakas commented Dec 3, 2025

As best I can tell, this is at most four months old?

@tanrax
Copy link
Author

tanrax commented Dec 3, 2025

4 months

@tanrax
Copy link
Author

tanrax commented Dec 3, 2025

@nzakas Maintenance won't be a problem; I'll personally take care of keeping it running and fixing any bugs.

@nzakas
Copy link
Contributor

nzakas commented Dec 9, 2025

Can you share some usage statistics? I need to feel like this is more than just a hobby.

@tanrax
Copy link
Author

tanrax commented Dec 9, 2025

@nzakas Of course! -> https://activity.andros.dev/@andros/statuses/01K9Y3KT2TH5DSVANEDYR25VQ3

I need to calculate last month's activity, but the network is very active and has several small projects underway. A language filter was recently added at the request of several users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants