EOL htz-cloud.pleroma
This commit is contained in:
parent
d88645c7bd
commit
497ecb5279
7 changed files with 0 additions and 295 deletions
|
@ -1,35 +0,0 @@
|
|||
import Config
|
||||
|
||||
config :pleroma,
|
||||
configurable_from_database: true
|
||||
|
||||
config :pleroma, Pleroma.Web.Endpoint,
|
||||
url: [host: "${node.metadata['pleroma']['url']}", scheme: "https", port: 443],
|
||||
http: [port: 21000, ip: {127, 0, 0, 1}],
|
||||
secret_key_base: "${node.metadata['pleroma']['secret_key']}",
|
||||
secure_cookie_flag: true
|
||||
|
||||
config :pleroma, :instance,
|
||||
static_dir: "/var/pleroma/static/"
|
||||
|
||||
config :pleroma, Pleroma.Upload,
|
||||
uploader: Pleroma.Uploaders.Local,
|
||||
filters: [Pleroma.Upload.Filter.Dedupe]
|
||||
|
||||
config :pleroma, Pleroma.Uploaders.Local,
|
||||
uploads: "/var/pleroma/uploads/"
|
||||
|
||||
config :pleroma, :media_proxy,
|
||||
enabled: false,
|
||||
redirect_on_failure: true
|
||||
#base_url: "https://cache.pleroma.social"
|
||||
|
||||
# Configure your database
|
||||
config :pleroma, Pleroma.Repo,
|
||||
adapter: Ecto.Adapters.Postgres,
|
||||
username: "pleroma",
|
||||
password: "${node.metadata['postgresql']['roles']['pleroma']['password']}",
|
||||
database: "pleroma",
|
||||
hostname: "localhost",
|
||||
pool_size: 10,
|
||||
timeout: 60000
|
|
@ -1,22 +0,0 @@
|
|||
[Unit]
|
||||
Description=Pleroma social network
|
||||
After=network.target
|
||||
Requires=postgresql.service
|
||||
|
||||
[Service]
|
||||
User=pleroma
|
||||
WorkingDirectory=/opt/pleroma
|
||||
Environment="HOME=/opt/pleroma"
|
||||
Environment="PLEROMA_CONFIG_PATH=/opt/pleroma/pleroma.config.exs"
|
||||
Environment="PLUG_TMPDIR=/tmp/pleroma"
|
||||
ExecStart=/opt/pleroma/release/bin/pleroma start
|
||||
ExecStop=/opt/pleroma/release/bin/pleroma stop
|
||||
Restart=always
|
||||
|
||||
PrivateTmp=true
|
||||
ProtectHome=true
|
||||
ProtectSystem=full
|
||||
CapabilityBoundingSet=~CAP_SYS_ADMIN
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -1,88 +0,0 @@
|
|||
version = node.metadata['pleroma']['version']
|
||||
|
||||
users = {
|
||||
'pleroma': {
|
||||
'home': '/opt/pleroma',
|
||||
},
|
||||
}
|
||||
|
||||
directories = {
|
||||
'/opt/pleroma': {},
|
||||
'/var/pleroma': {
|
||||
'owner': 'pleroma',
|
||||
},
|
||||
'/var/pleroma/uploads': {
|
||||
'owner': 'pleroma',
|
||||
},
|
||||
'/var/pleroma/static': {
|
||||
'owner': 'pleroma',
|
||||
},
|
||||
'/var/pleroma/static/emoji': {
|
||||
'owner': 'pleroma',
|
||||
},
|
||||
}
|
||||
|
||||
if node.has_bundle('zfs'):
|
||||
directories['/var/pleroma']['needs'] = {
|
||||
'zfs_dataset:tank/pleroma-data',
|
||||
}
|
||||
|
||||
actions = {
|
||||
'pleroma_download_release': {
|
||||
'command': \
|
||||
'cd /opt/pleroma/ && '\
|
||||
f'wget -O/opt/pleroma/pleroma.zip https://git.pleroma.social/api/v4/projects/2/jobs/artifacts/release/{version}/download?job=amd64 && '\
|
||||
'rm -rf release && '\
|
||||
'unzip /opt/pleroma/pleroma.zip && '\
|
||||
'chown -R pleroma:pleroma /opt/pleroma/release && '\
|
||||
f'echo -n "{version}" > /opt/pleroma/.bundlewrap_installed_version',
|
||||
'unless': f'[ "$(cat /opt/pleroma/.bundlewrap_installed_version)" = "{version}" ]',
|
||||
'needs': {
|
||||
'directory:/opt/pleroma',
|
||||
},
|
||||
'preceded_by': {
|
||||
'svc_systemd:pleroma:stop',
|
||||
},
|
||||
'triggers': {
|
||||
'action:pleroma_migrate_database',
|
||||
'svc_systemd:pleroma:restart',
|
||||
},
|
||||
},
|
||||
'pleroma_migrate_database': {
|
||||
'triggered': True,
|
||||
'command': \
|
||||
'echo "CREATE EXTENSION IF NOT EXISTS citext;" | psql pleroma && '\
|
||||
'echo "CREATE EXTENSION IF NOT EXISTS pg_trgm;" | psql pleroma && '\
|
||||
'echo "CREATE EXTENSION IF NOT EXISTS \\\"uuid-ossp\\\";" | psql pleroma && '\
|
||||
'sudo -u pleroma PLEROMA_CONFIG_PATH=/opt/pleroma/pleroma.config.exs /opt/pleroma/release/bin/pleroma_ctl create',
|
||||
'needs': {
|
||||
'postgres_db:pleroma',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
files = {
|
||||
'/etc/systemd/system/pleroma.service': {
|
||||
'triggers': {
|
||||
'action:systemd-reload',
|
||||
'svc_systemd:pleroma:restart',
|
||||
},
|
||||
},
|
||||
'/opt/pleroma/pleroma.config.exs': {
|
||||
'content_type': 'mako',
|
||||
'triggers': {
|
||||
'svc_systemd:pleroma:restart',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
svc_systemd = {
|
||||
'pleroma': {
|
||||
'needs': {
|
||||
'action:pleroma_download_release',
|
||||
'action:pleroma_migrate_database',
|
||||
'file:/etc/systemd/system/pleroma.service',
|
||||
'file:/opt/pleroma/pleroma.config.exs',
|
||||
},
|
||||
},
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
defaults = {
|
||||
'apt': {
|
||||
'packages': {
|
||||
'imagemagick': {},
|
||||
'ffmpeg': {},
|
||||
'libimage-exiftool-perl': {},
|
||||
},
|
||||
},
|
||||
'backups': {
|
||||
'paths': {
|
||||
'/var/pleroma',
|
||||
},
|
||||
},
|
||||
'zfs': {
|
||||
'datasets': {
|
||||
'tank/pleroma-data': {
|
||||
'mountpoint': '/var/pleroma',
|
||||
'needed_by': {
|
||||
'directory:/var/pleroma',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
'postgresql': {
|
||||
'roles': {
|
||||
'pleroma': {
|
||||
'password': repo.vault.password_for(f'{node.name} postgresql pleroma'),
|
||||
},
|
||||
},
|
||||
'databases': {
|
||||
'pleroma': {
|
||||
'owner': 'pleroma',
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@metadata_reactor.provides(
|
||||
'nginx/vhosts/pleroma',
|
||||
)
|
||||
def nginx(metadata):
|
||||
if not node.has_bundle('nginx'):
|
||||
raise DoNotRunAgain
|
||||
|
||||
return {
|
||||
'nginx': {
|
||||
'vhosts': {
|
||||
'pleroma': {
|
||||
'domain': metadata.get('pleroma/url'),
|
||||
'locations': {
|
||||
'/': {
|
||||
'target': 'http://127.0.0.1:21000',
|
||||
'websockets': True,
|
||||
},
|
||||
},
|
||||
'website_check_path': '/main/all',
|
||||
'website_check_string': 'use Pleroma',
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue