docs: improvements to building and docs (#5234)

This commit is contained in:
Henrique Dias 2025-06-29 09:28:39 +02:00 committed by GitHub
parent 5a07291306
commit 2d1a82b73f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
28 changed files with 122 additions and 170 deletions

View File

@ -1,7 +1,10 @@
name: Build Site Image name: Build Site
on: on:
pull_request: pull_request:
paths:
- 'www'
- '*.md'
jobs: jobs:
build: build:
@ -13,11 +16,5 @@ jobs:
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2 uses: docker/setup-buildx-action@v2
- name: Build - name: Build site
uses: docker/build-push-action@v4 run: make site
with:
context: .
file: ./Dockerfile.site
platforms: linux/amd64,linux/arm64
push: false

View File

@ -1,4 +1,4 @@
name: Build and Push Site Image name: Build and Deploy Site
on: on:
push: push:
@ -6,39 +6,6 @@ on:
- master - master
jobs: 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: deploy:
permissions: permissions:
contents: read contents: read
@ -61,5 +28,5 @@ jobs:
with: with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} 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 }} gitHubToken: ${{ secrets.GITHUB_TOKEN }}

1
.gitignore vendored
View File

@ -42,4 +42,3 @@ build/
default.nix default.nix
Dockerfile.dev Dockerfile.dev
site/public/

View File

@ -1,6 +1,6 @@
# Contributing # 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](LICENSE).
## Project Structure ## Project Structure

View File

@ -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"]

View File

@ -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"]

View File

@ -55,18 +55,27 @@ bump-version: $(standard-version) ## Bump app version
.PHONY: site .PHONY: site
site: ## Build site site: ## Build site
@rm -rf site/public/site* @rm -rf www/public
@docker rm -f spot-site docker build -f www/Dockerfile --progress=plain -t filebrowser.site www
docker build -f Dockerfile.site --progress=plain -t filebrowser.site . docker run --rm -v $(CURDIR)/www:/docs \
docker run -d --name=filebrowser-site filebrowser.site -v $(CURDIR)/LICENSE:/docs/docs/LICENSE \
sleep 3 -v $(CURDIR)/SECURITY.md:/docs/docs/security.md \
docker cp "filebrowser-site":/srv/site/ site/public -v $(CURDIR)/CHANGELOG.md:/docs/docs/changelog.md \
docker rm -f filebrowser-site -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 .PHONY: site-serve
site-serve: ## Serve site for development site-serve: ## Serve site for development
docker build -f Dockerfile.site.dev -t filebrowser.site.dev . docker build -f www/Dockerfile --progress=plain -t filebrowser.site www
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 run --rm -it -p 8000:8000 \
-v $(CURDIR)/www:/docs \
-v $(CURDIR)/LICENSE:/docs/docs/LICENSE \
-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:
help: ## Show this help help: ## Show this help

View File

