mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
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:
9
roles/web-app-yourls/Administration.md
Normal file
9
roles/web-app-yourls/Administration.md
Normal 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
|
||||
```
|
31
roles/web-app-yourls/README.md
Normal file
31
roles/web-app-yourls/README.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# YOURLS
|
||||
|
||||
## Description
|
||||
|
||||
YOURLS (Your Own URL Shortener) is an open‑source 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 pre‑configured 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)
|
30
roles/web-app-yourls/meta/main.yml
Normal file
30
roles/web-app-yourls/meta/main.yml
Normal file
@@ -0,0 +1,30 @@
|
||||
---
|
||||
galaxy_info:
|
||||
author: "Kevin Veen-Birkenbach"
|
||||
description: >
|
||||
Streamline your online presence with YOURLS — a nimble, open‑source 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
|
5
roles/web-app-yourls/meta/schema.yml
Normal file
5
roles/web-app-yourls/meta/schema.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
credentials:
|
||||
administrator_password:
|
||||
description: "Initial password for the YOURLS administrator account"
|
||||
algorithm: "sha256"
|
||||
validation: "^[a-f0-9]{64}$"
|
3
roles/web-app-yourls/meta/users.yml
Normal file
3
roles/web-app-yourls/meta/users.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
users:
|
||||
administrator:
|
||||
username: "administrator"
|
12
roles/web-app-yourls/tasks/main.yml
Normal file
12
roles/web-app-yourls/tasks/main.yml
Normal 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] }}"
|
||||
|
17
roles/web-app-yourls/templates/docker-compose.yml.j2
Normal file
17
roles/web-app-yourls/templates/docker-compose.yml.j2
Normal 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' %}
|
9
roles/web-app-yourls/templates/env.j2
Normal file
9
roles/web-app-yourls/templates/env.j2
Normal 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))}}"
|
24
roles/web-app-yourls/vars/configuration.yml
Normal file
24
roles/web-app-yourls/vars/configuration.yml
Normal 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
|
2
roles/web-app-yourls/vars/main.yml
Normal file
2
roles/web-app-yourls/vars/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
application_id: "yourls"
|
||||
database_type: "mariadb"
|
Reference in New Issue
Block a user