mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-20 12:29:02 +02:00
services/lemmy: fix /feeds/* and /nodeinfo/* API endpoints
Co-authored-by: Shahar Dawn Or <mightyiampresence@gmail.com> Co-authored-by: Matthias Meschede <MMesch@users.noreply.github.com> Co-authored-by: a-kenji <aks.kenji@protonmail.com> Co-authored-by: Ctem <c@ctem.me> Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
This commit is contained in:
parent
c5cb6985cc
commit
b7f19802af
|
@ -117,7 +117,7 @@ in
|
||||||
file_server
|
file_server
|
||||||
}
|
}
|
||||||
@for_backend {
|
@for_backend {
|
||||||
path /api/* /pictrs/* feeds/* nodeinfo/*
|
path /api/* /pictrs/* /feeds/* /nodeinfo/*
|
||||||
}
|
}
|
||||||
handle @for_backend {
|
handle @for_backend {
|
||||||
reverse_proxy 127.0.0.1:${toString cfg.settings.port}
|
reverse_proxy 127.0.0.1:${toString cfg.settings.port}
|
||||||
|
|
|
@ -23,6 +23,13 @@ in
|
||||||
hostname = "http://${lemmyNodeName}";
|
hostname = "http://${lemmyNodeName}";
|
||||||
port = backendPort;
|
port = backendPort;
|
||||||
database.createLocally = true;
|
database.createLocally = true;
|
||||||
|
# Without setup, the /feeds/* and /nodeinfo/* API endpoints won't return 200
|
||||||
|
setup = {
|
||||||
|
admin_username = "mightyiam";
|
||||||
|
admin_password = "ThisIsWhatIUseEverywhereTryIt";
|
||||||
|
site_name = "Lemmy FTW";
|
||||||
|
admin_email = "mightyiam@example.com";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
caddy.enable = true;
|
caddy.enable = true;
|
||||||
};
|
};
|
||||||
|
@ -76,7 +83,8 @@ in
|
||||||
# No path can return 200 until after we upload an image to pict-rs
|
# No path can return 200 until after we upload an image to pict-rs
|
||||||
assert_http_code("${lemmyNodeName}/pictrs/", 404)
|
assert_http_code("${lemmyNodeName}/pictrs/", 404)
|
||||||
|
|
||||||
# The paths `/feeds/*` and `/nodeinfo/*` are not tested because they seem to be misconfigured
|
assert_http_code("${lemmyNodeName}/feeds/all.xml", 200)
|
||||||
|
assert_http_code("${lemmyNodeName}/nodeinfo/2.0.json", 200)
|
||||||
|
|
||||||
assert_http_code("${lemmyNodeName}/some-other-made-up-path/", 404, "-X POST")
|
assert_http_code("${lemmyNodeName}/some-other-made-up-path/", 404, "-X POST")
|
||||||
assert_http_code("${lemmyNodeName}/some-other-path", 404, "-H 'Accept: application/activity+json'")
|
assert_http_code("${lemmyNodeName}/some-other-path", 404, "-H 'Accept: application/activity+json'")
|
||||||
|
|
Loading…
Reference in a new issue