Skip to content

💻 cheat.sh

cheat.sh is used as a set of cheat sheets that can be accessed via the command line.

The hopes is to be able to add my own commands that I can reference in the cheat sheets without having to contribute to the community repos.

🛠 Installation

Default Port: 8002

Configuration path: homelab/docker/cheatsh/etc/config.yml

homelab/docker/cheatsh

task up
docker compose up

⚙ Config

homelab/docker/cheatsh/.env

CONTAINER_NAME=cheatsh
homelab/docker/cheatsh/compose.yaml
---
services:
  app:
    image: nicholaswilde/cheat.sh:sha-139f8c2
    container_name: ${CONTAINER_NAME}
    env_file:
      - .env
    depends_on:
      - redis
    environment:
      - CHEATSH_CACHE_REDIS_HOST=redis
      # - CHEATSH_CACHE_TYPE=none
    ports:
      - "8002:8002"
    volumes:
      - cheatsh_data:/root/.cheat.sh
      - ./etc:/app/etc
    restart: always
  redis:
    image: redis:4-alpine
    volumes:
      - redis_data:/data
volumes:
  redis_data:
  cheatsh_data:

Traefik

homelab/pve/traefik/conf.d/cheatsh.yaml
---
http:
 #region routers 
  routers:
    cheatsh:
      entryPoints:
        - "websecure"
      rule: "Host(`cheatsh.l.nicholaswilde.io`)"
      middlewares:
        - default-headers@file
        - https-redirectscheme@file
      tls: {}
      service: cheatsh
#endregion
#region services
  services:
    cheatsh:
      loadBalancer:
        servers:
          - url: "http://192.168.2.103:8002"
        passHostHeader: true
#endregion

📝 Usage

curl localhost:8002/ssh

Task List

task: Available tasks for this project:
* decrypt:       Decrypt .env using SOPS
* encrypt:       Encrypt .env using SOPS
* export:        Export the task list
* init:          Init .env file
* pull:          Pull docker images
* restart:       Restart Docker containers
* status:        Docker container status
* stop:          Stop Docker containers
* up:            Run Docker compose in the foreground.
* up-d:          Run Docker compose in the background.
* update:        Update running containers
* upgrade:       Upgrade Docker containers
* watch:         Watch Docker container logs

🔗 References