Repository: scribble-rs/scribble.rs Branch: master Commit: 018e84862221 Files: 92 Total size: 1.2 MB Directory structure: gitextract_v5hmk19x/ ├── .dockerignore ├── .gitattributes ├── .github/ │ └── workflows/ │ ├── docker-image-update.yml │ ├── release.yml │ ├── test-and-build.yml │ └── test-pr.yml ├── .gitignore ├── .golangci.yml ├── .vscode/ │ ├── launch.json │ └── settings.json ├── LICENSE ├── README.md ├── cmd/ │ └── scribblers/ │ └── main.go ├── fly.Dockerfile ├── fly.toml ├── fly_deploy.sh ├── go.mod ├── go.sum ├── internal/ │ ├── api/ │ │ ├── createparse.go │ │ ├── createparse_test.go │ │ ├── doc.go │ │ ├── http.go │ │ ├── v1.go │ │ └── ws.go │ ├── config/ │ │ └── config.go │ ├── frontend/ │ │ ├── doc.go │ │ ├── http.go │ │ ├── index.go │ │ ├── index.js │ │ ├── lobby.go │ │ ├── lobby.js │ │ ├── lobby_test.go │ │ ├── resources/ │ │ │ ├── draw.js │ │ │ ├── error.css │ │ │ ├── index.css │ │ │ ├── lobby.css │ │ │ └── root.css │ │ ├── templates/ │ │ │ ├── error.html │ │ │ ├── favicon.html │ │ │ ├── footer.html │ │ │ ├── index.html │ │ │ ├── lobby.html │ │ │ └── non-static-css.html │ │ └── templating_test.go │ ├── game/ │ │ ├── data.go │ │ ├── data_test.go │ │ ├── lobby.go │ │ ├── lobby_test.go │ │ ├── shared.go │ │ ├── words/ │ │ │ ├── ar │ │ │ ├── de │ │ │ ├── en_gb │ │ │ ├── en_us │ │ │ ├── fa │ │ │ ├── fr │ │ │ ├── he │ │ │ ├── it │ │ │ ├── nl │ │ │ ├── pl │ │ │ ├── ru │ │ │ └── ua │ │ ├── words.go │ │ └── words_test.go │ ├── metrics/ │ │ └── metrics.go │ ├── sanitize/ │ │ └── sanitize.go │ ├── state/ │ │ ├── doc.go │ │ ├── lobbies.go │ │ └── lobbies_test.go │ ├── translations/ │ │ ├── ar.go │ │ ├── de_DE.go │ │ ├── doc.go │ │ ├── en_us.go │ │ ├── es_ES.go │ │ ├── fa.go │ │ ├── fr_FR.go │ │ ├── he.go │ │ ├── pl.go │ │ ├── translations.go │ │ └── translations_test.go │ └── version/ │ └── version.go ├── linux.Dockerfile ├── tools/ │ ├── compare_en_words.sh │ ├── sanitizer/ │ │ ├── README.md │ │ └── main.go │ ├── simulate/ │ │ └── main.go │ ├── skribbliohintsconverter/ │ │ ├── README.md │ │ ├── english.json │ │ ├── german.json │ │ └── main.go │ ├── statcollector/ │ │ └── main.go │ └── translate.sh └── windows.Dockerfile ================================================ FILE CONTENTS ================================================ ================================================ FILE: .dockerignore ================================================ # We are going with a whitelisting approach, to avoid accidentally bleeding # too much into our container. This reduces the amount of cache miss and # potentially speeds up the build. * # All non-test Go Code !internal/ !pkg/ !cmd/ **_test.go # Go Modules !go.mod !go.sum # While the dockerfile aren't needed inside of the Dockerfile, fly.io requires # them for remote bulding and uses this dockerignore to filter what's sent to # the remote builder. !linux.Dockerfile !windows.Dockerfile !public ================================================ FILE: .gitattributes ================================================ * text eol=lf *.otf binary *.png binary *.wav binary ================================================ FILE: .github/workflows/docker-image-update.yml ================================================ name: docker image update on: workflow_run: workflows: [Build] branches: [v**] types: [completed] jobs: main: runs-on: ${{ matrix.os }} strategy: max-parallel: 3 matrix: os: [ubuntu-latest, windows-2022] include: - os: ubuntu-latest platforms: linux/amd64,linux/arm/v7,linux/arm64 file: linux.Dockerfile buildArgs: VERSION=${{ github.event.workflow_run.head_branch }} tags: latest, ${{ github.event.workflow_run.head_branch }} multiPlatform: true - os: windows-2022 platforms: windows/amd64 file: windows.Dockerfile buildArgs: VERSION=${{ github.event.workflow_run.head_branch }} tags: windows-latest, windows-${{ github.event.workflow_run.head_branch }} multiPlatform: false steps: - name: Checkout uses: actions/checkout@v4 - name: Build and push id: docker_build uses: mr-smithers-excellent/docker-build-push@v6 with: multiPlatform: ${{ matrix.multiPlatform }} registry: docker.io dockerfile: ${{ matrix.file }} image: biosmarcel/scribble.rs buildArgs: ${{ matrix.buildArgs }} platform: ${{ matrix.platforms }} tags: ${{ matrix.tags }} username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} ================================================ FILE: .github/workflows/release.yml ================================================ name: Publish release on: workflow_run: workflows: [Build] branches: [v**] types: [completed] jobs: publish-release: runs-on: ubuntu-latest # Kinda bad since it might release on any branch starting with v, but it'll do for now. # Tag filtering in "on:" doesn't work, since the inital build trigger gets lost. # github.ref is therefore also being reset to "refs/head/master". if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - name: Download linux artifact uses: dawidd6/action-download-artifact@v6 with: workflow: test-and-build.yml name: scribblers-linux-x64 - name: Download macos artifact uses: dawidd6/action-download-artifact@v6 with: workflow: test-and-build.yml name: scribblers-macos-x64 - name: Download windows artifact uses: dawidd6/action-download-artifact@v6 with: workflow: test-and-build.yml name: scribblers-x64.exe - name: Create release uses: softprops/action-gh-release@v1 with: name: ${{ github.event.workflow_run.head_branch }} tag_name: ${{ github.event.workflow_run.head_branch }} files: | scribblers-linux-x64 scribblers-macos-x64 scribblers-x64.exe ================================================ FILE: .github/workflows/test-and-build.yml ================================================ name: Build on: push jobs: test-and-build: strategy: matrix: include: - platform: windows-latest binary_name: scribblers-x64.exe - platform: ubuntu-latest binary_name: scribblers-linux-x64 - platform: macos-latest binary_name: scribblers-macos-x64 runs-on: ${{ matrix.platform }} steps: - uses: actions/checkout@v4 with: # Workaround to get tags, getting git describe to work. fetch-depth: 0 - name: Install Go uses: actions/setup-go@v5 with: go-version: 1.25.5 - name: Run tests shell: bash run: | go test -v -race ./... - name: Build artifact shell: bash env: # Disable CGO to get "more static" binaries. They aren't really static ... # since it can still happen that part of the stdlib access certain libs, but # whatever, this will probs do for our usecase. (Can't quite remember # anymore, but I have had issues with this in the past) :D CGO_ENABLED: 0 run: | go build -trimpath -ldflags "-w -s -X 'github.com/scribble-rs/scribble.rs/internal/version.Version=$(git describe --tags --dirty)'" -o ${{ matrix.binary_name }} ./cmd/scribblers - name: Upload build artifact uses: actions/upload-artifact@v4 with: name: ${{ matrix.binary_name }} path: ./${{ matrix.binary_name }} ================================================ FILE: .github/workflows/test-pr.yml ================================================ name: Run tests on: pull_request jobs: run-tests: strategy: matrix: go-version: [1.25.5] platform: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.platform }} steps: - uses: actions/checkout@v4 - name: Install Go uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} - name: Run tests run: | go test -v -race -count=3 ./... ================================================ FILE: .gitignore ================================================ # Executable names /scribblers *.exe __debug_bin # IntelliJ state .idea/ # Folder that contains code used for trying stuff locally playground/ # Temporary output text files *.out # System metadata files .DS_Store # Configuration files .env # Anything temporary *.tmp # Profiling results *.pprof # Additional files for hosting. Workaround for now ig. public/ ================================================ FILE: .golangci.yml ================================================ linters: enable-all: true disable: ## These are deprecated - exportloopref ## These are too strict for our taste # Whitespace linter - wsl # Demands a newline before each return - nlreturn # Magic numbers - mnd # function, line and variable length - funlen - lll - varnamelen # testpackages must be named _test for reduced visibility to package # details. - testpackage # I don't really care about cyclopmatic complexity - cyclop - gocognit # I don't see the harm in returning an interface - ireturn # Too many false positives, due to easyjson rn - recvcheck # While aligned tags look nice, i can't be arsed doing it manually. - tagalign ## Useful, but we won't use it for now, maybe later # Allows us to define rules for dependencies - depguard # For some reason, imports aren't sorted right now. - gci # For now, we'll stick with our globals and inits. Everything needs to be # rewrite to be more testable and safe to teardown and reset. - gochecknoglobals - gochecknoinits # Seems to be very useful, but is also a very common usecase, so we'll # ignore it for now - exhaustruct # Requires certain types of tags, such as json or mapstructure. # While very useful, I don't care right now. - musttag # Not wrapping errors - err113 - wrapcheck # Code duplications - dupl ## Provides no real value - testifylint # Broken - goimports linters-settings: govet: disable: - fieldalignment gocritic: disabled-checks: # This has false positives and provides little value. - ifElseChain gosec: excludes: # weak number generator stuff; mostly false positives, as we don't do # security sensitive things anyway. - G404 revive: rules: - name: var-naming disabled: true stylecheck: checks: ["all", "-ST1003"] run: exclude-files: - ".*_easyjson.go" issues: exclude-rules: - path: translations\\[^e][^n].*?\.go linters: # Too many potential false positives - misspell # Exclude some linters from running on tests files. In tests, we often have # code that is rather unsafe and only has one purpose, or furthermore things # that indicate an issue in production, but are fine for testing only small # units. - path: _test\.go linters: - funlen - cyclop - forcetypeassert - varnamelen # The tools aren't part of the actual production code and therefore we don't # care about codequality much right now. - path: tools/ text: .+ ================================================ FILE: .vscode/launch.json ================================================ { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "Start server", "type": "go", "request": "launch", "mode": "debug", "program": "${workspaceFolder}/cmd/scribblers/main.go", "cwd": "${workspaceFolder}" } ] } ================================================ FILE: .vscode/settings.json ================================================ { "html.format.templating": true, "go.lintTool": "golangci-lint", "go.useLanguageServer": true, "gopls": { "formatting.gofumpt": true, }, } ================================================ FILE: LICENSE ================================================ BSD 3-Clause License Copyright (c) 2019, scribble-rs All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: README.md ================================================