Add admin UI + MinIO image uploads

- Admin API: list/edit posts (incl. drafts, raw markdown), moderate comments, subscribers,
  author bio/links, and presigned image upload to MinIO (bucket is public-read for covers).
- Admin UI at /admin: post editor with cover-image upload, comment moderation, subscriber list.
- Public security switched to authenticated-paths so static assets (/images, /data) stay public.
This commit is contained in:
2026-07-22 20:50:45 -05:00
parent 0c5bbaaa01
commit 3827b615dc
82 changed files with 0 additions and 5492 deletions
@@ -1,56 +0,0 @@
package net.reformedwitness.cog;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;
import org.testcontainers.utility.DockerImageName;
import net.reformedwitness.cog.repo.AuthorRepository;
import net.reformedwitness.cog.repo.PostRepository;
/**
* Full-context test against a real Postgres: proves the Flyway schema, the JPA mappings, and the markdown
* seeding (front-matter parsing + HTML rendering) all work end to end.
*/
@SpringBootTest(properties = {
"platform.storage.access-key=test",
"platform.storage.secret-key=test"
})
@Testcontainers
class ConfessionsApplicationTests {
@Container
@ServiceConnection
static PostgreSQLContainer<?> postgres =
new PostgreSQLContainer<>(DockerImageName.parse("postgres:18-alpine"));
@Autowired
PostRepository posts;
@Autowired
AuthorRepository authors;
@Test
void seedsPostsAndAuthorsFromBundledMarkdown() {
assertThat(posts.findByPublishedTrueOrderByPublishedOnDescIdDesc()).isNotEmpty();
assertThat(authors.findAllByOrderByNameAsc()).isNotEmpty();
var fourfold = posts.findBySlug("fourfold");
assertThat(fourfold).isPresent();
assertThat(fourfold.get().getTitle()).isNotBlank();
assertThat(fourfold.get().getAuthor()).isNotBlank();
assertThat(fourfold.get().getTags()).isNotEmpty();
assertThat(fourfold.get().getContentHtml()).contains("<p>");
}
@Test
void tagCountsAreAggregated() {
assertThat(posts.tagCounts()).isNotEmpty();
}
}