diff --git a/.github/workflows/site-pr.yml b/.github/workflows/site-pr.yml index bf9f6804..c3075c93 100644 --- a/.github/workflows/site-pr.yml +++ b/.github/workflows/site-pr.yml @@ -1,7 +1,10 @@ -name: Build Site Image +name: Build Site on: pull_request: + paths: + - 'www' + - '*.md' jobs: build: @@ -13,11 +16,5 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - - name: Build - uses: docker/build-push-action@v4 - with: - context: . - file: ./Dockerfile.site - platforms: linux/amd64,linux/arm64 - push: false - + - name: Build site + run: make site diff --git a/.github/workflows/site-publish.yml b/.github/workflows/site-publish.yml index 66dc5a53..e3618a99 100644 --- a/.github/workflows/site-publish.yml +++ b/.github/workflows/site-publish.yml @@ -1,4 +1,4 @@ -name: Build and Push Site Image +name: Build and Deploy Site on: push: @@ -6,39 +6,6 @@ on: - master jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Log in to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Log in to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v4 - with: - context: . - file: ./Dockerfile.site - push: true - platforms: linux/amd64,linux/arm64 - tags: | - filebrowser/site:latest - ghcr.io/filebrowser/site:latest - deploy: permissions: contents: read @@ -61,5 +28,5 @@ jobs: with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - command: pages deploy site/public/site --project-name=${{ secrets.CLOUDFLARE_PROJECT_NAME }} + command: pages deploy www/public --project-name=${{ secrets.CLOUDFLARE_PROJECT_NAME }} gitHubToken: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 559f056c..47f34732 100644 --- a/.gitignore +++ b/.gitignore @@ -42,4 +42,3 @@ build/ default.nix Dockerfile.dev -site/public/ \ No newline at end of file diff --git a/docs/code-of-conduct.md b/CODE-OF-CONDUCT.md similarity index 100% rename from docs/code-of-conduct.md rename to CODE-OF-CONDUCT.md diff --git a/docs/contributing.md b/CONTRIBUTING.md similarity index 97% rename from docs/contributing.md rename to CONTRIBUTING.md index b72c6b70..f442f9dd 100644 --- a/docs/contributing.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributing -If you're interested in contributing to this project, this is the best place to start. Before contributing to this project, please take a bit of time to read our [Code of Conduct](code-of-conduct.md). Also, note that this project is open-source and licensed under [Apache License 2.0](../LICENSE). +If you're interested in contributing to this project, this is the best place to start. Before contributing to this project, please take a bit of time to read our [Code of Conduct](code-of-conduct.md). Also, note that this project is open-source and licensed under [Apache License 2.0](https://github.com/filebrowser/filebrowser/blob/master/LICENSE). ## Project Structure diff --git a/Dockerfile.site b/Dockerfile.site deleted file mode 100644 index a589e2b9..00000000 --- a/Dockerfile.site +++ /dev/null @@ -1,22 +0,0 @@ -FROM squidfunk/mkdocs-material as build - -WORKDIR /build -COPY site/requirements.txt /build/requirements.txt -RUN pip install --no-cache-dir -r requirements.txt -COPY LICENSE /build/docs/LICENSE - -COPY site/ /build/ - -COPY docs/ /build/docs/docs -COPY README.md /build/docs/index.md - -RUN mkdocs build - - -FROM ghcr.io/umputun/reproxy -# enables automatic changelog generation by tools like Dependabot -LABEL org.opencontainers.image.source="https://github.com/filebrowser/filebrowser" -COPY --from=build /build/site /srv/site -EXPOSE 8080 -USER app -ENTRYPOINT ["/srv/reproxy", "--assets.location=/srv/site", "--assets.cache=30d", "--assets.cache=text/html:30s"] \ No newline at end of file diff --git a/Dockerfile.site.dev b/Dockerfile.site.dev deleted file mode 100644 index b0233752..00000000 --- a/Dockerfile.site.dev +++ /dev/null @@ -1,15 +0,0 @@ -FROM squidfunk/mkdocs-material - -# Install inotify-tools for watching file changes -RUN apk add --no-cache inotify-tools - -WORKDIR /build - -COPY site/ /build/ -RUN pip install --no-cache-dir -r requirements.txt - -# Expose the port for mkdocs serve -EXPOSE 8000 - -# The entrypoint will run the initial setup and then start the server. -ENTRYPOINT ["mkdocs", "serve", "-a", "0.0.0.0:8000", "--dirtyreload"] diff --git a/Makefile b/Makefile index 3120f8b5..6918c8be 100644 --- a/Makefile +++ b/Makefile @@ -55,18 +55,25 @@ bump-version: $(standard-version) ## Bump app version .PHONY: site site: ## Build site - @rm -rf site/public/site* - @docker rm -f spot-site - docker build -f Dockerfile.site --progress=plain -t filebrowser.site . - docker run -d --name=filebrowser-site filebrowser.site - sleep 3 - docker cp "filebrowser-site":/srv/site/ site/public - docker rm -f filebrowser-site + @rm -rf www/public + docker build -f www/Dockerfile --progress=plain -t filebrowser.site www + docker run --rm -it -v $(CURDIR)/www:/docs \ + -v $(CURDIR)/SECURITY.md:/docs/docs/security.md \ + -v $(CURDIR)/CHANGELOG.md:/docs/docs/changelog.md \ + -v $(CURDIR)/CODE-OF-CONDUCT.md:/docs/docs/code-of-conduct.md \ + -v $(CURDIR)/CONTRIBUTING.md:/docs/docs/contributing.md \ + filebrowser.site build -d "public" .PHONY: site-serve site-serve: ## Serve site for development - docker build -f Dockerfile.site.dev -t filebrowser.site.dev . - docker run --rm -it -p 8000:8000 -v $(CURDIR)/docs:/build/docs/docs -v $(CURDIR)/README.md:/build/docs/index.md filebrowser.site.dev + docker build -f www/Dockerfile --progress=plain -t filebrowser.site www + docker run --rm -it -p 8000:8000 \ + -v $(CURDIR)/www:/docs \ + -v $(CURDIR)/SECURITY.md:/docs/docs/security.md \ + -v $(CURDIR)/CHANGELOG.md:/docs/docs/changelog.md \ + -v $(CURDIR)/CODE-OF-CONDUCT.md:/docs/docs/code-of-conduct.md \ + -v $(CURDIR)/CONTRIBUTING.md:/docs/docs/contributing.md \ + filebrowser.site ## Help: help: ## Show this help diff --git a/docs/security.md b/SECURITY.md similarity index 100% rename from docs/security.md rename to SECURITY.md diff --git a/scripts/watch.sh b/scripts/watch.sh deleted file mode 100644 index 1b8a15af..00000000 --- a/scripts/watch.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -# Initial setup -cp /tmp/README.md /build/docs/index.md -sed -i 's|site/docs/||g' /build/docs/index.md - -# Start mkdocs in the background -mkdocs serve -a 0.0.0.0:8000 --dirtyreload & - -# Watch for changes in README.md -while true; do - inotifywait -e modify /tmp/README.md - echo "README.md changed. Updating index.md..." - cp /tmp/README.md /build/docs/index.md - sed -i 's|site/docs/||g' /build/docs/index.md -done - diff --git a/site/public/.keep b/site/public/.keep deleted file mode 100644 index e69de29b..00000000 diff --git a/www/.gitignore b/www/.gitignore new file mode 100644 index 00000000..a7d69f33 --- /dev/null +++ b/www/.gitignore @@ -0,0 +1,5 @@ +docs/code-of-conduct.md +docs/contributing.md +docs/security.md +docs/changelog.md +public diff --git a/www/Dockerfile b/www/Dockerfile new file mode 100644 index 00000000..93d6dc26 --- /dev/null +++ b/www/Dockerfile @@ -0,0 +1,4 @@ +FROM squidfunk/mkdocs-material + +COPY requirements.txt requirements.txt +RUN pip install --no-cache-dir -r requirements.txt diff --git a/docs/configuration.md b/www/docs/configuration.md similarity index 98% rename from docs/configuration.md rename to www/docs/configuration.md index 03d677d5..bc4f0ac8 100644 --- a/docs/configuration.md +++ b/www/docs/configuration.md @@ -10,7 +10,7 @@ You are able to customize your File Browser installation by changing its name to * **Disable external links:** this will disable any external links (except the ones to this documentation). * **Folder:** is the path to a directory that can contain two items: * **custom.css**, containing the styles you want to apply to your installation. - * **img** a directory whose files can replace the [default logotypes](../frontend/public/img) in the application. + * **img** a directory whose files can replace the [default logotypes](https://github.com/filebrowser/filebrowser/tree/master/frontend/public/img) in the application. These options can be either set via the CLI interface using the following command: diff --git a/www/docs/index.md b/www/docs/index.md new file mode 100644 index 00000000..bbdb6c5c --- /dev/null +++ b/www/docs/index.md @@ -0,0 +1,59 @@ + + +

+ +

+ +![Preview](static/example.gif) + +> [!WARNING] +> +> This project is currently on **maintenance-only** mode. For more information, read the information on [GitHub](https://github.com/filebrowser/filebrowser#status). + +File Browser provides a file managing interface within a specified directory and it can be used to upload, delete, preview and edit your files. It is a **create-your-own-cloud**-kind of software where you can just install it on your server, direct it to a path and access your files through a nice web interface. + +## Features + +
+ +- **Easy Login System** + + --- + + ![](./static/1.jpg) + +- **Sleek Interface** + + --- + + ![](./static/2.jpg) + +- **User Management** + + --- + + ![](./static/3.jpg) + +- **File Editing** + + --- + + ![](./static/4.jpg) + +- **Custom Commands** + + --- + + ![](./static/5.jpg) + +- **Customization** + + --- + + ![](./static/6.jpg) + +
diff --git a/docs/installation.md b/www/docs/installation.md similarity index 100% rename from docs/installation.md rename to www/docs/installation.md diff --git a/docs/assets/1.jpg b/www/docs/static/1.jpg similarity index 100% rename from docs/assets/1.jpg rename to www/docs/static/1.jpg diff --git a/docs/assets/2.jpg b/www/docs/static/2.jpg similarity index 100% rename from docs/assets/2.jpg rename to www/docs/static/2.jpg diff --git a/docs/assets/3.jpg b/www/docs/static/3.jpg similarity index 100% rename from docs/assets/3.jpg rename to www/docs/static/3.jpg diff --git a/docs/assets/4.jpg b/www/docs/static/4.jpg similarity index 100% rename from docs/assets/4.jpg rename to www/docs/static/4.jpg diff --git a/docs/assets/5.jpg b/www/docs/static/5.jpg similarity index 100% rename from docs/assets/5.jpg rename to www/docs/static/5.jpg diff --git a/docs/assets/6.jpg b/www/docs/static/6.jpg similarity index 100% rename from docs/assets/6.jpg rename to www/docs/static/6.jpg diff --git a/www/docs/static/example.gif b/www/docs/static/example.gif new file mode 100644 index 00000000..1387a0cd Binary files /dev/null and b/www/docs/static/example.gif differ diff --git a/docs/assets/favicon.png b/www/docs/static/favicon.png similarity index 100% rename from docs/assets/favicon.png rename to www/docs/static/favicon.png diff --git a/docs/assets/logo.png b/www/docs/static/logo.png similarity index 100% rename from docs/assets/logo.png rename to www/docs/static/logo.png diff --git a/site/mkdocs.yml b/www/mkdocs.yml similarity index 69% rename from site/mkdocs.yml rename to www/mkdocs.yml index 8ca934e2..0b82e492 100644 --- a/site/mkdocs.yml +++ b/www/mkdocs.yml @@ -5,27 +5,26 @@ site_url: 'https://filebrowser.org' repo_name: 'filebrowser/filebrowser' repo_url: 'https://github.com/filebrowser/filebrowser' -edit_uri: 'edit/master/docs/' copyright: 'Copyright © 2025 File Browser Community' theme: name: material language: en - logo: docs/assets/logo.png - favicon: docs/assets/favicon.png + logo: static/logo.png + favicon: static/favicon.png palette: - scheme: default primary: blue accent: light blue toggle: - icon: material/brightness-7 + icon: material/lightbulb name: Switch to dark mode - scheme: slate primary: blue accent: light blue toggle: - icon: material/brightness-4 + icon: material/lightbulb-outline name: Switch to light mode font: @@ -34,11 +33,11 @@ theme: features: - navigation.tabs - - navigation.tabs.sticky - navigation.sections - navigation.expand - navigation.indexes - navigation.top + - navigation.tabs.sticky - navigation.instant - search.suggest - search.highlight @@ -71,15 +70,7 @@ markdown_extensions: - md_in_html - toc: permalink: true - - pymdownx.arithmatex: - generic: true - - pymdownx.betterem: - smart_enable: all - pymdownx.caret - - pymdownx.details - - pymdownx.emoji: - emoji_index: !!python/name:material.extensions.emoji.twemoji - emoji_generator: !!python/name:material.extensions.emoji.to_svg - pymdownx.highlight: anchor_linenums: true use_pygments: true @@ -87,11 +78,7 @@ markdown_extensions: - pymdownx.keys - pymdownx.mark - pymdownx.smartsymbols - - pymdownx.superfences: - custom_fences: - - name: mermaid - class: mermaid - format: !!python/name:pymdownx.superfences.fence_code_format + - pymdownx.superfences - pymdownx.tabbed: alternate_style: true - pymdownx.tasklist: @@ -110,10 +97,10 @@ extra: nav: - Home: index.md - - Getting Started: - - Installation: docs/installation.md - - Configuration: docs/configuration.md - - Security: docs/security.md + - Installation: installation.md + - Configuration: configuration.md - Contributing: - - Contributing: docs/contributing.md - - Code of Conduct: docs/code-of-conduct.md + - Contributing: contributing.md + - Code of Conduct: code-of-conduct.md + - Security Policy: security.md + - Changelog: changelog.md diff --git a/site/requirements.txt b/www/requirements.txt similarity index 100% rename from site/requirements.txt rename to www/requirements.txt