@ -1,17 +1,20 @@
#
<p align="center"> <p align="center">
<img src="https://raw.githubusercontent.com/filebrowser/logo/master/banner.png" width="550"/> <img src="https://raw.githubusercontent.com/filebrowser/logo/master/banner.png" width="550"/>
</p> </p>
![Preview](https://user-images.githubusercontent.com/5447088/50716739-ebd26700-107a-11e9-9817-14230c53efd2.gif)
[![Build](https://github.com/filebrowser/filebrowser/actions/workflows/main.yaml/badge.svg)](https://github.com/filebrowser/filebrowser/actions/workflows/main.yaml) [![Build](https://github.com/filebrowser/filebrowser/actions/workflows/main.yaml/badge.svg)](https://github.com/filebrowser/filebrowser/actions/workflows/main.yaml)
[![Go Report Card](https://goreportcard.com/badge/github.com/filebrowser/filebrowser?style=flat-square)](https://goreportcard.com/report/github.com/filebrowser/filebrowser) [![Go Report Card](https://goreportcard.com/badge/github.com/filebrowser/filebrowser)](https://goreportcard.com/report/github.com/filebrowser/filebrowser)
[![Documentation](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat-square)](http://godoc.org/github.com/filebrowser/filebrowser) [![Documentation](https://img.shields.io/badge/godoc-reference-blue.svg)](http://godoc.org/github.com/filebrowser/filebrowser)
[![Version](https://img.shields.io/github/release/filebrowser/filebrowser.svg?style=flat-square)](https://github.com/filebrowser/filebrowser/releases/latest) [![Version](https://img.shields.io/github/release/filebrowser/filebrowser.svg)](https://github.com/filebrowser/filebrowser/releases/latest)
[![Chat IRC](https://img.shields.io/badge/freenode-%23filebrowser-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23filebrowser) [![Chat IRC](https://img.shields.io/badge/freenode-%23filebrowser-blue.svg)](http://webchat.freenode.net/?channels=%23filebrowser)
filebrowser provides a file managing interface within a specified directory and it can be used to upload, delete, preview, rename and edit your files. It allows the creation of multiple users and each user can have its own directory. It can be used as a standalone app. 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.
## Documentation
Documentation on how to install, configure, and contribute to this project is hosted at [filebrowser.org](https://filebrowser.org).
## Project Status
> [!WARNING] > [!WARNING]
> >
@ -25,28 +28,3 @@ filebrowser provides a file managing interface within a specified directory and
[issues]: https://github.com/filebrowser/filebrowser/issues [issues]: https://github.com/filebrowser/filebrowser/issues
[discussions]: https://github.com/filebrowser/filebrowser/discussions [discussions]: https://github.com/filebrowser/filebrowser/discussions
## Features
File Browser is a **create-your-own-cloud-kind** of software where you can install it on a server, direct it to a path and then access your files through a nice web interface. You have many available features!
| Easy Login System | Sleek Interface | User Management |
| :----------------------: | :----------------------: | :----------------------: |
| ![](docs/assets/1.jpg) | ![](docs/assets/2.jpg) | ![](docs/assets/3.jpg) |
| File Editing | Custom Commands | Customization |
| :----------------------: | :----------------------: | :----------------------: |
| ![](docs/assets/4.jpg) | ![](docs/assets/5.jpg) | ![](docs/assets/6.jpg) |
## Install
For information on how to install File Browser, please check [installation](docs/installation.md).
## Configuration
For information on how to configure File Browser, please check [configuration](docs/configuration.md).
## Contributing
For information on how to contribute to the project, including how translations are managed, please check [contributing](docs/contributing.md).

View File

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

View File

6
www/.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
docs/LICENSE
docs/code-of-conduct.md
docs/contributing.md
docs/security.md
docs/changelog.md
public

4
www/Dockerfile Normal file
View File

@ -0,0 +1,4 @@
FROM squidfunk/mkdocs-material
COPY requirements.txt requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

View File

@ -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). * **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: * **Folder:** is the path to a directory that can contain two items:
* **custom.css**, containing the styles you want to apply to your installation. * **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: These options can be either set via the CLI interface using the following command:

59
www/docs/index.md Normal file
View File

@ -0,0 +1,59 @@
<style>
.md-content .md-typeset h1 {
display: none;
}
</style>
<p align="center">
<img src="https://raw.githubusercontent.com/filebrowser/logo/master/banner.png" width="550"/>
</p>
![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#project-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
<div class="grid cards" markdown>
- **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)
</div>

View File

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 65 KiB

View File

Before

Width:  |  Height:  |  Size: 116 KiB

After

Width:  |  Height:  |  Size: 116 KiB

View File

Before

Width:  |  Height:  |  Size: 151 KiB

After

Width:  |  Height:  |  Size: 151 KiB

View File

Before

Width:  |  Height:  |  Size: 212 KiB

After

Width:  |  Height:  |  Size: 212 KiB

View File

Before

Width:  |  Height:  |  Size: 130 KiB

After

Width:  |  Height:  |  Size: 130 KiB

View File

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

BIN
www/docs/static/example.gif vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 477 KiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -1,31 +1,30 @@
site_name: Filebrowser site_name: File Browser
site_description: 'A web-based file browser and manager for your files' site_description: 'A web-based file browser and manager for your files'
site_author: 'Filebrowser Community' site_author: 'File Browser Community'
site_url: 'https://filebrowser.org' site_url: 'https://filebrowser.org'
repo_name: 'filebrowser/filebrowser' repo_name: 'filebrowser/filebrowser'
repo_url: 'https://github.com/filebrowser/filebrowser' repo_url: 'https://github.com/filebrowser/filebrowser'
edit_uri: 'edit/master/docs/'
copyright: 'Copyright &copy; 2025 Filebrowser Community' copyright: 'Copyright &copy; 2025 File Browser Community'
theme: theme:
name: material name: material
language: en language: en
logo: docs/assets/logo.png logo: static/logo.png
favicon: docs/assets/favicon.png favicon: static/favicon.png
palette: palette:
- scheme: default - scheme: default
primary: blue primary: blue
accent: light blue accent: light blue
toggle: toggle:
icon: material/brightness-7 icon: material/lightbulb
name: Switch to dark mode name: Switch to dark mode
- scheme: slate - scheme: slate
primary: blue primary: blue
accent: light blue accent: light blue
toggle: toggle:
icon: material/brightness-4 icon: material/lightbulb-outline
name: Switch to light mode name: Switch to light mode
font: font:
@ -71,15 +70,7 @@ markdown_extensions:
- md_in_html - md_in_html
- toc: - toc:
permalink: true permalink: true
- pymdownx.arithmatex:
generic: true
- pymdownx.betterem:
smart_enable: all
- pymdownx.caret - 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: - pymdownx.highlight:
anchor_linenums: true anchor_linenums: true
use_pygments: true use_pygments: true
@ -87,11 +78,7 @@ markdown_extensions:
- pymdownx.keys - pymdownx.keys
- pymdownx.mark - pymdownx.mark
- pymdownx.smartsymbols - pymdownx.smartsymbols
- pymdownx.superfences: - pymdownx.superfences
custom_fences:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format
- pymdownx.tabbed: - pymdownx.tabbed:
alternate_style: true alternate_style: true
- pymdownx.tasklist: - pymdownx.tasklist:
@ -110,10 +97,10 @@ extra:
nav: nav:
- Home: index.md - Home: index.md
- Getting Started: - Installation: installation.md
- Installation: docs/installation.md - Configuration: configuration.md
- Configuration: docs/configuration.md
- Security: docs/security.md
- Contributing: - Contributing:
- Contributing: docs/contributing.md - Contributing: contributing.md
- Code of Conduct: docs/code-of-conduct.md - Code of Conduct: code-of-conduct.md
- Security Policy: security.md
- Changelog: changelog.md