4 Commits

Author SHA1 Message Date
9d8b14a08b nix/module: fix spaceapi endpoint 2024-05-18 20:54:05 +02:00
0542a10d03 spaceapi: Moves calendar into feeds
Co-authored-by: h7x4 <h7x4@nani.wtf>
2024-05-18 20:03:20 +02:00
c6df8e6ae3 nix/module: Specify json mimetype for spaceapi.php 2024-05-14 19:29:51 +02:00
aebc14ccb5 feat: adds spaceapi endpoint 2024-05-14 19:29:51 +02:00
2 changed files with 6 additions and 6 deletions

@@ -196,6 +196,9 @@ in
include ${pkgs.nginx}/conf/fastcgi_params;
fastcgi_param SCRIPT_FILENAME ${finalPackage}/share/php/pvv-nettsiden/www$fastcgi_script_name;
fastcgi_pass unix:${config.services.phpfpm.pools."pvv-nettsiden".socket};
location = /spaceapi.php {
add_header Content-Type application/json;
}
'';
# based on https://simplesamlphp.org/docs/stable/simplesamlphp-install.html#configuring-nginx

@@ -2,9 +2,6 @@
require_once dirname(__DIR__) . implode(DIRECTORY_SEPARATOR, ['', 'inc', 'include.php']);
header('Content-Type: application/json');
header('Access-Control-Allow-Origin: *');
$pdo = new \PDO($DB_DSN, $DB_USER, $DB_PASS);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
@@ -23,8 +20,8 @@ $doorEntry = (object)($door->getCurrent());
"ext_mazemap": "https://link.mazemap.com/2n2HWa7H",
"address": "Sem Sælands vei 1, 7034 Trondheim, Norway",
"timezone": "Europe/Oslo",
"lon": 10.4038103,
"lat": 63.417025
"lon": 10.242,
"lat": 63.250
},
"contact": {
"irc": "irc://irc.pvv.ntnu.no/pvv",
@@ -42,7 +39,7 @@ $doorEntry = (object)($door->getCurrent());
"feeds": {
"wiki": {
"type": "atom",
"url": "https://wiki.pvv.ntnu.no/w/api.php?hidebots=1&urlversion=1&action=feedrecentchanges&feedformat=atom"
"url": "https://www.pvv.ntnu.no/w/api.php?hidebots=1&urlversion=1&action=feedrecentchanges&feedformat=atom"
},
"calendar": {
"type": "html",