UPCaddy is a shell script tool designed to streamline the management of Caddy configurations. It simplifies the creation and updating of .caddy
files, making it easier to set up reverse proxies and other configurations through an interactive, menu-driven interface.
- Caddy must be installed in a Docker container named
caddy
.- If Caddy is installed on the host, you might need to modify the
upcaddy
script
- If Caddy is installed on the host, you might need to modify the
- For private subdomains to function, you need a custom Caddy build with Cloudflare DNS challenge support.
- Your domain's DNS must be managed through Cloudflare.
- You need Cloudflare's API Token
To install UPCaddy:
git clone https://github.com/deuts/upcaddy.git
cd upcaddy
chmod +x install.sh
sudo ./install.sh
This script will:
- Create necessary directories and configuration files.
- Load configuration variables from
config.cfg
. - Provide an option to back up your existing Caddyfile.
- Copy all required scripts to their respective locations.
To launch UPCaddy, run the main script from the terminal:
upcaddy
You will see a menu with the following options:
- Create a new .caddy file
- Consolidate .caddy files and update Caddy
- Exit
Selecting option 1 allows you to choose from the following configuration types:
- Public subdomain
- Private subdomain
- Send relay of a subdomain
- Receive relay of a subdomain
The script will prompt you for necessary details, such as the subdomain, address, and port. The $subdomain.caddy
file will be created in the directory that you run the upcaddy
command, so make sure to execute this within the SEARCH_DIRECTORY
so it will be consolidated into the Caddyfile in the next step.
Choosing option 2 will gather all existing .caddy
files in the specified directory and update the Caddyfile accordingly. You can also opt to restart the Caddy Docker container.
During the execution of install.sh
, you'll be prompted for the following configuration variables:
SEARCH_DIRECTORY
: The directory to search for.caddy
files.CADDYFILE_LOCATION
: The location of the Caddyfile on the host.DOMAIN
: Your main domain name.PRIVATE_SUBDOMAIN
: The subdomain for private access, which should have itsA
record pointing to a private IP address.
This configuration will be saved at /usr/local/bin/upcaddy_files/config.cfg
, and you can edit it for further customization.
install.sh
: Main installation script for UPCaddy.upcaddy
: The main menu-driven interface for user interactions.upcaddy_files/update
: Consolidates.caddy
files into the main Caddyfile.upcaddy_files/new1_public_subdomain
: Creates a new public subdomain configuration.upcaddy_files/new2_private_subdomain
: Creates a new private subdomain configuration.upcaddy_files/new3_send_subdomain
: Sets up a send relay for a subdomain.upcaddy_files/new4_receive_subdomain
: Sets up a receive relay for a subdomain.
- Check todos for the plans to implement in the future.
Contributions are welcome! Please submit a pull request or open an issue for any bugs or suggestions.
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for more details.