feat: track images with git lfs

This commit is contained in:
2024-03-27 01:51:42 +01:00
parent f0129ecc76
commit 31b24de86c
142 changed files with 5133 additions and 169 deletions

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 697 KiB

View File

@ -0,0 +1,97 @@
---
title: "How I completely rebuild my server setup."
date: 2020-06-09
comments: true
---
import Image from "@components/Image.astro"
So, this topic has been on my mind for a long time. And in the past two weeks i have finally realized it. This blog post is not meant as a guide, but as a way for future me to understand my current me's decision processes.
> **My plan is to publish the guides as separate posts later:**
>
> - [ ] _🔗 Proxying local servers with Tinc_
> - [ ] _☕+🛸=♥ Setting up a Gitea server with drone.io CI/CD_
> - [ ] _Setting up Nginx+SFTP+Traefik_
> - [ ] _Including Svelte elements in a Hugo site_
## Requirements
But before we begin to dive into the technical details of my new setup i would like to talk about the requirements i have:
### Git
This one is relatively simple; I code, so i need git. Preferably hosted publicly so that i can share code with other people, and preferably with a CI/CD pipeline attached for the benefits that CI/CD has.
### PAAS
I don't really like to worry about infrastructure, (i know ironic right). At least when I'm working on a project and the infrastructure is not the main focus for that I need a way to easily deploy any application i have to the cloud.
### Static Hosting
Because I code a lot of small static HTML+CSS+Javascript websites and experiments I want to have a way to quickly host them somewhere. Also this Blog needs to be hosted somewhere.
### Blogging
I dont write a lot of blog posts at all, but i still like to have a central platform to put my thoughts onto.
### Filesharing
Most of the time i keep my project file both on my laptop and my main pc. If i work on a coding project i can sync those with git, but for that i need to commit and push every time i switch my pc. For 3D/Media that workflow is not very feasible. To achieve a better workflow I need a File sharing platform, which i definitely want to self host for one because storing a lot of data with a third party is expensive and because i want to be in control of my own data.
 
## My previous setup
In my previous setup i used a mixture of external services. For **git hosting** i have experience with Github, Gitlab and Bitbucket. I have experience with a few **PaaS** providers, IBM Cloud, Google Cloud but mostly Heroku because it is very easy to use. My **static website** was hosted with one.com, again because it was very easy to use. I have tried a few different **Filesharing** solutions in the past, from Google Drive, Dropbox and Mega and some self hosted solutions like Koken.me, Syncthing and Nextcloud. But in the last year i did not use any File sharing at all.
 
## My new Setup
![New Setup](./images/new-server.svg)
Now, the first question that may come to mind is, "Why do you use both cloud and local servers?". There are some drawbacks and some benefits to both. Cloud servers provide fast network speeds and static public IPs but storing large amount of data is kind of expensive. Disk space is comparably cheap with local servers I paid around 60€ for my 1tb harddrive which is made specifically for nas situations with drives running 24/7. Also i really like the idea of having physical access to my own data and not having to trust a third party with it. Another benefit to having physical access to my own server is that i can tinker with hardware aspects like networking, drives and cooling as well as taking physical measurements like room temperature and humidity.
To be totally honest the main reason for me to use a cloud server is because i cant use port forwarding on my local network because we (me and my flatmates) dont know the password to our router 🤦. The solution to that is to create a vpn network with my cloud server and proxy all requests through it.
The whole process of setting up my new infrastructure was mainly my trying out different tech stacks until i found one i liked. So, what i choose in the end:
 
### Git
I definitely wanted to setup a git server on my local raspberry pi, because i want to own my own code, if that makes sense. My first instinct was to use Gitlab, because i really like the integrated ci/cd pipeline, so i downloaded the appropriate docker-compose.yml, started and made my pi instantly unusable because it was so performance intensive. So Gitlab was definitely not the right choice for me.
After that i tried Gogs, which is a lightweight git server build with Go. I really liked the simplicity of the setup and the configuration, but the integration with my ci/cd server of choice, drone.io was not very easy.
So finally i ended up with my current setup which is running a Gitea, and Drone.io Instance on my pi, with the Drone.io CI/CD runner running in the cloud. I started the Drone.io runner in the cloud because the pi is arm based and that caused some problems with certain docker images.
### PAAS
My first idea was to use Dokku, but for some reason i had a lot of problems setting up dokku as a docker image. Then i tried caprover which is a rebranding of a project called CaptainDuckDuck, which is imho a wayyy better name. Caprover was super easy to setup and its super easy to deploy to.
### Static Hosting
This was a very easy decision, as i already had some good experience with nginx and some not so good experience with the configuration of apache. On my cloud server i provisioned a harddrive with a folder which is being mounted into a nginx docker image and a sftp docker image.
### Blogging
Coming from some experience with developing wordpress sites i definitely did not want to keep my old wordpress site. Honestly i did not try a lot of different solutions as Hugo just seemed to click with me, from the blazing fast site generation to the very minimal overhead to the incredible flexible asset pipelines.
### Filesharing
Nextcloud, easy. I just like it and it does not seem to have any competitors with the same amount of functionality.
 
