parent
996da6dd87
commit
38856cb9ad
@ -0,0 +1,30 @@
|
||||
#include "nodeinfo.h"
|
||||
|
||||
#include "http_server/http_request.h"
|
||||
#include "model/server.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
bool route_wellknown_nodeinfo( struct http_request* req )
|
||||
{
|
||||
http_request_send_headers( req, 200, "application/json", true );
|
||||
FILE* f = http_request_get_response_body(req);
|
||||
#define RENDER
|
||||
#include "src/view/nodeinfo.json.inc"
|
||||
#undef RENDER
|
||||
return true;
|
||||
}
|
||||
bool route_nodeinfo( struct http_request* req )
|
||||
{
|
||||
if( http_request_route( req, "/2.1" ) ) {
|
||||
http_request_send_headers( req, 200, "application/json", true );
|
||||
FILE* f = http_request_get_response_body(req);
|
||||
#define RENDER
|
||||
#include "src/view/nodeinfo_2_1.json.inc"
|
||||
#undef RENDER
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
struct http_request;
|
||||
|
||||
bool route_wellknown_nodeinfo( struct http_request* req );
|
||||
bool route_nodeinfo( struct http_request* req );
|
||||
|
@ -0,0 +1,5 @@
|
||||
#include "server.h"
|
||||
|
||||
// TODO: make this configurable
|
||||
const char* g_server_name = "apogee.polaris-1.work";
|
||||
|
@ -0,0 +1,4 @@
|
||||
#pragma once
|
||||
|
||||
extern const char* g_server_name;
|
||||
|
@ -0,0 +1,9 @@
|
||||
{
|
||||
"links": [
|
||||
{
|
||||
"rel": "http://nodeinfo.diaspora.software/ns/schema/2.1",
|
||||
"href": "https://%s{g_server_name}/nodeinfo/2.1"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -0,0 +1,26 @@
|
||||
{
|
||||
"version": "2.1",
|
||||
"software": {
|
||||
"name": "apogee",
|
||||
"version": "0.1alpha",
|
||||
"repository": "https://gitea.polaris-1.work/teknomunk/apogee",
|
||||
},
|
||||
"protocols": ["activitypub"],
|
||||
"services": {
|
||||
"inbound": [],
|
||||
"outbound": []
|
||||
},
|
||||
"openRegistrations": false,
|
||||
"usage": {
|
||||
"users": {
|
||||
"total": 1,
|
||||
"activeHalfyear": 0,
|
||||
"activeMonth": 0
|
||||
},
|
||||
"localPosts": 0,
|
||||
"localComments": 0
|
||||
},
|
||||
"metadata": {
|
||||
"chat_enabled": false
|
||||
}
|
||||
}
|
Loading…
Reference in new issue