Huge role refactoring/cleanup. Other commits will propably follow. Because some bugs will exist. Still important for longrun and also for auto docs/help/slideshow generation

This commit is contained in:
2025-07-08 23:43:13 +02:00
parent 6b87a049d4
commit 563d5fd528
1242 changed files with 2301 additions and 1355 deletions

View File

@@ -0,0 +1,9 @@
# Administration
## database
To login to the database type in:
```bash
docker-compose exec -it database /bin/mysql -u yourls -p
```

View File

@@ -0,0 +1,31 @@
# YOURLS
## Description
YOURLS (Your Own URL Shortener) is an opensource URL shortening solution that enables you to create, track, and manage short links with ease. This deployment leverages Docker to provide a secure and easily scalable environment, ensuring that your YOURLS instance is configured for optimal performance and reliability.
## Overview
This containerized YOURLS solution is built on robust Docker Compose and Ansible automation. It simplifies the deployment process by integrating with centralized MariaDB management and providing preconfigured health checks and environment settings. Whether you're looking to quickly generate memorable links or need detailed analytics, this deployment supports your digital strategy seamlessly.
## Features
- **Efficient URL Shortening:**
Quickly generate short, branded links that help streamline your online presence.
- **Built-in Analytics:**
Monitor link performance and track click data to gain valuable insights into user engagement.
- **Centralized Database Integration:**
Seamlessly connect to a MariaDB instance for consistent, reliable data storage and management.
- **Configurable Environment:**
Easily customize your YOURLS instance through environment variables—set your site URL, admin credentials, and more.
- **Secure and Scalable:**
Benefit from container isolation and reproducible deployments that ensure your service is both secure and scalable.
## Further Resources
- [YOURLS Official Website](https://yourls.org/)
- [YOURLS GitHub Repository](https://github.com/YOURLS/YOURLS)

View File

@@ -0,0 +1,30 @@
---
galaxy_info:
author: "Kevin Veen-Birkenbach"
description: >
Streamline your online presence with YOURLS — a nimble, opensource URL shortener that empowers you to create, track, and manage short links effortlessly.
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: Linux
versions:
- all
galaxy_tags:
- yourls
- url-shortener
- docker
- automation
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-link"
run_after:
- service-rdbms-mariadb
- web-app-matomo
- web-app-keycloak

View File

@@ -0,0 +1,5 @@
credentials:
administrator_password:
description: "Initial password for the YOURLS administrator account"
algorithm: "sha256"
validation: "^[a-f0-9]{64}$"

View File

@@ -0,0 +1,3 @@
users:
administrator:
username: "administrator"

View File

@@ -0,0 +1,12 @@
---
- name: "include service-rdbms-central"
include_role:
name: service-rdbms-central
- name: "include role webserver-proxy-domain for {{application_id}}"
include_role:
name: webserver-proxy-domain
vars:
domain: "{{ domains | get_domain(application_id) }}"
http_port: "{{ ports.localhost.http[application_id] }}"

View File

@@ -0,0 +1,17 @@
{% include 'roles/docker-compose/templates/base.yml.j2' %}
application:
{% set container_port = 80 %}
{% set container_healthcheck = 'http://127.0.0.1/admin/' %}
image: yourls:{{applications.yourls.version}}
{% include 'roles/docker-container/templates/base.yml.j2' %}
ports:
- "127.0.0.1:{{ports.localhost.http[application_id]}}:{{ container_port }}"
{% include 'roles/docker-container/templates/healthcheck/curl.yml.j2' %}
{% include 'roles/docker-container/templates/depends_on/dmbs_excl.yml.j2' %}
{% include 'roles/docker-container/templates/networks.yml.j2' %}
{% include 'roles/docker-compose/templates/volumes-just-database.yml.j2' %}
{% include 'roles/docker-compose/templates/networks.yml.j2' %}

View File

@@ -0,0 +1,9 @@
YOURLS_DB_HOST: "{{database_host}}"
YOURLS_DB_USER: "{{database_username}}"
YOURLS_DB_PASS: "{{database_password}}"
YOURLS_DB_NAME: "{{database_name}}"
YOURLS_SITE: "{{ domains | get_url(application_id, web_protocol) }}"
YOURLS_USER: "{{applications.yourls.users.administrator.username}}"
YOURLS_PASS: "{{applications[application_id].credentials.administrator_password}}"
# The following deactivates the login mask for admins, if the oauth2 proxy is activated
YOURLS_PRIVATE: "{{not (applications | is_feature_enabled('oauth2', application_id))}}"

View File

@@ -0,0 +1,24 @@
version: "latest"
oauth2_proxy:
application: "application"
port: "80"
allowed_groups:
- "yourls-administrator"
acl:
blacklist:
- "/admin/" # Protects the admin area
features:
matomo: true
css: true
portfolio_iframe: true
central_database: true
oauth2: true
domains:
canonical:
- "s.{{ primary_domain }}"
aliases:
- "short.{{ primary_domain }}"
docker:
services:
database:
enabled: true

View File

@@ -0,0 +1,2 @@
application_id: "yourls"
database_type: "mariadb"