## Conclusion
This was a very good learning experience for me and just so much fun. My future plans are to expand my local server setup to a cluster build out of pies and also maybe to try out wireguard instead of tinc because it seems to be way faster.
 
 
Cheers thats all for now,
Max

View File

@ -0,0 +1,85 @@
---
title: "Wie ich mein Server-Setup komplett neu aufbaue."
date: 2020-06-09
comments: true
---
import Image from "@components/Image.astro"
Dieses Thema beschäftigt mich also schon seit längerem. Und in den letzten zwei Wochen ist es mir endlich klar geworden. Dieser Blogbeitrag ist nicht als Leitfaden gedacht, sondern als Möglichkeit für mein zukünftiges Ich, die Entscheidungsprozesse meines jetzigen Ichs zu verstehen.
> **Mein Plan ist es, die Leitfäden später als separate Beiträge zu veröffentlichen:**
> > - [ ] _🔗 Proxying lokaler Server mit Tinc_
> > - [ ] _☕+🛸=♥ Einrichten eines Gitea-Servers mit Drone.io CI/ CD_
> > - [ ] _Nginx+SFTP+Traefik einrichten_
> > - [ ] _Svelte-Elemente in eine Hugo-Site einbinden_
## Anforderungen
Bevor wir uns jedoch mit den technischen Details meines neuen Setups befassen, möchte ich über meine Anforderungen sprechen:
### Git
Dieser ist relativ einfach; Ich programmiere, also brauche ich Git. Vorzugsweise öffentlich gehostet, damit ich Code mit anderen Leuten teilen kann, und vorzugsweise mit angeschlossener CI/CD-Pipeline, um die Vorteile von CI/CD nutzen zu können.
### PAAS
Ich mag es nicht wirklich, mich um die Infrastruktur zu kümmern, (ich weiß, ironisch, oder?). Zumindest, wenn ich an einem Projekt arbeite und die Infrastruktur nicht der Hauptfokus ist, brauche ich eine Möglichkeit, jede Anwendung, die ich habe, einfach in die Cloud zu deployen.
### Static Hosting
Weil ich viele kleine statische HTML+CSS+Javascript-Websites und -Experimente programmiere, möchte ich eine Möglichkeit haben, sie schnell irgendwo zu hosten. Auch dieser Blog muss irgendwo gehostet werden.
### Blogging
Ich schreibe nicht viele Blogbeiträge, aber ich möchte trotzdem eine zentrale Plattform haben, um meine Gedanken festzuhalten.
### Filesharing
Die meiste Zeit halte ich meine Projektdatei sowohl auf meinem Laptop als auch auf meinem Haupt-PC. Wenn ich an einem Codierungsprojekt arbeite, kann ich diese mit Git synchronisieren, aber dafür muss ich jedes Mal, wenn ich meinen PC wechsle, committen und pushen. Für 3D/Media ist dieser Workflow nicht sehr praktikabel. Um einen besseren Workflow zu erreichen, benötige ich eine Filesharing-Plattform, die ich definitiv selbst hosten möchte, zum einen, weil das Speichern einer großen Datenmenge bei einem Drittanbieter teuer ist, und zum anderen, weil ich die Kontrolle über meine eigenen Daten haben möchte.
## Mein vorheriges Setup
In meinem vorherigen Setup habe ich eine Mischung aus externen Diensten verwendet. Für **Git-Hosting** habe ich Erfahrung mit Github, Gitlab und Bitbucket. Ich habe Erfahrung mit einigen **PaaS**-Anbietern, IBM Cloud, Google Cloud, aber hauptsächlich Heroku, weil es sehr einfach zu bedienen ist. Meine **statische Website** wurde mit one.com gehostet, wiederum, weil es sehr einfach zu bedienen war. Ich habe ein paar verschiedene **Filesharing**-Lösungen ausprobiert, von Google Drive, Dropbox und Mega und einigen selbst gehosteten Lösungen wie Koken.me, Syncthing und Nextcloud. Aber im letzten Jahr habe ich überhaupt kein Filesharing genutzt.
## My new Setup
![New Setup](./images/new-server.svg)
Eine Frage, die man sich jetzt stellen könnte wäre: „Warum benutzt du Cloud und lokale Server?“ Beide haben einige Nachteile und einige Vorteile. Cloud-Server bieten schnelle Netzwerkgeschwindigkeiten und statische öffentliche IPs, aber die Speicherung großer Datenmengen ist recht teuer. Der Festplattenspeicher ist bei lokalen Servern vergleichsweise günstig. Ich habe etwa 60 € für meine 1-TB-Festplatte bezahlt, die speziell für NAS-Situationen entwickelt wurde, bei denen die Laufwerke rund um die Uhr laufen. Außerdem gefällt mir die Idee sehr gut, physischen Zugriff auf meine eigenen Daten zu haben und diese nicht einem Dritten anvertrauen zu müssen. Ein weiterer Vorteil des physischen Zugriffs auf meinen eigenen Server besteht darin, dass ich an Hardwareaspekten wie Netzwerk, Laufwerken und Kühlung herumbasteln und physische Messungen wie Raumtemperatur und Luftfeuchtigkeit vornehmen kann.
Um ganz ehrlich zu sein, der Hauptgrund für mich, einen Cloud-Server zu verwenden, ist, dass ich auf meinem lokalen Netzwerk kein Port-Forwarding verwenden kann, weil wir (meine Mitbewohner und ich) das Passwort zu unserem Router nicht kennen 🤦. Die Lösung dafür ist, ein VPN-Netzwerk mit meinem Cloud-Server zu erstellen und alle Anfragen darüber zu proxyen.
Die Idee ist also, dass ich meinen lokalen Server als Hauptserver verwende und den Cloud-Server als Proxy verwende, um auf meinen lokalen Server zuzugreifen. Der Cloud-Server wird auch als Backup-Server für meine Dateien verwendet, falls mein lokaler Server ausfällt.
### Git
Ich wollte definitiv einen Git-Server auf meinem lokalen Raspberry Pi einrichten, weil ich meinen eigenen Code besitzen wollte, wenn das Sinn macht. Mein erster Instinkt war, Gitlab zu verwenden, weil ich die integrierte CI/CD-Pipeline wirklich mag, also habe ich die entsprechende docker-compose.yml heruntergeladen, gestartet und meinen Pi sofort unbrauchbar gemacht, weil es so leistungsintensiv war. Also war Gitlab definitiv nicht die richtige Wahl für mich.
Danach habe ich Gogs ausprobiert, das ist ein leichtgewichtiger Git-Server, der mit Go erstellt wurde. Mir gefiel die Einfachheit des Setups und der Konfiguration wirklich gut, aber die Integration mit meinem CI/CD-Server der Wahl, drone.io, war nicht sehr einfach.
Also landete ich schließlich bei meinem aktuellen Setup, das einen Gitea- und einen Drone.io-Server auf meinem Pi mit einem in der Cloud laufenden Drone.io CI/CD-Runner umfasst. Ich habe den Drone.io-Runner in der Cloud gestartet, weil der Pi arm-basiert ist und das bei bestimmten Docker-Images Probleme verursacht hat.
### PAAS
Meine erste Idee war, Dokku zu verwenden, aber aus irgendeinem Grund hatte ich viele Probleme, Dokku als Docker-Image einzurichten. Dann habe ich Caprover ausprobiert, das eine Neubrandung eines Projekts namens CaptainDuckDuck ist, was meiner Meinung nach ein viel besserer Name ist. Caprover war super einfach einzurichten und es ist super einfach zu deployen.
### Static Hosting
Ich habe mich für Nginx entschieden. Dies war eine sehr einfache Entscheidung, da ich bereits einige gute Erfahrungen mit nginx und einige nicht so gute Erfahrungen mit der Konfiguration von Apache hatte. Auf meinem Cloud-Server habe ich eine Festplatte mit einem Ordner bereitgestellt, der in ein Nginx-Docker-Image und ein SFTP-Docker-Image eingebunden ist.
### Blogging
Aufgrund einiger Erfahrung in der Entwicklung von WordPress-Sites wollte ich meine alte WordPress-Site definitiv nicht behalten. Ehrlich gesagt habe ich nicht viele verschiedene Lösungen ausprobiert, da Hugo einfach zu mir passte, von der rasend schnellen Site-Generierung über den sehr minimalen Overhead bis hin zu den unglaublich flexiblen Asset-Pipelines.
### Filesharing
Ich habe mich für Nextcloud entschieden, weil ich es einfach mag und es keine Konkurrenz mit der gleichen Funktionalität zu geben scheint.
## Abschluss
Alles in allem bin ich sehr zufrieden mit meinem neuen Setup. Ich habe viel gelernt und es hat mir viel Spaß gemacht. Meine zukünftigen Pläne sind, mein lokales Server-Setup zu einem Cluster-Build aus Pies zu erweitern und auch vielleicht Wireguard anstelle von Tinc auszuprobieren, weil es anscheinend viel schneller ist.
Cheers,
Max