Giter Club home page Giter Club logo

pathwar's Introduction


The Pathwar Project

Pathwar

🤝 Pathwar is an educational platform with a focus on security/cryptography, where you can go through challenges (courses) to learn new things and hone your skills.

Code Factor Go Report Card GitHub version GoDoc

pathwar.landDiscordTwitterGitHub

Documentation

Licensing

© 2015-2021 Pathwar Staff

Licensed under the Apache License, Version 2.0 (LICENSE-APACHE) or the MIT license (LICENSE-MIT), at your option. See the COPYRIGHT file for more details.

SPDX-License-Identifier: (Apache-2.0 OR MIT)

pathwar's People

Contributors

aimxhaisse avatar blotus avatar bolnel avatar cdeleeuwe avatar cerisier avatar dependabot[bot] avatar dzalevski avatar ekelen avatar emijanina avatar gnieark avatar lfgaming avatar lucasgdev avatar mikaelvallenet avatar mlequeux avatar moul avatar moul-bot avatar omahs avatar overedge avatar pathwar-bot avatar quentinperez avatar rezarahemtola avatar rllola avatar snyk-bot avatar solvik avatar sylvainsndt avatar z-a-r-a-k-i avatar zxxma avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pathwar's Issues

getUserTeams should be getUserTournaments

tldr: you should update the code to call /tournaments instead of /user-teams

to reduce the amount of calls to do from the client, the API will provide the list of userTeams in the /tournaments endpoint that will retrieve all the available tournaments with the related user team if the user already has one

Depends on #124

