All Projects → louim → bedrock-site-protect

louim / bedrock-site-protect

Licence: other
Ansible role: Add htpasswd protection to Trellis (Bedrock-Ansible) WordPress sites.

Projects that are alternatives of or similar to bedrock-site-protect

enveigle
Deceive Ansible to template Trellis .env files to local Bedrock
Stars: ✭ 18 (-77.22%)
Mutual labels:  bedrock, trellis
Trellis
WordPress LEMP stack with PHP 8.0, Composer, WP-CLI and more
Stars: ✭ 2,295 (+2805.06%)
Mutual labels:  bedrock, trellis
ansible-role-mysql
Ansible Role - MySQL and MariaDB
Stars: ✭ 28 (-64.56%)
Mutual labels:  ansible-role
LiteXLoader
This project has been merged into LiteLoaderBDS 👇 click below to new project 本项目已经合并到 LiteLoaderBDS 项目中 👇 点击前往 https://github.com/LiteLDev/LiteLoaderBDS
Stars: ✭ 84 (+6.33%)
Mutual labels:  bedrock
ansible-role-pacemaker
Ansible role to deploy Pacemaker HA clusters
Stars: ✭ 19 (-75.95%)
Mutual labels:  ansible-role
Windows-2012-Member-Server-STIG
Ansible role for the Windows 2012 Member Server STIG
Stars: ✭ 12 (-84.81%)
Mutual labels:  ansible-role
mcwzh-meme-resourcepack-bedrock
An add-on that include meme translation in Chinese. | 梗体中文基岩版
Stars: ✭ 38 (-51.9%)
Mutual labels:  bedrock
bedrock-viz
Minecraft Bedrock Edition World Visualization & Reporting Tool with Web App
Stars: ✭ 194 (+145.57%)
Mutual labels:  bedrock
ansible-bluegreen-docker
Ansible role, showing a concept of blue-green deployments with Docker containers
Stars: ✭ 23 (-70.89%)
Mutual labels:  ansible-role
ansible-role-etcd
Ansible role for installing etcd cluster
Stars: ✭ 38 (-51.9%)
Mutual labels:  ansible-role
ansible-mdadm
No description or website provided.
Stars: ✭ 48 (-39.24%)
Mutual labels:  ansible-role
ansible-role-do-agent
Cross-distro installation of the DigitalOcean monitoring agent
Stars: ✭ 22 (-72.15%)
Mutual labels:  ansible-role
ansible role proxmox
Ansible role to provision containers in Proxmox VE virtualization
Stars: ✭ 42 (-46.84%)
Mutual labels:  ansible-role
ansible-haproxy
Installs and configures HAProxy
Stars: ✭ 19 (-75.95%)
Mutual labels:  ansible-role
BedrockBackwards
Connects older clients to newer servers
Stars: ✭ 24 (-69.62%)
Mutual labels:  bedrock
ansible-drone
Ansible role to configure drone (server and agent)
Stars: ✭ 16 (-79.75%)
Mutual labels:  ansible-role
ModdedBE
Open source Minecraft: Bedrock Edition launcher for Android. Using EnderCore as Mod Engine, patching NMods to Minecraft.
Stars: ✭ 41 (-48.1%)
Mutual labels:  bedrock
static-auth
The most simple way to add Basic Authentication to a static website hosted on Vercel.
Stars: ✭ 25 (-68.35%)
Mutual labels:  basic-authentication
tomcat role
Ansible role to install Apache Tomcat Java Servlet Container
Stars: ✭ 13 (-83.54%)
Mutual labels:  ansible-role
ansible-role-containerd
Ansible Role - containerd.io
Stars: ✭ 45 (-43.04%)
Mutual labels:  ansible-role

Bedrock Site protect

This role is specifically crafted to go with Trellis. It will allow you to set Basic authentication on your bedrock websites. This is especially useful during development if you have a staging environment that you don't want the world to see.

Requirements

This role is made for Trellis (previously known as Bedrock-Ansible), so it depends on it.

Role Variables

The role will read from the wordpress_sites dict set in environments files of Trellis. It will search for the htpasswd key.

Example:

wordpress_sites:
  example.com:
    site_hosts:
      - canonical: example.dev
    local_path: '../site' # path targeting local Bedrock site directory (relative to Ansible root)
    admin_email: [email protected]
    multisite:
      enabled: false
    ssl:
      enabled: false
    cache:
      enabled: false
    htpasswd:
      - name: user
        password: secret
      - name: user2
        password: secret2

You may want to add the htpasswd block in the vault.yml file so password will be encrypted. You can also set the htpasswd_path to specify the folder used to store htpasswd files. The default is /etc/htpasswd. If you want to set this parameter, it is recommended that you set it in the group_vars/all/main.yml file, so it will be the same for all environments.

Dependencies

Trellis.

Example Playbook

To get started, add this role (louim.bedrock-site-protect) to the galaxy.yml file in your Trellis installation like so:

- name: bedrock-site-protect
  src: louim.bedrock-site-protect
  version: 2.0.0

Then re-run the ansible-galaxy install -r galaxy.yml to install the new role. You might need to add the -f option to force install of previously downloaded roles.

You will also need to add the role to the server.yml like so:

roles:
  ... other Trellis roles ...
  - { role: bedrock-site-protect, tags: [htpasswd, wordpress, wordpress-setup, letsencrypt] }

Adding / Removing Basic Authentication

To Add: Run the Trellis command to set up your previously configured remote server: ansible-playbook server.yml -e env=<environment> To Remove: Remove the following htpasswd block:

  htpasswd:
    - name: user
      password: secret

in the wordpress_sites dict set, and reconfigure via: ansible-playbook server.yml -e env=<environment>.

License

MIT

Author Information

© Louis-Michel Couture 2018. Role inspired by ansible-htpasswd by franklinkim

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].