mirror of
				https://github.com/kevinveenbirkenbach/computer-playbook.git
				synced 2025-11-04 04:08:15 +00:00 
			
		
		
		
	Finished simpleicons implementation
This commit is contained in:
		
							
								
								
									
										34
									
								
								roles/docker-simpleicons/README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								roles/docker-simpleicons/README.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,34 @@
 | 
			
		||||
# Simple Icons
 | 
			
		||||
 | 
			
		||||
## Description
 | 
			
		||||
 | 
			
		||||
This Ansible role deploys and manages a containerized [Simple Icons](https://simpleicons.org/) server, providing easy access to over 2,000 SVG and PNG icons for use in web projects, documentation, and branding.
 | 
			
		||||
 | 
			
		||||
## Overview
 | 
			
		||||
 | 
			
		||||
Ideal for developers and content creators, the role simplifies deploying a dedicated icon server. It automates container setup, configuration, and routing, ensuring reliable, quick access to icons. Easily integrate scalable icons into your projects without managing individual asset files.
 | 
			
		||||
 | 
			
		||||
## Purpose
 | 
			
		||||
 | 
			
		||||
The Docker-SimpleIcons role streamlines the deployment and management of a simple, efficient icon server. It helps you:
 | 
			
		||||
- Quickly deploy a lightweight, dedicated icon server.
 | 
			
		||||
- Serve icons consistently and reliably across multiple projects.
 | 
			
		||||
- Reduce manual maintenance of icon assets.
 | 
			
		||||
- Integrate seamlessly with complementary Ansible roles and web server configurations.
 | 
			
		||||
 | 
			
		||||
## Features
 | 
			
		||||
 | 
			
		||||
- **Icon Server:** Serves scalable SVG and PNG icons from the Simple Icons collection.
 | 
			
		||||
- **Containerized Deployment:** Utilizes Docker and Docker Compose for isolated, reliable deployment.
 | 
			
		||||
- **Dynamic Icon Delivery:** Icons are dynamically served via RESTful endpoints.
 | 
			
		||||
- **Customizable Setup:** Configure icon sizes, formats, and routes effortlessly.
 | 
			
		||||
- **Efficient Integration:** Works seamlessly with web server roles for robust domain routing.
 | 
			
		||||
- **Automated Maintenance:** Simplifies updates and re-deployments via automated container management.
 | 
			
		||||
 | 
			
		||||
## Credits 📝
 | 
			
		||||
 | 
			
		||||
Developed and maintained by **Kevin Veen-Birkenbach**.  
 | 
			
		||||
Learn more at [www.veen.world](https://www.veen.world)
 | 
			
		||||
 | 
			
		||||
Part of the [CyMaIS Project](https://github.com/kevinveenbirkenbach/cymais)  
 | 
			
		||||
License: [CyMaIS NonCommercial License (CNCL)](https://s.veen.world/cncl)
 | 
			
		||||
							
								
								
									
										26
									
								
								roles/docker-simpleicons/meta/main.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								roles/docker-simpleicons/meta/main.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,26 @@
 | 
			
		||||
galaxy_info:
 | 
			
		||||
  author: "Kevin Veen-Birkenbach"
 | 
			
		||||
  description: "Deploy and serve SVG and PNG icons effortlessly with Simple Icons, a containerized icon server ideal for web projects, documentation, and branding."
 | 
			
		||||
  license: "CyMaIS NonCommercial License (CNCL)"
 | 
			
		||||
  license_url: "https://s.veen.world/cncl"
 | 
			
		||||
  company: |
 | 
			
		||||
    Kevin Veen-Birkenbach
 | 
			
		||||
    Consulting & Coaching Solutions
 | 
			
		||||
    https://www.veen.world
 | 
			
		||||
  min_ansible_version: "2.9"
 | 
			
		||||
  platforms:
 | 
			
		||||
    - name: Docker
 | 
			
		||||
      versions:
 | 
			
		||||
        - latest
 | 
			
		||||
  galaxy_tags:
 | 
			
		||||
    - docker
 | 
			
		||||
    - icons
 | 
			
		||||
    - branding
 | 
			
		||||
    - svg
 | 
			
		||||
    - png
 | 
			
		||||
  repository: "https://s.veen.world/cymais"
 | 
			
		||||
  issue_tracker_url: "https://s.veen.world/cymaisissues"
 | 
			
		||||
  documentation: "https://s.veen.world/cymais"
 | 
			
		||||
  logo:
 | 
			
		||||
    class: "fa-solid fa-icons"
 | 
			
		||||
  run_after: []
 | 
			
		||||
							
								
								
									
										30
									
								
								roles/docker-simpleicons/tasks/main.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								roles/docker-simpleicons/tasks/main.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,30 @@
 | 
			
		||||
---
 | 
			
		||||
- name: "include docker-compose role"
 | 
			
		||||
  include_role: 
 | 
			
		||||
    name: docker-compose
 | 
			
		||||
  when: run_once_docker_simpleicons is not defined
 | 
			
		||||
 | 
			
		||||
- name: "include role nginx-domain-setup for {{application_id}}"
 | 
			
		||||
  include_role:
 | 
			
		||||
    name: nginx-domain-setup
 | 
			
		||||
  vars:
 | 
			
		||||
    domain:   "{{ domains | get_domain(application_id) }}"
 | 
			
		||||
    http_port:   "{{ ports.localhost.http[application_id] }}"
 | 
			
		||||
  when: run_once_docker_simpleicons is not defined
 | 
			
		||||
 | 
			
		||||
- name: "Copy '{{ application_id }}' files"
 | 
			
		||||
  template:
 | 
			
		||||
    src: "{{ item.source }}"
 | 
			
		||||
    dest: "{{ item.target }}"
 | 
			
		||||
    mode: '0755'
 | 
			
		||||
  loop:
 | 
			
		||||
    - { source: "server.js.j2",    target: "{{ simpleicons_host_server_file }}" }
 | 
			
		||||
    - { source: "package.json.j2",  target: "{{ simpleicons_host_package_file }}" }
 | 
			
		||||
  notify:
 | 
			
		||||
    - docker compose up
 | 
			
		||||
  when: run_once_docker_simpleicons is not defined
 | 
			
		||||
 | 
			
		||||
- name: run the simpleicons tasks once
 | 
			
		||||
  set_fact:
 | 
			
		||||
    run_once_docker_portfolio: true
 | 
			
		||||
  when: run_once_docker_simpleicons is not defined
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
FROM node:latest AS builder
 | 
			
		||||
 | 
			
		||||
WORKDIR /app
 | 
			
		||||
COPY package*.json ./
 | 
			
		||||
COPY ./config/package*.json ./
 | 
			
		||||
 | 
			
		||||
RUN npm install
 | 
			
		||||
 | 
			
		||||
@@ -9,8 +9,8 @@ FROM node:latest
 | 
			
		||||
 | 
			
		||||
WORKDIR /app
 | 
			
		||||
COPY --from=builder /app/node_modules ./node_modules
 | 
			
		||||
COPY server.js .
 | 
			
		||||
COPY ./config/server.js .
 | 
			
		||||
 | 
			
		||||
EXPOSE 3000
 | 
			
		||||
EXPOSE {{ container_port }}
 | 
			
		||||
 | 
			
		||||
CMD ["node", "server.js"]
 | 
			
		||||
@@ -6,9 +6,9 @@
 | 
			
		||||
    image: simpleicons-server:latest
 | 
			
		||||
    container_name: simpleicons-server
 | 
			
		||||
    ports:
 | 
			
		||||
      - "{{ports.localhost.http[application_id]}}:3000"
 | 
			
		||||
      - "{{ports.localhost.http[application_id]}}:{{ container_port }}"
 | 
			
		||||
{% include 'roles/docker-container/templates/base.yml.j2' %}
 | 
			
		||||
{% include 'roles/docker-container/templates/networks.yml.j2' %}
 | 
			
		||||
{% include 'roles/docker-container/templates/healthcheck/curl.yml.j2' %}
 | 
			
		||||
 | 
			
		||||
{% include 'roles/docker-compose/templates/networks.yml.j2' %}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										1
									
								
								roles/docker-simpleicons/templates/env.j2
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								roles/docker-simpleicons/templates/env.j2
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
{# This file just exists, because the framework requests it. #}
 | 
			
		||||
@@ -3,7 +3,7 @@ import * as icons from 'simple-icons';
 | 
			
		||||
import sharp from 'sharp';
 | 
			
		||||
 | 
			
		||||
const app = express();
 | 
			
		||||
const port = process.env.PORT || 3000;
 | 
			
		||||
const port = {{ container_port }};
 | 
			
		||||
 | 
			
		||||
// Helper: convert 'nextcloud' → 'siNextcloud'
 | 
			
		||||
function getExportName(slug) {
 | 
			
		||||
@@ -15,7 +15,7 @@ function getExportName(slug) {
 | 
			
		||||
 | 
			
		||||
// Root: redirect to your documentation
 | 
			
		||||
app.get('/', (req, res) => {
 | 
			
		||||
  res.redirect('https://docs.cymais.cloud/roles/docker-{{ application_id }}/README.html');
 | 
			
		||||
  res.redirect('{{ domains | get_url('sphinx', web_protocol) }}/roles/docker-{{ application_id }}/README.html');
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
// GET /:slug.svg
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										27
									
								
								roles/docker-simpleicons/vars/configuration.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								roles/docker-simpleicons/vars/configuration.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,27 @@
 | 
			
		||||
 | 
			
		||||
credentials: {}
 | 
			
		||||
docker:
 | 
			
		||||
  images: {}                # @todo Move under services
 | 
			
		||||
  versions: {}              # @todo Move under services
 | 
			
		||||
  services:
 | 
			
		||||
    redis:
 | 
			
		||||
      enabled:      false   # Enable Redis 
 | 
			
		||||
    database:
 | 
			
		||||
      enabled:      false   # Enable the database 
 | 
			
		||||
features:
 | 
			
		||||
  matomo:           true    # Enable Matomo Tracking
 | 
			
		||||
  css:              true    # Enable Global CSS Styling
 | 
			
		||||
  portfolio_iframe: true    # Enable loading of app in iframe
 | 
			
		||||
  ldap:             false   # Enable LDAP Network
 | 
			
		||||
  central_database: false   # Enable Central Database Network
 | 
			
		||||
  recaptcha:        false   # Enable ReCaptcha
 | 
			
		||||
  oauth2:           false   # Enable the OAuth2-Proy
 | 
			
		||||
csp:                        
 | 
			
		||||
domains:
 | 
			
		||||
  canonical:
 | 
			
		||||
    - "icons.{{ primary_domain }}"
 | 
			
		||||
rbac:
 | 
			
		||||
  roles:
 | 
			
		||||
    mail-bot:
 | 
			
		||||
      description: "Has an token to send and recieve emails"
 | 
			
		||||
 | 
			
		||||
@@ -1 +1,4 @@
 | 
			
		||||
application_id: simpleicons
 | 
			
		||||
application_id:                 simpleicons 
 | 
			
		||||
container_port:                 3000
 | 
			
		||||
simpleicons_host_server_file:   "{{docker_compose.directories.config}}server.js"
 | 
			
		||||
simpleicons_host_package_file:  "{{docker_compose.directories.config}}package.json"
 | 
			
		||||
		Reference in New Issue
	
	Block a user