mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 18:35:51 +02:00
wip: added DNS challenge provider
This commit is contained in:
parent
710325447a
commit
5b8fae10df
149 changed files with 6164 additions and 988 deletions
43
lego-config.sh
Normal file
43
lego-config.sh
Normal file
|
@ -0,0 +1,43 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Download go-acme/lego repository
|
||||
download_and_extract() {
|
||||
local repo_url="https://github.com/go-acme/lego/archive/refs/heads/master.zip"
|
||||
local target_dir="$1"
|
||||
|
||||
# Check if wget and unzip are installed
|
||||
if ! command -v wget >/dev/null || ! command -v unzip >/dev/null; then
|
||||
echo "Please ensure wget and unzip are installed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Download and extract the source code
|
||||
wget -q -O lego-master.zip "$repo_url"
|
||||
unzip -q lego-master.zip -d "$target_dir"
|
||||
rm lego-master.zip
|
||||
}
|
||||
|
||||
# Copy .toml files from providers to the specified directory
|
||||
copy_toml_files() {
|
||||
local source_dir="$1/lego-master/providers"
|
||||
local target_dir="server/pkg/cert/config"
|
||||
|
||||
# Remove the lego-master folder
|
||||
if [ ! -d "$target_dir" ]; then
|
||||
mkdir -p "$target_dir"
|
||||
fi
|
||||
|
||||
# Copy .toml files
|
||||
find "$source_dir" -type f -name "*.toml" -exec cp {} "$target_dir" \;
|
||||
}
|
||||
|
||||
# Remove the lego-master folder
|
||||
remove_lego_master_folder() {
|
||||
local folder="$1/lego-master"
|
||||
rm -rf "$folder"
|
||||
}
|
||||
|
||||
destination="./tmp"
|
||||
download_and_extract "$destination"
|
||||
copy_toml_files "$destination"
|
||||
remove_lego_master_folder "$destination"
|
Loading…
Add table
Add a link
Reference in a new issue