- Elixir 100%
| config | ||
| lib/warmlake | ||
| priv | ||
| .formatter.exs | ||
| .gitignore | ||
| AGENTS.md | ||
| CONTRIBUTING.md | ||
| LICENSE | ||
| mix.exs | ||
| mix.lock | ||
| README.md | ||
Warmlake
This project is aiming to be a backend that can be used by an organisation (such as a ham radio club) to store important stuff - like announcements that can be browsed by its' members. Original plan includes users; activities, notes, pages for internal use; events, logs (logbooks and entries) for public and internal use; organizations and groups for both internal and public use - for example to display members of the org on a webpage.
Warmlake can and will stray away from ActivityPub / ActivityStreams for custom stuff, but will strive to be compatible, and federatable in the future.
Everything below version 1.0.0 is considered experimental and not production ready. Use at your own discretion.
Along side this project there's gonna be developement happening in Cuddlefish, which will be a dedicated frontend to use with Warmlake.
Development
Before continuing ensure you have the following:
- Postgres installed and ready to go
- Created a user and a database to use by Warmlake (
config/dev.exs) - Set up and have an operational OAuth2 Proxy
Prepare the project:
mix deps.get
mix ecto.setup
Run the development version:
OAUTH_PROXY_ENDPOINT="https://example.endpoint.org" iex -S mix phx.server
To wind everything down and start from scratch use mix ecto.drop
Getting started for Development
To set up your first admin user ensure you know the invite code specified in config/dev.exs
Create the admin user:
# This registration will only succeed if there's no users in the database
# Sidenote: below will also provide the newly created user with `is_admin: true`
curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X POST --data '{"invite_code": "helloworld", "user": {"username": "fish", "display_name": "Silly admin", "email": "[email protected]", "bio": "Hello."}}' http://localhost:4000/api/register | jq
Next step will involve getting a cookie from the OAuth Proxy. You can do that by utilising your existing infrastructure and grabbing the token manually or by passing the actual cookie from Cuddlefish that's behind the proxy. Authenticate yourself with the OAuth Proxy to receive a token:
curl -H 'Accept: application/json' -H 'Cookie: _oauth2_proxy=<long_ass_access_token>' -X POST http://localhost:4000/api/token/exchange | jq
# Example output:
# {
# "token": "fj1rZz3DJcyzkgZb7ZSdUqbjrY8F7xp1-94aabdxYQ0"
# }
Use the token to authenticate yourself in further requests:
curl -H 'Accept: application/json' -H 'Authorization: Bearer fj1rZz3DJcyzkgZb7ZSdUqbjrY8F7xp1-94aabdxYQ0' -H 'Content-Type: application/json' -X GET http://localhost:4000/api/users/self | jq
# {
# "@context": [
# "https://www.w3.org/ns/activitystreams#",
# "http://localhost:4000/schemas/warmlake-0.0.jsonld"
# ],
# "endpoints": {
# "sharedInbox": "http://localhost:4000/inbox"
# },
# "id": "http://localhost:4000/users/fish",
# "inbox": "http://localhost:4000/users/fish/inbox",
# "name": "Silly admin",
# "outbox": "http://localhost:4000/users/fish/outbox",
# "preferredUsername": "fish",
# "sharedInbox": "http://localhost:4000/inbox",
# "summary": "Hello.",
# "type": "Person",
# "url": "http://localhost:4000/users/fish"
# }
Acknowlegements
This thingy is heavily based on Pleroma. Please support it's creators.