Verified Commit f107b320 authored by Jakob Moser's avatar Jakob Moser
Browse files

Reformat file

parent adea1845
Loading
Loading
Loading
Loading
+12 −11
Original line number Diff line number Diff line
@@ -102,8 +102,8 @@ Of course, displaying them is not the only thing you can do with OpenAPI files.

The `api/v1/index.html` and everything in `lib/redoc` is static code that renders the OpenAPI specification for a visitor. This means you can comfortably look at the API at https://status.fsco.li/api/v1.

* [Swagger Editor](https://editor.swagger.io/)
* [Redoc](https://redocly.github.io/redoc/)
- [Swagger Editor](https://editor.swagger.io/)
- [Redoc](https://redocly.github.io/redoc/)

### The server side

@@ -122,9 +122,9 @@ The code itself sends HTTPS requests to the different services to see if they ar

The `.htaccess` files are configuration for the Apache webserver:

* `api/.htaccess` redirects every request to `/api` to `/api/v1` (so you can enter https://status.fsco.li/api in your browser and are automatically directed to https://status.fsco.li/api/v1). This is just a comfort feature.
* `api/v1/.htaccess` rewrites every request to `/api/v1/services` to go to `/api/v1/services.php`.
  * This is necessary because we want to provide a true REST-API experience (where all the request URLs look like paths), so we would like to avoid the `.php` suffix.
- `api/.htaccess` redirects every request to `/api` to `/api/v1` (so you can enter https://status.fsco.li/api in your browser and are automatically directed to https://status.fsco.li/api/v1). This is just a comfort feature.
- `api/v1/.htaccess` rewrites every request to `/api/v1/services` to go to `/api/v1/services.php`.
    - This is necessary because we want to provide a true REST-API experience (where all the request URLs look like paths), so we would like to avoid the `.php` suffix.

### Docker

@@ -148,7 +148,7 @@ Why do we do it this way and not using Docker? Because the “classic” is what

Why didn't we host the status page on our own infrastructure (and then using Docker)? Because it would be nice if the status page were still available even when the Fachschaft server is down.

* [lima-city](https://www.lima-city.de/?cref=435320) (referral link[^2])
- [lima-city](https://www.lima-city.de/?cref=435320) (referral link[^2])

## Questions & Answers

@@ -158,7 +158,7 @@ You're probably right. PHP is often mixed together with HTML to form some kind o

This is also how PHP is explained in many tutorials, e.g. this one:

* [PHP: Your first PHP-enabled page - Manual](https://www.php.net/manual/en/tutorial.firstpage.php)
- [PHP: Your first PHP-enabled page - Manual](https://www.php.net/manual/en/tutorial.firstpage.php)

However, nothing about PHP (the language) mandates that it has to output HTML. If you prefer to have a clear separation of concerns (server code only supplies data in machine-readable format, client code deals with presenting that to the user), you can write a “modern-style” API returning JavaScript in any language, including PHP.

@@ -174,7 +174,7 @@ Second, you should version your API, e.g. using Semantic Versioning (version num

This is why we have chosen a more convoluted-looking directory structure instead of just placing the file at root level.

* [Semantic Versioning](https://semver.org/)
- [Semantic Versioning](https://semver.org/)

### Couldn't we have done this entirely on the client?

@@ -186,7 +186,7 @@ The problem is that due to the Same-Origin-Policy, client-side JavaScript cannot

Why does this policy exist? Good question. The main reason is to protect against a security hole that is only there for historical reasons (but it is there). The policy could have been avoided if the web was designed differently, but sadly it wasn't, so we have to deal with that.

* [The Same Origin Policy - Hacker History (video)](https://www.youtube.com/watch?v=bSJm8-zJTzQ)
- [The Same Origin Policy - Hacker History (video)](https://www.youtube.com/watch?v=bSJm8-zJTzQ)

## License

@@ -194,12 +194,13 @@ This project is released into the [Public Domain (CC0)](LICENSE). You can do wit

Note that this does not apply to third party files (those found in `lib/*`), namely:

* Redoc (`lib/redoc/*`), which is licensed under the [MIT License](lib/redoc/LICENSE)
* fscoli-next Theme (`lib/fscoli-next/*`), which is licensed under the [GNU General Public License v3.0](lib/fscoli-next/style.css)
- Redoc (`lib/redoc/*`), which is licensed under the [MIT License](lib/redoc/LICENSE)
- fscoli-next Theme (`lib/fscoli-next/*`), which is licensed under the [GNU General Public License v3.0](lib/fscoli-next/style.css)

For details and authorship information, see the linked license files.

## Footnotes

[^1]: That is, unless you make a configuration error or run a server without PHP capabilities. This means: Yes, you can technically store secrets in PHP files, they should not be sent to the client – but if you ever do that, make sure you verify everything works as it should.

[^2]: Jakob gets commission if you happen to pay for a service at lima-city via this link. Not paid, Jakob just actually likes lima-city.
+13 −10
Original line number Diff line number Diff line
@@ -8,31 +8,34 @@ export default {
    view() {
        return [
            m("h2", "Dienste der Fachschaft"),
            m("p", 
                "Diese Dienste sollten jederzeit aus dem Internet verfübgar sein, genau dann werden sie hier grün markiert. Seit 2026-01-08 ist das auch wieder für alle Dienste der Fall."
            m(
                "p",
                "Diese Dienste sollten jederzeit aus dem Internet verfübgar sein, genau dann werden sie hier grün markiert. Seit 2026-01-08 ist das auch wieder für alle Dienste der Fall.",
            ),
            m(StatusSection, {
                category: "fachschaft",
                services: services.value
                services: services.value,
            }),

            m("h2", "Dienste des Instituts"),
            m("p", 
                "Auf diese Dienste haben wir als Fachschaft keinen Einfluss, denn sie werden vom Institut für Computerlinguistik betreiben. Falls sie aber auch down sind, spricht das dafür, dass gerade ein größeres Problem besteht."
            m(
                "p",
                "Auf diese Dienste haben wir als Fachschaft keinen Einfluss, denn sie werden vom Institut für Computerlinguistik betreiben. Falls sie aber auch down sind, spricht das dafür, dass gerade ein größeres Problem besteht.",
            ),
            m(StatusSection, {
                category: "institute",
                services: services.value
                services: services.value,
            }),

            m("h2", "Dienste der Uni"),
            m("p", 
                "Auch auf diese Dienste haben wir als Fachschaft keinen Einfluss."
            m(
                "p",
                "Auch auf diese Dienste haben wir als Fachschaft keinen Einfluss.",
            ),
            m(StatusSection, {
                category: "uni",
                services: services.value
                services: services.value,
            }),
        ]
    }
    },
}