jailman move

This commit is contained in:
Kjeld Schouten-Lebbing
2023-03-16 09:54:20 +01:00
parent 1d32ed34c1
commit 92fa99d689
124 changed files with 0 additions and 0 deletions
jailman
.github
.gitignore.shellcheckrcCNAMELICENSELICENSE.BSD2LICENSE.GPLV2
blueprints
config.yml.example
docs
global.shjailman.shmkdocs.yml

@@ -0,0 +1,3 @@
blueprint:
organizr:
pkgs: nginx php74 php74-filter php74-curl php74-hash php74-json php74-openssl php74-pdo php74-pdo_sqlite php74-session php74-simplexml php74-sqlite3 php74-zip git

@@ -0,0 +1,145 @@
send_timeout 5m;
proxy_read_timeout 240;
proxy_send_timeout 240;
proxy_connect_timeout 240;
client_header_timeout 240;
client_body_timeout 240;
location / {
root /usr/local/www/Organizr;
index index.php index.html index.htm index.nginx-debian.html;
location ~ /auth-(.*) {
internal;
rewrite ^/auth-(.*) /api/?v1/auth&group=$1;
}
error_page 400 401 402 403 404 405 408 500 502 503 504 $scheme://$server_name/?error=$status;
location / {try_files $uri $uri/ =404;}
include custom/phpblock.conf; #PHP Block
}
location /transmission/ {
auth_request /auth-0;
add_header X-Frame-Options "SAMEORIGIN";
proxy_pass http://192.168.31.22:9091;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /sonarr/ {
auth_request /auth-0;
add_header X-Frame-Options "SAMEORIGIN";
proxy_pass http://192.168.31.23:8989;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /radarr/ {
auth_request /auth-0;
add_header X-Frame-Options "SAMEORIGIN";
proxy_pass http://192.168.31.24:7878;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /lidarr/ {
auth_request /auth-0;
add_header X-Frame-Options "SAMEORIGIN";
proxy_pass http://192.168.31.25:8686;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /jackett/ {
auth_request /auth-0;
add_header X-Frame-Options "SAMEORIGIN";
proxy_pass http://192.168.31.21:9117;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $http_host;
}
location /plex/ {
auth_request /auth-4;
add_header X-Frame-Options "SAMEORIGIN";
proxy_pass https://192.168.30.27:32400/;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_bind $server_addr;
proxy_buffers 32 4k;
#Timeout if the real server is dead
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;
# Advanced Proxy Config
send_timeout 5m;
proxy_read_timeout 240;
proxy_send_timeout 240;
proxy_connect_timeout 240;
proxy_hide_header X-Frame-Options;
# Basic Proxy Config
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_redirect http:// $scheme://;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_no_cache $cookie_session;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
if ($http_referer ~* /plex/) {
rewrite ^/web/(.*) /plex/web/$1? redirect;
}
location /tautulli/ {
auth_request /auth-4;
add_header X-Frame-Options "SAMEORIGIN";
proxy_pass http://192.168.31.26:8181;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_read_timeout 90;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Ssl on;
#proxy_redirect ~^(http(?:s)?://)([^:/]+)(?::\d+)?(/.*)?$ $1$2:$server_port$3;
proxy_redirect off;
}
location /ombi/ {
auth_request /auth-4;
add_header X-Frame-Options "SAMEORIGIN";
proxy_pass https://192.168.31.27:3579/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
location /grafana {
auth_request /auth-0;
add_header X-Frame-Options "SAMEORIGIN";
proxy_pass https://192.168.30.34/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /bitwarden {
auth_request /auth-0;
add_header X-Frame-Options "SAMEORIGIN";
proxy_pass https://bitwarden.schouten-lebbing.nl/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

@@ -0,0 +1,9 @@
fastcgi_read_timeout 240;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include fastcgi_params;
}

@@ -0,0 +1,25 @@
user www;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
include custom/organizr.conf;
}
server {
listen 443 ssl;
server_name localhost;
include custom/organizr.conf;
ssl_certificate /config/ssl/Organizr-Cert.crt; # Replace with actually valid certificate
ssl_certificate_key /config/ssl/Organizr-Cert.key; # Replace with actually valid certificate
}
}

