diff --git a/README.md b/README.md index 4711432..bb24a48 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,6 @@ # Ansible Role: strfry -This Ansible Role builds and installs [strfry](https://github.com/hoytech/strfry). - -Future role improvements: - -* The git tasks in this role are not yet idempotent due to handling a submodule. -* The installation process could be made to check if strfry is already running and perform a zero-downtime upgrade. +This Ansible Role builds and installs [strfry](https://github.com/hoytech/strfry). It is intended to be composed with a separate role to handle the web proxy configuration. ## Requirements @@ -16,20 +11,24 @@ None. ```yaml strfry_version: beta # git repository branch or release tag strfry_make_jobs: "{{ ansible_processor_cores }}" # number of CPUs to build with -strfry_skip_config: False +strfry_skip_config: no ``` -See `defaults/main.yml` +See the role [defaults](defaults/main.yml). -If you are not using the `beta` branch/version, you should override the template with your own by setting `strfry_skip_config` to true and manage the configuration manually. +If you are not using the `beta` branch/version, you should override the template with your own by enabling `strfry_skip_config` and managing the configuration manually. + +```yaml +strfry_skip_config: yes +``` For more configuration info, see the relevant upstream [configuration example](https://github.com/hoytech/strfry/blob/beta/strfry.conf) for your branch/version. ## Example Playbook ```yaml -- hosts: all - become: true +- hosts: strfry + become: yes roles: - role: bleetube.strfry - role: nginxinc.nginx_core.nginx @@ -37,10 +36,20 @@ For more configuration info, see the relevant upstream [configuration example](h - import_tasks: nginx_conf.yml ``` -## Troubleshooting +A sample [nginx configuration](docs/examples/nginx_conf.yml) is provided. -If `make` fails, try running on a single core: +For a fully functional production example that includes hosting multiple relays, see this [homelab stack](https://github.com/bleetube/satstack). + +## Troubleshooting +If `make` fails, try building on a single core: ```shell ansible-playbook playbooks/strfry/main.yml -e 'strfry_make_jobs=1' ``` + +Logs + +```shell +systemctl status strfry +journalctl -fu strfry +``` diff --git a/docs/examples/nginx_conf.yml b/docs/examples/nginx_conf.yml new file mode 100644 index 0000000..6bf6e31 --- /dev/null +++ b/docs/examples/nginx_conf.yml @@ -0,0 +1,41 @@ +--- +- name: strfry | Configure nginx + ansible.builtin.import_role: + name: nginxinc.nginx_core.nginx_config + vars: + nginx_config_http_template_enable: true + nginx_config_http_template: + - template_file: http/default.conf.j2 + deployment_location: "/etc/nginx/conf.d/strfry_{{ nginx_strfry_domain }}.conf" + backup: false + config: + upstreams: + - name: strfry + servers: + - address: "127.0.0.1:{{ strfry_relay.port|default(7777) }}" + #- address: unix:/var/lib/strfry/strfry.sock + servers: + - core: + listen: + - address: "{{ default_interface_ipv4_address|default(ansible_default_ipv4.address) }}:{{ nginx_strfry_https_port|default(443) }} ssl" + include: + - "/etc/nginx/acme_{{ nginx_strfry_domain }}.conf" + - /etc/nginx/enable_http2.conf + client_max_body_size: 0 # Stream request body to backend + locations: + - location: / + proxy: + pass: http://strfry + http_version: '1.1' + set_header: + - field: Host + value: $http_host + - field: Connection + value: $connection_upgrade + - field: Upgrade + value: $http_upgrade + - field: X-Forwarded-For + value: $proxy_add_x_forwarded_for + connect_timeout: 3m + send_timeout: 3m + read_timeout: 3m