summaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
authorlolcat <will@lolcat.ca>2024-06-22 14:00:12 -0400
committerlolcat <will@lolcat.ca>2024-06-22 14:00:12 -0400
commit75003b6617c1a828fb871c3f76da415b3ce0b455 (patch)
tree8d7cf9400bc924c065df3e310e570f6098cb8585 /docker
parent4e1df70ce6ab311aabc07946ca533deb5ef446d2 (diff)
parent0b68d6b2a9928d1b9dae389fbf5b95056e678be0 (diff)
Merge branch 'master' of https://git.lolcat.ca/lolcat/4get
Diffstat (limited to 'docker')
-rw-r--r--docker/gen_config.php4
-rw-r--r--docker/tor/Dockerfile18
-rw-r--r--docker/tor/torrc1
3 files changed, 21 insertions, 2 deletions
diff --git a/docker/gen_config.php b/docker/gen_config.php
index ceea117..b9e7730 100644
--- a/docker/gen_config.php
+++ b/docker/gen_config.php
@@ -66,10 +66,10 @@ foreach(($merged_config) as $key => $val){
// Handle case when original type of field is array and there is a type mismatch when a comma separted string is passed,
// then split on comma if string (and not numeric, boolean, null, etc)
//
- // except in the case where the inital value in default config is null. Assuming null
+ // except in the case where the inital value in default config is null or boolean. Assuming null and boolean
// in default config will be never be assigned an array
- if(gettype($from_config[$key]) != gettype($val) && !is_numeric($val) && !is_null($from_config[$key])) {
+ if(gettype($from_config[$key]) != gettype($val) && !is_numeric($val) && !is_null($from_config[$key]) && gettype($from_config[$key]) != "boolean") {
$stored_value = explode(",", $val);
}
$output = $output . "\tconst " . $key . " = " . type_to_string($stored_value) . ";\n";
diff --git a/docker/tor/Dockerfile b/docker/tor/Dockerfile
new file mode 100644
index 0000000..9310f68
--- /dev/null
+++ b/docker/tor/Dockerfile
@@ -0,0 +1,18 @@
+FROM alpine:edge
+
+RUN apk add --no-cache curl tor
+
+EXPOSE 9050
+
+HEALTHCHECK --interval=60s --timeout=15s --start-period=20s \
+ CMD curl -x socks5h://127.0.0.1:9050 'https://check.torproject.org/api/ip' | grep -qm1 -E '"IsTor"\s*:\s*true'
+
+
+# default owner is tor, but running as root to avoid docker volume mount issue
+RUN chown -R root:root /var/lib/tor
+
+VOLUME ["/var/lib/tor/4get"]
+
+COPY ./torrc /etc/tor/torrc
+
+ENTRYPOINT ["/usr/bin/tor"]
diff --git a/docker/tor/torrc b/docker/tor/torrc
new file mode 100644
index 0000000..da32a7a
--- /dev/null
+++ b/docker/tor/torrc
@@ -0,0 +1 @@
+SocksPort 0.0.0.0:9050