Agent daemon

  • dockerfile that contains nginx + docker-compose (just the binary, not the daemon) + pwhypervisor homemade golang binary
  • the daemon itself
    • on start: remove every existing challenge containers + make a request on the API to get the global config for the hypervisor + start every challenges
    • start a bundled challenge (#112)
    • update the challenge status on the API (write call)
    • subscribe or receive hook to make hot changes on running hypervisor

Set up Firebase

Instructions for the web:

<!-- The core Firebase JS SDK is always required and must be listed first -->
<script src="https://www.gstatic.com/firebasejs/6.0.2/firebase-app.js"></script>

<!-- TODO: Add SDKs for Firebase products that you want to use
     https://firebase.google.com/docs/web/setup#config-web-app -->

<script>
  // Your web app's Firebase configuration
  var firebaseConfig = {
    apiKey: "AIzaSyBzLrepNGhispjYaJqX3xWIO9KZpZdvZCk",
    authDomain: "pathwar-pwn.firebaseapp.com",
    databaseURL: "https://pathwar-pwn.firebaseio.com",
    projectId: "pathwar-pwn",
    storageBucket: "pathwar-pwn.appspot.com",
    messagingSenderId: "1009405509165",
    appId: "1:1009405509165:web:89aaba3d48ccec7f"
  };
  // Initialize Firebase
  firebase.initializeApp(firebaseConfig);
</script>

Inconsistent build failures with Gatsby

Approx 50% of Netlify builds fail:

Example: https://app.netlify.com/sites/pathwar/deploys/5d319466fb4c450008e950c5

11:59:03 AM: Build ready to start
11:59:04 AM: build-image version: 9e0f207a27642d0115b1ca97cd5e8cebbe492f63
11:59:04 AM: build-image tag: v3.3.2
11:59:04 AM: buildbot version: ef8d0929ed0baabafd8bbb7d0b021e1fc24180c0
11:59:05 AM: Fetching cached dependencies
11:59:05 AM: Starting to download cache of 124.7MB
11:59:06 AM: Finished downloading cache in 1.04022469s
11:59:06 AM: Starting to extract cache
11:59:11 AM: Finished extracting cache in 5.567677404s
11:59:11 AM: Finished fetching cache in 6.676466977s
11:59:11 AM: Starting to prepare the repo for build
11:59:12 AM: Preparing Git Reference pull/89/head
11:59:12 AM: Found netlify.toml. Overriding site configuration
11:59:12 AM: Different publish path detected, going to use the one specified in the toml file: 'web/public' versus '' in the site
11:59:12 AM: Different build command detected, going to use the one specified in the toml file: 'npm install && npm run build' versus '' in the site
11:59:12 AM: Different base path detected, going to use the one specified in the toml file: 'web' versus '' in the site
11:59:12 AM: Starting build script
11:59:13 AM: Installing dependencies
11:59:13 AM: Started restoring cached node version
11:59:15 AM: Finished restoring cached node version
11:59:16 AM: v10.16.0 is already installed.
11:59:19 AM: Now using node v10.16.0 (npm v6.9.0)
11:59:20 AM: Attempting ruby version 2.6.2, read from environment
11:59:21 AM: Using ruby version 2.6.2
11:59:21 AM: Using PHP version 5.6
11:59:21 AM: Started restoring cached node modules
11:59:21 AM: Finished restoring cached node modules
11:59:21 AM: Started restoring cached go cache
11:59:21 AM: Finished restoring cached go cache
11:59:21 AM: unset GOOS;
11:59:21 AM: unset GOARCH;
11:59:21 AM: export GOROOT='/opt/buildhome/.gimme/versions/go1.12.linux.amd64';
11:59:21 AM: export PATH="/opt/buildhome/.gimme/versions/go1.12.linux.amd64/bin:${PATH}";
11:59:21 AM: go version >&2;
11:59:21 AM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.12.linux.amd64.env';
11:59:21 AM: go version go1.12 linux/amd64
11:59:21 AM: Installing missing commands
11:59:21 AM: Verify run directory
11:59:21 AM: Executing user command: npm install && npm run build
11:59:31 AM: npm
11:59:31 AM:  WARN [email protected] requires a peer of typescript@* but none is installed. You must install peer dependencies yourself.
11:59:31 AM: npm
11:59:31 AM: WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
11:59:31 AM: npm WARN
11:59:31 AM:  notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
11:59:31 AM: audited 21707 packages in 8.774s
11:59:31 AM: found 0 vulnerabilities
11:59:31 AM: > [email protected] build /opt/build/repo/web
11:59:31 AM: > gatsby build
11:59:33 AM: success open and validate gatsby-configs — 0.033
11:59:34 AM: success load plugins — 0.130
11:59:34 AM: success onPreInit — 0.022
11:59:34 AM: success delete html and css files from previous builds — 0.025
11:59:34 AM: success initialize cache — 0.023
11:59:34 AM: success copy gatsby files — 0.048
11:59:34 AM: success onPreBootstrap — 0.031
11:59:34 AM: success source and transform nodes — 0.061
11:59:34 AM: error ENOSPC: System limit for number of file watchers reached, watch '/opt/build/repo/web/gatsby-config.js'
11:59:34 AM: UNHANDLED EXCEPTION ENOSPC: System limit for number of file watchers reached, watch '/opt/build/repo/web/gatsby-config.js'
11:59:34 AM: See our docs page for more info on this error: https://gatsby.dev/issue-how-to
11:59:34 AM: 
11:59:34 AM:   Error: ENOSPC: System limit for number of file watchers reached, watch '/opt/b  uild/repo/web/gatsby-config.js'
11:59:34 AM:   
11:59:34 AM:   - watchers.js:165 FSWatcher.start
11:59:34 AM:     internal/fs/watchers.js:165:26
11:59:34 AM:   
11:59:34 AM:   - nodefs-handler.js:38 createFsWatchInstance
11:59:34 AM:     [web]/[chokidar]/lib/nodefs-handler.js:38:15
11:59:34 AM:   
11:59:34 AM:   - nodefs-handler.js:81 setFsWatchListener
11:59:34 AM:     [web]/[chokidar]/lib/nodefs-handler.js:81:15
11:59:34 AM:   
11:59:34 AM:   - nodefs-handler.js:233 FSWatcher.NodeFsHandler._watchWithNodeFs
11:59:34 AM:     [web]/[chokidar]/lib/nodefs-handler.js:233:14
11:59:34 AM:   
11:59:34 AM:   - nodefs-handler.js:262 FSWatcher.NodeFsHandler._handleFile
11:59:34 AM:     [web]/[chokidar]/lib/nodefs-handler.js:262:21
11:59:34 AM:   
11:59:34 AM:   - nodefs-handler.js:495 FSWatcher.<anonymous>
11:59:34 AM:     [web]/[chokidar]/lib/nodefs-handler.js:495:21
11:59:34 AM: failed during stage 'building site': Build script returned non-zero exit code: 1
11:59:34 AM:   
11:59:34 AM: 
11:59:34 AM: npm
11:59:34 AM:  ERR! code
11:59:34 AM:  ELIFECYCLE
11:59:34 AM: npm ERR! errno 1
11:59:34 AM: npm
11:59:34 AM:  ERR! [email protected] build: `gatsby build`
11:59:34 AM: npm ERR! Exit status 1
11:59:34 AM: npm ERR!
11:59:34 AM: npm ERR! Failed at the [email protected] build script.
11:59:34 AM: npm ERR!
11:59:34 AM:  This is probably not a problem with npm. There is likely additional logging output above.
11:59:34 AM: npm
11:59:34 AM:  ERR! A complete log of this run can be found in:
11:59:34 AM: npm ERR!     /opt/buildhome/.npm/_logs/2019-07-19T09_59_34_506Z-debug.log
11:59:34 AM: Skipping functions preparation step: no functions directory set
11:59:34 AM: Caching artifacts
11:59:34 AM: Started saving node modules
11:59:34 AM: Finished saving node modules
11:59:34 AM: Started saving pip cache
11:59:34 AM: Finished saving pip cache
11:59:34 AM: Started saving emacs cask dependencies
11:59:34 AM: Finished saving emacs cask dependencies
11:59:34 AM: Started saving maven dependencies
11:59:34 AM: Finished saving maven dependencies
11:59:34 AM: Started saving boot dependencies
11:59:34 AM: Finished saving boot dependencies
11:59:34 AM: Started saving go dependencies
11:59:34 AM: Finished saving go dependencies
11:59:34 AM: Error running command: Build script returned non-zero exit code: 1
11:59:34 AM: Failing build: Failed to build site
11:59:34 AM: Finished processing build request in 29.956238231s

Pathwar compose

Checklist

Pwcompose is not a daemon, it's a cli tool for developers

  • pwcompose prepare . > my.dab
    • loads a docker-compose.yml file
    • check the docker-compose.yml file and raises error if incompatible
    • adapt the file to a temporary one (docker-compose-tmp.yml)
    • exec docker-compose bundle -f docker-compose-tmp.yml --push-images)
    • print the content of the dab file
    • cleanup the docker-compose tmp file and the dab file
    • remove build:
    • add labels annotate each image (was-pulled vs was-built; etc)
    • make it work with --no-push flag (to work in local only, no need to be logged on dockerhub)
  • pwcompose up [--instance-id=1] < my.dab
    • parse prepared docker-compose
    • hardening (see #184, and #130)
    • inject pwctl
    • exec docker-compose up ...
    • communicate with pwctl
    • print on stdout: instance_id ("${flavor_id}_${instance_id}) + pwctl config (later)
  • pwcompose ps
    • list services, service instances, and service instance containers
  • pwcompose down [ID...]
    • pwcompose down -> everything started by pwcompose (checkout labels)
    • pwcompose down instanceid a specific instanceid
    • pwcompose down flavorid every instance of a flavor
    • pwcompose down flavorid@version every instance of the specified version of a flavor

Expected usage

  1. pwcompose prepare . > prepared-challenge-flavor.yml
  2. Send the yml file to someone else and ask him/her to run
  3. pwcompose up < prepared-challenge-flavor.yml

Other considerations

  • support challenges with pulled images (without build:)

Blocks #113

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.