Skip to content

Commit

Permalink
restart haproxy and nginx on install
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddify-com committed Jan 22, 2024
1 parent 4ea8e9e commit 632c79e
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 8 deletions.
6 changes: 3 additions & 3 deletions acme.sh/cert_utils.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
restricted_tlds=("af" "by" "cu" "er" "gn" "ir" "kp" "lr" "ru" "ss" "su" "sy" "zw" "amazonaws.com","azurewebsites.net","cloudapp.net")
shopt -s expand_aliases

source lib/acme.sh.env
source ./lib/acme.sh.env

# Function to check if a domain is restricted
is_ok_domain_zerossl() {
Expand All @@ -14,7 +14,7 @@ is_ok_domain_zerossl() {
return 0 # Domain is not restricted
}
function get_cert() {
cd /opt/hiddify-manager/acme.sh
cd /opt/hiddify-manager/acme.sh/
source ./lib/acme.sh.env
# ./lib/acme.sh --register-account -m my@example.com

Expand Down Expand Up @@ -79,7 +79,7 @@ function has_valid_cert() {
}

function get_self_signed_cert() {
cd /opt/hiddify-manager/acme.sh
cd /opt/hiddify-manager/acme.sh/
d=$1
if [ ${#d} -gt 64 ]; then
echo "Domain length exceeds 64 characters. Truncating to the first 64 characters."
Expand Down
2 changes: 1 addition & 1 deletion acme.sh/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ fi
mkdir -p ../ssl/
./lib/acme.sh --uninstall-cronjob
shopt -s expand_aliases
source lib/acme.sh.env
source ./lib/acme.sh.env
acme.sh --register-account -m my@example.com
systemctl reload hiddify-haproxy
5 changes: 3 additions & 2 deletions haproxy/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
domains=$(cat ../current.json | jq -r '.domains[] | select(.mode | IN("direct", "cdn", "worker", "relay", "auto_cdn_ip", "old_xtls_direct", "sub_link_only", "fake")) | .domain')
# we need at least one ssl certificate to be able to run haproxy
for d in $domains; do
bash ../acme.sh/generate_self_signed_cert.sh $d
bash ../acme.sh/generate_self_signed_cert.sh $d
done

systemctl reload hiddify-haproxy
# systemctl reload hiddify-haproxy
systemctl restart hiddify-haproxy.service
systemctl start hiddify-haproxy
2 changes: 1 addition & 1 deletion hiddify-panel/src
Submodule src updated from 088f7d to 943952
2 changes: 1 addition & 1 deletion nginx/run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

systemctl reload hiddify-nginx
systemctl restart hiddify-nginx
systemctl start hiddify-nginx
20 changes: 20 additions & 0 deletions release
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

which gitchangelog
if [[ "$?" != 0 ]];then
pip3 install gitchangelog pystache
fi
previous_tag=$(git describe --tags $(git rev-list --tags --max-count=1))
echo "previous version was $previous_tag"
read -p "Version? (provide the next x.y.z semver) : " TAG
[[ $TAG = v* ]] && echo "incorrect tag" && exit 1
echo "${TAG}" > VERSION
git tag v${TAG}
gitchangelog > HISTORY.md
git tag -d v${TAG}
git add VERSION HISTORY.md
git commit -m "release: version ${TAG} 🚀"
echo "creating git tag : v${TAG}"
git tag v${TAG}
git push -u origin HEAD --tags
echo "Github Actions will detect the new tag and release the new version."

0 comments on commit 632c79e

Please sign in to comment.