This arkworks library describes an interface and contains an implementation for proof-carrying data (PCD).
PCD (introduced in [CT10]) is a cryptographic primitive that allows the incremental verification of a distributed computation that can continue indefinitely. A computation defined by a (possibly infinite) directed acyclic graph is augmented by attaching a succinct proof of correctness to each message, allowing any intermediate state of the computation to be verified efficiently. PCD is a generalization of IVC [Val08], or incrementally-verifiable computation, which is PCD in the case of a linear computation (that is, the graph is a path graph).
This library is released under the MIT License and the Apache v2 License (see License).
WARNING: This is an academic proof-of-concept prototype, and in particular has not received careful code review. This implementation is NOT ready for production use.
The PCD interface is here and relies on a cycle of elliptic curves (e.g. the MNT cycle). Separate CircuitSpecificSetupPCD and UniversalSetupPCD interfaces are included depending on the underlying SNARK type(s). Note that the underlying main SNARK and helper SNARK do not have to be the same, although both must implement either CircuitSpecificSetupSNARK or UniversalSetupSNARK.
Build guide
The library compiles on the stable toolchain of the Rust compiler. To install the latest version of Rust, first install rustup by following the instructions here, or via your platform’s package manager. Once rustup is installed, install the Rust toolchain by invoking:
rustup install stable
After that, use cargo, the standard Rust build tool, to build the libraries:
git clone https://github.com/arkworks-rs/pcd.git
cd pcd
cargo build
Tests
This library comes with comprehensive unit and integration tests. Run the tests with:
cargo test --all
License
The crates in this repo are licensed under either of the following licenses, at your discretion.
Unless you explicitly state otherwise, any contribution submitted for inclusion in this library by you shall be dual licensed as above (as defined in the Apache v2 License), without any additional terms or conditions.
The master branch is set up to run with etcd so if you want to run locally
then you’ll need to uncomment the seed-node config in src/main/resources/application.conf
// src/main/resources/application.conf...cluster {
roles = [frontend, backend]
// uncomment this if running locallyseed-nodes = [
"akka.tcp://ClusterSystem@127.0.0.1:2551"
]
}
Then you can run the project and curl the HTTP endpoint.
➜ curl "http://localhost:8080?msg=about+a+hotdog"
Hot Dog! (from fe: xxxxxxxx be: xxxxxxxx)%
➜ curl "http://localhost:8080?msg=about+a+dog"
Not Hot Dog :( (from fe: xxxxxxxx be: xxxxxxxx)%
Package into Docker
➜ sbt assembly
# outputs target/scala-2.12/akka-cluster-on-kubernetes-assembly-0.1.jar# now build that into a docker image
➜ docker build -t {your namespace}/akka-cluster .
Test Locally With Docker Compose
We still need etcd but we want it accessible from the same network as our app which
is now running on Docker, not on localhost. To do this we use Docker Compose.
➜ docker-compose up
Starting akkaclusteronkubernetes_etcd_1 ...
Starting akkaclusteronkubernetes_etcd_1 ... done
Starting akkaclusteronkubernetes_akka_1 ...
Starting akkaclusteronkubernetes_akka_1 ... done
Attaching to akkaclusteronkubernetes_etcd_1, akkaclusteronkubernetes_akka_1
etcd_1 | 2017-07-21 21:08:21.112937 I | etcdmain: etcd Version: 2.3.7
etcd_1 | 2017-07-21 21:08:21.113016 I | etcdmain: Git SHA: fd17c91
etcd_1 | 2017-07-21 21:08:21.113026 I | etcdmain: Go Version: go1.6.2
etcd_1 | 2017-07-21 21:08:21.113041 I | etcdmain: Go OS/Arch: linux/amd64
etcd_1 | 2017-07-21 21:08:21.113052 I | etcdmain: setting maximum number of CPUs to 2, total number of available CPUs is 2
etcd_1 | 2017-07-21 21:08:21.113058 W | etcdmain: no data-dir provided, using default data-dir ./default.etcd
etcd_1 | 2017-07-21 21:08:21.113834 N | etcdmain: the server is already initialized as member before, starting as etcd member...
etcd_1 | 2017-07-21 21:08:21.114360 I | etcdmain: listening for peers on http://localhost:2380
etcd_1 | 2017-07-21 21:08:21.114539 I | etcdmain: listening for peers on http://localhost:7001
etcd_1 | 2017-07-21 21:08:21.114584 I | etcdmain: listening for client requests on http://0.0.0.0:2379
etcd_1 | 2017-07-21 21:08:21.124405 I | etcdserver: name = default
etcd_1 | 2017-07-21 21:08:21.124445 I | etcdserver: data dir = default.etcd
etcd_1 | 2017-07-21 21:08:21.124453 I | etcdserver: member dir = default.etcd/member
etcd_1 | 2017-07-21 21:08:21.124461 I | etcdserver: heartbeat = 100ms
etcd_1 | 2017-07-21 21:08:21.124465 I | etcdserver: election = 1000ms
etcd_1 | 2017-07-21 21:08:21.124470 I | etcdserver: snapshot count = 10000
etcd_1 | 2017-07-21 21:08:21.124505 I | etcdserver: advertise client URLs = http://0.0.0.0:2379
etcd_1 | 2017-07-21 21:08:21.128006 I | etcdserver: restarting member ce2a822cea30bfca in cluster 7e27652122e8b2ae at commit index 424
etcd_1 | 2017-07-21 21:08:21.128122 I | raft: ce2a822cea30bfca became follower at term 10
etcd_1 | 2017-07-21 21:08:21.128165 I | raft: newRaft ce2a822cea30bfca [peers: [], term: 10, commit: 424, applied: 0, lastindex: 424, lastterm: 10]
etcd_1 | 2017-07-21 21:08:21.130984 I | etcdserver: starting server... [version: 2.3.7, cluster version: to_be_decided]
etcd_1 | 2017-07-21 21:08:21.134951 N | etcdserver: added local member ce2a822cea30bfca [http://localhost:2380 http://localhost:7001] to cluster 7e27652122e8b2ae
etcd_1 | 2017-07-21 21:08:21.135076 N | etcdserver: set the initial cluster version to 2.3
etcd_1 | 2017-07-21 21:08:22.431440 I | raft: ce2a822cea30bfca is starting a new election at term 10
etcd_1 | 2017-07-21 21:08:22.431735 I | raft: ce2a822cea30bfca became candidate at term 11
etcd_1 | 2017-07-21 21:08:22.431922 I | raft: ce2a822cea30bfca received vote from ce2a822cea30bfca at term 11
etcd_1 | 2017-07-21 21:08:22.432299 I | raft: ce2a822cea30bfca became leader at term 11
etcd_1 | 2017-07-21 21:08:22.432405 I | raft: raft.node: ce2a822cea30bfca elected leader ce2a822cea30bfca at term 11
etcd_1 | 2017-07-21 21:08:22.433347 I | etcdserver: published {Name:default ClientURLs:[http://0.0.0.0:2379]} to cluster 7e27652122e8b2ae
akka_1 | [INFO] [07/21/2017 21:08:24.309] [main] [akka.remote.Remoting] Starting remoting
akka_1 | [INFO] [07/21/2017 21:08:24.670] [main] [akka.remote.Remoting] Remoting started; listening on addresses :[akka.tcp://ClusterSystem@127.0.0.1:2551]
akka_1 | [INFO] [07/21/2017 21:08:24.696] [main] [akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@127.0.0.1:2551] - Starting up...
akka_1 | [INFO] [07/21/2017 21:08:24.936] [main] [akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@127.0.0.1:2551] - Registered cluster JMX MBean [akka:type=Cluster]
akka_1 | [INFO] [07/21/2017 21:08:24.936] [main] [akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@127.0.0.1:2551] - Started up successfully
akka_1 | [INFO] [07/21/2017 21:08:25.005] [ClusterSystem-akka.actor.default-dispatcher-5] [akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@127.0.0.1:2551] - No seed-nodes configured, manual cluster join required
akka_1 | [INFO] [07/21/2017 21:08:25.006] [ClusterSystem-akka.actor.default-dispatcher-2] [akka.tcp://ClusterSystem@127.0.0.1:2551/system/constructr] Creating constructr-machine, because no seed-nodes defined
akka_1 | [INFO] [07/21/2017 21:08:27.112] [ClusterSystem-akka.actor.default-dispatcher-4] [akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@127.0.0.1:2551] - Node [akka.tcp://ClusterSystem@127.0.0.1:2551] is JOINING, roles [frontend, backend]
akka_1 | [INFO] [07/21/2017 21:08:27.143] [ClusterSystem-akka.actor.default-dispatcher-4] [akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@127.0.0.1:2551] - Leader is moving node [akka.tcp://ClusterSystem@127.0.0.1:2551] to [Up]
➜ kubectl run bounce --image=markeijsermans/debug -it bash
If you don't see a command prompt, try pressing enter.(21:15 bounce-2304503334-6dqpw:/) curl etcd:2379/health{"health": "true"}
Now deploy the app! If you’ve been pushing your own Docker images, you’ll need to edit the kubernetes/nothotdog.yaml file to use your image. Specifically these lines
Executes a FFmpeg command. The second argument is an optional callback function (which only returns an error message). If you choose to enable the debug flag, the third argument should be set as true and the function will log all events during execution of the commang.
Usage
import{Component,OnInit}from"@angular/core";import{FFmpeg}from"nativescript-ffmpeg";import{VideoRecorder}from"nativescript-videorecorder";import*asPermissionsfrom"nativescript-permissions";import{isAndroid}from"tns-core-modules/platform";import*asdialogsfrom"tns-core-modules/ui/dialogs";declareconstandroid: any;
@Component({selector: "Home",moduleId: module.id,templateUrl: "./home.component.html"})exportclassHomeComponentimplementsOnInit{private_recorder=newVideoRecorder({format: "mp4",saveToGallery: true,hd: true,explanation: "We need to be able to record video"});constructor(){}ngOnInit(): void{}private_compress(src: string): void{constout=src.replace(/\.[^/.]+$/,"_COMPRESSED.mp4");FFmpeg.execute(["-i",src,"-vcodec","h264","-acodec","mp3",out],(err: string)=>{if(err){this._error(err);}else{console.log("Compressed file size "+this._getSize(out));}});}private_error(error: string|Error): Promise<void>{returndialogs.alert({title: "Uh oh...",message: (errorinstanceofError) ? error.message : error,okButtonText: "OK, got it"});}private_getSize(path: string): string{letlength: number=0;if(isAndroid){constfile=newjava.io.File(path);length=file.length();}else{constdefManager=NSFileManager.defaultManager;constfileAttributes=defManager.attributesOfItemAtPathError(path);length=fileAttributes.objectForKey(NSFileSize);}return`${(length/(1000*1000)).toFixed(2)} MB`;}private_takeVideo(): void{this._recorder.record().then((data)=>{console.log("Original file size "+this._getSize(data.file));this._compress(data.file);}).catch((error)=>{if(error.event!=="cancelled"){this._error("Couldn't record your video");}});}publictakeVideo(): void{if(isAndroid){Permissions.requestPermission([android.Manifest.permission.RECORD_AUDIO,android.Manifest.permission.CAMERA],"Demo needs Audio and Camera permissions to record a video").then(()=>{this._takeVideo();},(error)=>this._error("Demo needs Audio and Camera permissions to record a video"));}else{this._takeVideo();}}}
Runs the app in the development mode.
Open http://localhost:3000 to view it in your browser.
The page will reload when you make changes.
You may also see any lint errors in the console.
npm test
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
npm run build
Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
npm run eject
Note: this is a one-way operation. Once you eject, you can’t go back!
If you aren’t satisfied with the build tool and configuration choices, you can eject at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
You don’t have to ever use eject. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
Kotidien est une application dédiée à la gestion de votre argent. Comptes bancaires, cartes de paiements autonomes, et portefeuille d’espèces. Totalement libre et gratuite, elle vous permets de tenir vos comptes d’une main de fer. Écrite en Python 3 et compatible Linux (intégration parfaite sous KDE via l’utilisation de QT 5.12), Microsoft Windows 7 et supérieurs, Mac OS 10.11 et supérieurs.
Kotidien vous donne un accès permanent et en temps réel sur vos différents soldes, permets aussi d’automatiser l’écriture de vos transaction récurrentes, de pointer celles mises à jour sur votre interface bancaire, etc
Agencées au jour le jour, supplantées par une vue calendrier, et synthétisées sur des graphiques clairs, toutes vos transactions sont réunies au sein de Kotidien.
La complétion automatique des différentes informations permet une saisie plus rapide des données.
Plusieurs languages vous sont proposés avec par défaut le Français.
Points forts
Protection du dossier financier Kotidien par mot de passe
Copie de sauvegarde (.bak) automatique à chaque ouverture d’un dossier.
Facilement transportable, ne nécessite pas d’installation!
Assistant de création de dossiers financiers
Supporte les comptes en banques, cartes de paiements autonomes et – portefeuilles d’espèces.
Personnalisation des types de transactions (carte bancaire, virement, prélèvement, etc.)
Personnalisation des catégories et sous catégories
Personnalisation des tiers
Calcul automatique du solde du jour
Prévision automatique du solde “fin de mois”
Classement des transactions par jours
Anticipation du solde à date souhaitée
Possibilité d’ajouter titre, mémo et commentaire pour chaque transaction
Complétion automatique des données pour une écriture rapide des transactions
Gestion du découvert
Gestion des transferts entre comptes bancaires d’un même dossier Kotidien
Planification automatique de transactions avec répétitions programmables
Importation et exportation des données au format CVS programmable
Importation et exportation des données au format OFX compatible Money 98-2003
Résumé graphique des différentes évolutions de votre dossier financier
Statistiques graphiques complètes
Fichier d’aide disponible directement depuis l’application
Traduction de l’application en plusieurs langues. Français par défaut.
Possibilité de personnaliser l’apparence de Kotidien pour redistribuer l’application aux couleurs de votre système.
Incorporation facile par dossier ‘vendor’
Totalement libre et gratuit! Licence open-source GNU GPL v3
Écrite en Python, utilise QT. Supporte Windows , Linux et Mac OS.
Aucune installation n’est nécessaire. Décompressez l’archive dans le dossier de votre choix et exécutez le fichier Kotidien ou Kotidien.exe pour lancer l’application
pycountry provides the ISO databases for the standards:
639-3 Languages
3166 Countries
3166-3 Deleted countries
3166-2 Subdivisions of countries
4217 Currencies
15924 Scripts
The package includes a copy from Debian’s pkg-isocodes and makes the data accessible through a Python API.
Translation files for the various strings are included as well.
PyQtGraph is a pure-python graphics and GUI library built on PyQt4/PyQt5/PySide/PySide2 and numpy.
It is intended for use in mathematics / scientific / engineering applications. Despite being written entirely in python, the library is very fast due to its heavy leverage of numpy for number crunching, Qt’s GraphicsView framework for 2D display, and OpenGL for 3D display.
fpdf2 is a minimalist PDF creation library for Python:
It is a fork and the successor of PyFPDF. Compared with other PDF libraries, fpdf2 is simple, small and versatile, with advanced capabilities, and is easy to learn, extend and maintain.
ofxtools is a Python library for working with Open Financial Exchange (OFX) data – the standard format for downloading financial information from banks and stockbrokers. OFX data is widely provided by financial institutions so that their customers can import transactions into financial management software such as Quicken, Microsoft Money, or GnuCash.
If you want to download your transaction data outside of one of these programs – if you wish to develop a Python application to use this data – if you need to generate your own OFX-formatted data… ofxtools is for you!
cryptography is a package which provides cryptographic recipes and primitives to Python developers. Our goal is for it to be your “cryptographic standard library”. It supports Python 3.6+ and PyPy3 7.2+.
cryptography includes both high level recipes and low level interfaces to common cryptographic algorithms such as symmetric ciphers, message digests, and key derivation functions.
Six is a Python 2 and 3 compatibility library. It provides utility functions for smoothing over the differences between the Python versions with the goal of writing Python code that is compatible on both Python versions. See the documentation for more information on what is provided.
Kotidien est sous licence libre et open-source GNU GPL v3. Cette licence vous permet de redistribuer, modifier et améliorer Kotidien à votre guise. Elle vous interdit de revendre l’application ou ce qu’elle contient.
Toute modification, redistribution ou amélioration devra citer l’auteur original dans le respect de la licence.
Utiliser un conteneur Docker. Tout terrain, simple et efficace.
Benoit485 propose d’utiliser Docker pour compiler et lancer Kotidien sur votre machine sans vous soucier des versions de Python et des dépendances requises. Pratique non? 😉
Pour ce faire, vous retrouverez toutes les instructions nécessaires dans son dépot dédié: Kotidien_docker
Compiler manuellement. J’aime le cambouis, j’y mets les mains…
Kotidien est une application dédiée à la gestion de votre argent. Comptes bancaires, cartes de paiements autonomes, et portefeuille d’espèces. Totalement libre et gratuite, elle vous permets de tenir vos comptes d’une main de fer. Écrite en Python 3 et compatible Linux (intégration parfaite sous KDE via l’utilisation de QT 5.12), Microsoft Windows 7 et supérieurs, Mac OS 10.11 et supérieurs.
Kotidien vous donne un accès permanent et en temps réel sur vos différents soldes, permets aussi d’automatiser l’écriture de vos transaction récurrentes, de pointer celles mises à jour sur votre interface bancaire, etc
Agencées au jour le jour, supplantées par une vue calendrier, et synthétisées sur des graphiques clairs, toutes vos transactions sont réunies au sein de Kotidien.
La complétion automatique des différentes informations permet une saisie plus rapide des données.
Plusieurs languages vous sont proposés avec par défaut le Français.
Points forts
Protection du dossier financier Kotidien par mot de passe
Copie de sauvegarde (.bak) automatique à chaque ouverture d’un dossier.
Facilement transportable, ne nécessite pas d’installation!
Assistant de création de dossiers financiers
Supporte les comptes en banques, cartes de paiements autonomes et – portefeuilles d’espèces.
Personnalisation des types de transactions (carte bancaire, virement, prélèvement, etc.)
Personnalisation des catégories et sous catégories
Personnalisation des tiers
Calcul automatique du solde du jour
Prévision automatique du solde “fin de mois”
Classement des transactions par jours
Anticipation du solde à date souhaitée
Possibilité d’ajouter titre, mémo et commentaire pour chaque transaction
Complétion automatique des données pour une écriture rapide des transactions
Gestion du découvert
Gestion des transferts entre comptes bancaires d’un même dossier Kotidien
Planification automatique de transactions avec répétitions programmables
Importation et exportation des données au format CVS programmable
Importation et exportation des données au format OFX compatible Money 98-2003
Résumé graphique des différentes évolutions de votre dossier financier
Statistiques graphiques complètes
Fichier d’aide disponible directement depuis l’application
Traduction de l’application en plusieurs langues. Français par défaut.
Possibilité de personnaliser l’apparence de Kotidien pour redistribuer l’application aux couleurs de votre système.
Incorporation facile par dossier ‘vendor’
Totalement libre et gratuit! Licence open-source GNU GPL v3
Écrite en Python, utilise QT. Supporte Windows , Linux et Mac OS.
Aucune installation n’est nécessaire. Décompressez l’archive dans le dossier de votre choix et exécutez le fichier Kotidien ou Kotidien.exe pour lancer l’application
pycountry provides the ISO databases for the standards:
639-3 Languages
3166 Countries
3166-3 Deleted countries
3166-2 Subdivisions of countries
4217 Currencies
15924 Scripts
The package includes a copy from Debian’s pkg-isocodes and makes the data accessible through a Python API.
Translation files for the various strings are included as well.
PyQtGraph is a pure-python graphics and GUI library built on PyQt4/PyQt5/PySide/PySide2 and numpy.
It is intended for use in mathematics / scientific / engineering applications. Despite being written entirely in python, the library is very fast due to its heavy leverage of numpy for number crunching, Qt’s GraphicsView framework for 2D display, and OpenGL for 3D display.
fpdf2 is a minimalist PDF creation library for Python:
It is a fork and the successor of PyFPDF. Compared with other PDF libraries, fpdf2 is simple, small and versatile, with advanced capabilities, and is easy to learn, extend and maintain.
ofxtools is a Python library for working with Open Financial Exchange (OFX) data – the standard format for downloading financial information from banks and stockbrokers. OFX data is widely provided by financial institutions so that their customers can import transactions into financial management software such as Quicken, Microsoft Money, or GnuCash.
If you want to download your transaction data outside of one of these programs – if you wish to develop a Python application to use this data – if you need to generate your own OFX-formatted data… ofxtools is for you!
cryptography is a package which provides cryptographic recipes and primitives to Python developers. Our goal is for it to be your “cryptographic standard library”. It supports Python 3.6+ and PyPy3 7.2+.
cryptography includes both high level recipes and low level interfaces to common cryptographic algorithms such as symmetric ciphers, message digests, and key derivation functions.
Six is a Python 2 and 3 compatibility library. It provides utility functions for smoothing over the differences between the Python versions with the goal of writing Python code that is compatible on both Python versions. See the documentation for more information on what is provided.
Kotidien est sous licence libre et open-source GNU GPL v3. Cette licence vous permet de redistribuer, modifier et améliorer Kotidien à votre guise. Elle vous interdit de revendre l’application ou ce qu’elle contient.
Toute modification, redistribution ou amélioration devra citer l’auteur original dans le respect de la licence.
Utiliser un conteneur Docker. Tout terrain, simple et efficace.
Benoit485 propose d’utiliser Docker pour compiler et lancer Kotidien sur votre machine sans vous soucier des versions de Python et des dépendances requises. Pratique non? 😉
Pour ce faire, vous retrouverez toutes les instructions nécessaires dans son dépot dédié: Kotidien_docker
Compiler manuellement. J’aime le cambouis, j’y mets les mains…
Before using g10k with a large Puppet setup with many modules, be sure to increase the amount of open file handles (nfiles) and number of child processes (nproc), see limits.conf(5) for details.
If you are using a private Git or Forge server think about adjusting the -maxworker parameter/config setting before DOSing your own infrastructure 😉 (default 50)
To protect your local machine use -maxextractworker parameter/config setting with wich you can limit the number of Goroutines that are allowed to run in parallel for local Git and Forge module extracting processes (git clone, untar and gunzip) (default 20)
installation of g10k via Puppet module
User @Conzar was so nice and shared his g10k Puppet module that you can check out here:
Usage of ./g10k:
-branch string
which git branch of the Puppet environment to update. Just the branch name, e.g. master, qa, dev
-cachedir string
allows overriding of the g10k config file cachedir setting, the folder in which g10k will download git repositories and Forge modules
-check4update
only check if the is newer version of the Puppet module avaialable. Does implicitly set dryrun to true
-checksum
get the md5 check sum for each Puppetlabs Forge module and verify the integrity of the downloaded archive. Increases g10k run time!
-clonegit
populate the Puppet environment with a git clone of each git Puppet module. Helpful when developing locally with -puppetfile
-config string
which config file to use
-debug
log debug output, defaults to false
-dryrun
do not modify anything, just print what would be changed
-environment string
which Puppet environment to update. Source name inside the config + '_' + branch name, e.g. foo_master, foo_qa, foo_dev
-force
purge the Puppet environment directory and do a full sync
-gitobjectsyntaxnotsupported
if your git version is too old to support reference syntax like master^{object} use this setting to revert to the older syntax
-info
log info output, defaults to false
-maxextractworker int
how many Goroutines are allowed to run in parallel for local Git and Forge module extracting processes (git clone, untar and gunzip) (default 20)
-maxworker int
how many Goroutines are allowed to run in parallel for Git and Forge module resolving (default 50)
-module string
which module of the Puppet environment to update, e.g. stdlib
-moduledir string
allows overriding of Puppetfile specific moduledir setting, the folder in which Puppet modules will be extracted
-outputname string
overwrite the environment name if -branch is specified
-puppetfile
install all modules from Puppetfile in cwd
-puppetfilelocation string
which Puppetfile to use in -puppetfile mode (default "./Puppetfile")
-quiet
no output, defaults to false
-retrygitcommands
if g10k should purge the local repository and retry a failed git command (clone or remote update) instead of failing
-tags
to pull tags as well as branches
-usecachefallback
if g10k should try to use its cache for sources and modules instead of failing
-usemove
do not use hardlinks to populate your Puppet environments with Puppetlabs Forge modules. Instead uses simple move commands and purges the Forge cache directory after each run! (Useful for g10k runs inside a Docker container)
-validate
only validate given configuration and exit
-verbose
log verbose output, defaults to false
-version
show build time and version number
Regarding anything usage/workflow you really can just use the great puppetlabs/r10k docs as the Puppetfile etc. are all intentionally kept unchanged.
Using g10k behind a proxy
Set the environment variables http_proxy or https_proxy to make g10k use a proxy.
E.g. http_proxy=http://proxy.domain.tld:8080 ./g10k -puppetfile
See https://golang.org/pkg/net/http/#ProxyFromEnvironment for details.
additional Puppetfile features
link Git module branch to the current environment branch:
mod 'awesomemodule',
:git => 'http://github.com/foo/bar.git',
:link => 'true'
If you are in environment branch dev then g10k would try to check out this module with branch dev.
This helps to be able to use the same Puppetfile over multiple environment branches and makes merges easier.
See #6 for details.
Now also supports the r10k setting name :branch => :control_branch See #73
only clone if branch/tag/commit exists
mod 'awesomemodule',
:git => 'http://github.com/foo/bar.git',
:ignore-unreachable => 'true'
In combination with the previous link feature you don’t need to keep all environment branches also available for your modules.
See #9 for details.
use different Forge base URL for your modules in your Puppetfile
forge.baseUrl http://foobar.domain.tld/
skip version checks for latest Forge modules for a certain time to speed up the sync
try multiple Git branches for a Puppet module until one can be used
mod 'stdlib',
:git => 'https://github.com/puppetlabs/puppetlabs-stdlib.git',
:fallback => '4.889.x|foobar|master'
In this example g10k tries to use the branches:
4.889.x -> foobar -> master
Because there are no branches 4.889.x or foobar.
All without failing or error messages.
Tip: You can see which branch was used, when using the -verbose parameter:
./g10k -puppetfile -verbose
2016/11/08 14:16:40 Executing git --git-dir ./tmp/https-__github.com_puppetlabs_puppetlabs-stdlib.git remote update --prune took 1.05001s
2016/11/08 14:16:40 Executing git --git-dir ./tmp/https-__github.com_puppetlabs_puppetlabs-stdlib.git log -n1 --pretty=format:%H master took 0.00299s
Synced ./Puppetfile with 4 git repositories and 0 Forge modules in 1.1s with git (1.1s sync, I/O 0.0s) and Forge (0.0s query+download, I/O 0.0s)
Now also supports the r10k setting name :default_branch => 'master' See #73
additionl Git attribute :use_ssh_agent:
Normally g10k adds the SSH key specified in the g10k config for each SSH+Git module in your Puppetfile.
If you don’t want to use this SSH key, need a different key for a certain Git module or have the key encrypted in your SSH agent, then use this parameter to skip the ssh-add commands:
For (some) increased security you can add a SHA256 sum for each Forge module, which g10k will verify after downloading the respective .tar.gz file:
mod 'puppetlabs/ntp', '6.0.0', :sha256sum => 'a988a172a3edde6ac2a26d0e893faa88d37bc47465afc50d55225a036906c944'
This does provide a very crude way to detect manipulated Forge modules and MITM attacks until the Puppetlabs Forge does support some sort of signing of Forge module releases.
If the SHA256 sum does not match the expected hash sum, g10k will warn the user and retry a download until giving up:
Resolving Forge modules (0/1) --- [--------------------------------------------------------------------] 0%
WARNING: calculated sha256sum a988a172a3edde6ac2a26d0e893faa88d37bc47465afc50d55225a036906c944 for ./tmp/puppetlabs-ntp-6.0.0.tar.gz does not match expected sha256sum a988a172a3edde6ac2a26d0e893faa88d37bc47465afc50d55225a036906c94
Resolving Forge modules (0/1) --- [--------------------------------------------------------------------] 0%
WARNING: calculated sha256sum a988a172a3edde6ac2a26d0e893faa88d37bc47465afc50d55225a036906c944 for ./tmp/puppetlabs-ntp-6.0.0.tar.gz does not match expected sha256sum a988a172a3edde6ac2a26d0e893faa88d37bc47465afc50d55225a036906c94
2016/12/08 18:05:11 downloadForgeModule(): giving up for Puppet module puppetlabs-ntp version: 6.0.0
(The Forge module retry count in case the Puppetlabs Forge provided MD5 sum, file archive size or SHA256 sum doesn’t match defaults to 1, but will be user configurable later.)
override g10k cache directory with environment variable
You can use the following environment variable to make g10k use a different cache directory:
g10k_cachedir=/var/tmp g10k ...
This will also override the -cachedir parameter.
additional g10k config features compared to r10k
you can enforce version numbers of Forge modules in your Puppetfiles instead of :latest or :present by adding force_forge_versions: true to the g10k config in the specific resource
If g10k then encounters :latest or :present for a Forge module it errors out with:
2016/11/15 18:45:38 Error: Found present setting for forge module in /tmp/example/example_benchmark/Puppetfile for module puppetlabs/concat line: mod 'puppetlabs/concat' and force_forge_versions is set to true! Please specify a version (e.g. '2.3.0')
g10k can let you know if your source does not contain the branch you specified with the -branch parameter:
This can be helpful if you use a dedicated hiera repository/g10k source and you want to ensure that you always have a matching branch, see #45
By default g10k fails if one of your Puppet environments could not be completely populated (e.g. if one of your Puppet Git module branches doesn’t exist anymore). You can change this by setting ignore_unreachable_modules to true in your g10k config:
If you then call g10k with this config file. You should get:
WARN: git repository git://github.com/xorpaul/g10k-environment-unavailable.git does not exist or is unreachable at this moment!
WARNING: Could not resolve git repository in source 'example' (git://github.com/xorpaul/g10k-environment-unavailable.git)
with an exit code 1
g10k can use the cached version of Forge and git modules if their sources are currently not available:
If you then call g10k with this config file and your github.com repository is unavailable your g10k run tries to find a suitable cached version of your modules:
WARN: git repository https://github.com/puppetlabs/puppetlabs-firewall.git does not exist or is unreachable at this moment!
WARN: Trying to use cache for https://github.com/puppetlabs/puppetlabs-firewall.git git repository
if your g10k did manage to at least once cache this git repository.
If there is no useable cache available your g10k run still fails.
You can let g10k retry to git clone or update the local repository if it failed before and was left in a corrupted state:
If you then call g10k with this config file and have a corrupted local Git repository, g10k deletes the local cache and retries the Git clone command once:
WARN: git command failed: git --git-dir /tmp/g10k/modules/https-__github.com_puppetlabs_puppetlabs-firewall.git remote update --prune deleting local cached repository and retrying...
If you then call g10k with this config file and have a branch named something like single_autocorrect-%-fooo it will be renamed to single_autocorrect___fooo
To check for really existing objects, g10k uses master^{object} syntax, which is not supported in older Git versions, like on CentOS 6, see #91
g10k will skip this sanity check when the g10k config setting git_object_syntax_not_supported is set to true (defaults to false)
Example:
Added support for r10k-like purge behaviour of stale content
Starting with v.0.9.0 g10k supports the r10k-like purge behaviour of stale content with the different configuration settings purge_level and purge_allowlist as documented here for purge_levels and here for purge_allowlist
Please check if you need to allowlist files/folders inside your Puppet environments!
As an additional setting, you can also allowlist Puppet environments with deployment_purge_allowlist, that would’ve been purged by the deploymentpurge_level.
This can be helpful if you have a similar source name or prefix set. E.g. having a source called foobar and another one foobar_hiera would have purged all foobar_hiera_* branches if there are not branches called hiera_master or similar in the foobar source.
See #166 for the discussion and #167 for the merge request.
building
# only initially needed to resolve all dependencies
go get
# actually compiling the binary with the current date as build time
BUILDTIME=$(date -u '+%Y-%m-%d_%H:%M:%S') && go build -ldflags "-s -w -X main.buildtime=$BUILDTIME"
All functions that call the API in any way return a tuple of the format:
{:ok,value}{:error,reason}
To indicate whether the API call was successful or not.
For example
iex>MISP.Event.create(%MISP.EventInfo{info: "my event"}){:ok,%MISP.Event{}}iex>MISP.Event.create(%MISP.EventInfo{}){:error,"Event.info: Info cannot be empty."}
Create an event
{:ok,my_event}=%MISP.EventInfo{info: "my event"}|>MISP.Event.create()
Retrive an event
{:ok,my_event}=MISP.Event.get(15)
Update an event
{:ok,my_event}=MISP.Event.get(17){:ok,my_updated_event}=my_event|>put_in([:Event,:info],"my new info field")|>MISP.Event.update()
{:ok,my_event}=MISP.Event.get(17){:ok,tagged_event}=my_event|>MISP.Event.add_tag(%MISP.Tag{name: "my tag"})|>MISP.Event.update()
Tag an attribute
{:ok,matching}=MISP.Attribute.search(%{value: "8.8.8.8"}){:ok,updated_attr}=matching|>List.first()|>MISP.Attribute.add_tag(%MISP.Tag{name: "my tag"})|>MISP.Attribute.update()
Create an event with attributes and tags already applied
%MISP.EventInfo{info: "my event",Attribute: [%MISP.Attribute{value: "8.8.8.8",type: "ip-dst",Tag: [%MISP.Tag{name: "my attribute-level tag"}]}],Tag: [%MISP.Tag{name: "my event-level tag"}]}|>MISP.Event.create()