Page MenuHomeDevCentral

D2016.id5084.diff
No OneTemporary

D2016.id5084.diff

diff --git a/PORTS b/PORTS
--- a/PORTS
+++ b/PORTS
@@ -25,6 +25,7 @@
24180 Tommy HTTP - CD
25080 Auth Grove HTTP
26080 Sentry HTTP
+ 30080 Pixelfed HTTP
31080 Phabricator HTTP - DevCentral
33080 Bugzilla HTTP - Espace Win
34080 Etherpad
diff --git a/pillar/credentials/zr.sls b/pillar/credentials/zr.sls
--- a/pillar/credentials/zr.sls
+++ b/pillar/credentials/zr.sls
@@ -34,6 +34,10 @@
mailgun: 82
sentry: 141
+ # photos.nasqueron.org
+ pixelfed:
+ mysql: 142
+
# sentry.nasqueron.org
sentry:
postgresql: 139
diff --git a/pillar/paas/docker.sls b/pillar/paas/docker.sls
--- a/pillar/paas/docker.sls
+++ b/pillar/paas/docker.sls
@@ -361,6 +361,18 @@
app_port: 9090
host: xmpp.nasqueron.org
+ # Pixelfed
+ pixelfed:
+ pixelfed:
+ app_port: 30080
+ host: photos.nasqueron.org
+ aliases:
+ - photo.nasqueron.org
+ links:
+ mysql: acquisitariat
+ redis: pixelfed_redis
+ credential: nasqueron.pixelfed.mysql
+
# Sentry
# The Sentry instance uses a Redis and a PostgreSQL instance,
# declared above.
diff --git a/roles/paas-docker/containers/pixelfed.sls b/roles/paas-docker/containers/pixelfed.sls
new file mode 100644
--- /dev/null
+++ b/roles/paas-docker/containers/pixelfed.sls
@@ -0,0 +1,66 @@
+# -------------------------------------------------------------
+# Salt — Provision Docker engine
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# Created: 2018-11-12
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+{% set has_selinux = salt['grains.get']('selinux:enabled', False) %}
+{% set containers = pillar['docker_containers'][grains['id']] %}
+
+{% for instance, container in containers['pixelfed'].items() %}
+
+# -------------------------------------------------------------
+# Data directory
+#
+# The uid/gid pair depends of the image base:
+#
+# - library/php + fpm: 82:85
+# - library/php + Apache: 33:33
+# - nasqueron/nginx-php7-fpm: 431:433
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+/srv/{{ instance }}/storage:
+ file.directory:
+ - makedirs: True
+
+{% if has_selinux %}
+selinux_context_{{ instance }}_data:
+ selinux.fcontext_policy_present:
+ - name: /srv/{{ instance }}/storage
+ - sel_type: container_file_t
+
+selinux_context_{{ instance }}_data_applied:
+ selinux.fcontext_policy_applied:
+ - name: /srv/{{ instance }}/storage
+{% endif %}
+
+# -------------------------------------------------------------
+# Container
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{{ instance }}:
+ docker_container.running:
+ - detach: True
+ - interactive: True
+ - image: pixelfed
+ - links:
+ - {{ container['links']['redis'] }}:redis
+ - {{ container['links']['mysql'] }}:mysql
+ - environment:
+ - DB_DRIVER: mysql
+ - DB_HOST: mysql
+ - DB_PORT: 3306
+ - DB_DATABASE: {{ instance }}
+ - DB_USERNAME: {{ salt['zr.get_username'](container['credential']) }}
+ - DB_PASSWORD: {{ salt['zr.get_password'](container['credential']) }}
+
+ - CANONICAL_URL: https://{{ container['host'] }}
+ - binds: /srv/{{ instance }}/storage:/var/www/storage
+ - ports:
+ - 80
+ - port_bindings:
+ - {{ container['app_port'] }}:80
+
+{% endfor %}
diff --git a/roles/paas-docker/nginx/files/vhosts/pixelfed.conf b/roles/paas-docker/nginx/files/vhosts/pixelfed.conf
new file mode 100644
--- /dev/null
+++ b/roles/paas-docker/nginx/files/vhosts/pixelfed.conf
@@ -0,0 +1 @@
+{% include 'roles/paas-docker/nginx/files/vhosts/_default.conf' %}

File Metadata

Mime Type
text/plain
Expires
Tue, Mar 4, 23:09 (6 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2460179
Default Alt Text
D2016.id5084.diff (3 KB)

Event Timeline