This fullstack-example
directory aims to be a quick way to try out Diskuto.
In everyday use, Diskuto has two main parts:
- diskuto-api - The API server which lets you read/write content in the Diskuto network.
- diskuto-web - A web UI that lets you do that in a browser.
You can host both of those things on different servers, but I suspect many people might want to have them on the same server, so you can put them behind a web proxy like Nginx.
This directory puts all three of those together in a compose.yaml file to simplify testing.
You can also use the configuration files here as a starting point to bootstrap your "production" setup.
-
Install Podman
-
Install podman-compose.
Note: Docker and docker-compose might work here, but I'm testing this with Podman, so YMMV.
-
Build/download all images:
./compose build
-
Initialize the database.
./compose run api diskuto db init
This just runs
diskuto db init
inside of theapi
container. It will create adiskuto.sqlite3
database in the./data/
directory. -
Start services.
./compose up
You should now be able to access an empty Diskuto instance at: http://localhost:9090.
There's nothing interesting there yet, though. Just an empty "Home" page and a "Log In" page.
The "Log In" page has a tool called "Create ID". Click the "New" button to create one.
The UserID
will be your global, public ID within Diskuto. For example:
B2wQ3yuzGaaE6U5KbduAWwTNFZsX2RfspdUAFbmLjaEM
. (Don't worry, you'll have a name, too.)
The Private Key
should be kept in a secure location like a password manager. You only
need your private key when you write to Diskuto. Browsing only needs your UserID.
"Log In" to the web UI by with your new UserID.
I good idea for your first post is to publish a profile about yourself. This lets you set a display name associated with your new user ID, and write a bit about yourself.
Click on "My Profile" to create a new profile. Fill in the Display Name field and type something about yourself.
You can ignore the other sections ("Servers" and "Follows") for now.
Any time you write content to Diskuto, you cryptographically sign it so that the server knows:
- It's from you
- It hasn't been altered in transit.
So to send our post, we first need to sign it.
Eventually, there will be a browser plugin that will automate this for us. Until then, you can use diskuto-web's built-in signing tool to to this.
- Click the "Copy Signing Request" button to copy your new post to the clipboard.
- Click the "Open Signing Tool" link to use the built-in signing tool.
- Paste the signing request.
- Paste your private key.
- Copy the generated signature at the bottom of the page.
- Paste that signature back into the "Edit Profile" page.
- Click the "Post" button to send your signed update to Diskuto.
And... it failed! You'll likely see something like this:
Error uploading Item: 403 Forbidden
That's because we haven't yet told the server which users are allowed to store content on it.
Keep this browser tab open, we'll come back to it and try again, right after we...
-
Open up a new terminal window in this directory.
-
Run:
./compose run api diskuto user add $yourUserID --on-homepage
Of course, replace
$yourUserID
with your public user ID. The server does not need to know your private key. -
To verify the user was added, you can run:
./compose run api diskuto user list
Now return to your web browser and click the "Post" button again. This time it succeeds, the server accepts your profile update.
- Try creating a post. The process for signing is similar to signing a profile update.
- Follow a new user
- Create a new userID.
- In your old userID, add the new ID to its "follows" list and post your profile update. This lets the server (and other people) know that you're interested in updates from that user.
- Log in as the new userID.
- You can automatically post profile updates and posts because you're followed by someone on the server.
(i.e.: no need to run
diskuto user add ...
)
- Sync content from other servers using diskuto-sync
- Sync content from RSS feeds using rss-sync
- Sync content from Mastodon using [coming soon!].
- Try browsing the content directly from the API using diskuto-client
- Join the Discord server to chat about Diskuto and find other users to follow. (see link here)