feat(homepage): add homepage stack
This commit is contained in:
@@ -105,7 +105,7 @@ services:
|
|||||||
domain:
|
domain:
|
||||||
internal: "grafana"
|
internal: "grafana"
|
||||||
ports:
|
ports:
|
||||||
http: "3000"
|
http: "3000" # infra
|
||||||
subuid: "100471"
|
subuid: "100471"
|
||||||
dependency:
|
dependency:
|
||||||
web: "infra-internal"
|
web: "infra-internal"
|
||||||
@@ -124,6 +124,14 @@ services:
|
|||||||
db: "postgresql"
|
db: "postgresql"
|
||||||
redis:
|
redis:
|
||||||
subuid: "100998"
|
subuid: "100998"
|
||||||
|
homepage:
|
||||||
|
domain:
|
||||||
|
public: "@"
|
||||||
|
internal: "homepage.app"
|
||||||
|
ports:
|
||||||
|
http: "3000" # app
|
||||||
|
dependency:
|
||||||
|
web: "app-public"
|
||||||
vaultwarden:
|
vaultwarden:
|
||||||
domain:
|
domain:
|
||||||
public: "vault"
|
public: "vault"
|
||||||
@@ -143,30 +151,6 @@ services:
|
|||||||
dependency:
|
dependency:
|
||||||
web: "app-public"
|
web: "app-public"
|
||||||
db: "postgresql"
|
db: "postgresql"
|
||||||
immich:
|
|
||||||
domain:
|
|
||||||
public: "immich"
|
|
||||||
internal: "immich.app"
|
|
||||||
ports:
|
|
||||||
http: "2283"
|
|
||||||
redis: "6379"
|
|
||||||
dependency:
|
|
||||||
web: "app-public"
|
|
||||||
db: "postgresql"
|
|
||||||
immich-ml:
|
|
||||||
ports:
|
|
||||||
http: "3003"
|
|
||||||
paperless:
|
|
||||||
domain:
|
|
||||||
public: "paperless"
|
|
||||||
internal: "paperless.app"
|
|
||||||
ports:
|
|
||||||
http: "8001"
|
|
||||||
redis: "6380"
|
|
||||||
subuid: "100999"
|
|
||||||
dependency:
|
|
||||||
web: "app-public"
|
|
||||||
db: "postgresql"
|
|
||||||
nextcloud:
|
nextcloud:
|
||||||
domain:
|
domain:
|
||||||
public: "nextcloud"
|
public: "nextcloud"
|
||||||
@@ -187,17 +171,19 @@ services:
|
|||||||
subuid: "101000"
|
subuid: "101000"
|
||||||
dependency:
|
dependency:
|
||||||
web: "app-public"
|
web: "app-public"
|
||||||
sure:
|
immich:
|
||||||
domain:
|
domain:
|
||||||
public: "sure"
|
public: "immich"
|
||||||
internal: "sure.app"
|
internal: "immich.app"
|
||||||
ports:
|
ports:
|
||||||
http: "3002"
|
http: "2283"
|
||||||
redis: "6383"
|
redis: "6379"
|
||||||
subuid: "100999"
|
|
||||||
dependency:
|
dependency:
|
||||||
web: "app-public"
|
web: "app-public"
|
||||||
db: "postgresql"
|
db: "postgresql"
|
||||||
|
immich-ml:
|
||||||
|
ports:
|
||||||
|
http: "3003"
|
||||||
outline:
|
outline:
|
||||||
domain:
|
domain:
|
||||||
public: "outline"
|
public: "outline"
|
||||||
@@ -219,6 +205,28 @@ services:
|
|||||||
dependency:
|
dependency:
|
||||||
web: "app-public"
|
web: "app-public"
|
||||||
db: "postgresql"
|
db: "postgresql"
|
||||||
|
sure:
|
||||||
|
domain:
|
||||||
|
public: "sure"
|
||||||
|
internal: "sure.app"
|
||||||
|
ports:
|
||||||
|
http: "3002"
|
||||||
|
redis: "6383"
|
||||||
|
subuid: "100999"
|
||||||
|
dependency:
|
||||||
|
web: "app-public"
|
||||||
|
db: "postgresql"
|
||||||
|
paperless:
|
||||||
|
domain:
|
||||||
|
public: "paperless"
|
||||||
|
internal: "paperless.app"
|
||||||
|
ports:
|
||||||
|
http: "8001"
|
||||||
|
redis: "6380"
|
||||||
|
subuid: "100999"
|
||||||
|
dependency:
|
||||||
|
web: "app-public"
|
||||||
|
db: "postgresql"
|
||||||
mealie:
|
mealie:
|
||||||
domain:
|
domain:
|
||||||
public: "mealie"
|
public: "mealie"
|
||||||
@@ -276,3 +284,4 @@ version:
|
|||||||
memos: "0.29.1"
|
memos: "0.29.1"
|
||||||
mealie: "v3.19.2"
|
mealie: "v3.19.2"
|
||||||
homebox: "0.26.2"
|
homebox: "0.26.2"
|
||||||
|
homepage: "v1.13.2"
|
||||||
|
|||||||
@@ -135,3 +135,14 @@
|
|||||||
changed_when: false
|
changed_when: false
|
||||||
listen: "notification_restart_homebox"
|
listen: "notification_restart_homebox"
|
||||||
ignore_errors: true # noqa: ignore-errors
|
ignore_errors: true # noqa: ignore-errors
|
||||||
|
|
||||||
|
- name: Restart homepage
|
||||||
|
ansible.builtin.systemd:
|
||||||
|
name: "homepage.service"
|
||||||
|
state: "restarted"
|
||||||
|
enabled: true
|
||||||
|
scope: "user"
|
||||||
|
daemon_reload: true
|
||||||
|
changed_when: false
|
||||||
|
listen: "notification_restart_homepage"
|
||||||
|
ignore_errors: true # noqa: ignore-errors
|
||||||
|
|||||||
@@ -0,0 +1,99 @@
|
|||||||
|
---
|
||||||
|
- name: Set homepage services list
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
homepage_public_services: >-
|
||||||
|
{{
|
||||||
|
services
|
||||||
|
| dict2items
|
||||||
|
| selectattr('value.dependency.web', 'defined')
|
||||||
|
| selectattr('value.dependency.web', 'in', ['infra-public', 'auth-public', 'app-public'])
|
||||||
|
| map(attribute='key')
|
||||||
|
| list
|
||||||
|
}}
|
||||||
|
homepage_internal_services: >-
|
||||||
|
{{
|
||||||
|
services
|
||||||
|
| dict2items
|
||||||
|
| selectattr('value.dependency.web', 'defined')
|
||||||
|
| selectattr('value.dependency.web', 'in', ['infra-internal', 'auth-internal', 'app-internal'])
|
||||||
|
| map(attribute='key')
|
||||||
|
| list
|
||||||
|
}}
|
||||||
|
|
||||||
|
- name: Create homepage directory
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ node['home_path'] }}/{{ item }}"
|
||||||
|
state: "directory"
|
||||||
|
owner: "{{ ansible_user }}"
|
||||||
|
group: "{{ node['group'] }}"
|
||||||
|
mode: "0770"
|
||||||
|
loop:
|
||||||
|
- "containers/homepage"
|
||||||
|
- "containers/homepage/config"
|
||||||
|
- "containers/homepage/images"
|
||||||
|
|
||||||
|
- name: Pull image
|
||||||
|
containers.podman.podman_image:
|
||||||
|
name: "docker.io/gethomepage/homepage"
|
||||||
|
tag: "{{ version['containers']['homepage'] }}"
|
||||||
|
state: "present"
|
||||||
|
pull: true
|
||||||
|
|
||||||
|
- name: Deploy config files
|
||||||
|
ansible.builtin.template:
|
||||||
|
src: "{{ hostvars['console']['node']['config_path'] }}/services/containers/app/homepage/config/{{ item }}.j2"
|
||||||
|
dest: "{{ node['home_path'] }}/containers/homepage/config/{{ item }}"
|
||||||
|
owner: "{{ ansible_user }}"
|
||||||
|
group: "{{ node['group'] }}"
|
||||||
|
mode: "0644"
|
||||||
|
loop:
|
||||||
|
- "settings.yaml"
|
||||||
|
- "widgets.yaml"
|
||||||
|
- "services.yaml"
|
||||||
|
- "bookmarks.yaml"
|
||||||
|
notify: "notification_restart_homepage"
|
||||||
|
|
||||||
|
- name: Deploy image directory
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: "{{ hostvars['console']['node']['config_path'] }}/services/containers/app/homepage/images/"
|
||||||
|
dest: "{{ node['home_path'] }}/containers/homepage/images/"
|
||||||
|
owner: "{{ ansible_user }}"
|
||||||
|
group: "{{ node['group'] }}"
|
||||||
|
mode: "0644"
|
||||||
|
|
||||||
|
- name: Deploy container file
|
||||||
|
ansible.builtin.template:
|
||||||
|
src: "{{ hostvars['console']['node']['config_path'] }}/services/containers/app/homepage/homepage.container.j2"
|
||||||
|
dest: "{{ node['home_path'] }}/.config/containers/systemd/homepage.container"
|
||||||
|
owner: "{{ ansible_user }}"
|
||||||
|
group: "{{ node['group'] }}"
|
||||||
|
mode: "0644"
|
||||||
|
notify: "notification_restart_homepage"
|
||||||
|
|
||||||
|
- name: Enable homepage.service
|
||||||
|
ansible.builtin.systemd:
|
||||||
|
name: "homepage.service"
|
||||||
|
state: "started"
|
||||||
|
enabled: true
|
||||||
|
daemon_reload: true
|
||||||
|
scope: "user"
|
||||||
|
|
||||||
|
- name: Check container archive images
|
||||||
|
ansible.builtin.stat:
|
||||||
|
path: "{{ node['home_path'] }}/archives/containers/docker.io_gethomepage_homepage_{{ version['containers']['homepage'] }}.tar"
|
||||||
|
register: container_archive_images
|
||||||
|
|
||||||
|
- name: Save container archive images
|
||||||
|
containers.podman.podman_save:
|
||||||
|
image:
|
||||||
|
- "docker.io/gethomepage/homepage:{{ version['containers']['homepage'] }}"
|
||||||
|
dest: "{{ node['home_path'] }}/archives/containers/docker.io_gethomepage_homepage_{{ version['containers']['homepage'] }}.tar"
|
||||||
|
format: "oci-archive"
|
||||||
|
force: false
|
||||||
|
when: not container_archive_images.stat.exists
|
||||||
|
|
||||||
|
- name: Fetch container archive images
|
||||||
|
ansible.builtin.fetch:
|
||||||
|
src: "{{ node['home_path'] }}/archives/containers/docker.io_gethomepage_homepage_{{ version['containers']['homepage'] }}.tar"
|
||||||
|
dest: "{{ hostvars['console']['node']['data_path'] }}/images/containers/"
|
||||||
|
flat: true
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
- Developer:
|
||||||
|
- Code-Server:
|
||||||
|
- abbr: CS
|
||||||
|
href: http://localhost:2080/
|
||||||
|
|
||||||
|
- School:
|
||||||
|
- Portal:
|
||||||
|
- abbr: SJU
|
||||||
|
href: https://portal.sejong.ac.kr/
|
||||||
|
- e-campus:
|
||||||
|
- abbr: SJU
|
||||||
|
href: https://ecampus.sejong.ac.kr/
|
||||||
|
- OJ:
|
||||||
|
- abbr: SJU
|
||||||
|
href: https://oj.sejong.ac.kr/
|
||||||
|
|
||||||
|
- Entertainment:
|
||||||
|
- YouTube:
|
||||||
|
- abbr: YT
|
||||||
|
href: https://youtube.com/
|
||||||
|
- NetFlix:
|
||||||
|
- abbr: NF
|
||||||
|
href: https://www.netflix.com/
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
- Services:
|
||||||
|
{% for item in (homepage_public_services | reject('in', ['homepage', 'collabora'])) %}
|
||||||
|
- {{ item }}:
|
||||||
|
icon: {{ item }}.svg
|
||||||
|
href: https://{{ services[item]['domain']['public'] }}.{{ domain['public'] }}
|
||||||
|
{% endfor %}
|
||||||
|
- Admin:
|
||||||
|
{% for item in homepage_internal_services %}
|
||||||
|
- {{ item }}:
|
||||||
|
icon: {{ 'lldap' if item == 'ldap' else item }}.svg
|
||||||
|
href: https://{{ services[item]['domain']['internal'] }}.{{ domain['internal'] }}
|
||||||
|
{% endfor %}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
title: {{ domain['org'] }} homepage
|
||||||
|
|
||||||
|
target: _blank
|
||||||
|
hideVersion: true
|
||||||
|
disableUpdateCheck: true
|
||||||
|
disableIndexing: true
|
||||||
|
|
||||||
|
layout:
|
||||||
|
Services:
|
||||||
|
|
||||||
|
Admin:
|
||||||
|
initiallyCollapsed: true
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
#- resources:
|
||||||
|
# cpu: true
|
||||||
|
# memory: true
|
||||||
|
# disk: /
|
||||||
|
|
||||||
|
- greeting:
|
||||||
|
text_size: xl
|
||||||
|
text: ilnmors
|
||||||
|
|
||||||
|
- search:
|
||||||
|
provider: google
|
||||||
|
target: _blank
|
||||||
|
|
||||||
|
- datetime:
|
||||||
|
text_size: xl
|
||||||
|
format:
|
||||||
|
dateStyle: short
|
||||||
|
timeStyle: short
|
||||||
|
|
||||||
|
- openmeteo:
|
||||||
|
label: Seoul
|
||||||
|
latitude: 37.5665
|
||||||
|
longitude: 126.9780
|
||||||
|
timezone: Asia/Seoul
|
||||||
|
units: metric
|
||||||
|
cache: 5
|
||||||
|
format:
|
||||||
|
maximumFractionDigits: 1
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
[Quadlet]
|
||||||
|
DefaultDependencies=false
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
Description=Homepage
|
||||||
|
|
||||||
|
[Container]
|
||||||
|
Image=docker.io/gethomepage/homepage:{{ version['containers']['homepage'] }}
|
||||||
|
|
||||||
|
ContainerName=homepage
|
||||||
|
HostName=homepage
|
||||||
|
|
||||||
|
PublishPort={{ services['homepage']['ports']['http'] }}:3000
|
||||||
|
|
||||||
|
# Volumes
|
||||||
|
Volume=%h/containers/homepage/config:/app/config:rw
|
||||||
|
Volume=%h/containers/homepage/images:/app/public/images:ro
|
||||||
|
|
||||||
|
# Environment
|
||||||
|
Environment="TZ={{ timezone }}"
|
||||||
|
# The public root domain will be the domain of homepage
|
||||||
|
Environment="HOMEPAGE_ALLOWED_HOSTS={{ domain['public'] }},www.{{ domain['public']}}"
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Restart=always
|
||||||
|
RestartSec=10s
|
||||||
|
TimeoutStopSec=120
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=default.target
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
{% set web_type = service['dependency']['web'] %}
|
{% set web_type = service['dependency']['web'] %}
|
||||||
{% if node['name'] == 'auth' %}
|
{% if node['name'] == 'auth' %}
|
||||||
{% if service['domain']['public'] == '@' %}
|
{% if service['domain']['public'] == '@' %}
|
||||||
{{ domain['public'] }} {
|
{{ domain['public'] }}, www.{{ domain['public'] }} {
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ service['domain']['public'] }}.{{ domain['public'] }} {
|
{{ service['domain']['public'] }}.{{ domain['public'] }} {
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
Reference in New Issue
Block a user