Skip to content

Commit

Permalink
add gitea and gotify configs
Browse files Browse the repository at this point in the history
  • Loading branch information
vit01 committed Jul 23, 2022
1 parent 7a0c330 commit 9ac9115
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
16 changes: 16 additions & 0 deletions software/manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,22 @@
require => Package['nginx'],
notify => Service['Nginx']
}

file { '/etc/nginx/sites-enabled/gitea.conf':
ensure => present,
content => epp('software/gitea.conf', { 'key' => $key_file, 'cert' => $cert_file }),
mode => "0644",
require => Package['nginx'],
notify => Service['Nginx']
}

file { '/etc/nginx/sites-enabled/gotify.conf':
ensure => present,
content => epp('software/gotify.conf', { 'key' => $key_file, 'cert' => $cert_file }),
mode => "0644",
require => Package['nginx'],
notify => Service['Nginx']
}

file { '/etc/nginx/sites-enabled/exporter.conf':
ensure => present,
Expand Down
21 changes: 21 additions & 0 deletions software/templates/gitea.conf.epp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<%- | String $key, String $cert | -%>
upstream gitea {
server 127.0.0.1:3003;
}

server {
listen <%= $facts['networking']['ip'] %>:3000 ssl;
server_name _;

ssl_certificate <%= $cert %>; # managed by Certbot
ssl_certificate_key <%= $key %>; # managed by Certbot

location / {
proxy_pass http://gitea;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_set_header Origin "";
}
}
23 changes: 23 additions & 0 deletions software/templates/gotify.conf.epp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<%- | String $key, String $cert | -%>
upstream gotify {
server 127.0.0.1:3001;
}

server {
listen <%= $facts['networking']['ip'] %>:3001 ssl;
server_name _;

ssl_certificate <%= $cert %>; # managed by Certbot
ssl_certificate_key <%= $key %>; # managed by Certbot

location / {
proxy_pass http://gotify;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;

proxy_set_header Origin "";
}
}

0 comments on commit 9ac9115

Please sign in to comment.