Skip to content

Commit

Permalink
added php main page
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry Kodden committed Oct 1, 2023
1 parent c804157 commit 1e1901d
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 5 deletions.
36 changes: 36 additions & 0 deletions ansible/roles/rclone/files/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php
echo "<h1>Links</h1>";

echo "Here you find the links supported at this moment";

echo "<ul>";
foreach (glob("/etc/mounts/*.conf") as $filename) {
$path = basename($filename, ".conf");
if ($path != "admin") {
$description = "WebDAV link: '" . $path . "'";
$path = "webdav/" . $path;
} else {
$description = "Administration page";
}
echo "<li><a href=\"" . $_SERVER['url'] . "/" . $path . "\">" . $description . "</a></li>";

if ($path == 'admin') {
echo "<li><a href=\"" . $_SERVER['url'] . "/" . $path . "/api/doc\">" . $description . " (API Documentation)</a></li>";
}
}
echo "</ul>";

echo "<h2>Authentication</h2>";

echo "The following rules for authentication apply:";

echo "<h3>Admininistration portal</h3>";
echo "Federated authentication via your institute at which you are linked to this SRAM Service";
echo "<br/>";
echo "You also need to be member of the admins groups that is registered with this SRAM Service.";

echo "<h3>WebDAV links</h3>";
echo "Authenticate with your SRAM User ID and your SRAM Token that you have registered for this SRAM Service";

// phpinfo();
?>
15 changes: 13 additions & 2 deletions ansible/roles/rclone/templates/docker-compose.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -103,19 +103,30 @@ services:
- redis
labels:
- "traefik.enable=true"
- "traefik.http.routers.mount.rule=Host(`{{ inventory_hostname }}`) && (PathPrefix(`/`) ||PathPrefix(`/admin`) || PathPrefix(`/webdav`))"
- "traefik.http.routers.mount.rule=Host(`{{ inventory_hostname }}`) && (Path(`/`) || PathPrefix(`/admin`) || PathPrefix(`/webdav`))"
- "traefik.http.routers.mount.tls=true"
- "traefik.http.routers.mount.tls.certresolver=le"
- "traefik.http.routers.mount.entrypoints=https"
- "traefik.http.routers.mount.service=mount"
- "traefik.http.services.mount.loadbalancer.server.port=80"


php-fpm:
image: php:8-fpm
environment:
- url=https://{{ inventory_hostname }}
volumes:
- mounts:/etc/mounts
- ./index.php:/var/www/html/index.php
networks:
- {{ traefik_docker_internal_network }}

volumes:
mounts:
cache:

networks:
{{ traefik_docker_external_network }}:
{{ traefik_docker_external_network }}
external:
name: {{ traefik_docker_external_network }}
{{ traefik_docker_internal_network }}:
Expand Down
6 changes: 3 additions & 3 deletions mount/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM ubuntu:20.04
ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update && apt-get install -y \
nginx nginx-full libnginx-mod-http-lua libnginx-mod-http-fancyindex \
nginx nginx-full libnginx-mod-http-lua \
wget cron curl vim git sudo \
ca-certificates autoconf build-essential make \
libpam-dev libcurl4-gnutls-dev libhiredis-dev libssl-dev \
Expand All @@ -13,7 +13,7 @@ RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG=en_US.UTF-8

ENV LANG en_US.UTF-8
ENV LANG en_US.UTF-8

RUN git clone https://github.com/HarryKodden/SRAM-Token-Service.git /pam && \
cd /pam && \
Expand All @@ -31,4 +31,4 @@ RUN chmod a+x /usr/local/bin/renew.sh

RUN echo "* * * * * root /usr/local/bin/renew.sh" >/etc/cron.d/renew

CMD [ "sh", "-c", "rsyslogd && cron && nginx -g 'daemon off;'" ]
CMD [ "sh", "-c", "rsyslogd && cron && nginx -g 'daemon off;'" ]

0 comments on commit 1e1901d

Please sign in to comment.