diff --git a/opsec/nextcloud/index.html b/opsec/nextcloud/index.html index 7e97822..121c177 100644 --- a/opsec/nextcloud/index.html +++ b/opsec/nextcloud/index.html @@ -81,21 +81,35 @@

Serverside Setup

-

So to install nextcloud we're going to use docker-compose as follows:

+

So to install nextcloud we're going to use docker-compose as follows (as the root user):


+[ Wonderland ] [ /dev/pts/9 ] [/srv/nextcloud]
+→ sudo -i
+
 [ Wonderland ] [ /dev/pts/9 ] [/srv/nextcloud]
 → apt install docker.io docker-compose -y
 
 [ Wonderland ] [ /dev/pts/9 ] [/srv/nextcloud]
 → vim docker-compose.yml
 
-[ Wonderland ] [ /dev/pts/9 ] [/srv/nextcloud]
+[ Wonderland ] [ /dev/pts/7 ] [/srv/nextcloud]
 → cat docker-compose.yml
+networks:
+  tor-nxtcld:
+    driver: bridge
+    ipam:
+      config:
+        - subnet: 10.7.0.0/24
+          gateway: 10.7.0.1
+
 services:
   db:
     image: mariadb:latest
     restart: always
     command: --transaction-isolation=READ-COMMITTED
+    networks:
+      tor-nxtcld:
+        ipv4_address: 10.7.0.2
     volumes:
       - db:/var/lib/mysql
     environment:
@@ -111,6 +125,9 @@ services:
   app:
     image: nextcloud:latest
     restart: always
+    networks:
+      tor-nxtcld:
+        ipv4_address: 10.7.0.3
     ports:
       - 127.0.0.1:9639:80
     depends_on:
@@ -126,6 +143,17 @@ services:
       - NEXTCLOUD_TRUSTED_DOMAINS=nxtcloud.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion
       - OVERWRITEHOSTPROTOCOL=http
       - OVERWRITEHOST=nxtcloud.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion
+      - PROXY=tor-nxtcld:9050
+
+  tor-nxtcld:
+    image: osminogin/tor-simple
+    container_name: tor-nxtcld
+    volumes:
+      - ./tor-data:/var/lib/tor
+      - ./tor-data/torrc:/etc/tor
+    networks:
+      tor-nxtcld:
+        ipv4_address: 10.7.0.4
 
 volumes:
   nextcloud:
@@ -133,7 +161,7 @@ volumes:
 
 

Don't forget to replace the "P@SSW0RD" with a password of your own, and that docker-compose.yaml will expose the nextcloud service on local port 9639, so let's run docker-compose up -d to run the service:

-

+

As you can see in the docker-compose.yml file, there is a tor container, this is to make sure that the nextcloud connects to the internet through Tor (see the PROXY environment variable), to protect the serverside anonymity.


 [ Wonderland ] [ /dev/pts/9 ] [/srv/nextcloud]
 → docker-compose up -d
@@ -159,7 +187,7 @@ torrc
  SOCKSPort 0.0.0.0:9050
 
 
-

Then we setup the nginx config to be able to access the nextcloud service accordingly:

+

Then we setup the nginx config to be able to access the nextcloud service accordingly. (obviously, replace the onion domain with your own onion domain):


 [ Wonderland ] [ /dev/pts/9 ] [/srv/nextcloud]
 → vim /etc/nginx/sites-available/nxtcloud.conf