{"id":16938635,"url":"https://github.com/dsnet/playground","last_synced_at":"2025-03-23T17:30:54.049Z","repository":{"id":132959766,"uuid":"89553858","full_name":"dsnet/playground","owner":"dsnet","description":"Locally hosted Go playground for more advanced functionality.","archived":false,"fork":false,"pushed_at":"2023-12-18T23:01:50.000Z","size":457,"stargazers_count":20,"open_issues_count":1,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-18T22:11:49.099Z","etag":null,"topics":["go","golang","playground"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dsnet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-27T03:57:34.000Z","updated_at":"2024-01-05T16:15:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"ce0b6cf3-414a-4f89-be27-39662b7b4335","html_url":"https://github.com/dsnet/playground","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsnet%2Fplayground","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsnet%2Fplayground/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsnet%2Fplayground/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsnet%2Fplayground/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dsnet","download_url":"https://codeload.github.com/dsnet/playground/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245140784,"owners_count":20567448,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","playground"],"created_at":"2024-10-13T21:01:22.789Z","updated_at":"2025-03-23T17:30:53.693Z","avatar_url":"https://github.com/dsnet.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Local Go Playground #\n\n## Introduction ##\n\nPlayground is a web application that executes arbitrary Go code locally.\nThis tool provides the ability to save and load various code snippets,\nthe ability to run Go code using arbitrary third-party packages,\nand the ability to run tests and benchmarks.\n\n![screenshot](doc/screenshot.png)\n\nSince the Playground executes arbitrary Go code on the server it is running from,\nthere are obvious security implications. As a baseline, the Playground requires\na password in order use the service. However, anyone using this is responsible\nfor adding extra layers of security themselves:\n* Consider running `playground` from a [Linux Container](https://linuxcontainers.org/)\nor from a dedicated VM to sandbox the process.\n* Consider using a web server (like [Caddy](https://caddyserver.com/)) to provide\nautomatic HTTPS and another layer of authentication.\n\nRunning the server is only supported on Linux and OSX.\n\n## Basic Usage ##\n\nBuild the server:\n\n```go get -u github.com/dsnet/playground```\n\nStart the server (assuming `$GOPATH/bin` is in your `$PATH`):\n\n```\n$ playground\nEnter a new Playground login password: ...\n2017/05/11 18:07:07 main.go:184: loaded config:\n{\n\t\"ServeAddress\": \"localhost:8080\",\n\t\"PasswordSalt\": \"c9c8959441f5a49e0fed99a9a0704ef0725786b318304088fee0b9b1299a68f3\",\n\t\"PasswordHash\": \"ec3c17aba3fa603bc443e82b748db059bf294d9d3d9f975e15e9598241671af7\",\n\t\"DataPath\": \"/home/rawr/.playground\",\n\t\"GoBinary\": \"go\",\n\t\"FmtBinary\": \"goimports\",\n\t\"BinaryVersion\": \"Git+7ed13d2, Fri May 12 00:35:19 2017\",\n\t\"BinarySHA256\": \"c026207e6ff152e4f5b7be4a098577f164fed983650389a971a205384f5829aa\"\n}\n2017/05/11 18:07:07 main.go:254: playground starting on localhost:8080\n...\n```\n\nWhen running `playground` without a configuration file, it requires a password\nto be supplied. The Playground can be interacted with by visiting\nhttp://localhost:8080 in a browser.\n\nThe Playground executes arbitrary snippets of Go code. Each code snippet is an\nindividual Go program and will be executed as either an executable or\na test suite. The presence of a `main` function or any `Test` or `Benchmark`\nfunctions determine what type of program it is.\tThese functions cannot be mixed;\nthat is, only one type or the other may exist within the snippet.\nLastly, all snippets must be within the `main` package.\n\n## Advanced Usage ##\n\nTypically, `playground` is started as a background service; in which case,\na configuration file should be provided. An example configuration file is:\n\n```\n{\n\t\"ServeAddress\": \"localhost:8080\",\n\t\"LogFile\": \"daemon.log\",\n\t\"PasswordSalt\": \"ed1b3112286780279e740612b0a03f2c0d1550d5e7d2197c636b5d3eb6ee51b2\",\n\t\"PasswordHash\": \"4ef6b693629568e78ad0846ee189c8e9fdf719fbe631650ad547192d9c3490ba\",\n\t\"DataPath\": \"/usr/local/playground\",\n\t\"GoBinary\": \"go\",\n\t\"FmtBinary\": \"goimports\",\n\t\"Environment\": {\n\t\t\"PATH\": \"/usr/local/bin:/usr/bin:/bin\",\n\t\t\"GOPATH\": \"/path/to/gopath\",\n\t},\n}\n```\n\nThe password fields consists of a randomly generated salt and a hashed version\nof the actual password. This pair of values can be generated with the following\nshell script:\n\n```bash\n#!/bin/bash\nread -s -p \"Password: \" PASSWORD \u0026\u0026 echo\nPASSWORD_SALT=$(head -c 1024 /dev/urandom | sha256sum | head -c 64)\nPASSWORD_HASH=$(echo -n \"$(echo $PASSWORD_SALT | xxd -r -p)${PASSWORD}\" | sha256sum | head -c 64)\necho -en \"PasswordSalt: $PASSWORD_SALT\\nPasswordHash: $PASSWORD_HASH\\n\"\nunset PASSWORD PASSWORD_SALT PASSWORD_HASH\n```\n\nSee the `Help` in `main.go` for more details about configuration options.\n\nSee the `Help` in web interface for more details about using the Playground.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsnet%2Fplayground","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdsnet%2Fplayground","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsnet%2Fplayground/lists"}