diff --git a/Packages/chrosey_materialize/index.twig b/Packages/chrosey_materialize/index.twig index 8a207a8..4b1d4bd 100644 --- a/Packages/chrosey_materialize/index.twig +++ b/Packages/chrosey_materialize/index.twig @@ -1 +1,15 @@ {% extends "templates/layout/base.twig" %} + +{% if page.meta.hasCode %} + {% block css %} + + {{ parent() }} + {% endblock %} + + {% block js %} + + + {{ parent() }} + {% endblock %} + +{% endif %} diff --git a/Packages/chrosey_materialize/templates/blog.twig b/Packages/chrosey_materialize/templates/blog.twig index 83d03aa..e80cbbc 100644 --- a/Packages/chrosey_materialize/templates/blog.twig +++ b/Packages/chrosey_materialize/templates/blog.twig @@ -1,4 +1,4 @@ -{% extends "templates/layout/base.twig" %} +{% extends "index.twig" %} {% block content %} {{parent()}} diff --git a/Packages/chrosey_materialize/templates/home.twig b/Packages/chrosey_materialize/templates/home.twig index 180144d..9ecace5 100644 --- a/Packages/chrosey_materialize/templates/home.twig +++ b/Packages/chrosey_materialize/templates/home.twig @@ -1,4 +1,4 @@ -{% extends "templates/layout/base.twig" %} +{% extends "index.twig" %} {% block content %}
diff --git a/Packages/chrosey_materialize/templates/withCode.twig b/Packages/chrosey_materialize/templates/withCode.twig deleted file mode 100644 index 944649e..0000000 --- a/Packages/chrosey_materialize/templates/withCode.twig +++ /dev/null @@ -1,12 +0,0 @@ -{% extends "templates/layout/base.twig" %} - -{% block css %} - -{{ parent() }} -{% endblock %} - -{% block js %} - - -{% endblock %} diff --git a/content/about/index.md b/content/about/index.md index 917ddb6..2c6d70a 100644 --- a/content/about/index.md +++ b/content/about/index.md @@ -4,7 +4,7 @@ Description: Das bin ich Author: Christian Seyfferth Date: 2020-01-21 Robots: noindex,nofollow -Template: templates/withCode +hasCode: true --- # Ich bin Christian und würde dir gern helfen diff --git a/content/admin/.htaccess b/content/admin/.htaccess new file mode 100644 index 0000000..e69de29 diff --git a/content/blog/2020/20200507.synology-docker-gitea-drone.md b/content/blog/2020/20200507.synology-docker-gitea-drone.md index e9c879a..2afda8a 100644 --- a/content/blog/2020/20200507.synology-docker-gitea-drone.md +++ b/content/blog/2020/20200507.synology-docker-gitea-drone.md @@ -7,6 +7,7 @@ Categories: - DevOps Template: templates/blogitem +hasCode: true --- # Task-Automatisierung mit der Diskstation @@ -14,13 +15,73 @@ Template: templates/blogitem Einige haben ja, wie ich, zu Hause eine Diskstation von Synology stehen. Da ich selbst auch einige kleine Sachen programmiere, wollte ich mir auch den Komfort wie auf Arbeit gönnen und automatisiert Pipelines starten. -Zunächst habe ich mir hier ein Gitea aufgesetzt: +Da ich aber nicht gleich eine Enterprise-Lösung wie GitLab einsetzen wollte, habe ich mir alternativen gesucht. -- [ ] Drone-Server -- [ ] Drone-Runner -- [ ] Oauth -- [ ] Webhook -- [ ] Admin +Und da die DS218+ ja genug Power für ein paar Docker-Container hat sieht diese Alternative folgendermaßen aus: +- Docker + - Gitea + - Drone-Server + - Drone-Runner +- Oauth +- Webhook +- Admin +## Gitea-Setup + +Zuerst brauchen wir einen User unter dem Gitea laufen soll. Also legen wir im DSM einen Benutzer und eine Gruppe an. Den User richten wir direkt als Mitglied der Gruppe ein. + +In meinem Fall habe ich beide `git` genannt. + +Nun brauchen wir die IDs von beiden. Dafür gehe ich per SSH auf die Diskstation und suche mir die IDs zu beiden und das Homeverzeichnis des Users heraus. Letzteres brauchen wir später um gitea über ssh ansprechen zu können. + +```bash +id git +#uid=1034(git) gid=100(users) groups=100(users),65540(git) +cat /etc/passwd | grep git +#git:x:1034:100:Gitea-Benutzer:/var/services/homes/git:/sbin/nologin +``` +Hieraus habe ich folgende Infos erhalten: + +| Name | Wert | +| ---- | ----------------------- | +| UID | 1034 | +| GID | 65540 | +| Home | /var/services/homes/git | + +Wenn wir einmal beim User sind, richten wir direkt die möglichkeit für git-per-ssh ein. +```bash +HOMEDIR=/var/services/git +mkdir $GIT_HOMEDIR/.ssh +chown git:git $HOMEDIR/.ssh +``` + +Um GitCommandos an Gitea weiterzugeben, legen wir die Datei /app/gitea/gitea an und füllen sie. +```bash +mkdir -p /app/gitea +echo "#!/bin/sh" > /app/gitea/gitea +echo "ssh -p 2222 -o StrictHostKeyChecking=no git@127.0.0.1 "SSH_ORIGINAL_COMMAND"=\$SSH_ORIGINAL_COMMAND\" $0 @0" >> /app/gitea/gitea +``` + +Weiterhin brauchen wir eine Datenbank. Ich arbeite hier mit der MariaDB v10, die eh auf der Diskstation läuft. +Also legen wir uns einen DB-User an und geben diesem Rechte auf eine ebenso anzulegende Datenbank. + +Nun können wir Gitea im Docker starten: +```bash +docker run -d --name gitea \ + -e DB_TYPE=mysql \ + -e DB_HOST=127.20.0.1:3307 \ + -e DB_NAME=gitea \ + -e DB_PASSWD=passwort \ + -e TZ=Europe/Berlin \ + -e USER_UID=1034 \ + -e USER_GID=65540 \ + -e ROOT_URL=https://git.example.com/ \ + -e SSH_DOMAIN=git.example.com \ + -p 2222:22 \ + -p 30180:3000 \ + -v /var/services/homes/git/.ssh:/data/git/.ssh \ + -v /volume1/docker/gitea/data:/data \ + gitea/gitea +``` \ No newline at end of file diff --git a/content/index.md b/content/index.md index c55ebe9..0dff068 100644 --- a/content/index.md +++ b/content/index.md @@ -11,6 +11,8 @@ Template: templates/home Willkommen auf meiner Seite. Ich hoffe sie gefällt dir. +Zur Zeit befindet sich die neue Seite noch voll im Aufbau. Also sei nicht zu streng mit mir. Dennoch freue ich mich über jegliche Art Rückmeldung. ;) + Sieh dich in Ruhe um, zum Beispiel was ich so zuletzt geschrieben habe, oder an was ich gerade arbeite. Wenn du dir verloren vorkommst oder einfach nur etwas loswerden möchtest, bekommst du [hier][Kontakt] die Möglichkeit. diff --git a/content/projects/index.md b/content/projects/index.md index ad057f2..ee4f38c 100644 --- a/content/projects/index.md +++ b/content/projects/index.md @@ -8,9 +8,9 @@ Robots: noindex,nofollow # Projekte -- Dienstplan to iCal -- Wichtel-mini-app -- Schulnotenverwaltung -- Nextcloud -- Gitea -- Bar-Inventur-Rechner \ No newline at end of file +- [Dienstplan to iCal](https://apps.chrosey.de/orchester_dienstplan/) +- [Wichtel-mini-app](https://apps.chrosey.de/wichteln/) +- [Schulnotenverwaltung](https://apps.chrosey.de/ags_noten) +- [Nextcloud](https://nextcloud.chrosey.de/) +- [Gitea](https://git.chrosey.de/) +- [Bar-Inventur-Rechner](https://apps.chrosey.de/inv/) \ No newline at end of file diff --git a/plugins/PicoContact/log.json b/plugins/PicoContact/log.json index 55f951c..165214d 100644 --- a/plugins/PicoContact/log.json +++ b/plugins/PicoContact/log.json @@ -5,5 +5,12 @@ "test", "Christian Seyfferth", "error" + ], + [ + "20\/05\/2020 19:30:22", + "info@chrosey.de", + "(kein Betreff)", + "Anonym", + "error" ] ] \ No newline at end of file diff --git a/plugins/PicoContact/src/P01contact_Form.php b/plugins/PicoContact/src/P01contact_Form.php index 7cfe21f..9370cb3 100644 --- a/plugins/PicoContact/src/P01contact_Form.php +++ b/plugins/PicoContact/src/P01contact_Form.php @@ -179,7 +179,7 @@ class P01contactForm } $html .= '
'; $html .= ''; - $html .= '
'; + $html .= '
'; } $html .= '';