@@ -5,4 +5,6 @@
.vscode
READMETEMPLATE.md
README.md
LICENSE
LICENSE
.editorconfig
assets
@@ -0,0 +1,19 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
# trim_trailing_whitespace may cause unintended issues and should not be globally set true
trim_trailing_whitespace = false

[{Dockerfile*,**.yml}]
indent_style = space
indent_size = 2

[{**.sh,root/etc/cont-init.d/**,root/etc/services.d/**}]
indent_style = space
indent_size = 4
@@ -12,6 +12,7 @@ A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
@@ -24,15 +25,17 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
@@ -5,7 +5,7 @@

version: 2
updates:
- package-ecosystem: "docker" # See documentation for possible values
directory: "/" # Location of package manifests
- package-ecosystem: 'docker' # See documentation for possible values
directory: '/' # Location of package manifests
schedule:
interval: "daily"
interval: 'daily'
@@ -0,0 +1,3 @@
{
"docker.languageserver.formatter.ignoreMultilineInstructions": true
}
@@ -116,13 +116,13 @@ the community.

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
<https://www.contributor-covenant.org/version/2/0/code_of_conduct.html>.

Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
<https://www.contributor-covenant.org/faq>. Translations are available at
<https://www.contributor-covenant.org/translations>.
@@ -7,36 +7,36 @@ LABEL org.opencontainers.image.description="Hosted Obsidian instance allowing ac

RUN \
echo "**** install packages ****" && \
# Update and install extra packages.
apt-get update && \
apt-get install -y --no-install-recommends \
# Packages needed to download and extract obsidian.
curl \
libnss3 \
# Install Chrome dependencies.
dbus-x11 \
uuid-runtime && \
# Update and install extra packages.
apt-get update && \
apt-get install -y --no-install-recommends \
# Packages needed to download and extract obsidian.
curl \
libnss3 \
# Install Chrome dependencies.
dbus-x11 \
uuid-runtime && \
echo "**** cleanup ****" && \
apt-get autoclean && \
rm -rf \
/var/lib/apt/lists/* \
/var/tmp/* \
/tmp/*
apt-get autoclean && \
rm -rf \
/var/lib/apt/lists/* \
/var/tmp/* \
/tmp/*

# set version label
ARG OBSIDIAN_VERSION=0.13.31

RUN \
echo "**** download obsidian ****" && \
curl \
https://github.com/obsidianmd/obsidian-releases/releases/download/v$OBSIDIAN_VERSION/Obsidian-$OBSIDIAN_VERSION.AppImage \
-L \
-o obsidian.AppImage
curl \
https://github.com/obsidianmd/obsidian-releases/releases/download/v$OBSIDIAN_VERSION/Obsidian-$OBSIDIAN_VERSION.AppImage \
-L \
-o obsidian.AppImage

RUN \
echo "**** extract obsidian ****" && \
chmod +x /obsidian.AppImage && \
/obsidian.AppImage --appimage-extract
chmod +x /obsidian.AppImage && \
/obsidian.AppImage --appimage-extract

ENV \
CUSTOM_PORT="8080" \
@@ -4,36 +4,64 @@ This docker image allows you to run obsidian in docker as a container and access

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!!

## Using Container
## Using the Container

To run a interactive version to test it out. This is using windows based path, update for the OS you are running on.

```PowerShell
docker run --rm -it `
-v D:/ob/vaults:/vaults `
-v D:/ob/config:/config/.config/obsidian `
-v D:/ob/config:/config `
-p 8080:8080 `
ghcr.io/sytone/obsidian-remote:latest
```

To run it as a daemon.
To run it as a daemon in the background.

```PowerShell
docker run -d `
-v D:/ob/vaults:/vaults `
-v D:/ob/config:/config/.config/obsidian `
-v D:/ob/config:/config `
-p 8080:8080 `
ghcr.io/sytone/obsidian-remote:latest
```

### Mapped Volumes

| Path | Description |
| --------- | ------------------------------------------------------------------------- |
| `/vaults` | The location on the host for your Obsidian Vaults |
| `/config` | The location to store Obsidan configuration and ssh data for obsidian-git |

## Enabling GIT for the obsidian-git plugin

This container uses the base images from linuxserver.io. This means you can the linuxserver.io mods. To add support for git add the `DOCKER_MODS` environment variable like so `DOCKER_MODS=linuxserver/mods:universal-git`.

### Docker CLI example

```PowerShell
docker run -d `
-v D:/ob/vaults:/vaults `
-v D:/ob/config:/config `
-p 8080:8080 `
-e DOCKER_MODS=linuxserver/mods:universal-git `
ghcr.io/sytone/obsidian-remote:latest
```

## Reloading Obsidan in the Browser

If you make changes to plugins or do updates that need to have obsidian restarted, instead of having to stop and start the docker container you can just close the Obsidian UI and right click to show the menus and reopen it. Here is a short clip showing how to do it.

![Reloading Obsidian in the Browser](./assets/ReloadExample.gif)

## 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

```PowerShell
docker run --rm -it `
-v D:/ob/vaults:/vaults `
-v D:/ob/config:/config/.config/obsidian `
-v D:/ob/config:/config `
-e PUID=1000 `
-e PGID=1000 `
-p 8080:8080 `
@@ -70,7 +98,7 @@ To run the localy build image:
```PowerShell
docker run --rm -it `
-v D:/ob/vaults:/vaults `
-v D:/ob/config:/config/.config/obsidian `
-v D:/ob/config:/config `
-p 8080:8080 `
obsidian-remote:latest bash
```
@@ -88,7 +116,7 @@ services:
- 8585:8080
volumes:
- /home/obsidian/vaults:/vaults
- /home/obsidian/config:/config/.config/obsidian
- /home/obsidian/config:/config
environment:
- PUID=1000
- PGID=1000
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -1 +1 @@
/squashfs-root/obsidian --no-sandbox --disable-dev-shm-usage --disable-gpu --disable-software-rasterizer
/squashfs-root/obsidian --no-sandbox --disable-dev-shm-usage --disable-gpu --disable-software-rasterizer
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<openbox_menu xmlns="http://openbox.org/3.4/menu">
<menu id="root-menu" label="MENU">
<item label="Calibre GUI">
<item label="Obsidian" icon="/squashfs-root/usr/share/icons/hicolor/48x48/apps/obsidian.png">
<action name="Execute">
<command>/squashfs-root/obsidian --no-sandbox </command>
<command>/squashfs-root/obsidian --no-sandbox --disable-dev-shm-usage --disable-gpu --disable-software-rasterizer</command>
</action>
</item>
<item label="xterm" icon="/usr/share/pixmaps/xterm-color_48x48.xpm">
@@ -15,4 +15,4 @@
<action name="Reconfigure" />
</item>
</menu>
</openbox_menu>
</openbox_menu>
@@ -1,3 +1,3 @@
#!/bin/bash
/startpulse.sh &
/usr/bin/openbox-session > /dev/null 2>&1
/usr/bin/openbox-session > /dev/null 2>&1
@@ -0,0 +1,7 @@
#!/usr/bin/with-contenv bash

# default file copies first run
[[ ! -f /config/.config/openbox/menu.xml ]] && \
mkdir -p /config/.config/openbox && \
cp /defaults/menu.xml /config/.config/openbox/menu.xml && \
chown -R abc:abc /config/.config