Add AFFiNE pod creation script with PostgreSQL and Redis

Shell script to create a rootless Podman pod running AFFiNE v0.26.3
with pgvector/PostgreSQL and Redis, managed via systemd user services.
Exposes AFFiNE Web UI and GraphQL API on port 8092.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
pln
2026-03-15 16:28:36 +01:00
commit 626a951681
3 changed files with 243 additions and 0 deletions

64
prompt_shell-script.md Normal file
View File

@@ -0,0 +1,64 @@
# Podman shell script for AFFiNE service
## Motivation
A Podman Pod is needed on a Linux server which provides an AFFiNE service.
This Podman Pod needs to be created and started with a shell script which needs to be designed.
The AFFiNE service will be used by humans and by AI agents; it will also be part of a design environment for designing a special MCP server for AFFiNE.
## Shell script requirements
Requirements for the shell script:
- Must use a container image with a Pinned Tag (for exact consistency) which points to the AFFiNE version 0.26.3. The name likely is something like "ghcr.io/toeverything/affine:0.26.3".
- Must provide the AFFiNE web user interface at port 8092.
- Must provide the GraphQL API. Background: The AFFiNE web and desktop apps use an internal GraphQL API to communicate with the backend. There is a /graphql endpoint but it is not documented for third-party use.
- Must be in folder /home/pln/bin.
- Must have the name create_pod_affine.sh
The shell script shall be run by user pln which has permissions to run rootless pods.
## Shell script style
The needed shell script must have the same style as other shell scripts on the server.
These files are examples:
/home/lwc/bin/create_pod_langflow.sh
/home/krt/bin/create_pod_qdrant.sh
## Your tasks
### Ask first
Before starting to design the shell script, ask between two and five questions to fully understand the situation, your tasks and the objectives.
### Identify the container image
Find the container image with Pinned Tag pointing to AFFiNE version 0.26.3.
### Write the shell script
Write the shell script.
### Test the shell script
Run the shell script and test it.
### Redesign if necessary
If the test failed, understand the problem, improve the shell script and go back to Test the shell script.
Repeat this in a loop up to five times.
## Your objectives
Your objectives are:
- All requirements are fulfilled.
- AFFiNE web user interface shows up at 127.0.0.1:8092.
- The AFFiNE GraphQL API shows up under 127.0.0.1:8092 at /graphql or another link.
## Your behaviour
If it is not possible to achieve your objectives, interrupt and ask me.
Complete all your tasks without asking in between if you can achieve your objectives.