├── .dockerignore ├── .github ├── FUNDING.yml └── workflows │ ├── cron.yml │ └── trivy-analysis.yml ├── Dockerfile ├── LICENSE └── README.md /.dockerignore: -------------------------------------------------------------------------------- 1 | .github 2 | LICENSE 3 | README.md -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [bubuntux]# Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | -------------------------------------------------------------------------------- /.github/workflows/cron.yml: -------------------------------------------------------------------------------- 1 | name: cron 2 | on: 3 | schedule: 4 | - cron: '0 0 * * *' 5 | push: 6 | 7 | jobs: 8 | 9 | validate: 10 | runs-on: ubuntu-latest 11 | outputs: 12 | new: ${{ steps.check.outputs.new }} 13 | version: ${{ steps.check.outputs.version }} 14 | steps: 15 | - name: Install depepndencies 16 | run: sudo apt-get install -y curl jq 17 | - name: Check new version 18 | id: check 19 | run: | 20 | element_version=`curl -SsL https://api.github.com/repos/vector-im/element-web/releases | jq -r '.[].tag_name' | head -n 1` 21 | echo "::set-output name=version::${element_version}" 22 | docker_version=`curl -sSL 'https://registry.hub.docker.com/v2/repositories/bubuntux/element-web/tags' | jq -r '."results"[]["name"] | select(.=="'${element_version}'")'` 23 | if [ "${element_version}" == "${docker_version}" ]; then 24 | echo "::set-output name=new::false" 25 | else 26 | echo "::set-output name=new::true" 27 | fi 28 | - name: Print outputs 29 | run: echo version=${{steps.check.outputs.version}} new=${{steps.check.outputs.new}} 30 | 31 | release: 32 | runs-on: ubuntu-latest 33 | needs: validate 34 | if: needs.validate.outputs.new == 'true' 35 | steps: 36 | - name: Checkout 37 | uses: actions/checkout@v2 38 | 39 | - name: Set up QEMU 40 | uses: docker/setup-qemu-action@v1 41 | 42 | - name: Set up Docker Buildx 43 | uses: docker/setup-buildx-action@v1 44 | 45 | - name: Login to DockerHub 46 | uses: docker/login-action@v1 47 | with: 48 | username: ${{ github.repository_owner }} 49 | password: ${{ secrets.DOCKERHUB_TOKEN }} 50 | 51 | - name: Login to GitHub Container Registry 52 | uses: docker/login-action@v1 53 | with: 54 | registry: ghcr.io 55 | username: ${{ github.repository_owner }} 56 | password: ${{ secrets.CR_PAT }} 57 | 58 | - name: Build and push 59 | uses: docker/build-push-action@v2 60 | with: 61 | platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x 62 | build-args: version=${{ needs.validate.outputs.version }} 63 | push: true 64 | tags: | 65 | bubuntux/riot-web:${{ needs.validate.outputs.version }} 66 | ${{ github.repository }}:${{ needs.validate.outputs.version }} 67 | ghcr.io/${{ github.repository }}:${{ needs.validate.outputs.version }} 68 | 69 | - name: Push latest 70 | if: ${{ !contains( needs.validate.outputs.version , 'rc') }} 71 | uses: docker/build-push-action@v2 72 | with: 73 | platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x 74 | build-args: version=${{ needs.validate.outputs.version }} 75 | push: true 76 | tags: | 77 | bubuntux/riot-web:latest 78 | ${{ github.repository }}:latest 79 | ghcr.io/${{ github.repository }}:latest 80 | 81 | - name: Update repo description 82 | uses: peter-evans/dockerhub-description@v2 83 | with: 84 | username: ${{ github.repository_owner }} 85 | password: ${{ secrets.DOCKERHUB_PASSWORD }} 86 | repository: ${{ github.repository }} 87 | -------------------------------------------------------------------------------- /.github/workflows/trivy-analysis.yml: -------------------------------------------------------------------------------- 1 | name: analysis 2 | on: 3 | push: 4 | pull_request: 5 | jobs: 6 | analysis: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - name: Checkout code 10 | uses: actions/checkout@v2 11 | 12 | - name: Build an image from Dockerfile 13 | run: | 14 | version=`curl -SsL https://api.github.com/repos/vector-im/element-web/releases/latest | jq -r '.tag_name'` 15 | docker build --build-arg version=${version} -t ${{ github.repository }}:${{ github.sha }} . 16 | 17 | - name: Run Trivy vulnerability scanner 18 | uses: aquasecurity/trivy-action@master 19 | with: 20 | image-ref: '${{ github.repository }}:${{ github.sha }}' 21 | format: 'template' 22 | template: '@/contrib/sarif.tpl' 23 | output: 'trivy-results.sarif' 24 | severity: 'CRITICAL,HIGH' 25 | 26 | - name: Upload Trivy scan results to GitHub Security tab 27 | uses: github/codeql-action/upload-sarif@v1 28 | with: 29 | sarif_file: 'trivy-results.sarif' 30 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:alpine 2 | 3 | MAINTAINER Julio Gutierrez 4 | 5 | ARG version 6 | ARG GPG_KEY=2BAA9B8552BD9047 7 | RUN if [ -z "$version" ]; then echo >&2 "error: build argument 'version' is required" && exit 1; fi &&\ 8 | apk add --no-cache --virtual .build-deps curl gnupg &&\ 9 | curl -sSL https://github.com/vector-im/element-web/releases/download/${version}/element-${version}.tar.gz -o element-web.tar.gz &&\ 10 | curl -sSL https://github.com/vector-im/element-web/releases/download/${version}/element-${version}.tar.gz.asc -o element-web.tar.gz.asc &&\ 11 | for server in \ 12 | hkp://keyserver.ubuntu.com:80 \ 13 | hkp://p80.pool.sks-keyservers.net:80 \ 14 | ha.pool.sks-keyservers.net \ 15 | ; do \ 16 | echo "Fetching GPG key $GPG_KEY from $server"; \ 17 | gpg --keyserver "$server" --keyserver-options timeout=10 --recv-keys "$GPG_KEY" && break; \ 18 | done &&\ 19 | gpg --batch --verify element-web.tar.gz.asc element-web.tar.gz &&\ 20 | tar -xzf element-web.tar.gz &&\ 21 | mv element-${version} /etc/element-web &&\ 22 | cp /etc/element-web/config.sample.json /etc/element-web/config.json &&\ 23 | rm -rf /usr/share/nginx/html && ln -s /etc/element-web /usr/share/nginx/html &&\ 24 | rm element-web.tar.gz* &&\ 25 | apk del .build-deps 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Julio Gutierrez 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |

12 | 13 | This project is on charge of checking everyday if there is a new [Element](https://element.io/) version and create the proper docker image and push it to the [hub](https://hub.docker.com/r/bubuntux/element-web/) as need it. 14 | 15 | # What is Element ? # 16 | [Element](https://element.io/features) (formerly known as Vector/Riot) is a web client for [Matrix](https://matrix.org) an open network for secure, decentralized communication. 17 | 18 | # How to use the docker image # 19 | ``` 20 | $ docker run --name element -p 8080:80 -d ghcr.io/bubuntux/element-web 21 | ``` 22 | Then you can hit [http://localhost:8080](http://localhost:8080) in your browser. 23 | 24 | # Element configuration # 25 | ``` 26 | $ docker run -v /host/path/config.json:/etc/element-web/config.json:ro --name element -p 8080:80 -d ghcr.io/bubuntux/element-web 27 | ``` 28 | For information on the syntax of the element configuration file, see [the official documentation](https://github.com/vector-im/element-web#configjson). 29 | 30 | # HTTP server configuration # 31 | ``` 32 | $ docker run -v /host/path/nginx.conf:/etc/nginx/nginx.conf:ro --name element -p 8080:80 -d ghcr.io/bubuntux/element-web 33 | ``` 34 | For information on the syntax of the nginx configuration files, see [the official documentation](http://nginx.org/en/docs/) (specifically the [Beginner's Guide](http://nginx.org/en/docs/beginners_guide.html#conf_structure)). 35 | --------------------------------------------------------------------------------