@@ -0,0 +1,34 @@
#!/usr/local/bin/bash
# This file contains the install script for Organizr
iocage exec "$1" sed -i '' -e 's?listen = 127.0.0.1:9000?listen = /var/run/php-fpm.sock?g' /usr/local/etc/php-fpm.d/www.conf
iocage exec "$1" sed -i '' -e 's/;listen.owner = www/listen.owner = www/g' /usr/local/etc/php-fpm.d/www.conf
iocage exec "$1" sed -i '' -e 's/;listen.group = www/listen.group = www/g' /usr/local/etc/php-fpm.d/www.conf
iocage exec "$1" sed -i '' -e 's/;listen.mode = 0660/listen.mode = 0600/g' /usr/local/etc/php-fpm.d/www.conf
iocage exec "$1" cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini
iocage exec "$1" sed -i '' -e 's?;date.timezone =?date.timezone = "Universal"?g' /usr/local/etc/php.ini
iocage exec "$1" sed -i '' -e 's?;cgi.fix_pathinfo=1?cgi.fix_pathinfo=0?g' /usr/local/etc/php.ini
# shellcheck disable=SC2154
mv /mnt/"${global_dataset_iocage}"/jails/"$1"/root/usr/local/etc/nginx/nginx.conf /mnt/"${global_dataset_iocage}"/jails/"$1"/root/usr/local/etc/nginx/nginx.conf.bak
cp "${SCRIPT_DIR}"/blueprints/organizr/includes/nginx.conf /mnt/"${global_dataset_iocage}"/jails/"$1"/root/usr/local/etc/nginx/nginx.conf
cp -Rf "${SCRIPT_DIR}"/blueprints/organizr/includes/custom /mnt/"${global_dataset_iocage}"/jails/"$1"/root/usr/local/etc/nginx/custom
# shellcheck disable=SC2154
if [ ! -d "/mnt/${global_dataset_config}/$1/ssl" ]; then
echo "cert folder doesn't exist... creating..."
iocage exec "$1" mkdir /config/ssl
fi
if [ -f "/mnt/${global_dataset_config}/$1/ssl/Organizr-Cert.crt" ]; then
echo "certificate exists... Skipping cert generation"
else
echo "No ssl certificate present, generating self signed certificate"
openssl req -new -newkey rsa:2048 -days 365 -nodes -x509 -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=localhost" -keyout /mnt/"${global_dataset_config}"/"$1"/ssl/Organizr-Cert.key -out /mnt/"${global_dataset_config}"/"$1"/ssl/Organizr-Cert.crt
fi
iocage exec "$1" git clone https://github.com/causefx/Organizr.git /usr/local/www/Organizr
iocage exec "$1" chown -R www:www /usr/local/www /config /usr/local/etc/nginx/nginx.conf /usr/local/etc/nginx/custom
iocage exec "$1" ln -s /config/config.php /usr/local/www/Organizr/api/config/config.php
iocage exec "$1" sysrc nginx_enable=YES
iocage exec "$1" sysrc php_fpm_enable=YES
iocage exec "$1" service nginx start
iocage exec "$1" service php-fpm start

