change to init

This commit is contained in:
Dread
2022-09-09 12:56:41 -04:00
parent 216d3407d1
commit 284a403b08
4 changed files with 39 additions and 21 deletions

View File

@ -1,14 +1,17 @@
FROM recksato/robosats-client
RUN apt-get update && apt-get install wget curl sudo bash tini -y \
&& wget https://github.com/mikefarah/yq/releases/download/v4.25.1/yq_linux_arm.tar.gz -O - |\
tar xz && mv yq_linux_arm /usr/bin/yq
ENV APP_HOST "robosats.embassy"
ENV APP_HOST robosats.embassy
ENV APP_PORT 9000
ENV TOR_PROXY_IP localhost
ENV TOR_PROXY_IP robosats.embassy
ENV TOR_PROXY_PORT 9050
ADD ./docker_entrypoint.sh /usr/local/bin/docker_entrypoint.sh
ADD check-web.sh /usr/local/bin/check-web.sh
RUN chmod a+x /usr/local/bin/*.sh
RUN chmod a+x robosats-client.sh
RUN chmod a+x *.sh
EXPOSE 12596

View File

@ -2,16 +2,14 @@
set -e
_term() {
echo "Caught SIGTERM signal!"
kill -TERM "$rs_process" 2>/dev/null
exit 0
}
# Setting env-vars from config page
echo "Setting environment variables..."
export ROBOSATS_ONION=$(yq e '.tor-address' /root/start9/config.yaml)
export LAN_HOST=$(yq e '.lan-address' /root/start9/config.yaml)
# export TOR_PROXY_IP=$(yq e '.tor-address' /root/start9/config.yaml)
client_server="npm exec http-server -- . -p 12596 -P http://127.18.0.1:9050 --cors -i false -d false"
backend_tor_bridge="socat tcp4-LISTEN:81,reuseaddr,fork,keepalive,bind=127.0.0.1 SOCKS4A:${TOR_PROXY_IP:-127.18.0.1}:${ROBOSATS_ONION:-robosats6tkf3eva7x2voqso3a5wcorsnw34jveyxfqi2fu7oyheasid.onion}:80,socksport=${TOR_PROXY_PORT:-9050}"
echo "Starting RoboSats..."
./robosats-client.sh
exec tini $client_server & $backend_tor_bridge & nginx -g "daemon off;"
trap _term SIGTERM
wait -n $rs_process

View File

@ -85,7 +85,7 @@ interfaces:
tor-config:
# Port mappings are from the external port to the internal container port
port-mapping:
12596: "12596"
80: "12596"
9000: "9000"
81: "81"
# Port mappings are from the external port to the internal container port

View File

@ -4,12 +4,29 @@ import { compat, types as T } from "../deps.ts";
export const getConfig: T.ExpectedExports.getConfig = compat.getConfig({
"tor-address": {
"name": "Tor Address",
"description": "The Tor address of the network interface",
"type": "pointer",
"subtype": "package",
"package-id": "robosats",
"target": "tor-address",
"interface": "main",
"name": "Tor Address",
"description": "The Tor address of the network interface",
"type": "pointer",
"subtype": "package",
"package-id": "robosats",
"target": "tor-address",
"interface": "main",
},
"lan-address": {
"name": "LAN Address",
"description": "The LAN address of the network interface",
"type": "pointer",
"subtype": "package",
"package-id": "robosats",
"target": "lan-address",
"interface": "main",
},
"rs-hash": {
"type": "string",
"name": "Robosats Unique Hash",
"description": "TBD",
"nullable": true,
"copyable": true,
"masked": false,
}
});