initial cleanup server-manager

This commit is contained in:
2020-12-24 14:27:31 +01:00
commit ccd20af081
81 changed files with 2601 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
# role mybb
## install plugins
Extract the plugins to /mnt.
Execute:
```bash
docker run --rm -v mybb-data:/target/ -v /mnt/:/origin/ "kevinveenbirkenbach/alpine-rsync" sh -c "rsync -avv /origin/inc/plugins/ /target/"
```

View File

@@ -0,0 +1,5 @@
---
conf_d_path: "/etc/nginx/conf.d/"
#default_conf_path: "/etc/nginx/nginx.conf"
conf_d_docker_path: "/etc/docker/applications/mybb{{conf_d_path}}"
default_conf_docker_path: "{{conf_d_docker_path}}default.conf"

View File

@@ -0,0 +1,2 @@
dependencies:
- native-nginx-docker-proxy

View File

@@ -0,0 +1,47 @@
---
- name: recieve {{domain}} certificate
command: certbot certonly --agree-tos --email {{administrator_email}} --non-interactive --webroot -w /var/lib/letsencrypt/ -d {{domain}}
- name: configure {{domain}}.conf
template: src=roles/native-nginx-docker-proxy/templates/domain.conf.j2 dest=/etc/nginx/conf.d/{{domain}}.conf
notify: restart nginx
- name: create data folder
file:
path: "{{conf_d_docker_path}}"
state: directory
- name: "create {{default_conf_docker_path}}"
template: src="default.conf" dest="{{default_conf_docker_path}}"
- name: "setup mybb"
docker_compose:
project_name: mybb
definition:
application:
image: mybb/mybb:latest
restart: always
links:
- database
volumes:
- mybb-data:/var/www/html
server:
links:
- application
image: nginx:mainline
restart: always
ports:
- "{{http_port}}:80"
volumes:
- "{{conf_d_docker_path}}:{{conf_d_path}}"
- "mybb-data:/var/www/html:ro"
database:
image: mariadb
environment:
MYSQL_DATABASE: "mybb"
MYSQL_USER: "mybb"
MYSQL_PASSWORD: "{{mybb_database_password}}"
MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
volumes:
- mybb-database:/var/lib/mysql
restart: always

View File

@@ -0,0 +1,32 @@
upstream mybb {
server application:9000 weight=5;
}
server {
listen 80;
root /var/www/html;
index index.html index.php;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ inc/ {
internal;
}
location ~ ^/(images|cache|jscripts|uploads)/ {
access_log off;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass mybb;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}