diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml new file mode 100644 index 00000000..8cca12c9 --- /dev/null +++ b/.github/workflows/dev.yml @@ -0,0 +1,59 @@ +name: Docker Build DEV + +# Controls when the workflow will run +on: + workflow_dispatch: + push: + branches: + - 'dev' + tags: + - '*.*.*' + pull_request: + branches: + - 'dev' + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + build: + runs-on: ubuntu-latest + steps: + # Get the repository's code + - name: Checkout + uses: actions/checkout@v3 + # https://github.com/docker/setup-qemu-action + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + # https://github.com/docker/setup-buildx-action + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + - name: Login to Docker Hub + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Docker meta + id: meta # you'll use this in the next step + uses: docker/metadata-action@v4 + with: + # list of Docker images to use as base name for tags + images: | + sec77/perlite + # Docker tags based on the following events/attributes + tags: | + type=ref,event=branch + # type=ref,event=pr + # type=semver,pattern={{version}} + # type=semver,pattern={{major}}.{{minor}} + # type=semver,pattern={{major}} + # type=sha + # type=schedule + - name: Build and push + uses: docker/build-push-action@v4 + with: + context: ./perlite + platforms: linux/amd64,linux/arm/v7 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8f96a2e6..c0c15e24 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,16 +1,16 @@ -name: Docker Builds +name: Docker Build Main # Controls when the workflow will run on: workflow_dispatch: push: branches: - - 'dev' + - 'main' tags: - '*.*.*' pull_request: branches: - - 'dev' + - 'main' # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -42,9 +42,9 @@ jobs: sec77/perlite # Docker tags based on the following events/attributes tags: | - type=ref,event=branch + type=pep440,pattern={{version}} + # type=ref,event=branch # type=ref,event=pr - # type=semver,pattern={{version}} # type=semver,pattern={{major}}.{{minor}} # type=semver,pattern={{major}} # type=sha diff --git a/.gitignore b/.gitignore index 72075b72..d5843802 100644 --- a/.gitignore +++ b/.gitignore @@ -13,8 +13,7 @@ perlite/Demo/.obsidian/workspace.json perlite/Demo/Test Canvas.canvas perlite/logo2.svg Thumbs.db -ParsedownExtra.php perlite-dev _Notes perlite/.scripts/vendor -release.sh \ No newline at end of file +perlite/.scripts/release.sh \ No newline at end of file diff --git a/README.md b/README.md index 9a2871cb..7ebc9478 100644 --- a/README.md +++ b/README.md @@ -36,47 +36,22 @@ If you want to discuss about Perlite you can join the [Perlite Discord Server](h - Dark and Light Mode - -## Changelog -[Changelog](https://github.com/secure-77/Perlite/blob/main/Changelog.md) - -### previous versions -- [Perlite 1.4.4 Demo](https://perlite.secure77.de/1.4.4) -- [Perlite 1.3 Demo](https://perlite.secure77.de/1.3) - -## Wiki -Please check the [wiki](https://github.com/secure-77/Perlite/wiki) - - ## Install -Just put the content of the perlite directory in your web root directory, your notes should resident as a subfolder of perlite. You only need to set your root direcotry. +Please make sure you read the [required settings](https://github.com/secure-77/Perlite/wiki/03---Perlite-Settings#required-settings) first! + +You can download the latest release from github or git clone the project and use docker. - For non Docker please check [Setup](https://github.com/secure-77/Perlite/wiki/01---Setup-(no-Docker)) - For Docker, please check [Docker Setup](https://github.com/secure-77/Perlite/wiki/02---Setup-Docker) -### Requirements -- Web server, tested with ![coverage](https://img.shields.io/badge/NGINX-1.24.0-blue) -- Php-fpm, tested with ![coverage](https://img.shields.io/badge/PHP-7.4.30-green) and ![coverage](https://img.shields.io/badge/PHP-8.2.6-green) -other webservers may work.. - -Please make sure you read also the [required settings](https://github.com/secure-77/Perlite/wiki/03---Perlite-Settings#required-settings) - - -## Themes -[Themes](https://github.com/secure-77/Perlite/wiki/Themes) - -## Graph -[Graph Setup and Settings](https://github.com/secure-77/Perlite/wiki/Graph) - -## Dependencies (all included) +## Wiki +Please check the [wiki](https://github.com/secure-77/Perlite/wiki), here you will find further information, for example: -- [![coverage](https://img.shields.io/badge/Parsedown-1.7.4-lightgrey)](https://github.com/erusev/parsedown) -- [![coverage](https://img.shields.io/badge/jQuery-3.7.0-lightblue)](https://jquery.com/) -- [![coverage](https://img.shields.io/badge/Highlight.js-11.7.0-green)](https://highlightjs.org/) -- [![coverage](https://img.shields.io/badge/vis.network-9.1.6-yellow)](https://visjs.org/) -- [![coverage](https://img.shields.io/badge/KaTeX-0.16.4-red)](https://katex.org/) -- [![coverage](https://img.shields.io/badge/Mermaid-8.12.1-orange)](https://mermaid-js.github.io/mermaid/) +- [Themes](https://github.com/secure-77/Perlite/wiki/Themes) +- [Graph Setup and Settings](https://github.com/secure-77/Perlite/wiki/Graph) +- [Perlite Settings](https://github.com/secure-77/Perlite/wiki/03---Perlite-Settings) +- [Troubleshooting](https://github.com/secure-77/Perlite/wiki/Troubleshooting) ## Security @@ -85,6 +60,17 @@ Please make sure you read also the [required settings](https://github.com/secure - You should prevent that the metadata.json file is direct accessible via the browser (only the php engine need access to it). The extracted metadata.json contains the whole obsidian structure, so this file could be sensitive if you plan to exclude some files or folders from Perlite. However, the parsing is done by the php engine and it checks for every path if the file really exists in the provided vault, so files you excluded from the vault will also not be visible in the graph, but they are still present in the metadata.json. This is why you should prevent access to it. +## Contributing +Want to contribute? Awesome! Please use the [dev branch](https://github.com/secure-77/Perlite/tree/dev) for pull requests. + + ## Why Perlite? [Wiki](https://en.wikipedia.org/wiki/Perlite): *Perlite is an amorphous volcanic glass ... typically formed by the hydration of obsidian.* + + +## Previous Versions and Changelog + +- [Changelog](https://github.com/secure-77/Perlite/blob/main/Changelog.md) +- [Perlite 1.4.4 Demo](https://perlite.secure77.de/1.4.4) +- [Perlite 1.3 Demo](https://perlite.secure77.de/1.3) \ No newline at end of file diff --git a/docker-compose-build.yml b/docker-compose-build.yml new file mode 100644 index 00000000..ae7a8b2f --- /dev/null +++ b/docker-compose-build.yml @@ -0,0 +1,41 @@ +version: "3.9" + +services: + perlite: + image: sec77/perlite:latest + container_name: perlite-build + environment: + - NOTES_PATH=Demo + - HIDE_FOLDERS=docs,private,trash + - LINE_BREAKS=true + - ALLOWED_FILE_LINK_TYPES=pdf + - DISABLE_POP_HOVER=true + - SHOW_TOC=true + - HOME_FILE=README + - FONT_SIZE=15 + - HTML_SAFE_MODE=true + - TEMP_PATH=/tmp + - SITE_TITLE=Demo + - SITE_TYPE=article + - SITE_URL= + - SITE_IMAGE= + - SITE_DESC= + - SITE_NAME= + - SITE_TWITTER= + volumes: + - ./perlite:/var/www/perlite + - ./perlite/Demo:/var/www/perlite/Demo:ro + + web: + build: + context: ./web + image: sec77/perlite_web:stable + container_name: perlite_web-build + ports: + - 80:80 + volumes: + - ./perlite:/var/www/perlite + - ./perlite/Demo:/var/www/perlite/Demo:ro + depends_on: + - perlite + diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml index b9a8cbe8..e3638518 100644 --- a/docker-compose-dev.yml +++ b/docker-compose-dev.yml @@ -2,15 +2,16 @@ version: "3.9" services: perlite: - image: sec77/perlite:latest - container_name: perlite + image: sec77/perlite:dev + container_name: perlite-dev + restart: unless-stopped environment: - NOTES_PATH=Demo - HIDE_FOLDERS=docs,private,trash - LINE_BREAKS=true - ALLOWED_FILE_LINK_TYPES=pdf - - DISABLE_POP_HOVER=true - - SHOW_TOC=true + - DISABLE_POP_HOVER=false + - SHOW_TOC=false - HOME_FILE=README - FONT_SIZE=15 - HTML_SAFE_MODE=true @@ -23,19 +24,18 @@ services: - SITE_NAME= - SITE_TWITTER= volumes: - - ./perlite:/var/www/perlite - ./perlite/Demo:/var/www/perlite/Demo:ro web: build: context: ./web image: sec77/perlite_web:stable - container_name: perlite_web-dev + container_name: perlite_web + restart: unless-stopped ports: - - 80:80 - volumes: - - ./perlite:/var/www/perlite - - ./perlite/Demo:/var/www/perlite/Demo:ro + - 80:80 + volumes_from: + - perlite depends_on: - perlite