{"id":13430659,"url":"https://github.com/MACEL94/BlazorPong","last_synced_at":"2025-03-16T06:30:43.537Z","repository":{"id":38100299,"uuid":"198706787","full_name":"macel94/BlazorPong","owner":"macel94","description":"BlazorPong Project for one of my University Exams \u0026 Thesis","archived":true,"fork":false,"pushed_at":"2022-12-08T09:55:46.000Z","size":354,"stargazers_count":12,"open_issues_count":3,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-28T09:59:31.582Z","etag":null,"topics":["aspnetapp","aspnetcore-urls","azure","blazor","blazor-ap","blazor-ser","certificates","components","docker","microsoft","net-core","net-core-3","razor","signalr-core","university-exams","wasm"],"latest_commit_sha":null,"homepage":"https://github.com/macel94/cloudnativeblazorpong","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/macel94.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-24T20:39:48.000Z","updated_at":"2024-04-16T18:45:50.000Z","dependencies_parsed_at":"2023-01-24T22:45:09.164Z","dependency_job_id":null,"html_url":"https://github.com/macel94/BlazorPong","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/macel94%2FBlazorPong","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macel94%2FBlazorPong/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macel94%2FBlazorPong/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macel94%2FBlazorPong/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/macel94","download_url":"https://codeload.github.com/macel94/BlazorPong/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243835952,"owners_count":20355611,"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":["aspnetapp","aspnetcore-urls","azure","blazor","blazor-ap","blazor-ser","certificates","components","docker","microsoft","net-core","net-core-3","razor","signalr-core","university-exams","wasm"],"created_at":"2024-07-31T02:00:56.317Z","updated_at":"2025-03-16T06:30:43.208Z","avatar_url":"https://github.com/macel94.png","language":"C#","funding_links":[],"categories":["Sample Projects"],"sub_categories":["Games"],"readme":"# BlazorPong\nBlazorPong Project for one of my University Exams + Thesis\n\n## No javascript allowed(except for the JSInterop to listen to an event not supported by blazor or to log in browser console).\nTrying Blazor for the first time, please be patient.\nDevops integrated, deployed as self-contained, 32 bit because i chose the free tier plan.\nUsing SignalR Core\n\n**Server-Side Blazor**\n\nBuild status: [![Build Status](https://francesco-belacca.visualstudio.com/BlazorPong/_apis/build/status/BlazorPongServer.CI?branchName=master)](https://francesco-belacca.visualstudio.com/BlazorPong/_build/latest?definitionId=10\u0026branchName=master)\n\nDeploy status: ![Deployment Status](https://francesco-belacca.vsrm.visualstudio.com/_apis/public/Release/badge/ce5f42c0-8688-4de0-b486-36c5cebb3c0b/1/1)\n\n**Client-Side(Wasm) .NET Core Hosted Blazor**\n\nBuild status: [![Build Status](https://francesco-belacca.visualstudio.com/BlazorPong/_apis/build/status/BlazorPongWasm.CI?branchName=master)](https://francesco-belacca.visualstudio.com/BlazorPong/_build/latest?definitionId=9\u0026branchName=master)\n\nDeploy status: ![Deployment Status](https://francesco-belacca.vsrm.visualstudio.com/_apis/public/Release/badge/ce5f42c0-8688-4de0-b486-36c5cebb3c0b/2/2)\n\n**Docker Images BuildnPush**\nDeploy status: ![Deployment Status](https://vsrm.dev.azure.com/francesco-belacca/_apis/public/Release/badge/ce5f42c0-8688-4de0-b486-36c5cebb3c0b/3/3)\n\n# Websites\nServer --\u003e https://blazorpong-dev-as.azurewebsites.net/\nWasm --\u003e https://blazorpongwasm.azurewebsites.net/\nWasm with Docker and NGINX --\u003e https://www.dockerblazorpongwasm.cloud/\n\n# Credits\nInspired by https://github.com/coffeeboyds/Demos/tree/master/PongSignalR\nhttps://docs.microsoft.com/en-us/aspnet/core/security/docker-https?view=aspnetcore-3.1\nhttps://codeburst.io/load-balancing-an-asp-net-core-web-app-using-nginx-and-docker-66753eb08204\nhttps://nginx.org/en/docs\nhttps://www.c-sharpcorner.com/article/fun-with-docker-compose-using-net-core-and-nginx/\nhttps://github.com/jongio/BlazorDocker\nhttps://medium.com/@dbillinghamuk/certbot-certificate-verification-through-nginx-container-710c299ec549\n\n# DockerHub\nhttps://hub.docker.com/u/macel94\n\n# Instructions\npsw example: asdqwertyu1234QQ123eqw12\n\n--CAREFUL! USE POWERSHELL\n--CLEAN EVERYTHING\ndotnet dev-certs https --clean\n\n--GENERATE CERT\ndotnet dev-certs https -ep $env:USERPROFILE\\.aspnet\\https\\aspnetapp.pfx -p asdqwertyu1234QQ123eqw12\ndotnet dev-certs https --trust\n\n--LAUNCH http only\ndocker run -it --rm -p 80:80 --name aspnetcore_sample mcr.microsoft.com/dotnet/core/samples:aspnetapp\ndocker run -it --rm -p 8000:80 --name blazorpongwasmserver macel94/blazorpongwasmserver\n\n\n--Local dev LAUNCH https\ndocker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS=\"https://+;http://+\" -e ASPNETCORE_HTTPS_PORT=8001 -e ASPNETCORE_Kestrel__Certificates__Default__Password=\"asdqwertyu1234QQ123eqw12\" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx -v $env:USERPROFILE\\.aspnet\\https:/https/ mcr.microsoft.com/dotnet/core/samples:aspnetapp\n\n--Local dev LAUNCH https blazorpongwasmserver\ndocker run --rm -it -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS=\"https://+;http://+\" -e ASPNETCORE_HTTPS_PORT=8001 -e ASPNETCORE_Kestrel__Certificates__Default__Password=\"asdqwertyu1234QQ123eqw12\" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx -v $env:USERPROFILE\\.aspnet\\https:/https/ macel94/blazorpongwasmserver\ndocker run --rm -it -p 80:80 -p 443:443 -e ASPNETCORE_URLS=\"https://+;http://+\" -e ASPNETCORE_HTTPS_PORT=443 -e ASPNETCORE_Kestrel__Certificates__Default__Password=\"\" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/var/www/dockerblazorpongwasm.cloud/ -v %USERPROFILE%\\.aspnet\\https:/https/ macel94/blazorpongwasmserver\ndocker run --rm -it -p 80:80 -p 443:443 -e ASPNETCORE_URLS=\"https://+;http://+\" -e ASPNETCORE_HTTPS_PORT=443 -e ASPNETCORE_Kestrel__Certificates__Default__Password=\"\" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/mycertificatename.pfx -v %USERPROFILE%\\.aspnet\\https:/https/ aspnetcore-react:latest\n\n\n--ssh\nhttps://stackoverflow.com/questions/42863913/key-load-public-invalid-format\n\n--certbot\nsudo snap install core; sudo snap refresh core\nsudo snap install --classic certbot\nsudo certbot certonly --webroot --agree-tos --email email@domain.it address -d dockerblazorpongwasm.cloud -w /var/www/dockerblazorpongwasm.cloud/\n\n**DockerCompose**\n```powershell\n\ncd BlazorPong\n\ndocker-compose -f \"Docker-Compose.yml\" up -d --build\n\ndocker-compose -f \"Docker-Compose.yml\" down --remove-orphans\n\n```\n\n**PROD DEPLOY**\ndocker context create remote --docker \"host=ssh://root@HOST\"\nCD source\\repos\\MACEL94\\BlazorPong\\BlazorPongWasm\ndocker-compose -c remote -f Docker-Compose.PROD.yml up\n\nIf you get paramiko.ssh_exception.PasswordRequiredException: private key file is encrypted\nand you can't use ssh-agent on windows:\nssh-agent -s --\u003e unable to start ssh-agent service, error :1058\n\nCheck for OpenSSH Authentication Agent service, mine was disabled.\n\nIt also needs to be updated so you can ssh-add correctly: https://github.com/PowerShell/Win32-OpenSSH/issues/1263#issuecomment-499542944\n\n...still no luck. i ended up using scp\nscp .\\Docker-Compose.PROD.yml root@host:app \n\nThen ssh on machine as root\ncd app\ndocker-compose -f \"Docker-Compose.PROD.yml\" down --remove-orphans\ndocker-compose -f \"Docker-Compose.PROD.yml\" up -d --build\n\nsudo certbot certonly --webroot -w /root/certs-data/ -d dockerblazorpongwasm.cloud -d www.dockerblazorpongwasm.cloud\n\nSave certificates to localhost\nscp -r user@your.server.example.com:/path/to/foo /home/user/Desktop/\n\nTo generate localhost SSL\nUse this Dockerfile\n\n```Docker\n# we use the tiny alpine linux as base\nFROM alpine\n\n# install openssl\nRUN apk update \u0026\u0026 \\\n  apk add --no-cache openssl \u0026\u0026 \\\n  rm -rf \"/var/cache/apk/*\"\n\n# create and set mount volume\nWORKDIR /openssl-certs\nVOLUME  /openssl-certs\n\nENTRYPOINT [\"openssl\"]\n```\n\nto use it \n```bash\ndocker build -t my-openssl:latest .\n\ndocker run -it --rm -v \"C:/some/path:/openssl-certs\" my-openssl\nreq -newkey rsa:2048 -keyout privkey.pem -x509 -days 365 -out fullchain.pem\n\nreq -x509 -nodes -new -sha256 -days 1024 -newkey rsa:2048 -keyout privkey.pem -out fullchain.pem\nx509 -outform pem -in fullchain.pem -out RootCA.crt\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMACEL94%2FBlazorPong","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMACEL94%2FBlazorPong","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMACEL94%2FBlazorPong/lists"}