From 0cb8f855232a723a5c579533968388bec4718f27 Mon Sep 17 00:00:00 2001 From: Drdada Date: Sat, 7 Oct 2023 16:29:20 +0000 Subject: [PATCH 1/8] Nextcloud Sync feature and update Debian version --- .env.example | 11 +++++++++++ Dockerfile | 15 ++++++++------- README.md | 35 +++++++++++++++++++++++++++++------ root/defaults/menu.xml | 8 +++++--- root/defaults/nextcloud.sh | 21 +++++++++++++++++++++ root/defaults/startwm.sh | 3 --- 6 files changed, 74 insertions(+), 19 deletions(-) create mode 100644 .env.example create mode 100644 root/defaults/nextcloud.sh delete mode 100644 root/defaults/startwm.sh diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..bd02842 --- /dev/null +++ b/.env.example @@ -0,0 +1,11 @@ +#Set your Nextcloud credentials and informations +#Please fill all the variables + +# Nextcloud Username +NC_USER= +# Nextcloud Password +NC_PASS= +# Nextcloud hostname e.g: nextcloud.myserver.net +NC_HOST= +# Folder path on your Nextcloud personal space e.g: /Obsidian +NC_PATH= diff --git a/Dockerfile b/Dockerfile index 345a72a..a5a745e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,23 +1,24 @@ -FROM ghcr.io/linuxserver/baseimage-kasmvnc:debianbullseye +FROM ghcr.io/linuxserver/baseimage-kasmvnc:debianbookworm LABEL maintainer="github@sytone.com" \ - org.opencontainers.image.authors="github@sytone.com" \ - org.opencontainers.image.source="https://github.com/sytone/obsidian-remote" \ + org.opencontainers.image.authors="drdada" \ + org.opencontainers.image.source="https://github.com/drdada/obsidian-remote" \ org.opencontainers.image.title="Container hosted Obsidian MD" \ org.opencontainers.image.description="Hosted Obsidian instance allowing access via web browser" # Update and install extra packages. RUN echo "**** install packages ****" && \ apt-get update && \ - apt-get install -y --no-install-recommends curl libgtk-3-0 libnotify4 libatspi2.0-0 libsecret-1-0 libnss3 desktop-file-utils fonts-noto-color-emoji git ssh-askpass && \ + apt-get install -y --no-install-recommends curl nextcloud-desktop-cmd libgtk-3-0 libnotify4 libatspi2.0-0 libsecret-1-0 libnss3 desktop-file-utils fonts-noto-color-emoji git ssh-askpass && \ apt-get autoclean && rm -rf /var/lib/apt/lists/* /var/tmp/* /tmp/* # Set version label -ARG OBSIDIAN_VERSION=1.4.13 +ARG OBSIDIAN_REMOTE_RELEASE=1.0 # Download and install Obsidian RUN echo "**** download obsidian ****" && \ - curl --location --output obsidian.deb "https://github.com/obsidianmd/obsidian-releases/releases/download/v${OBSIDIAN_VERSION}/obsidian_${OBSIDIAN_VERSION}_amd64.deb" && \ + file_url=$(curl -s "https://api.github.com/repos/obsidianmd/obsidian-releases/releases/latest" | grep "browser_download_url.*deb" | cut -d : -f 2,3 | tr -d \") && \ + curl --location --output obsidian.deb $file_url && \ dpkg -i obsidian.deb # Environment variables @@ -26,7 +27,7 @@ ENV CUSTOM_PORT="8080" \ CUSTOM_USER="" \ PASSWORD="" \ SUBFOLDER="" \ - TITLE="Obsidian v${OBSIDIAN_VERSION}" \ + TITLE="Obsidian Remote v${OBSIDIAN_REMOTE_RELEASE}" \ FM_HOME="/vaults" # Add local files diff --git a/README.md b/README.md index 4a68bb1..5b29b9f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # obsidian-remote -This docker image allows you to run [obsidian](https://obsidian.md/) in docker as a container and access it via your web browser. +This docker image allows you to run the latest version of [obsidian](https://obsidian.md/) in docker as a container and access it via your web browser. Use `http://localhost:8080/` to access it locally, do not expose this to the web unless you secure it and know what you are doing!! @@ -12,6 +12,7 @@ Use `http://localhost:8080/` to access it locally, do not expose this to the web - [Enabling GIT for the obsidian-git plugin](#enabling-git-for-the-obsidian-git-plugin) - [Docker CLI example](#docker-cli-example) - [Reloading Obsidan in the Browser](#reloading-obsidan-in-the-browser) +- [Nextcloud](#nextcloud) - [Setting PUID and PGID](#setting-puid-and-pgid) - [Adding missing fonts](#adding-missing-fonts) - [Map font file using Docker CLI](#map-font-file-using-docker-cli) @@ -85,6 +86,10 @@ docker run -d ` | SUBFOLDER | Subfolder for the application if running a subfolder reverse proxy, need both slashes IE `/subfolder/` | | TITLE | The page title displayed on the web browser, default "KasmVNC Client". | | FM_HOME | This is the home directory (landing) for the file manager, default "/config". | +| NC_USER | Username for Nextcloud | +| NC_PASS | Password for Nextcloud | +| NC_HOST | Domain name of your Nextcloud instance E.g. nextcloud.mydomain.net | +| NC_PATH | Path where you store your md file on Nextcloud E.g. /Obsidian | ## Using Docker Compose @@ -133,6 +138,26 @@ If you make changes to plugins or do updates that need to have obsidian restarte ![Reloading Obsidian in the Browser](./assets/ReloadExample.gif) +## Nextcloud + +If you wish to store your MD files on your nextcloud instance, you can trigger a sync script. + +Please copy the .env.example file + +``` +cp .env.example .env +``` + +Now edit your .env file and fill your Nextcloud credentials and informations. + +### Trigger Sync + +The synchronization with Nextcloud is not automated because Obsidian frequently performs file save, which could result in frequent and potentially unnecessary synchronizations. To avoid network overload and minimize unnecessary traffic, the synchronization with Nextcloud is left to the user's discretion and must be done manually. + +This approach allows the user to control when the synchronization should take place, choosing appropriate moments when your work are done. + +You can trigger sync via right cliking on the desktop and choosing **Nextcloud Sync** + ## Setting PUID and PGID To set PUID and PGID use the follow environment variables on the command line, by default the IDs are 911/911 @@ -183,6 +208,7 @@ Download the font of the language that you want to use in Obsidian and add it to ## Hosting behind a reverse proxy If you wish to do that **please make sure you are securing it in some way!**. You also need to ensure **websocket** support is enabled. +Even if you can set auth to reach the container, it's always a good practice to secure auth to the higher level. So it's better to set password auth via the reverse proxy rather than here. ### Example nginx configuration @@ -249,7 +275,7 @@ Create a proxy host in NPM pointing to the "obsidian-remote:8080" container, cho ## Updating Obsidian -By default obsidian will update itself in the container. If you recreate the container you will have to do the update again. This repo will be updated periodically to keep up with the latest version of Obsidian. +When creating the container it download the latest version of obsidian. ## Building locally @@ -275,9 +301,6 @@ docker run --rm -it ` ## Copy/Paste From External Source -Click on the circle to the left side of your browser window. In there you will find a textbox for updating the remote clipboard or copying from it. - -![image](https://user-images.githubusercontent.com/1399443/202805847-a87e2c7c-a5c6-4dea-bbae-4b25b4b5866a.png) - +Open the KasmVNC menu on the middle right and select clipboard diff --git a/root/defaults/menu.xml b/root/defaults/menu.xml index 7038f78..de74091 100644 --- a/root/defaults/menu.xml +++ b/root/defaults/menu.xml @@ -6,13 +6,15 @@ sudo /usr/bin/obsidian --no-sandbox + + + xterm -e "bash /defaults/nextcloud.sh" + + /usr/bin/xterm - - - diff --git a/root/defaults/nextcloud.sh b/root/defaults/nextcloud.sh new file mode 100644 index 0000000..b2b169d --- /dev/null +++ b/root/defaults/nextcloud.sh @@ -0,0 +1,21 @@ +#!/usr/bin/with-contenv bash +if [[ -z "${NC_PASS}" ]]; then + echo "NEXTCLOUD VARIABLES NOT SET" + echo "Please fill the env file" + sleep 100 + exit 1 +fi + +echo "Sync NC file in progress" +sync=$(/usr/bin/nextcloudcmd --path ${NC_PATH} /vaults https://${NC_USER}:${NC_PASS}@${NC_HOST}) +exit_code=$? +if [ $exit_code -ne 0 ]; then + echo "SYNC FAILED" + echo $sync + echo $exit_code + echo "SYNC FAILED" + sleep 100 +else + echo "Sync complete" + sleep 5 +fi diff --git a/root/defaults/startwm.sh b/root/defaults/startwm.sh deleted file mode 100644 index 86e4128..0000000 --- a/root/defaults/startwm.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -/startpulse.sh & -/usr/bin/openbox-session > /dev/null 2>&1 From d0cb5d2d7b24f10b80522904b4e2205b5a510401 Mon Sep 17 00:00:00 2001 From: Drdada Date: Sat, 7 Oct 2023 16:37:51 +0000 Subject: [PATCH 2/8] fix Authors in dockerfile --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index a5a745e..24d500a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ FROM ghcr.io/linuxserver/baseimage-kasmvnc:debianbookworm LABEL maintainer="github@sytone.com" \ - org.opencontainers.image.authors="drdada" \ - org.opencontainers.image.source="https://github.com/drdada/obsidian-remote" \ + org.opencontainers.image.authors="github@sytone.com" \ + org.opencontainers.image.source="https://github.com/sytone/obsidian-remote" \ org.opencontainers.image.title="Container hosted Obsidian MD" \ org.opencontainers.image.description="Hosted Obsidian instance allowing access via web browser" From fc3210c53ef3f912be0dc52facd39cd4022a52d3 Mon Sep 17 00:00:00 2001 From: Drdada Date: Sat, 7 Oct 2023 16:43:05 +0000 Subject: [PATCH 3/8] Update README envfile section --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 5b29b9f..4ed5319 100644 --- a/README.md +++ b/README.md @@ -150,6 +150,17 @@ cp .env.example .env Now edit your .env file and fill your Nextcloud credentials and informations. +When starting your docker container, you'll have to mention en env-file + +```PowerShell +docker run -d ` + -v D:/ob/vaults:/vaults ` + -v D:/ob/config:/config ` + -p 8080:8080 ` + --env-file .env ` + ghcr.io/sytone/obsidian-remote:latest +``` + ### Trigger Sync The synchronization with Nextcloud is not automated because Obsidian frequently performs file save, which could result in frequent and potentially unnecessary synchronizations. To avoid network overload and minimize unnecessary traffic, the synchronization with Nextcloud is left to the user's discretion and must be done manually. From 12d4e9fedc550f19b940c9d7cd42a1c277e03b38 Mon Sep 17 00:00:00 2001 From: Drdada Date: Sat, 21 Oct 2023 09:03:28 +0000 Subject: [PATCH 4/8] Add instructions for NC hostname --- .env.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.example b/.env.example index bd02842..0accb8e 100644 --- a/.env.example +++ b/.env.example @@ -5,7 +5,7 @@ NC_USER= # Nextcloud Password NC_PASS= -# Nextcloud hostname e.g: nextcloud.myserver.net +# Nextcloud hostname (without https://) e.g: nextcloud.myserver.net NC_HOST= # Folder path on your Nextcloud personal space e.g: /Obsidian NC_PATH= From 97e3a640244a8d318967f63dc1d6cf195c69ce90 Mon Sep 17 00:00:00 2001 From: Drdada Date: Sat, 21 Oct 2023 10:03:01 +0000 Subject: [PATCH 5/8] First workflow --- .github/workflows/docker-publish.yml | 58 --------------------- .github/workflows/docker.yml | 76 ---------------------------- .github/workflows/publish-ghcr.yaml | 15 ++++++ .vscode/settings.json | 3 -- 4 files changed, 15 insertions(+), 137 deletions(-) delete mode 100644 .github/workflows/docker-publish.yml delete mode 100644 .github/workflows/docker.yml create mode 100644 .github/workflows/publish-ghcr.yaml delete mode 100644 .vscode/settings.json diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml deleted file mode 100644 index 1b69229..0000000 --- a/.github/workflows/docker-publish.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: Docker - -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -on: - push: - # branches: [main] - # Publish semver tags as releases. - tags: ['v*.*.*'] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Get current date - id: date - run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H:%M:%S')" - - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: ghcr.io/${{ github.repository_owner }}/obsidian-remote - tags: | - type=ref,event=branch - type=ref,event=pr - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and Push Docker Image - uses: docker/build-push-action@v5 - with: - context: . - #file: ./Dockerfile - push: true # Will only build if this is not here - #tags: ghcr.io/${{ github.repository_owner }}/obsidian-remote:latest - # build-args: | - # "BUILD_DATE=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}" - # "IMAGE_VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}" - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml deleted file mode 100644 index c5cddcf..0000000 --- a/.github/workflows/docker.yml +++ /dev/null @@ -1,76 +0,0 @@ -name: Docker - -on: - workflow_dispatch: - schedule: - - cron: "0 0 * * 1" - push: - branches: - - latest - - main - paths-ignore: - - 'README.MD' - - '.github' - -jobs: - build: - name: build - runs-on: ubuntu-latest - - permissions: - packages: write - contents: read - - steps: - - name: Check out the repo - uses: actions/checkout@v4 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Setup Docker buildx - uses: docker/setup-buildx-action@v3 - - - name: Log in to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - -# - name: Log in to the Container registry -# uses: docker/login-action@v3 -# with: -# registry: ghcr.io -# username: ${{ github.actor }} -# password: ${{ secrets.GIT_TOKEN }} - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v5 - with: - images: | - ${{ secrets.DOCKERHUB_USERNAME }}/obsidian-remote - - - name: Build and push Docker images - uses: docker/build-push-action@v5 - with: - context: . - file: dockerfile.amd64 - platforms: linux/amd64 - push: true - tags: ${{ secrets.DOCKERHUB_USERNAME }}/obsidian-remote:latest - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/obsidian-remote:buildcache_amd64 - cache-to: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/obsidian-remote:buildcache_amd64,mode=max - -# - name: Build and push Docker images -# uses: docker/build-push-action@v5 - #with: - #context: . - #file: dockerfile.arm64 - #platforms: linux/arm64 - #push: true - #tags: ${{ secrets.DOCKERHUB_USERNAME }}/obsidian-remote:arm64 - #labels: ${{ steps.meta.outputs.labels }} - #cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/obsidian-remote:buildcache_arm64 - #cache-to: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/obsidian-remote:buildcache_arm64,mode=max diff --git a/.github/workflows/publish-ghcr.yaml b/.github/workflows/publish-ghcr.yaml new file mode 100644 index 0000000..a0f49f1 --- /dev/null +++ b/.github/workflows/publish-ghcr.yaml @@ -0,0 +1,15 @@ +name: Docker image CI for GHCR + +on: + push + +jobs: + build_and_publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Build an push the image + run: | + docker login --username drdada --password ${{ secrets.GH_TOKEN }} ghcr.io + docker build . --tag ghcr.io/drdada/obsidian-remote:latest + docker push ghcr.io/drdada/obsidian-remote:latest diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 34dfacb..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "docker.languageserver.formatter.ignoreMultilineInstructions": true -} \ No newline at end of file From e2c0b361b57f42e81bbeb8259edb81284e30ddb1 Mon Sep 17 00:00:00 2001 From: Drdada Date: Sat, 21 Oct 2023 10:25:32 +0000 Subject: [PATCH 6/8] Update author in Dockerfile --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 24d500a..1377539 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ FROM ghcr.io/linuxserver/baseimage-kasmvnc:debianbookworm -LABEL maintainer="github@sytone.com" \ - org.opencontainers.image.authors="github@sytone.com" \ - org.opencontainers.image.source="https://github.com/sytone/obsidian-remote" \ +LABEL maintainer="drdada@github.com" \ + org.opencontainers.image.authors="drdada@github.com" \ + org.opencontainers.image.source="https://github.com/drdada/obsidian-remote" \ org.opencontainers.image.title="Container hosted Obsidian MD" \ org.opencontainers.image.description="Hosted Obsidian instance allowing access via web browser" From 024e66ca24e1d5691af2a1f290f28a0f249bfd7a Mon Sep 17 00:00:00 2001 From: Drdada Date: Sat, 21 Oct 2023 12:53:01 +0200 Subject: [PATCH 7/8] Update README.md --- README.md | 77 +++++++++++++++++++++++-------------------------------- 1 file changed, 32 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index 4ed5319..d6b3a50 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,9 @@ This docker image allows you to run the latest version of [obsidian](https://obs Use `http://localhost:8080/` to access it locally, do not expose this to the web unless you secure it and know what you are doing!! +**Note :** This is a fork of *sytone/obsidian-remote* project and i missed some features like Nextcloud Sync or auto downloading the latest obsidian version during build. Feel free to use the original if you don't need such feature. + + - [Using the Container](#using-the-container) - [Ports](#ports) - [Mapped Volumes](#mapped-volumes) @@ -23,6 +26,7 @@ Use `http://localhost:8080/` to access it locally, do not expose this to the web - [Updating Obsidian](#updating-obsidian) - [Building locally](#building-locally) - [Copy/Paste From External Source](#copypaste-from-external-source) +- [Credits](#Credits) ## Using the Container @@ -33,28 +37,18 @@ docker run --rm -it ` -v D:/ob/vaults:/vaults ` -v D:/ob/config:/config ` -p 8080:8080 ` - ghcr.io/sytone/obsidian-remote:latest + ghcr.io/drdada/obsidian-remote:latest ``` -To run it as a daemon in the background. +Copy and fill the env file ```PowerShell -docker run -d ` - -v D:/ob/vaults:/vaults ` - -v D:/ob/config:/config ` - -p 8080:8080 ` - ghcr.io/sytone/obsidian-remote:latest +cp .env.example .env.local ``` -The ARM container is now avaliable, will look to make this simpler in the future. The ARM imange is on the docker hub and not the github container registry. +To run it as a daemon in the background, i recommand to do it via docker-compose (see below) -```PowerShell -docker run -d ` - -v D:/ob/vaults:/vaults ` - -v D:/ob/config:/config ` - -p 8080:8080 ` - sytone/obsidian-remote:latest -``` +The ARM container is not available, feel free to use the sytone build. ### Ports @@ -88,33 +82,25 @@ docker run -d ` | FM_HOME | This is the home directory (landing) for the file manager, default "/config". | | NC_USER | Username for Nextcloud | | NC_PASS | Password for Nextcloud | -| NC_HOST | Domain name of your Nextcloud instance E.g. nextcloud.mydomain.net | +| NC_HOST | Domain name of your Nextcloud instance (without protocol - https://) E.g. nextcloud.mydomain.net | | NC_PATH | Path where you store your md file on Nextcloud E.g. /Obsidian | -## Using Docker Compose +## Using Docker Compose (Recommanded) ```YAML +version: '3.6' services: - obsidian: - image: 'ghcr.io/sytone/obsidian-remote:latest' - container_name: obsidian-remote - restart: unless-stopped + obsidian-remote: + image: 'ghcr.io/drdada/obsidian-remote:latest' + env_file: + - .env.local ports: - - 8080:8080 - - 8443:8443 + - 8080 + - 443 + restart: unless-stopped volumes: - - /home/obsidian/vaults:/vaults - - /home/obsidian/config:/config - environment: - - PUID=1000 - - PGID=1000 - - TZ=America/Los_Angeles - - DOCKER_MODS=linuxserver/mods:universal-git - - CUSTOM_PORT="8080" - - CUSTOM_HTTPS_PORT="8443" - - CUSTOM_USER="" - - PASSWORD="" - - SUBFOLDER="" + - ./vaults:/vaults + - ./config:/config ``` ## Enabling GIT for the obsidian-git plugin @@ -129,7 +115,7 @@ docker run -d ` -v D:/ob/config:/config ` -p 8080:8080 ` -e DOCKER_MODS=linuxserver/mods:universal-git ` - ghcr.io/sytone/obsidian-remote:latest + ghcr.io/drdada/obsidian-remote:latest ``` ## Reloading Obsidan in the Browser @@ -142,11 +128,7 @@ If you make changes to plugins or do updates that need to have obsidian restarte If you wish to store your MD files on your nextcloud instance, you can trigger a sync script. -Please copy the .env.example file - -``` -cp .env.example .env -``` +Please make sure to copy the .env.local file Now edit your .env file and fill your Nextcloud credentials and informations. @@ -157,8 +139,8 @@ docker run -d ` -v D:/ob/vaults:/vaults ` -v D:/ob/config:/config ` -p 8080:8080 ` - --env-file .env ` - ghcr.io/sytone/obsidian-remote:latest + --env-file .env.local ` + ghcr.io/drdada/obsidian-remote:latest ``` ### Trigger Sync @@ -180,7 +162,7 @@ docker run --rm -it ` -e PUID=1000 ` -e PGID=1000 ` -p 8080:8080 ` - ghcr.io/sytone/obsidian-remote:latest + ghcr.io/drdada/obsidian-remote:latest ``` Or, if you use docker-compose, add them to the environment: section: @@ -218,6 +200,7 @@ Download the font of the language that you want to use in Obsidian and add it to ## Hosting behind a reverse proxy +This is a danger zone ! Exposing this instance on the internet (even without a reverse proxy) increase security risk for your server. If you wish to do that **please make sure you are securing it in some way!**. You also need to ensure **websocket** support is enabled. Even if you can set auth to reach the container, it's always a good practice to secure auth to the higher level. So it's better to set password auth via the reverse proxy rather than here. @@ -263,7 +246,7 @@ If you install obsidian-remote in Docker, you can proxy it through [Nginx Proxy ```yaml services: obsidian: - image: 'ghcr.io/sytone/obsidian-remote:latest' + image: 'ghcr.io/drdada/obsidian-remote:latest' container_name: obsidian-remote restart: unless-stopped ports: @@ -314,4 +297,8 @@ docker run --rm -it ` Open the KasmVNC menu on the middle right and select clipboard +## Credits + +Thanks to the original author @sytone + From 5202c8a23e3b95bf7679a232cb232e65c4fdc1ea Mon Sep 17 00:00:00 2001 From: Drdada Date: Sat, 21 Oct 2023 10:59:56 +0000 Subject: [PATCH 8/8] Cleanup file and envfile example --- .env.example | 18 ++++++++++++++++-- .gitignore | 2 ++ dockerfile.amd64 | 33 --------------------------------- dockerfile.arm64 | 44 -------------------------------------------- 4 files changed, 18 insertions(+), 79 deletions(-) create mode 100644 .gitignore delete mode 100644 dockerfile.amd64 delete mode 100644 dockerfile.arm64 diff --git a/.env.example b/.env.example index 0accb8e..3ec0460 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,7 @@ -#Set your Nextcloud credentials and informations -#Please fill all the variables +#Set your credentials and informations (if needed) +# NEXTCLOUD +# Please fill all the variables # Nextcloud Username NC_USER= # Nextcloud Password @@ -9,3 +10,16 @@ NC_PASS= NC_HOST= # Folder path on your Nextcloud personal space e.g: /Obsidian NC_PATH= + +# Set credentials (mandatory if exposed on internet) +CUSTOM_USER= +PASSWORD= + +# Timezone used +TZ=Europe/Paris + +# If you use nginx-proxy +VIRTUAL_HOST= +VIRTUAL_PORT=8080 +LETSENCRYPT_HOST= + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1c79342 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.env +.env.local diff --git a/dockerfile.amd64 b/dockerfile.amd64 deleted file mode 100644 index d34062c..0000000 --- a/dockerfile.amd64 +++ /dev/null @@ -1,33 +0,0 @@ -FROM ghcr.io/linuxserver/baseimage-kasmvnc:debianbullseye - -# Update and install extra packages. -RUN echo "**** install packages ****" && \ - apt-get update && \ - apt-get install -y --no-install-recommends curl libgtk-3-0 libnotify4 libatspi2.0-0 libsecret-1-0 libnss3 desktop-file-utils && \ - apt-get autoclean && rm -rf /var/lib/apt/lists/* /var/tmp/* /tmp/* - -# Set version label -ARG OBSIDIAN_VERSION=1.3.5 - -# Download and install Obsidian -RUN echo "**** download obsidian ****" && \ - curl --location --output obsidian.deb "https://github.com/obsidianmd/obsidian-releases/releases/download/v${OBSIDIAN_VERSION}/obsidian_${OBSIDIAN_VERSION}_amd64.deb" && \ - dpkg -i obsidian.deb - -# Environment variables -ENV CUSTOM_PORT="8080" \ - CUSTOM_HTTPS_PORT="8443" \ - CUSTOM_USER="" \ - PASSWORD="" \ - SUBFOLDER="" \ - TITLE="Obsidian v${OBSIDIAN_VERSION}" \ - FM_HOME="/vaults" - -# Add local files -COPY root/ / - -EXPOSE 8080 8443 -VOLUME ["/config","/vaults"] - -# Define a healthcheck -HEALTHCHECK CMD curl --fail http://localhost:8080/ || exit 1 diff --git a/dockerfile.arm64 b/dockerfile.arm64 deleted file mode 100644 index 4bfd8ab..0000000 --- a/dockerfile.arm64 +++ /dev/null @@ -1,44 +0,0 @@ -# FROM ghcr.io/linuxserver/baseimage-rdesktop-web:focal-20210824 -FROM ghcr.io/linuxserver/baseimage-kasmvnc:debianbullseye - -ARG OBSIDIAN_VERSION=1.3.5 -ARG ARCH=arm64 - -# Update and install extra packages. -RUN echo "**** install packages ****" && \ - apt-get update && \ - apt-get install -y --no-install-recommends \ - git \ - curl \ - libnss3 \ - zlib1g-dev \ - dbus-x11 \ - uuid-runtime && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* /var/tmp/* /tmp/* - -# Download and install Obsidian -RUN echo "**** download obsidian ****" && \ - curl -L -o /obsidian.AppImage \ - "https://github.com/obsidianmd/obsidian-releases/releases/download/v${OBSIDIAN_VERSION}/Obsidian-${OBSIDIAN_VERSION}-${ARCH}.AppImage" && \ - chmod +x /obsidian.AppImage && \ - /obsidian.AppImage --appimage-extract - -# Environment variables -ENV CUSTOM_PORT="8080" \ - CUSTOM_HTTPS_PORT="8443" \ - CUSTOM_USER="" \ - PASSWORD="" \ - SUBFOLDER="" \ - TITLE="Obsidian v$OBSIDIAN_VERSION" \ - FM_HOME="/vaults" - -# Add local files -COPY root/ / - -# Expose ports and volumes -EXPOSE 8080 27123 27124 -VOLUME ["/config","/vaults"] - -# Define a healthcheck -HEALTHCHECK CMD curl --fail http://localhost:8080/ || exit 1