diff --git a/.dockerignore b/.dockerignore index e0f0209..0fb6d0a 100644 --- a/.dockerignore +++ b/.dockerignore @@ -5,4 +5,6 @@ .vscode READMETEMPLATE.md README.md -LICENSE \ No newline at end of file +LICENSE +.editorconfig +assets diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..27d4bd5 --- /dev/null +++ b/.editorconfig @@ -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 diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index dd84ea7..3205926 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -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. diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 1ae86b6..2659b8c 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -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' diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..34dfacb --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "docker.languageserver.formatter.ignoreMultilineInstructions": true +} \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index d8cec55..172b751 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -116,7 +116,7 @@ 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. +. Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). @@ -124,5 +124,5 @@ 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. +. Translations are available at +. diff --git a/Dockerfile b/Dockerfile index 9619133..0b2e76d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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" \ diff --git a/README.md b/README.md index 896059e..2c05723 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,12 @@ docker run -d ` 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 diff --git a/assets/ReloadExample.gif b/assets/ReloadExample.gif new file mode 100644 index 0000000..3e078c7 Binary files /dev/null and b/assets/ReloadExample.gif differ diff --git a/root/defaults/autostart b/root/defaults/autostart index 8894e07..f5838d8 100644 --- a/root/defaults/autostart +++ b/root/defaults/autostart @@ -1 +1 @@ -/squashfs-root/obsidian --no-sandbox --disable-dev-shm-usage --disable-gpu --disable-software-rasterizer \ No newline at end of file +/squashfs-root/obsidian --no-sandbox --disable-dev-shm-usage --disable-gpu --disable-software-rasterizer diff --git a/root/defaults/menu.xml b/root/defaults/menu.xml index 97eeac7..90fe8a9 100644 --- a/root/defaults/menu.xml +++ b/root/defaults/menu.xml @@ -1,9 +1,9 @@ - + - /squashfs-root/obsidian --no-sandbox + /squashfs-root/obsidian --no-sandbox --disable-dev-shm-usage --disable-gpu --disable-software-rasterizer @@ -15,4 +15,4 @@ - \ No newline at end of file + diff --git a/root/defaults/startwm.sh b/root/defaults/startwm.sh index 209b276..86e4128 100644 --- a/root/defaults/startwm.sh +++ b/root/defaults/startwm.sh @@ -1,3 +1,3 @@ #!/bin/bash /startpulse.sh & -/usr/bin/openbox-session > /dev/null 2>&1 \ No newline at end of file +/usr/bin/openbox-session > /dev/null 2>&1 diff --git a/root/etc/cont-init.d/56-openboxcopy b/root/etc/cont-init.d/56-openboxcopy new file mode 100644 index 0000000..f22df65 --- /dev/null +++ b/root/etc/cont-init.d/56-openboxcopy @@ -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