├── logo.png ├── TODO.md ├── Makefile ├── .github └── workflows │ └── build.yml ├── README.md ├── Dockerfile ├── CONTRIBUTING.md └── LICENSE /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wwmoraes/pvpgn-server-docker/HEAD/logo.png -------------------------------------------------------------------------------- /TODO.md: -------------------------------------------------------------------------------- 1 | # Configure 2 | 3 | - [ ] PvPGN (realm.conf) 4 | - [ ] D2CS (d2cs.conf) 5 | - [ ] D2GS (d2gs.reg) 6 | - [ ] D2DBS (d2dbs.conf) 7 | 8 | # Cloud 9 | 10 | - [ ] docker-compose 11 | - [ ] Helm chart 12 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | BRANCH ?= develop 2 | OWNER := wwmoraes 3 | PROJECT := pvpgn-server 4 | MODE ?= plain # plain | mysql | pgsql | sqlite3 | odbc 5 | TAG ?= ${BRANCH}-${MODE} 6 | 7 | SHELL := /bin/bash 8 | REPO := ${OWNER}/${PROJECT} 9 | 10 | GIT_REV = $(shell git log -n 1 --format="%H") 11 | DATE = $(shell date -u +"%Y-%m-%dT%TZ") 12 | 13 | ifeq ($(shell docker buildx inspect --bootstrap | grep Driver | cut -d: -f2 | xargs),docker-container) 14 | BUILDKIT_FLAGS ?= --load 15 | endif 16 | 17 | .PHONY: build-all 18 | build-all: build-plain build-mysql build-pgsql build-sqlite3 build-odbc 19 | 20 | build-%: MODE=% 21 | build-%: build 22 | 23 | .PHONY: build 24 | build: 25 | @docker build \ 26 | ${BUILDKIT_FLAGS} \ 27 | --build-arg BRANCH=${BRANCH} \ 28 | --build-arg MODE=${MODE} \ 29 | $(if ${TARGET},--target ${TARGET}) \ 30 | -t ${REPO}:${TAG} . 31 | 32 | .PHONY: release-all 33 | release-all: release-plain release-mysql release-pgsql release-sqlite3 release-odbc 34 | 35 | release-%: MODE=% 36 | release-%: release 37 | 38 | .PHONY: release 39 | release: 40 | @docker build --push \ 41 | --platform linux/amd64,linux/arm/v7,linux/arm64 \ 42 | --label org.opencontainers.image.title="PvPGN-PRO" \ 43 | --label org.opencontainers.image.description="Next generation of PvPGN server" \ 44 | --label org.opencontainers.image.url=https://github.com/wwmoraes/pvpgn-server-docker \ 45 | --label org.opencontainers.image.source=https://github.com/wwmoraes/pvpgn-server-docker \ 46 | --label org.opencontainers.image.created=${DATE} \ 47 | --label org.opencontainers.image.revision=${GIT_REV} \ 48 | --label org.opencontainers.image.licenses=Apache-2.0 \ 49 | --label org.opencontainers.image.version=${BRANCH} \ 50 | --label org.opencontainers.image.documentation=https://pvpgn.pro \ 51 | --build-arg BRANCH=${BRANCH} \ 52 | --build-arg MODE=${MODE} \ 53 | -t ${REPO}:${TAG} \ 54 | -t ${REPO}:latest-${MODE} \ 55 | . 56 | 57 | .PHONY: ls 58 | ls: 59 | @docker create --name="${PROJECT}_${TAG}_ls" ${REPO}:${TAG} > /dev/null 60 | @docker export ${PROJECT}_${TAG}_ls | tar t 61 | @docker container rm ${PROJECT}_${TAG}_ls > /dev/null 62 | 63 | .PHONY: export 64 | export: 65 | @docker create --name="${PROJECT}_${TAG}_export" ${REPO}:${TAG} > /dev/null 66 | @docker export ${PROJECT}_${TAG}_export > ${PROJECT}-${TAG}.tar 67 | @docker container rm ${PROJECT}_${TAG}_export > /dev/null 68 | 69 | .PHONY: run 70 | run: 71 | @docker run --rm -p 4000:4000 -p 6112:6112 -it ${REPO}:${TAG} 72 | 73 | .PHONY: sh 74 | sh: 75 | @docker run --rm -it --entrypoint=ash ${REPO}:${TAG} 76 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | 3 | # yamllint disable-line rule:truthy 4 | on: 5 | push: 6 | branches: 7 | - master 8 | tags: 9 | - '*' 10 | paths: 11 | - .github/workflows/build.yml 12 | - Dockerfile 13 | pull_request: 14 | branches: 15 | - master 16 | paths: 17 | - .github/workflows/build.yml 18 | - Dockerfile 19 | 20 | env: 21 | BRANCH: 1.99.7.2.1 22 | 23 | jobs: 24 | build: 25 | runs-on: ubuntu-latest 26 | strategy: 27 | fail-fast: true 28 | max-parallel: 2 29 | matrix: 30 | mode: [plain, mysql, pgsql, sqlite3, odbc] 31 | steps: 32 | - name: set up QEMU 33 | uses: docker/setup-qemu-action@v1 34 | - name: set up docker buildx 35 | uses: docker/setup-buildx-action@v1 36 | - name: cache build 37 | uses: pat-s/always-upload-cache@v2.1.5 38 | with: 39 | path: ${{ runner.temp }}/.buildx-cache 40 | key: ${{ runner.os }}-build-${{ matrix.mode }}-${{ hashFiles('Dockerfile') }} 41 | restore-keys: | 42 | ${{ runner.os }}-build-${{ matrix.mode }}-${{ hashFiles('Dockerfile') }} 43 | ${{ runner.os }}-build-${{ matrix.mode }}- 44 | - name: checkout 45 | uses: actions/checkout@v2 46 | - name: generate container meta 47 | id: meta 48 | uses: docker/metadata-action@v3 49 | with: 50 | images: ${{ github.repository_owner }}/pvpgn-server 51 | flavor: | 52 | latest=true 53 | suffix=-${{ matrix.mode }},onlatest=true 54 | labels: | 55 | org.opencontainers.image.title="PvPGN-PRO" 56 | org.opencontainers.image.description="Next generation of PvPGN server" 57 | org.opencontainers.image.version=${{ env.BRANCH }} 58 | org.opencontainers.image.documentation=https://pvpgn.pro 59 | tags: | 60 | type=ref,event=branch 61 | type=ref,event=pr 62 | type=raw,value=${{ env.BRANCH }} 63 | github-token: ${{ github.token }} 64 | - name: login to DockerHub 65 | if: github.event_name != 'pull_request' 66 | uses: docker/login-action@v1 67 | with: 68 | username: ${{ secrets.DOCKER_USERNAME }} 69 | password: ${{ secrets.DOCKER_PASSWORD }} 70 | - name: build & push 71 | uses: docker/build-push-action@v2 72 | env: 73 | DOCKER_BUILDKIT: 1 74 | BUILDKIT_INLINE_CACHE: 1 75 | with: 76 | build-args: | 77 | BRANCH=${{ env.BRANCH }} 78 | MODE=${{ matrix.mode }} 79 | push: ${{ github.event_name != 'pull_request' }} 80 | platforms: linux/amd64,linux/arm/v7,linux/arm64 81 | labels: ${{ steps.meta.outputs.labels }} 82 | cache-to: | 83 | type=local,mode=max,dest=${{ runner.temp }}/.buildx-cache 84 | cache-from: | 85 | type=local,src=${{ runner.temp }}/.buildx-cache 86 | ${{ steps.meta.outputs.tags }} 87 | tags: ${{ steps.meta.outputs.tags }} 88 | - name: update DockerHub description 89 | if: github.event_name != 'pull_request' 90 | uses: meeDamian/sync-readme@v1.0.6 91 | with: 92 | pass: ${{ secrets.DOCKER_PASSWORD }} 93 | description: true 94 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | ![PvPGN-PRO Docker](https://i.imgur.com/QfNbRxi.png) 4 | 5 | ### PvPGN Server Docker 6 | 7 | ![Status](https://img.shields.io/badge/status-active-success.svg) 8 | [![GitHub Issues](https://img.shields.io/github/issues/wwmoraes/pvpgn-server-docker.svg)](https://github.com/wwmoraes/pvpgn-server-docker/issues) 9 | [![GitHub Pull Requests](https://img.shields.io/github/issues-pr/wwmoraes/pvpgn-server-docker.svg)](https://github.com/wwmoraes/pvpgn-server-docker/pulls) 10 | [![License](https://img.shields.io/badge/license-AL2-blue.svg)](/LICENSE) 11 | 12 |
13 | 14 | --- 15 | 16 | > A simple docker and docker-compose for running a PvPGN-PRO server in no time 17 | 18 | ## 📝 Table of Contents 19 | 20 | - [About](#about) 21 | - [Getting Started](#getting_started) 22 | - [Deployment](#deployment) 23 | - [Usage](#usage) 24 | - [Built Using](#built_using) 25 | - [TODO](https://github.com/wwmoraes/pvpgn-server-docker/blob/master/TODO.md) 26 | - [Contributing](https://github.com/wwmoraes/pvpgn-server-docker/blob/master/CONTRIBUTING.md) 27 | - [Acknowledgments](#acknowledgement) 28 | 29 | ## 🧐 About 30 | 31 | Yet another [pvpgn-docker](https://github.com/search?q=pvpgn-docker) project. 32 | Aims to be: 33 | 34 | - ⌛ time-proof - builds binaries directly from [source][pvpgn-server] 35 | - 🔐 secure - uses non-privileged user and group to run the server 36 | - 🗜 small - based on Alpine linux 37 | - ⚖ lightweight - final image doesn't contain source or build tools 38 | 39 | Most users should be fine running the [official image][official-image-readme]. 40 | Use this image if you prefer Alpine's smaller footprint or if you plan to develop 41 | on PvPGN, as the dependencies are installed only once here. 42 | 43 | [pvpgn-server]: https://github.com/pvpgn/pvpgn-server 44 | [official-image-readme]: https://github.com/pvpgn/pvpgn-server/blob/develop/README_DOCKER.md 45 | 46 | ## 🏁 Getting Started 47 | 48 | Pull the image from Docker Hub: 49 | 50 | ```sh 51 | docker pull wwmoraes/pvpgn-server 52 | ``` 53 | 54 | Then/or just run: 55 | 56 | ```sh 57 | docker run -it wwmoraes/pvpgn-server 58 | ``` 59 | 60 | PvPGN-PRO is built and installed on the root filesystem. A sample configuration 61 | can be found at `/etc/pvpgn`. Data (logs, storage, scripts, etc) can be found 62 | at `/var/pvpgn`. These are the default locations `bnetd` will use, unless you 63 | configure it to use distinct paths. 64 | 65 | ## 🚀 Deployment 66 | 67 | The configuration and data paths should be bound to volumes for persistence, and 68 | the ports should be published so you can access the server outside of the 69 | container: 70 | 71 | ```sh 72 | docker run -it -p 6112:6112 -p 4000:4000 \ 73 | -v :/etc/pvpgn \ 74 | -v :/var/pvpgn \ 75 | wwmoraes/pvpgn-server 76 | ``` 77 | 78 | **IMPORTANT**: Make sure the volumes/bind mount sources are readable and 79 | writable by the server user and group. The image default is 1001. 80 | 81 | ## 🎈 Usage 82 | 83 | The build is done with Lua script support enabled, and MySQL support for the 84 | account backend. 85 | 86 | You can create persistent local volumes for the config and data without starting 87 | the server with: 88 | 89 | ```sh 90 | docker run --rm --entrypoint=true \ 91 | -v :/etc/pvpgn \ 92 | -v :/var/pvpgn \ 93 | wwmoraes/pvpgn-server 94 | ``` 95 | 96 | Both volumes must not exist prior to this call for Docker to create and populate 97 | them with the image contents. 98 | 99 | You can also copy the files to your host system using a temporary bind mount, 100 | for instance: 101 | 102 | ```sh 103 | mkdir {var,etc} 104 | 105 | docker run --rm --entrypoint=cp --user "$(id -u):$(id -g)" \ 106 | -v $PWD/var:/mnt/var \ 107 | wwmoraes/pvpgn-server \ 108 | -r /var/pvpgn /mnt/var 109 | 110 | docker run --rm --entrypoint=cp --user "$(id -u):$(id -g)" \ 111 | -v $PWD/etc:/mnt/etc \ 112 | wwmoraes/pvpgn-server \ 113 | -r /etc/pvpgn /mnt/etc 114 | ``` 115 | 116 | Please refer to the upstream documentation on how to configure your server. 117 | 118 | - [PvPGN Configuration](https://pvpgn.pro/pvpgn_installation.html) 119 | - [D2GS Installation Guide](https://pvpgn.pro/d2gs_installation.html) 120 | 121 | ## 🎉 Acknowledgements 122 | 123 | - [PvPGN-PRO](https://github.com/pvpgn/pvpgn-server) and its maintainers, which are keeping alive the legacy of PvPGN 124 | - [@ibepeer](https://github.com/ibepeer) for feedback on #3, which ended on a BRANCH build arg (to clone from develop, for instance) 125 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | ARG MODE=mysql 2 | FROM alpine:latest AS build-base 3 | 4 | ### Install build dependencies 5 | RUN apk --quiet --no-cache add \ 6 | git \ 7 | build-base \ 8 | clang \ 9 | cmake \ 10 | make \ 11 | zlib-dev \ 12 | curl-dev \ 13 | lua-dev \ 14 | && rm -rf /var/cache/apk/* \ 15 | ; 16 | 17 | ### CMake & make 18 | ARG REPO=https://github.com/pvpgn/pvpgn-server.git 19 | ARG BRANCH=master 20 | RUN git clone --depth 1 --single-branch --branch ${BRANCH} ${REPO} /src 21 | 22 | RUN mkdir /src/build /usr/local/pvpgn 23 | WORKDIR /src 24 | 25 | ENV WITH_LUA=true 26 | ENV WITH_MYSQL=false 27 | ENV WITH_SQLITE3=false 28 | ENV WITH_PGSQL=false 29 | ENV WITH_ODBC=false 30 | 31 | ################################################################################ 32 | FROM build-base AS build-plain 33 | 34 | RUN cmake -G "Unix Makefiles" -H./ -B./build \ 35 | -D WITH_LUA=${WITH_LUA} \ 36 | -D WITH_MYSQL=${WITH_MYSQL} \ 37 | -D WITH_SQLITE3=${WITH_SQLITE3} \ 38 | -D WITH_PGSQL=${WITH_PGSQL} \ 39 | -D WITH_ODBC=${WITH_ODBC} \ 40 | -D CMAKE_INSTALL_PREFIX=/ \ 41 | ../ && cd build && make 42 | 43 | ################################################################################ 44 | FROM build-base AS build-mysql 45 | 46 | RUN apk --quiet --no-cache add \ 47 | mariadb-dev \ 48 | && rm -rf /var/cache/apk/* \ 49 | ; 50 | 51 | ENV WITH_MYSQL=true 52 | 53 | RUN cmake -G "Unix Makefiles" -H./ -B./build \ 54 | -D WITH_LUA=${WITH_LUA} \ 55 | -D WITH_MYSQL=${WITH_MYSQL} \ 56 | -D WITH_SQLITE3=${WITH_SQLITE3} \ 57 | -D WITH_PGSQL=${WITH_PGSQL} \ 58 | -D WITH_ODBC=${WITH_ODBC} \ 59 | -D CMAKE_INSTALL_PREFIX=/ \ 60 | ../ && cd build && make 61 | 62 | ################################################################################ 63 | FROM build-base AS build-pgsql 64 | 65 | RUN apk --quiet --no-cache add \ 66 | libpq-dev \ 67 | && rm -rf /var/cache/apk/* \ 68 | ; 69 | 70 | ENV WITH_PGSQL=true 71 | 72 | RUN cmake -G "Unix Makefiles" -H./ -B./build \ 73 | -D WITH_LUA=${WITH_LUA} \ 74 | -D WITH_MYSQL=${WITH_MYSQL} \ 75 | -D WITH_SQLITE3=${WITH_SQLITE3} \ 76 | -D WITH_PGSQL=${WITH_PGSQL} \ 77 | -D WITH_ODBC=${WITH_ODBC} \ 78 | -D CMAKE_INSTALL_PREFIX=/ \ 79 | ../ && cd build && make 80 | 81 | ################################################################################ 82 | FROM build-base AS build-sqlite3 83 | 84 | RUN apk --quiet --no-cache add \ 85 | sqlite-dev \ 86 | && rm -rf /var/cache/apk/* \ 87 | ; 88 | 89 | ENV WITH_SQLITE3=true 90 | 91 | RUN cmake -G "Unix Makefiles" -H./ -B./build \ 92 | -D WITH_LUA=${WITH_LUA} \ 93 | -D WITH_MYSQL=${WITH_MYSQL} \ 94 | -D WITH_SQLITE3=${WITH_SQLITE3} \ 95 | -D WITH_PGSQL=${WITH_PGSQL} \ 96 | -D WITH_ODBC=${WITH_ODBC} \ 97 | -D CMAKE_INSTALL_PREFIX=/ \ 98 | ../ && cd build && make 99 | 100 | ################################################################################ 101 | FROM build-base AS build-odbc 102 | 103 | RUN apk --quiet --no-cache add \ 104 | unixodbc-dev \ 105 | && rm -rf /var/cache/apk/* \ 106 | ; 107 | 108 | ENV WITH_ODBC=true 109 | 110 | RUN cmake -G "Unix Makefiles" -H./ -B./build \ 111 | -D WITH_LUA=${WITH_LUA} \ 112 | -D WITH_MYSQL=${WITH_MYSQL} \ 113 | -D WITH_SQLITE3=${WITH_SQLITE3} \ 114 | -D WITH_PGSQL=${WITH_PGSQL} \ 115 | -D WITH_ODBC=${WITH_ODBC} \ 116 | -D CMAKE_INSTALL_PREFIX=/ \ 117 | ../ && cd build && make 118 | 119 | ################################################################################ 120 | FROM build-${MODE} AS build 121 | 122 | ### Install 123 | WORKDIR /src/build 124 | RUN make install && chown -R 1001:1001 /var/pvpgn /etc/pvpgn 125 | 126 | ################################################################################ 127 | FROM alpine:latest AS runner-plain 128 | 129 | ### Install dependencies 130 | RUN apk --quiet --no-cache add \ 131 | ca-certificates \ 132 | libstdc++ \ 133 | libgcc \ 134 | libcurl \ 135 | lua5.1-libs \ 136 | && rm -rf /var/cache/apk/* \ 137 | ; 138 | 139 | ################################################################################ 140 | FROM runner-plain AS runner-mysql 141 | 142 | ### Install dependencies 143 | RUN apk --quiet --no-cache add \ 144 | mariadb-connector-c \ 145 | && rm -rf /var/cache/apk/* \ 146 | ; 147 | 148 | ################################################################################ 149 | FROM runner-plain AS runner-pgsql 150 | 151 | ### Install dependencies 152 | RUN apk --quiet --no-cache add \ 153 | libpq \ 154 | && rm -rf /var/cache/apk/* \ 155 | ; 156 | 157 | ################################################################################ 158 | FROM runner-plain AS runner-sqlite3 159 | 160 | ### Install dependencies 161 | RUN apk --quiet --no-cache add \ 162 | sqlite-libs \ 163 | && rm -rf /var/cache/apk/* \ 164 | ; 165 | 166 | ################################################################################ 167 | FROM runner-plain AS runner-odbc 168 | 169 | ## Install dependencies 170 | RUN apk --quiet --no-cache add \ 171 | unixodbc \ 172 | && rm -rf /var/cache/apk/* \ 173 | ; 174 | 175 | ################################################################################ 176 | FROM runner-${MODE} AS runner 177 | 178 | ### Copy build files 179 | COPY --from=build \ 180 | /sbin/bnetd \ 181 | /sbin/bntrackd \ 182 | /sbin/d2cs \ 183 | /sbin/d2dbs \ 184 | /sbin 185 | COPY --from=build \ 186 | /bin/bn* \ 187 | /bin/sha1hash \ 188 | /bin/tgainfo \ 189 | /bin 190 | COPY --from=build --chown=1001:1001 /etc/pvpgn /etc/pvpgn 191 | COPY --from=build --chown=1001:1001 /var/pvpgn /var/pvpgn 192 | 193 | ### Prepare user 194 | RUN addgroup --gid 1001 pvpgn \ 195 | && adduser \ 196 | --home /var/pvpgn \ 197 | --gecos "" \ 198 | --shell /sbin/nologin \ 199 | --ingroup pvpgn \ 200 | --system \ 201 | --disabled-password \ 202 | --no-create-home \ 203 | --uid 1001 \ 204 | pvpgn 205 | 206 | ### persist data and configs 207 | VOLUME /var/pvpgn 208 | VOLUME /etc/pvpgn 209 | 210 | # expose served network ports 211 | EXPOSE 6112 4000 212 | 213 | ### Set user 214 | USER 1001:1001 215 | 216 | ### RUN! 217 | CMD ["bnetd", "-f"] 218 | ENTRYPOINT ["bnetd"] 219 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change. 4 | 5 | Please note we have a code of conduct, please follow it in all your interactions with the project. 6 | 7 | ## Pull Request Process 8 | 9 | 1. Ensure any install or build dependencies are removed before the end of the layer when doing a build. 10 | 2. Update the README.md with details of changes to the interface, this includes new environment variables, exposed ports, useful file locations and container parameters. 11 | 3. Increase the version numbers in any examples files and the README.md to the new version that this Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/). 12 | 4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you do not have permission to do that, you may request the second reviewer to merge it for you. 13 | 14 | ## Our Pledge 15 | 16 | We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. 17 | 18 | We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. 19 | 20 | ## Our Standards 21 | 22 | Examples of behavior that contributes to a positive environment for our community include: 23 | 24 | * Demonstrating empathy and kindness toward other people 25 | * Being respectful of differing opinions, viewpoints, and experiences 26 | * Giving and gracefully accepting constructive feedback 27 | * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience 28 | * Focusing on what is best not just for us as individuals, but for the overall community 29 | 30 | Examples of unacceptable behavior include: 31 | 32 | * The use of sexualized language or imagery, and sexual attention or 33 | advances of any kind 34 | * Trolling, insulting or derogatory comments, and personal or political attacks 35 | * Public or private harassment 36 | * Publishing others' private information, such as a physical or email 37 | address, without their explicit permission 38 | * Other conduct which could reasonably be considered inappropriate in a 39 | professional setting 40 | 41 | ## Enforcement Responsibilities 42 | 43 | Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. 44 | 45 | Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. 46 | 47 | ## Scope 48 | 49 | This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. 50 | 51 | ## Enforcement 52 | 53 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [INSERT CONTACT METHOD]. All complaints will be reviewed and investigated promptly and fairly. 54 | 55 | All community leaders are obligated to respect the privacy and security of the reporter of any incident. 56 | 57 | ## Enforcement Guidelines 58 | 59 | Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: 60 | 61 | ### 1. Correction 62 | 63 | **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. 64 | 65 | **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. 66 | 67 | ### 2. Warning 68 | 69 | **Community Impact**: A violation through a single incident or series of actions. 70 | 71 | **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. 72 | 73 | ### 3. Temporary Ban 74 | 75 | **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. 76 | 77 | **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. 78 | 79 | ### 4. Permanent Ban 80 | 81 | **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. 82 | 83 | **Consequence**: A permanent ban from any sort of public interaction within the project community. 84 | 85 | ## Attribution 86 | 87 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, 88 | available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 89 | 90 | Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). 91 | 92 | [homepage]: https://www.contributor-covenant.org 93 | 94 | For answers to common questions about this code of conduct, see the FAQ at 95 | https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations. 96 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------