summaryrefslogtreecommitdiff
path: root/modules/shiori/manifests/init.pp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/shiori/manifests/init.pp')
-rw-r--r--modules/shiori/manifests/init.pp51
1 files changed, 9 insertions, 42 deletions
diff --git a/modules/shiori/manifests/init.pp b/modules/shiori/manifests/init.pp
index ebeb0d0..69d5fde 100644
--- a/modules/shiori/manifests/init.pp
+++ b/modules/shiori/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
}