mirror of
https://github.com/PR0M3TH3AN/VoxVera.git
synced 2025-09-08 06:58:42 +00:00
Resolve paths in OnionShare script
This commit is contained in:
@@ -102,8 +102,9 @@ same subdomain are removed before new files are written.
|
|||||||
|
|
||||||
## Hosting with OnionShare
|
## Hosting with OnionShare
|
||||||
The folder under `host/<subdomain>` contains everything needed to serve the
|
The folder under `host/<subdomain>` contains everything needed to serve the
|
||||||
flyer. Run the helper script `serve_with_onionshare.sh` from the repository
|
flyer. Run the helper script `serve_with_onionshare.sh` to publish it over Tor.
|
||||||
root to publish it over Tor:
|
The script now resolves the configuration and host paths internally, so it can
|
||||||
|
be invoked from any directory:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./serve_with_onionshare.sh
|
./serve_with_onionshare.sh
|
||||||
|
@@ -8,7 +8,10 @@ fi
|
|||||||
|
|
||||||
# get subdomain from config
|
# get subdomain from config
|
||||||
subdomain=$(jq -r '.subdomain' "$CONFIG")
|
subdomain=$(jq -r '.subdomain' "$CONFIG")
|
||||||
DIR="host/${subdomain}"
|
|
||||||
|
# resolve paths to absolute locations so the script works from anywhere
|
||||||
|
CONFIG="$(realpath "$CONFIG")"
|
||||||
|
DIR="$(realpath "host/$subdomain")"
|
||||||
if [[ ! -d "$DIR" ]]; then
|
if [[ ! -d "$DIR" ]]; then
|
||||||
echo "Directory $DIR not found" >&2
|
echo "Directory $DIR not found" >&2
|
||||||
exit 1
|
exit 1
|
||||||
|
Reference in New Issue
Block a user