summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-01-12 01:56:51 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2022-01-12 01:58:58 +0100
commit4585dfaccf5dfb4e57218c67a9689c3632f1816e (patch)
tree47f23ce77be25057f412772715742fa2dc08de04
parentShiori require nginx if applicable. (diff)
downloadshiori-4585dfaccf5dfb4e57218c67a9689c3632f1816e.tar.gz
shiori-4585dfaccf5dfb4e57218c67a9689c3632f1816e.tar.xz
Fix up shiori.
-rw-r--r--manifests/init.pp51
1 files changed, 9 insertions, 42 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index ebeb0d0..69d5fde 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -1,9 +1,9 @@
class shiori (
$port = 8080,
- Array[String] $group_members = [],
- Optional[Hash] $nginx = undef,
+ $dir = '/var/www/shiori',
) {
+
# on arch this is available through the aur
package { 'shiori-bin':
ensure => installed,
@@ -12,15 +12,10 @@ class shiori (
user { 'shiori':
ensure => present,
system => true,
- home => '/var/www/shiori',
- }
-
- group { 'shiori':
- ensure => present,
- members => $group_members,
+ home => $dir,
}
- file { '/var/www/shiori':
+ file { $dir:
ensure => directory,
owner => shiori,
group => shiori,
@@ -28,8 +23,8 @@ class shiori (
}
file { [
- '/var/www/shiori/archive',
- '/var/www/shiori/thumb',
+ "${dir}/archive",
+ "${dir}/thumb",
] :
ensure => directory,
owner => shiori,
@@ -37,7 +32,7 @@ class shiori (
mode => '0770',
}
- file { '/var/www/shiori/shiori.db':
+ file { "${dir}/shiori.db":
owner => 'shiori',
group => 'shiori',
mode => '0660',
@@ -52,8 +47,8 @@ class shiori (
ensure => 'file',
content => @("EOF")
# This file is managed by Puppet.
- # Editing it might also lead to inconsistencies with nginx
PORT=${port}
+ SHIORI_DIR=${dir}
| EOF
}
@@ -66,33 +61,5 @@ class shiori (
],
}
- # TODO only run this if Class['profiles::group_profile'] is loaded
- file { '/etc/profile.d/group.d/shiori':
- ensure => file,
- content => "export SHIORI_DIR=/var/www/shiori\n",
- }
-
- if ($nginx) {
- include ::nginx
- $certname = $nginx['certname']
- nginx::resource::server { $nginx['server_name']:
- ipv6_enable => true,
- ipv6_listen_options => '',
- ssl => true,
- ssl_redirect => true,
- ssl_cert => "/etc/letsencrypt/live/${certname}/fullchain.pem",
- ssl_key => "/etc/letsencrypt/live/${certname}/privkey.pem",
- www_root => '/var/www/shiori',
- use_default_location => false,
- }
-
- nginx::resource::location { 'shiori /':
- location => '/',
- proxy => "http://[::]:$port",
- index_files => [],
- ssl => true,
- ssl_only => true,
- server => $nginx['server_name'],
- }
- }
+ # Users could be managed here, through shioris HTTP API
}