diff --git a/containers/Makefile b/Makefile similarity index 100% rename from containers/Makefile rename to Makefile diff --git a/containers/code-server/.gitignore b/code-server/.gitignore similarity index 100% rename from containers/code-server/.gitignore rename to code-server/.gitignore diff --git a/code-server/README.md b/code-server/README.md new file mode 100644 index 0000000..1cbf68f --- /dev/null +++ b/code-server/README.md @@ -0,0 +1,19 @@ +# Visual Studio + +A self-hosted version of Visual Studio Code, as an online notebook. + +## Instructions + +### Volumes +Mount the persistant storage somewhere. +- `/pwspool/software/code-server/config:/config` + +### Metadata +Re-roll hashed passwords. +`./olomana.ini:/etc/grafana/grafana.ini` + +## References +https://docs.linuxserver.io/images/docker-code-server/ +https://coder.com/docs/code-server/latest/install#docker +https://hub.docker.com/r/linuxserver/code-server +https://github.com/coder/code-server/blob/main/docs/FAQ.md#can-i-store-my-password-hashed diff --git a/containers/code-server/docker-compose.yml.blanked b/code-server/docker-compose.yml.blanked similarity index 93% rename from containers/code-server/docker-compose.yml.blanked rename to code-server/docker-compose.yml.blanked index 9162043..66fb264 100644 --- a/containers/code-server/docker-compose.yml.blanked +++ b/code-server/docker-compose.yml.blanked @@ -3,18 +3,16 @@ version: '3.7' networks: [TRAEFIK_NETWORK]: external: true - + services: code-server: image: lscr.io/linuxserver/code-server:latest container_name: code-server restart: unless-stopped networks: - - [TRAEFIK_NETWORK] + - traefik volumes: - /pwspool/software/code-server/config:/config - ports: - - 8443:8443 environment: - PUID=1000 - PGID=1000 @@ -30,4 +28,3 @@ services: - traefik.http.routers.code.tls=true - traefik.http.routers.code.tls.certresolver=lets-encrypt - traefik.http.services.code.loadbalancer.server.port=8443 - diff --git a/containers/code-server/README.md b/containers/code-server/README.md deleted file mode 100644 index 019dfcc..0000000 --- a/containers/code-server/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# Visual Studio - -A self-hosted version of Visual Studio Code, as an online notebook. - -https://coder.com/docs/code-server/latest/install#docker -https://hub.docker.com/r/linuxserver/code-server - diff --git a/containers/grafana/README.md b/containers/grafana/README.md deleted file mode 100644 index 0ba6866..0000000 --- a/containers/grafana/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# Whitney Grafana - -Resource: https://grafana.com/docs/grafana/latest/setup-grafana/installation/docker/ - -Note: Create a `grafana` user and add its UID to the docker-compose file so that created files will be given the correct ownership for later. Then, when running the container for the first time, use sudo so we can create the folder hierarchy for grafana. - -Grafana instance that produces system metrics. Creates a Node-Exporter container that reads system metrics. A bridge network is created to allow Prometheus to query Node Exporter for metrics. Grafana connects to Prometheus via its bridge network to gather aggregated metrics. - -Custom configuration held in grafana.ini in the container. Container expects to copy in a file called "olomana.ini", which is not checked into git. - -After starting this image, we still need to create a datasource. Select Prometheus as the type, and `prometheus_whitney:9090` is the address. Everything else can be default. The networks need to be set up correctly to be able to refer to the container like this. If not, specifying it over the local network works fine. - -We also need to create a dashboard if starting from scratch. A good default one for node-exporter is `1860`. - -Setting up the data source is kind of dumb. you need to both indicate you want to communicate over http and to the container by name. So the correct thing to put when making a prometheus data source is `http://prometheus:9090` if the container name is "prometheus". - -You can check the contents of Prometheus with `curl localhost:9090/metrics`. - -The repo contains `grafana.ini`, the config file for grafana. By default this defines the admin account to be `admin:admin`. Change that and save the new file as `olomana.ini`, which is what will be copied into the container. - -### Start with Docker-Compose (USING SUDO, see ownership issues above.) - -`sudo docker-compose up -d` - -I usually had to manually give ownership to the right user to the /pwspool/grafana folder hierarchy before grafana would work. - -Also, if using traefik, to expose this container, you probably need to restart traefik after this container goes up. - -#### Customization Notes -Images can be hosted by imgur and added in html to a Text Panel. - diff --git a/containers/homepage/README.md b/containers/homepage/README.md deleted file mode 100644 index c0d18a0..0000000 --- a/containers/homepage/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# PWS - -This is the official landing webpage for Olomana. - -### Run with Docker - -`docker-compose down && docker system prune && docker-compose build && docker-compose up -d` - diff --git a/containers/nordvpn/README.md b/containers/nordvpn/README.md deleted file mode 100644 index 47c8643..0000000 --- a/containers/nordvpn/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# NordVPN - -Some containers go through a nordvpn container. - -Uses the open source `https://github.com/bubuntux/nordvpn` repo to create a NordVPN container that other containers can reference when starting up. - -Changes were made to the docker-compose following each container's README instructions on the various repos. - -``` -Volumes: -- /data/persistent/qb/appdata/config:/config -- /data/persistent/qb/downloads:/downloads -``` - -``` -FIREWALL=Enable -``` - -Note: If conflicts on qb port, can change it by setting the env var for WEBUI_PORT=xxxx. diff --git a/containers/traefik/README.md b/containers/traefik/README.md deleted file mode 100644 index 679cd25..0000000 --- a/containers/traefik/README.md +++ /dev/null @@ -1,179 +0,0 @@ -# Traefik - -I got recommended Traefik over Nginx for its ease of use and service discovery. - -For setup I followed this official Traefik tutorial: https://doc.traefik.io/traefik/getting-started/quick-start/ - -`https://doc.traefik.io/traefik/user-guides/docker-compose/basic-example/` is also a good reference. - -GENERAL NOTE: Don't restart the container that often because it issues Let'sEncrypt challenges that can get you rate limited quickly. (1hr cooldown) - -## GENERAL REMINDERS - -There is some funkiness with Traefik's acme.json file. The container is supposed to create it and manage it but due to docker linking of files and folders this gets mixed up. - -Reading the logs can help you understand, need to look backward from the cert resolver that i've called lets-encrypt. - -To make Traefik correctly populate the acme.json do the following: - -1. create acme.json yourself. - -2. Make sure the mount in docker works with the definition of the certresolver in traefik.toml. - -I found that we needed to have a full path (or at least a path that contained a folder, so that traefik didn't get confused and think that acme.json was a folder. - -3. Give the acme.json file specific permissions (600) e.g. `chmod 600 acme.json` - -4. Run docker-compose, does not require you to be root. - - -### Baby Steps Setup - -##### Step 1 - -1. Run `step1-docker-compose.yml` - -`docker-compose -f step1-docker-compose.yml up -d` - -2. Test by curl - -`curl http://localhost:8080/api/rawdata` - -3. Stop all and prune - -`docker stop step1-traefik` - -`docker system prune` - -##### Step 2 - -1. Run `step2-docker-compose.yml` - -`docker-compose -f step2-docker-compose.yml up -d` - -2. Test by curl - -`curl -H Host:whoami.docker.localhost http://127.0.0.1` - -3. Stop all and prune - -`docker stop step2-traefik step2-whoami` - -`docker system prune` - -##### Step 3 - -1. Run `step3-docker-compose.yml` - -`docker-compose -f step3-docker-compose.yml up -d` - -2. Test by curl - -`curl http://whoami.whitney.rip` - -3. Stop all and prune - -`docker stop step3-traefik step3-whoami` - -`docker system prune` - -### Actual Traefik Setup - -##### Step 1: Basic Traefik - -Starting with the basic example: `https://doc.traefik.io/traefik/user-guides/docker-compose/basic-example/` - -1. Change basic things like names of containers, routing host for the example service. - -2. Add a traefik-specific network for the containers to communicate over. Other containers outside of this config file can reference it so that Traefik can discover and send requests to them internally. - -3. Run, and test that the whoami container gives its response back correctly. - -4. Then, configure other containers to be discovered off of Traefik by adding the basic labels: `traefik.enable`, `traefik.http.routers.container_name.rule`, and `traefik.http.routers.container_name.entrypoints`. - - -##### Step 2: Proper Traefik Config - -1. Convert the traefik related command line flags into traefik static and dynamic config. I am using toml files. These are `step5-traefik.toml` and `step5-traefik-dynamic.toml`. The static should reference a folder that the dynamic is copied into in the docker-compose. - -Note: These pages are good examples of syntax and options. `https://doc.traefik.io/traefik/reference/static-configuration/file/` and `https://doc.traefik.io/traefik/reference/dynamic-configuration/file/` - -Note: The Dynamic config is empty, and this is for good reason. See `https://doc.traefik.io/traefik/routing/providers/docker/` - -`If a label defines a router (e.g. through a router Rule) and a label defines a service (e.g. implicitly through a loadbalancer server port value), but the router does not specify any service, then that service is automatically assigned to the router.` - -Because we define the router as labels in docker-compose, we don't have to define them in the dynamic conf, which is where we'd normally have to do it. - -From this point, when we add another service, all that has to be done is the following: - -> 1. Add the `traefik_traefik-network` as an external network, so that the container can communicate with Traefik internally. - -> 2. Add the external network to the container's definition. - -> 3. Add labels defining a router for this container. This should at least include the `traefik.enable`, `traefik.http.routers.my_router_name.rule`, and `traefik.http.routers.my_router_name.entrypoints` labels. - - -### Some old notes from when I tried TLS stuff. - -Followed this tutorial: `https://doc.traefik.io/traefik/user-guides/docker-compose/acme-dns/`. - -Providers list for Traefik: `https://doc.traefik.io/traefik/https/acme/#providers`. - -1. Update `docker-compose-BLANKED.yml` with the correct values and copy it to `docker-compose.yml`. - -`EMAIL@ME.COM` - -`CLOUDFLARE@EMAIL.COM` - -`API_KEY` - -`MYDOMAIN.COM` - -2. Run `docker-compose.yml` - -`docker-compose up -d` - -3. Test by curl, then on browser. - -`curl -vvv https://whitney.rip` - -If certificate is not right, can probably debug from the curl response. - -Try `https://whitney.rip` in browser, should see the curl response in html. - -BEFORE running the container, create acme.json with permission code 600. Otherwise the container will create a folder instead. - -Running the container will generate the following structure: - -`letsencrypt/` - -|--> `acme.json` - -4. Check that the api is working. - -Visit `http://YOUR_IP_HERE:8080/dashboard` - -### Additional Steps - -1. Convert to a static Traefik configuration (seems better) - -Create `traefik.toml` and edit the `docker-compose.yml` to ensure that it's copied to one of the searched directories (I chose `/etc/traefik/`) - -The conversion from env vars to `traefik.toml` is really easy - each one of them is basically describing one attribute of the yaml, so basically just build the yaml from those attributes. - -2. Start to secure the Traefik Dashboard. - -Generate a password with `htpasswd` (`https://doc.traefik.io/traefik/middlewares/http/basicauth/`) - -Example using BCrypt: `https://unix.stackexchange.com/questions/307994/compute-bcrypt-hash-from-command-line`. See this thread about Traefik not liking the `$` character: `https://github.com/DeviaVir/zenbot/issues/2663` - - - -# Some notes about making this a cleaner experience. - -I have created blanked files for the traefik.toml and traefik-dynamic.toml since they need important info that will vary by deployment. - -When putting in the user and pw to the toml, you generate the password with htpasswd, but that generates a string with escaped dollar sign values. Since we're putting it into the toml we can replace the double dollar signs with just single dollar signs. - -Also. the acme.json is generated by letsencrypt, so that is not included in the repo as it's a secret. - diff --git a/containers/transmission/README.md b/containers/transmission/README.md deleted file mode 100644 index 503ad5a..0000000 --- a/containers/transmission/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Transmission - -https://github.com/haugene/docker-transmission-openvpn - diff --git a/containers/covid19/.gitignore b/covid19/.gitignore similarity index 100% rename from containers/covid19/.gitignore rename to covid19/.gitignore diff --git a/containers/covid19/README.md b/covid19/README.md similarity index 100% rename from containers/covid19/README.md rename to covid19/README.md diff --git a/containers/covid19/docker-compose.yml.blanked b/covid19/docker-compose.yml.blanked similarity index 100% rename from containers/covid19/docker-compose.yml.blanked rename to covid19/docker-compose.yml.blanked diff --git a/containers/gitea/.gitignore b/gitea/.gitignore similarity index 100% rename from containers/gitea/.gitignore rename to gitea/.gitignore diff --git a/containers/gitea/README.md b/gitea/README.md similarity index 100% rename from containers/gitea/README.md rename to gitea/README.md diff --git a/containers/gitea/docker-compose.yml.blanked b/gitea/docker-compose.yml.blanked similarity index 100% rename from containers/gitea/docker-compose.yml.blanked rename to gitea/docker-compose.yml.blanked diff --git a/containers/grafana/.gitignore b/grafana/.gitignore similarity index 100% rename from containers/grafana/.gitignore rename to grafana/.gitignore diff --git a/grafana/README.md b/grafana/README.md new file mode 100644 index 0000000..541708d --- /dev/null +++ b/grafana/README.md @@ -0,0 +1,23 @@ +# Whitney Grafana + +## Instructions + +### Files +Create/Fill in the following files in a `grafana` directory under this one using the templates. +- `grafana.ini` +- `prometheus.yml` + +### Volumes +Make sure that in additionto mounting the 2 files above to their respective containers, grafana container has the following mount: +- `/pwspool/software/grafana:/var/lib/grafana` + +Also make sure that the correct user has access to the folder on the host machine, sometimes grafana won't start up otherwise. + +### Grafana Setup +To set up the data source in grafana to point to prometheus, you would refer to `http://prometheus:9090`. + +## Notes +Some images are hosted on Imgur and linked to via url. + +## References +https://grafana.com/docs/grafana/latest/setup-grafana/installation/docker/ diff --git a/containers/grafana/docker-compose.yml.blanked b/grafana/docker-compose.yml.blanked similarity index 89% rename from containers/grafana/docker-compose.yml.blanked rename to grafana/docker-compose.yml.blanked index 9b55e4f..26cb6ba 100644 --- a/containers/grafana/docker-compose.yml.blanked +++ b/grafana/docker-compose.yml.blanked @@ -3,9 +3,9 @@ version: "3" networks: grafana-network: driver: bridge - [TRAEFIK_NETWORK]: + traefik: external: true - [MINECRAFT_NETWORK]: + minecraft: external: true volumes: @@ -19,12 +19,12 @@ services: restart: unless-stopped networks: - grafana-network - - [TRAEFIK_NETWORK] + - traefik volumes: - ./olomana.ini:/etc/grafana/grafana.ini - /pwspool/software/grafana:/var/lib/grafana labels: - - traefik.http.routers.grafana.rule=Host(`[SUBDOMAIN_URL]`) + - traefik.http.routers.grafana.rule=Host(`SITE_URL`) - traefik.http.routers.grafana.tls=true - traefik.http.routers.grafana.tls.certresolver=lets-encrypt - traefik.http.services.grafana.loadbalancer.server.port=3000 @@ -53,7 +53,7 @@ services: restart: always networks: - grafana-network - - [MINECRAFT_NETWORK] + - minecraft volumes: - "./prometheus.yml:/etc/prometheus.yml" - prometheus_data:/prometheus @@ -62,4 +62,3 @@ services: - "--storage.tsdb.path=/prometheus" - "--web.console.libraries=/usr/share/prometheus/console_libraries" - "--web.console.templates=/usr/share/prometheus/consoles" - diff --git a/containers/grafana/grafana.ini b/grafana/grafana.ini similarity index 100% rename from containers/grafana/grafana.ini rename to grafana/grafana.ini diff --git a/containers/grafana/prometheus.yml b/grafana/prometheus.yml similarity index 100% rename from containers/grafana/prometheus.yml rename to grafana/prometheus.yml diff --git a/containers/homepage/.gitignore b/homepage/.gitignore similarity index 100% rename from containers/homepage/.gitignore rename to homepage/.gitignore diff --git a/containers/homepage/Dockerfile b/homepage/Dockerfile similarity index 100% rename from containers/homepage/Dockerfile rename to homepage/Dockerfile diff --git a/homepage/README.md b/homepage/README.md new file mode 100644 index 0000000..227d596 --- /dev/null +++ b/homepage/README.md @@ -0,0 +1,12 @@ +# Homepage + +This is the official landing webpage for Olomana/PWS. + +## Instructions + +### Build +Test build with `docker compose build homepage`. + +### Run with Docker + +`docker-compose down && docker system prune && docker-compose build && docker-compose up -d` diff --git a/containers/homepage/docker-compose.yml.blanked b/homepage/docker-compose.yml.blanked similarity index 64% rename from containers/homepage/docker-compose.yml.blanked rename to homepage/docker-compose.yml.blanked index 26079b5..936880f 100644 --- a/containers/homepage/docker-compose.yml.blanked +++ b/homepage/docker-compose.yml.blanked @@ -1,19 +1,21 @@ version: '3' networks: - [TRAEFIK_NETWORK]: + traefik: external: true services: - web: + homepage: image: homepage + container_name: homepage + build: . restart: unless-stopped networks: - - [TRAEFIK_NETWORK] - build: . + - traefik + ports: + - "81:80" labels: - - traefik.http.routers.homepage.rule=Host(`[SUBDOMAIN_URL]`) + - traefik.http.routers.homepage.rule=Host(`SITE_URL`) - traefik.http.routers.homepage.tls=true - traefik.http.routers.homepage.tls.certresolver=lets-encrypt - - traefik.http.services.homepage.loadbalancer.server.port=[[NGINX_INTERNAL_PORT]] - + - traefik.http.services.homepage.loadbalancer.server.port=81 diff --git a/containers/homepage/nginx/nginx.conf b/homepage/nginx/nginx.conf similarity index 100% rename from containers/homepage/nginx/nginx.conf rename to homepage/nginx/nginx.conf diff --git a/containers/homepage/website/about.html b/homepage/website/about.html similarity index 100% rename from containers/homepage/website/about.html rename to homepage/website/about.html diff --git a/containers/homepage/website/index.html b/homepage/website/index.html similarity index 100% rename from containers/homepage/website/index.html rename to homepage/website/index.html diff --git a/containers/homepage/website/script.js b/homepage/website/script.js similarity index 100% rename from containers/homepage/website/script.js rename to homepage/website/script.js diff --git a/containers/homepage/website/services.html b/homepage/website/services.html similarity index 100% rename from containers/homepage/website/services.html rename to homepage/website/services.html diff --git a/containers/homepage/website/static/about/mount-olomana.jpg b/homepage/website/static/about/mount-olomana.jpg similarity index 100% rename from containers/homepage/website/static/about/mount-olomana.jpg rename to homepage/website/static/about/mount-olomana.jpg diff --git a/containers/homepage/website/static/about/olomana.jpg b/homepage/website/static/about/olomana.jpg similarity index 100% rename from containers/homepage/website/static/about/olomana.jpg rename to homepage/website/static/about/olomana.jpg diff --git a/containers/homepage/website/static/about/whitney.jpg b/homepage/website/static/about/whitney.jpg similarity index 100% rename from containers/homepage/website/static/about/whitney.jpg rename to homepage/website/static/about/whitney.jpg diff --git a/containers/homepage/website/static/favicon.ico b/homepage/website/static/favicon.ico similarity index 100% rename from containers/homepage/website/static/favicon.ico rename to homepage/website/static/favicon.ico diff --git a/containers/homepage/website/static/services/code-server.png b/homepage/website/static/services/code-server.png similarity index 100% rename from containers/homepage/website/static/services/code-server.png rename to homepage/website/static/services/code-server.png diff --git a/containers/homepage/website/static/services/covid-tracker.png b/homepage/website/static/services/covid-tracker.png similarity index 100% rename from containers/homepage/website/static/services/covid-tracker.png rename to homepage/website/static/services/covid-tracker.png diff --git a/containers/homepage/website/static/services/discord.png b/homepage/website/static/services/discord.png similarity index 100% rename from containers/homepage/website/static/services/discord.png rename to homepage/website/static/services/discord.png diff --git a/containers/homepage/website/static/services/gitea.png b/homepage/website/static/services/gitea.png similarity index 100% rename from containers/homepage/website/static/services/gitea.png rename to homepage/website/static/services/gitea.png diff --git a/containers/homepage/website/static/services/minecraft.png b/homepage/website/static/services/minecraft.png similarity index 100% rename from containers/homepage/website/static/services/minecraft.png rename to homepage/website/static/services/minecraft.png diff --git a/containers/homepage/website/static/services/photoprism.png b/homepage/website/static/services/photoprism.png similarity index 100% rename from containers/homepage/website/static/services/photoprism.png rename to homepage/website/static/services/photoprism.png diff --git a/containers/homepage/website/static/services/plex.png b/homepage/website/static/services/plex.png similarity index 100% rename from containers/homepage/website/static/services/plex.png rename to homepage/website/static/services/plex.png diff --git a/containers/homepage/website/static/services/recipes.png b/homepage/website/static/services/recipes.png similarity index 100% rename from containers/homepage/website/static/services/recipes.png rename to homepage/website/static/services/recipes.png diff --git a/containers/homepage/website/styles.css b/homepage/website/styles.css similarity index 100% rename from containers/homepage/website/styles.css rename to homepage/website/styles.css diff --git a/containers/jenkins/.gitignore b/jenkins/.gitignore similarity index 100% rename from containers/jenkins/.gitignore rename to jenkins/.gitignore diff --git a/containers/jenkins/README.md b/jenkins/README.md similarity index 100% rename from containers/jenkins/README.md rename to jenkins/README.md diff --git a/containers/jenkins/docker-compose.yml.blanked b/jenkins/docker-compose.yml.blanked similarity index 100% rename from containers/jenkins/docker-compose.yml.blanked rename to jenkins/docker-compose.yml.blanked diff --git a/containers/metube/.gitignore b/metube/.gitignore similarity index 100% rename from containers/metube/.gitignore rename to metube/.gitignore diff --git a/containers/metube/README.md b/metube/README.md similarity index 100% rename from containers/metube/README.md rename to metube/README.md diff --git a/containers/metube/docker-compose.yml.blanked b/metube/docker-compose.yml.blanked similarity index 100% rename from containers/metube/docker-compose.yml.blanked rename to metube/docker-compose.yml.blanked diff --git a/containers/minecraft/.gitignore b/minecraft/.gitignore similarity index 100% rename from containers/minecraft/.gitignore rename to minecraft/.gitignore diff --git a/containers/minecraft/README.md b/minecraft/README.md similarity index 100% rename from containers/minecraft/README.md rename to minecraft/README.md diff --git a/containers/minecraft/docker-compose.yml.blanked b/minecraft/docker-compose.yml.blanked similarity index 92% rename from containers/minecraft/docker-compose.yml.blanked rename to minecraft/docker-compose.yml.blanked index 9bea528..7d458d3 100644 --- a/containers/minecraft/docker-compose.yml.blanked +++ b/minecraft/docker-compose.yml.blanked @@ -1,11 +1,11 @@ version: "3" networks: - [MINECRAFT_NETWORK]: + minecraft: driver: bridge - [GRAFANA_NETWORK]: + grafana: external: true - [TRAEFIK_NETWORK]: + traefik: external: true services: @@ -14,8 +14,8 @@ services: container_name: minecraft_creative restart: unless-stopped networks: - - [GRAFANA_NETWORK] - - [MINECRAFT_NETWORK] + - grafana + - minecraft ports: - "[SERVER_PORT_1]:25565" - "[PROMETHEUS_PORT_1]:9225" @@ -39,14 +39,14 @@ services: - ALLOW_FLIGHT=true labels: - traefik.enable=false - + minecraft_2023: image: itzg/minecraft-server:latest container_name: minecraft_2023 networks: - - [TRAEFIK_NETWORK] - - [GRAFANA_NETWORK] - - [MINECRAFT_NETWORK] + - traefik + - grafana + - minecraft ports: - "[SERVER_PORT_2]:25565" - "[PROMETHEUS_PORT_2]:9225" @@ -78,7 +78,7 @@ services: image: itzg/minecraft-server:latest container_name: minecraft_skyblock networks: - - minecraft_network + - minecraft ports: - "[SERVER_PORT_3]:25565" volumes: @@ -101,7 +101,7 @@ services: image: joshi425/minecraft_exporter:latest container_name: minecraft_2023_metrics networks: - - minecraft_network + - minecraft ports: - [SEVER_PORT_4]:2565 volumes: @@ -115,6 +115,3 @@ services: - DYNMAP_ENABLED="True" labels: - traefik.enable=false - - - diff --git a/containers/monica/.gitignore b/monica/.gitignore similarity index 100% rename from containers/monica/.gitignore rename to monica/.gitignore diff --git a/containers/monica/README.md b/monica/README.md similarity index 100% rename from containers/monica/README.md rename to monica/README.md diff --git a/containers/monica/docker-compose.yml.blanked b/monica/docker-compose.yml.blanked similarity index 100% rename from containers/monica/docker-compose.yml.blanked rename to monica/docker-compose.yml.blanked diff --git a/monolith/README.md b/monolith/README.md deleted file mode 100644 index 1512a23..0000000 --- a/monolith/README.md +++ /dev/null @@ -1,85 +0,0 @@ -# Olomana - All in One -This is the one-dockerfile version of olomana containing the stable "production" containers. -Better than going module by module but don't let that stop you. -Run everything with a simple `docker compose down && docker system prune && docker compose up -d` -Run one thing with a simple `docker compose up serviceName` - -## Setup - -### Traefik - -#### Instructions - -##### Files -Create/Fill in the following files in a `traefik/` directory under this one using the provided templates: -- `traefik.toml` -- `traefik-dynamic.toml`. - -The file `traefik/acme.json` will be generated on first run. Make sure it eventually gets permission code 600. You might need to create a blank file before the first run. - -##### Volumes -In addition to the above files, make sure the docker socket is mounted: -- `/var/run/docker.sock:/var/run/docker.sock:ro` - -#### References -https://doc.traefik.io/traefik/getting-started/quick-start/ -https://doc.traefik.io/traefik/user-guides/docker compose/basic-example/ - -### Code-Server - -#### Instructions - -##### Volumes -Mount the persistant storage somewhere. -- `/pwspool/software/code-server/config:/config` - -##### Metadata -Re-roll hashed passwords. -./olomana.ini:/etc/grafana/grafana.ini -#### References -https://docs.linuxserver.io/images/docker-code-server/ -https://coder.com/docs/code-server/latest/install#docker -https://hub.docker.com/r/linuxserver/code-server -https://github.com/coder/code-server/blob/main/docs/FAQ.md#can-i-store-my-password-hashed - -### Grafana - -#### Instructions - -##### Files -Create/Fill in the following files in a `grafana` directory under this one using the templates. -- `grafana.ini` -- `prometheus.yml` - -##### Volumes -Make sure that in additionto mounting the 2 files above to their respective containers, grafana container has the following mount: -- `/pwspool/software/grafana:/var/lib/grafana` - -Also make sure that the correct user has access to the folder on the host machine, sometimes grafana won't start up otherwise. - -##### Grafana Setup -To set up the data source in grafana to point to prometheus, you would refer to `http://prometheus:9090`. - -#### References -https://grafana.com/docs/grafana/latest/setup-grafana/installation/docker/ - -### Homepage - -#### Instructions - -##### Build -Test build with `docker compose build homepage`. - -### NordVPN - -#### Instructions - -##### Files -Create `nordvpn/token.txt` with NordVPN token which is generated from NordVPN website. - -##### Notes -Can use either nordlynx or nordvpn in nordlynx configuration. - -#### References -https://github.com/bubuntux/nordvpn -https://github.com/bubuntux/nordlynx diff --git a/monolith/docker-compose.yml b/monolith/docker-compose.yml deleted file mode 100644 index 63d770b..0000000 --- a/monolith/docker-compose.yml +++ /dev/null @@ -1,160 +0,0 @@ -networks: - traefik: - driver: bridge - name: traefik - grafana: - driver: bridge - name: grafana - -volumes: - prometheus_data: {} - -services: - traefik: - image: traefik:latest - container_name: traefik - restart: unless-stopped - networks: - - traefik - ports: - - "80:80" - - "8080:8080" - - "443:443" - volumes: - - /var/run/docker.sock:/var/run/docker.sock:ro - - ./traefik/traefik.toml:/etc/traefik/traefik.toml - - ./traefik/traefik-dynamic.toml:/etc/traefik/dynamic/traefik-dynamic.toml - - ./traefik/acme.json:/etc/acme.json - - code-server: - image: lscr.io/linuxserver/code-server:latest - container_name: code-server - restart: unless-stopped - depends_on: - - traefik - networks: - - traefik - volumes: - - /pwspool/software/code-server/config:/config - environment: - - PUID=1000 - - PGID=1000 - - TZ=Etc/UTC - - HASHED_PASSWORD=$$argon2i$$v=19$$m=4096,t=3,p=1$$o70PqzdDrUvzijIN+Nd+uw$$8wsBelBomYLsaKFelBAf+v8KqpS7TMsfFvmouarbehg - - SUDO_PASSWORD_HASH=$$argon2i$$v=19$$m=4096,t=3,p=1$$o70PqzdDrUvzijIN+Nd+uw$$8wsBelBomYLsaKFelBAf+v8KqpS7TMsfFvmouarbehg - - PROXY_DOMAIN=code.whitney.rip - - DEFAULT_WORKSPACE=/config/workspace - labels: - - traefik.http.routers.code.rule=Host(`code.whitney.rip`) - - traefik.http.routers.code.tls=true - - traefik.http.routers.code.tls.certresolver=lets-encrypt - - traefik.http.services.code.loadbalancer.server.port=8443 - - grafana: - image: grafana/grafana - container_name: grafana - restart: unless-stopped - depends_on: - - traefik - - node_exporter - - prometheus - networks: - - grafana - - traefik - user: "1003" - volumes: - - ./grafana/grafana.ini:/etc/grafana/grafana.ini - - /pwspool/software/grafana:/var/lib/grafana - labels: - - traefik.http.routers.grafana.rule=Host(`grafana.whitney.rip`) - - traefik.http.routers.grafana.tls=true - - traefik.http.routers.grafana.tls.certresolver=lets-encrypt - - traefik.http.services.grafana.loadbalancer.server.port=3000 - - node_exporter: - image: quay.io/prometheus/node-exporter:latest - container_name: node_exporter - restart: unless-stopped - depends_on: - - prometheus - networks: - - grafana - pid: host - user: "1003:1005" - command: - - "--path.rootfs=/host" - volumes: - - "/:/host:ro,rslave" - labels: - - traefik.enable=false - - prometheus: - image: prom/prometheus:latest - container_name: prometheus - restart: unless-stopped - networks: - - grafana - volumes: - - "./grafana/prometheus.yml:/etc/prometheus.yml" - - prometheus_data:/prometheus - command: - - "--config.file=/etc/prometheus.yml" - - "--storage.tsdb.path=/prometheus" - - "--web.console.libraries=/usr/share/prometheus/console_libraries" - - "--web.console.templates=/usr/share/prometheus/consoles" - labels: - - traefik.enable=false - - homepage: - image: homepage - container_name: homepage - build: homepage/ - restart: unless-stopped - depends_on: - - traefik - networks: - - traefik - ports: - - "81:80" - labels: - - traefik.http.routers.homepage.rule=Host(`www.whitney.rip`) - - traefik.http.routers.homepage.tls=true - - traefik.http.routers.homepage.tls.certresolver=lets-encrypt - - traefik.http.services.homepage.loadbalancer.server.port=81 - - nordlynx: - image: ghcr.io/bubuntux/nordlynx - container_name: nordlynx - restart: unless-stopped - network_mode: bridge - cap_add: - - NET_ADMIN - - NET_RAW - environment: - - PRIVATE_KEY=mDnVa4EMbnlSF8Sg/i657hf+NRyWQxQjKTwkImD/HWE= - - NET_LOCAL=192.168.1.0/24 - - TZ=America/Los_Angeles - - QUERY=filters\[country_id\]=202 - ports: - - "8888:8888" - - 6881:6881 - - 6881:6881/udp - labels: - - traefik.enable=false - - qb: - image: ghcr.io/linuxserver/qbittorrent:latest - container_name: qb - restart: unless-stopped - depends_on: - - nordlynx - network_mode: service:nordlynx - environment: - - PUID=1001 - - PGID=1001 - - WEBUI_PORT=8888 - volumes: - - /data/write/qb/appdata/config:/config - - /data/write/qb/downloads:/downloads - labels: - - traefik.enable=false diff --git a/monolith/grafana/.gitignore b/monolith/grafana/.gitignore deleted file mode 100644 index 0cc5347..0000000 --- a/monolith/grafana/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -grafana.ini -prometheus.yml diff --git a/monolith/grafana/grafana.ini.BLANKED b/monolith/grafana/grafana.ini.BLANKED deleted file mode 100755 index 754a9c4..0000000 --- a/monolith/grafana/grafana.ini.BLANKED +++ /dev/null @@ -1,62 +0,0 @@ -[paths] -[server] -[database] -[datasources] -[remote_cache] -[dataproxy] -[analytics] -[security] -admin_user = admin -admin_password = adminpassword -[snapshots] -[dashboards] -[users] -default_theme = dark -[auth] -signout_redirect_url = www.example.com -[auth.anonymous] -enabled = true -[auth.github] -[auth.gitlab] -[auth.google] -[auth.grafana_com] -[auth.azuread] -[auth.okta] -[auth.generic_oauth] -[auth.basic] -[auth.proxy] -[auth.jwt] -[auth.ldap] -[aws] -[smtp] -[emails] -[log] -[log.console] -[log.file] -[log.syslog] -[log.frontend] -[quota] -[alerting] -[annotations] -[annotations.dashboard] -[annotations.api] -[explore] -[metrics] -[metrics.environment_info] -[metrics.graphite] -[grafana_com] -[tracing.jaeger] -[external_image_storage] -[external_image_storage.s3] -[external_image_storage.webdav] -[external_image_storage.gcs] -[external_image_storage.azure_blob] -[external_image_storage.local] -[rendering] -[panels] -[plugins] -[plugin.grafana-image-renderer] -[enterprise] -[feature_toggles] -[date_formats] -[expressions] diff --git a/monolith/grafana/prometheus.yml.BLANKED b/monolith/grafana/prometheus.yml.BLANKED deleted file mode 100644 index d177e6b..0000000 --- a/monolith/grafana/prometheus.yml.BLANKED +++ /dev/null @@ -1,14 +0,0 @@ -global: - scrape_interval: 15s - external_labels: - monitor: 'codelab-monitor' -scrape_configs: - - job_name: 'prometheus' - scrape_interval: 5s - static_configs: - - targets: ['localhost:9090'] - - job_name: 'node_exporter' - scrape_interval: 5s - static_configs: - - targets: ['node_exporter:9100'] - diff --git a/monolith/homepage/Dockerfile b/monolith/homepage/Dockerfile deleted file mode 100644 index a766deb..0000000 --- a/monolith/homepage/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM nginx:alpine - -COPY nginx/nginx.conf /etc/nginx/nginx.conf -COPY website /usr/share/nginx/html - -EXPOSE 80 - -CMD ["nginx", "-g", "daemon off;"] - diff --git a/monolith/homepage/nginx/nginx.conf b/monolith/homepage/nginx/nginx.conf deleted file mode 100644 index f18f499..0000000 --- a/monolith/homepage/nginx/nginx.conf +++ /dev/null @@ -1,15 +0,0 @@ -events { - worker_connections 1024; -} - -http { - server { - listen 81; - server_name localhost; - - location / { - root /usr/share/nginx/html; - index index.html; - } - } -} \ No newline at end of file diff --git a/monolith/homepage/website/about.html b/monolith/homepage/website/about.html deleted file mode 100644 index ebf043d..0000000 --- a/monolith/homepage/website/about.html +++ /dev/null @@ -1,47 +0,0 @@ - -
- - -Experience the ultimate web service tailored just for you.
- Learn More -"${quoteData.text}" - ${quoteData.author}
`; - quoteElement.innerHTML = html; - } else { - quoteSection.innerHTML = `${failureMessageQOTD}
`; - } - } catch (error) { - console.error('Error rendering Quote of the Day:', error); - quoteSection.innerHTML = `${failureMessageQOTD}
`; - } -} - -console.log("Thanks for checking out PWS!"); -document.addEventListener('DOMContentLoaded', renderQOTD); diff --git a/monolith/homepage/website/services.html b/monolith/homepage/website/services.html deleted file mode 100644 index 5b15243..0000000 --- a/monolith/homepage/website/services.html +++ /dev/null @@ -1,105 +0,0 @@ - - - - -Check out some of the PWS services!
-I usually host code on Github, but for personal projects or my own IP, I self host. Some repos are mirrored to Github.
-Personal notebook hosting stuff like my grocery list and anything I need to keep track of in the moment. UI is not too bad on both mobile and on desktop.
-This was a coding project that my dad and I worked on during covid. He wanted to do some data analysis to fact check what was reported on about the covid rates. I wanted some practice with hosting web applications on PWS v1, and hosted the covid tracker website for him on PWS.
-The website renders various charts, tables, and dashboards by interest. It additionally has a few "Checker" utilities to compare cases across cities and availability within hospitals.
-Unfortunately, as of 2024, the US government website we scraped data for has stopped sharing information, and unfortunately this marks the end for this project. However, we still run it on PWS with the most recent batch of data.
-Some stretch goals for this project include caching with Nginx, or converting it to a different framework like Observable.
-I host a personal photo gallery of memories that I'd like to remember. Photoprism makes a great open source(!) solution for doing this that is better than most other comparable projects. Its features list is rather long, and can give you a pretty decent Google Photos impression.
-There are a few one-of websites that I host off of PWS. One is my Recipes Website, a ad-less, bloat-less recipes website that actually tells you how to cook something instead of trying to sell you on a cookbook or something. This was written around the time that ChatGPT was becoming a household name, and this was a great project to start to learn some of the capabilities on.
-Some other sites include my personal website (where I blog on some of these projects), and, of course, this PWS website!
-At one point, when creating discord servers for special interest groups I was a part of, I found that moderation and automation were a problem with the default discord server owner experience.
-I tried using a paid discord bot to solve some of these problems, and eventually liked it enough to purchase a lifetime subscription. However, that bot's owners started to lock features away under additional tiers and I became unhappy.
-Just unhappy enought to sit down and learn how to use the Discord Api. With the help of the Discord API for Python, and ChatGPT by my side, I have started a repository containing some of the bots and features I have written for them. It's a nice, fun way to add functionality to a service that some of my friends choose to congregate on.
-Every few winters, people get stuck inside due to rain or snow and want to play some games. In the past, PWS has hosted a minecraft server to scratch that itch. Third party plugins like Dynmap allowed us to elevate the experience by hosting a live-updating server map, which is where the screenshot comes from.
-