@@ -0,0 +1,101 @@
# Organizr
## Original README from the Organizr github repo:
https://github.com/causefx/Organizr
<p align="center"><img src="https://github.com/causefx/Organizr/raw/v2-develop/plugins/images/organizr/logo-wide.png"></p>
[![Percentage of issues still open](http://isitmaintained.com/badge/open/causefx/Organizr.svg)](http://isitmaintained.com/project/causefx/Organizr "Percentage of issues still open")
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/causefx/Organizr.svg)](http://isitmaintained.com/project/causefx/Organizr "Average time to resolve an issue")
[![GitHub stars](https://img.shields.io/github/stars/causefx/Organizr.svg)](https://github.com/causefx/Organizr/stargazers)
[![GitHub forks](https://img.shields.io/github/forks/causefx/Organizr.svg)](https://github.com/causefx/Organizr/network)
[![Docker pulls](https://img.shields.io/docker/pulls/organizrtools/organizr-v2.svg)](https://hub.docker.com/r/organizrtools/organizr-v2)
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://paypal.me/causefx)
[![Beerpay](https://beerpay.io/causefx/Organizr/badge.svg?style=beer-square)](https://beerpay.io/causefx/Organizr) [![Beerpay](https://beerpay.io/causefx/Organizr/make-wish.svg?style=flat-square)](https://beerpay.io/causefx/Organizr?focus=wish)
<img src="https://user-images.githubusercontent.com/16184466/53614282-a91e9e00-3b96-11e9-9b3e-d249775ecaa1.png">
Do you have quite a bit of services running on your computer or server? Do you have a lot of bookmarks or have to memorize a bunch of ip's and ports? Well, Organizr is here to help with that. Organizr allows you to setup "Tabs" that will be loaded all in one webpage. You can then work on your server with ease. Want to give users access to some Tabs? No problem, just enable user support and have them make an account. Want guests to be able to visit too? Enable Guest support for those tabs.
<img src="https://user-images.githubusercontent.com/16184466/53614285-a9b73480-3b96-11e9-835e-9fadd045582b.png">
- PHP 7.1.3+
- [Official Site](https://organizr.app) - Will be refreshed soon!
- [Official Discord](https://organizr.app/discord)
- [See Wiki](https://github.com/causefx/Organizr/wiki) - Will be updated soon!
- [Docker](https://hub.docker.com/r/organizrtools/organizr-v2/)
<img src="https://user-images.githubusercontent.com/16184466/53614284-a9b73480-3b96-11e9-9bea-d7a30b294267.png">
<img src="https://user-images.githubusercontent.com/16184466/53615855-35cc5a80-3b9d-11e9-882b-f09f3eb18173.png" width="23%"></img> <img src="https://user-images.githubusercontent.com/16184466/53615856-35cc5a80-3b9d-11e9-8428-1f2ae05da2c9.png" width="23%"></img> <img src="https://user-images.githubusercontent.com/16184466/53615857-35cc5a80-3b9d-11e9-82bf-91987c529e72.png" width="23%"></img> <img src="https://user-images.githubusercontent.com/16184466/53615858-35cc5a80-3b9d-11e9-8149-01a7fcd9160a.png" width="23%"></img>
[![Organizr Overview](https://img.youtube.com/vi/LZL4smFB6wU/0.jpg)](https://www.youtube.com/watch?v=LZL4smFB6wU)
<img src="https://user-images.githubusercontent.com/16184466/53614283-a9b73480-3b96-11e9-90ef-6e752e067884.png">
- Login with Plex/Emby/LDAP or sFTP credentials
- Custom tabs for your services
- Fullscreen Support
- Pin/Unpin sidebar
- Mobile support
- Set default page on launch
- Upload new icons with ease
- Enable or disable iFrame for your tabs
- User management support: Create, delete and promote users from the user management console
- Unlimited User Groups
- Theme-able
- Personalise any theme: Customise the look and feel of Organizr with access to the colour palette
- Organizr login log viewer
- Fail2ban support (see wiki)
- Nginx Auth_Request support
- Protect new user account creation with registration password
- 'Forgot Password' support [receive an email with your new password, prerequisites: mail server setup]
- Multiple login support
- Keyboard shortcut support (Check help tab in settings)
- Gravatar Support
- Customise the top bar by adding your own site logo or site name
- Additional language support
- Quick access tabs [access your tabs quickly e.g. www.example.com/#Sonarr]
- Many more...
<img src="https://user-images.githubusercontent.com/16184466/53614286-a9b73480-3b96-11e9-8495-4944b85b1313.png">
[![Feature Requests](http://feathub.com/causefx/Organizr?format=svg)](http://feathub.com/causefx/Organizr)
<img src="https://user-images.githubusercontent.com/16184466/53667702-fcdcc600-3c2e-11e9-8828-860e531e8096.png">
##### Usage
```
docker create \
--name=organizr \
-v <path to data>:/config \
-e PGID=<gid> -e PUID=<uid> \
-p 80:80 \
organizrtools/organizr-v2
```
##### Parameters
The parameters are split into two halves, separated by a colon, the left hand side representing the host and the right the container side. For example with a port -p external:internal - what this shows is the port mapping from internal to external of the container. So `-p 8080:80` would expose port 80 from inside the container to be accessible from the host's IP on port 8080 and `http://192.168.x.x:8080` would show you what's running INSIDE the container on port 80.
* `-p 80` - The port(s)
* `-v /config` - Mapping the config files for Organizr
* `-e PGID` Used for GroupID - see below for explanation
* `-e PUID` Used for UserID - see below for explanation
##### Info
* Shell access whilst the container is running: `docker exec -it organizr /bin/bash`
* To monitor the logs of the container in realtime: `docker logs -f organizr`
* Container version number: `docker inspect -f '{{ index .Config.Labels "build_version" }}' organizr`
* Image version number: `docker inspect -f '{{ index .Config.Labels "build_version" }}' organizrtools/docker-organizr-v2`
<img src="https://user-images.githubusercontent.com/16184466/53614287-a9b73480-3b96-11e9-9c8e-e32b4ae20c0d.png">
<p align="center"><a href="https://www.browserstack.com"><img src="https://avatars2.githubusercontent.com/u/1119453?s=200&v=4g"></a></p>
<p align="center"><a href="https://www.browserstack.com">BrowserStack</a> for allowing us to use their platform for testing</p>
<p>This project is supported by:</p>
<p>
<a href="https://www.digitalocean.com/">
<img src="https://opensource.nyc3.cdn.digitaloceanspaces.com/attribution/assets/SVG/DO_Logo_horizontal_blue.svg" width="201px">
</a>
</p>

@@ -0,0 +1,12 @@
#!/usr/local/bin/bash
# This file contains the update script for Organizr
iocage exec "$1" service nginx stop
iocage exec "$1" service php-fpm stop
# TODO setup cli update for Organizr here.
# shellcheck disable=SC2154
cp "${SCRIPT_DIR}"/blueprints/organizr/includes/nginx.conf /mnt/"${global_dataset_iocage}"/jails/"$1"/root/usr/local/etc/nginx/nginx.conf
iocage exec "$1" "cd /usr/local/www/Organizr && git pull"
iocage exec "$1" chown -R www:www /usr/local/www /config /usr/local/etc/nginx/nginx.conf /usr/local/etc/nginx/custom
iocage exec "$1" service nginx start
iocage exec "$1" service php-fpm start