├── README.md ├── todo-single ├── run.sh ├── nodejs-source │ ├── compile.sh │ ├── run.sh │ ├── todo │ │ ├── lib │ │ │ └── dependencies │ │ │ │ └── fonts │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ └── glyphicons-halflings-regular.woff │ │ ├── hello.html │ │ └── css │ │ │ └── style.css │ ├── package.json │ ├── models │ │ └── db.js │ ├── README.md │ └── app.js ├── enable-rh-nodejs8.sh ├── build.sh └── Dockerfile ├── loadtest ├── requirements.txt ├── README.md └── app.py ├── scaling └── index.php ├── helm └── charts │ ├── influxdb │ ├── ci │ │ ├── default-values.yaml │ │ └── auth-init-script-values.yaml │ ├── OWNERS │ ├── templates │ │ ├── init-config.yaml │ │ ├── backup-retention-configmap.yaml │ │ ├── serviceaccount.yaml │ │ ├── secret.yaml │ │ ├── backup-pvc.yaml │ │ ├── meta-service.yaml │ │ ├── meta-configmap.yaml │ │ ├── ingress.yaml │ │ ├── service.yaml │ │ ├── _helpers.tpl │ │ └── NOTES.txt │ ├── .helmignore │ ├── Chart.yaml │ └── files │ │ └── backup-retention-script.sh │ ├── mysql-persistent │ ├── mysql-persistent-0.0.2.tgz │ ├── charts │ │ └── mysql-imagestreams-0.0.1.tgz │ ├── templates │ │ ├── persistentvolumeclaim.yaml │ │ ├── service.yaml │ │ ├── secret.yaml │ │ ├── tests │ │ │ └── test-mysql-connection.yaml │ │ └── deploymentconfig.yaml │ ├── values.yaml │ ├── Chart.yaml │ ├── values.schema.json │ └── README.md │ ├── etherpad-0.0.6 │ ├── Chart.yaml │ ├── templates │ │ ├── service.yaml │ │ ├── route.yaml │ │ ├── pvc.yaml │ │ ├── ingress.yaml │ │ ├── _helpers.tpl │ │ └── deployment.yaml │ ├── .helmignore │ ├── .test.sh │ └── values.yaml │ └── etherpad-0.0.7 │ ├── Chart.yaml │ ├── templates │ ├── service.yaml │ ├── route.yaml │ ├── pvc.yaml │ ├── ingress.yaml │ ├── _helpers.tpl │ └── deployment.yaml │ ├── .helmignore │ ├── .test.sh │ └── values.yaml ├── todo-angular ├── src │ ├── favicon.ico │ ├── assets │ │ ├── css │ │ │ ├── fonts │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ └── glyphicons-halflings-regular.woff │ │ │ ├── app.css │ │ │ └── libs │ │ │ │ ├── angular-motion │ │ │ │ └── modules │ │ │ │ │ ├── fade.min.css │ │ │ │ │ ├── fade-and-scale.min.css │ │ │ │ │ ├── fade.css │ │ │ │ │ └── fade-and-scale.css │ │ │ │ └── angular-xeditable │ │ │ │ └── xeditable.css │ │ ├── js │ │ │ ├── app │ │ │ │ ├── ui │ │ │ │ │ ├── filters.js │ │ │ │ │ ├── gravatar.js │ │ │ │ │ ├── focus.js │ │ │ │ │ └── editable.js │ │ │ │ ├── module.js │ │ │ │ ├── states │ │ │ │ │ └── states.js │ │ │ │ └── domain │ │ │ │ │ └── todoitems.js │ │ │ └── libs │ │ │ │ ├── angular-strap │ │ │ │ └── modules │ │ │ │ │ ├── tooltip.tpl.min.js │ │ │ │ │ ├── popover.tpl.min.js │ │ │ │ │ ├── tooltip.tpl.js │ │ │ │ │ ├── alert.tpl.min.js │ │ │ │ │ ├── popover.tpl.js │ │ │ │ │ ├── typeahead.tpl.min.js │ │ │ │ │ ├── alert.tpl.js │ │ │ │ │ ├── raf.min.js │ │ │ │ │ ├── tab.tpl.min.js │ │ │ │ │ ├── typeahead.tpl.js │ │ │ │ │ ├── select.tpl.min.js │ │ │ │ │ ├── aside.tpl.min.js │ │ │ │ │ ├── modal.tpl.min.js │ │ │ │ │ ├── tab.tpl.js │ │ │ │ │ ├── dropdown.tpl.min.js │ │ │ │ │ ├── select.tpl.js │ │ │ │ │ ├── debounce.min.js │ │ │ │ │ ├── aside.tpl.js │ │ │ │ │ ├── modal.tpl.js │ │ │ │ │ ├── dropdown.tpl.js │ │ │ │ │ ├── navbar.min.js │ │ │ │ │ ├── parse-options.min.js │ │ │ │ │ ├── tab.min.js │ │ │ │ │ ├── aside.min.js │ │ │ │ │ ├── popover.min.js │ │ │ │ │ ├── alert.min.js │ │ │ │ │ ├── datepicker.tpl.min.js │ │ │ │ │ ├── datepicker.tpl.js │ │ │ │ │ ├── debounce.js │ │ │ │ │ ├── dimensions.min.js │ │ │ │ │ ├── navbar.js │ │ │ │ │ ├── dropdown.min.js │ │ │ │ │ ├── raf.js │ │ │ │ │ ├── tab.js │ │ │ │ │ ├── parse-options.js │ │ │ │ │ ├── button.min.js │ │ │ │ │ ├── timepicker.tpl.min.js │ │ │ │ │ ├── timepicker.tpl.js │ │ │ │ │ ├── date-parser.min.js │ │ │ │ │ ├── affix.min.js │ │ │ │ │ └── aside.js │ │ │ │ └── angular │ │ │ │ ├── angular-csp.css │ │ │ │ ├── angular-cookies.min.js │ │ │ │ ├── angular-loader.min.js │ │ │ │ ├── angular-cookies.min.js.map │ │ │ │ └── angular-loader.min.js.map │ │ └── partials │ │ │ ├── list.html │ │ │ ├── edit.html │ │ │ └── create.html │ ├── ToDoApp.iml │ └── README.md ├── nginx │ ├── dhparam.pem │ ├── conf.d │ │ └── ssl.conf │ └── nginx.conf ├── Dockerfile ├── ssl │ └── certs │ │ ├── tls.crt │ │ └── tls.key └── README.md ├── hello-world-nginx ├── index.html ├── nginxconf.sed └── Dockerfile ├── todo-frontend ├── src │ ├── lib │ │ └── dependencies │ │ │ └── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ └── glyphicons-halflings-regular.woff │ ├── hello.html │ └── css │ │ └── style.css ├── Dockerfile └── nginx.conf ├── python-load ├── Dockerfile └── load.py ├── books ├── main.go ├── Dockerfile ├── database.go ├── Makefile ├── template.html ├── server.go ├── seed.go ├── README.md └── books.go ├── .gitignore ├── exoplanets ├── main.go ├── Dockerfile ├── database.go ├── server.go ├── fetch_planets.py ├── Makefile ├── template.html ├── README.md └── exoplanets.go ├── php-ssl ├── httpd │ ├── www.conf │ ├── ssl.conf │ └── httpd.conf ├── Dockerfile ├── ssl │ └── certs │ │ ├── tls.crt │ │ └── tls.key ├── README.md └── index.php └── famous-quotes ├── layout.html └── Dockerfile /README.md: -------------------------------------------------------------------------------- 1 | # DO280-apps -------------------------------------------------------------------------------- /todo-single/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | node app.js 4 | 5 | -------------------------------------------------------------------------------- /loadtest/requirements.txt: -------------------------------------------------------------------------------- 1 | Flask==1.0.2 2 | requests==2.22.0 3 | -------------------------------------------------------------------------------- /todo-single/nodejs-source/compile.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | npm install -------------------------------------------------------------------------------- /scaling/index.php: -------------------------------------------------------------------------------- 1 | Server IP: 2 | -------------------------------------------------------------------------------- /todo-single/nodejs-source/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | node app.js 4 | 5 | -------------------------------------------------------------------------------- /helm/charts/influxdb/ci/default-values.yaml: -------------------------------------------------------------------------------- 1 | # Default values only, no overrides 2 | -------------------------------------------------------------------------------- /loadtest/README.md: -------------------------------------------------------------------------------- 1 | # loadtest 2 | Generate workloads for CPU and memory on request 3 | -------------------------------------------------------------------------------- /todo-angular/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RedHatTraining/DO280-apps/HEAD/todo-angular/src/favicon.ico -------------------------------------------------------------------------------- /hello-world-nginx/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Hello, world from nginx!

4 | 5 | 6 | -------------------------------------------------------------------------------- /todo-single/enable-rh-nodejs8.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source /opt/rh/rh-nodejs8/enable 3 | export X_SCLS="`scl enable rh-nodejs8 'echo $X_SCLS'`" 4 | -------------------------------------------------------------------------------- /helm/charts/mysql-persistent/mysql-persistent-0.0.2.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RedHatTraining/DO280-apps/HEAD/helm/charts/mysql-persistent/mysql-persistent-0.0.2.tgz -------------------------------------------------------------------------------- /helm/charts/mysql-persistent/charts/mysql-imagestreams-0.0.1.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RedHatTraining/DO280-apps/HEAD/helm/charts/mysql-persistent/charts/mysql-imagestreams-0.0.1.tgz -------------------------------------------------------------------------------- /todo-angular/src/assets/css/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RedHatTraining/DO280-apps/HEAD/todo-angular/src/assets/css/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /todo-angular/src/assets/css/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RedHatTraining/DO280-apps/HEAD/todo-angular/src/assets/css/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /helm/charts/influxdb/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - rawkode 3 | - gitirabassi 4 | - aisuko 5 | - naseemkullah 6 | reviewers: 7 | - rawkode 8 | - gitirabassi 9 | - aisuko 10 | - naseemkullah 11 | -------------------------------------------------------------------------------- /todo-angular/src/assets/css/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RedHatTraining/DO280-apps/HEAD/todo-angular/src/assets/css/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /todo-frontend/src/lib/dependencies/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RedHatTraining/DO280-apps/HEAD/todo-frontend/src/lib/dependencies/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /todo-frontend/src/lib/dependencies/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RedHatTraining/DO280-apps/HEAD/todo-frontend/src/lib/dependencies/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /todo-frontend/src/lib/dependencies/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RedHatTraining/DO280-apps/HEAD/todo-frontend/src/lib/dependencies/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /todo-single/nodejs-source/todo/lib/dependencies/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RedHatTraining/DO280-apps/HEAD/todo-single/nodejs-source/todo/lib/dependencies/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /todo-single/nodejs-source/todo/lib/dependencies/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RedHatTraining/DO280-apps/HEAD/todo-single/nodejs-source/todo/lib/dependencies/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /todo-single/nodejs-source/todo/lib/dependencies/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RedHatTraining/DO280-apps/HEAD/todo-single/nodejs-source/todo/lib/dependencies/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /todo-single/nodejs-source/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "todo", 3 | "version": "0.0.1", 4 | "private": true, 5 | "dependencies": { 6 | "restify": "8.4.0", 7 | "sequelize": "5.21.1", 8 | "mysql2": "2.0.0" 9 | } 10 | } -------------------------------------------------------------------------------- /todo-single/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "Preparing build folder" 4 | rm -fr build 5 | mkdir -p build 6 | cp -ap nodejs-source/* build 7 | rm build/*.sh 8 | chmod -R a+rwX build 9 | 10 | podman build --layers=false -t do280/todo-single . 11 | -------------------------------------------------------------------------------- /hello-world-nginx/nginxconf.sed: -------------------------------------------------------------------------------- 1 | s/listen 80/listen 8080/ 2 | s/listen \[::\]:80/listen \[::\]:8080/ 3 | s/user nginx;// 4 | s%error_log /var/log/nginx/error.log%error_log stderr% 5 | s%access_log /var/log/nginx/access.log main;%% 6 | -------------------------------------------------------------------------------- /todo-angular/src/assets/css/app.css: -------------------------------------------------------------------------------- 1 | a.form-control-static.editable-click { 2 | display: block; 3 | border-bottom: none; 4 | } 5 | .form-control-static pre { 6 | background-color: transparent; 7 | } 8 | 9 | .btn .label { 10 | padding-left: 5px; 11 | } 12 | -------------------------------------------------------------------------------- /todo-frontend/src/hello.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | HTML5 Todo App 4 | 5 | 6 |

Test HTML page

7 |
8 |

9 | This is just a test page to check Nginx is working before involving Angular and the REST services. 10 |

11 | 12 | 13 | -------------------------------------------------------------------------------- /todo-single/nodejs-source/todo/hello.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | HTML5 Todo App 4 | 5 | 6 |

Test HTML page

7 |
8 |

9 | This is just a test page to check Apache Httpd is working before involving Angular and the REST services. 10 |

11 | 12 | 13 | -------------------------------------------------------------------------------- /helm/charts/influxdb/templates/init-config.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.initScripts.enabled -}} 2 | apiVersion: v1 3 | kind: ConfigMap 4 | metadata: 5 | name: {{ include "influxdb.fullname" . }}-init 6 | labels: 7 | {{- include "influxdb.labels" . | nindent 4 }} 8 | data: 9 | {{ toYaml .Values.initScripts.scripts | indent 2 }} 10 | {{- end -}} 11 | -------------------------------------------------------------------------------- /helm/charts/etherpad-0.0.6/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: etherpad 3 | description: A Helm chart for etherpad lite 4 | type: application 5 | version: 0.0.6 6 | appVersion: latest 7 | home: https://github.com/redhat-cop/helm-charts 8 | icon: https://pbs.twimg.com/profile_images/1336377123964145665/2gTadaDt_400x400.jpg 9 | maintainers: 10 | - name: eformat 11 | -------------------------------------------------------------------------------- /helm/charts/etherpad-0.0.7/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: etherpad 3 | description: A Helm chart for etherpad lite 4 | type: application 5 | version: 0.0.7 6 | appVersion: latest 7 | home: https://github.com/redhat-cop/helm-charts 8 | icon: https://pbs.twimg.com/profile_images/1336377123964145665/2gTadaDt_400x400.jpg 9 | maintainers: 10 | - name: eformat 11 | -------------------------------------------------------------------------------- /helm/charts/mysql-persistent/templates/persistentvolumeclaim.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | labels: 5 | template: mysql-persistent-template 6 | name: {{ .Values.database_service_name }} 7 | spec: 8 | accessModes: 9 | - ReadWriteOnce 10 | resources: 11 | requests: 12 | storage: {{ .Values.volume_capacity }} 13 | -------------------------------------------------------------------------------- /python-load/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM registry.access.redhat.com/ubi8/python-36:latest 2 | 3 | LABEL version="1.0" \ 4 | description="Application for stressing the system" \ 5 | creationDate="2019-12-10" \ 6 | updatedDate="2019-12-28" 7 | 8 | USER 0 9 | RUN pip3 install numpy 10 | 11 | ADD load.py $HOME/ 12 | 13 | ENTRYPOINT [ "python3", "./load.py" ] 14 | 15 | USER 1001 16 | -------------------------------------------------------------------------------- /todo-single/nodejs-source/models/db.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports.params = { 3 | dbname: process.env.MYSQL_ENV_MYSQL_DATABASE, 4 | username: process.env.MYSQL_ENV_MYSQL_USER, 5 | password: process.env.MYSQL_ENV_MYSQL_PASSWORD, 6 | params: { 7 | host: process.env.MYSQL_SERVICE_HOST, 8 | port: process.env.MYSQL_SERVICE_PORT, 9 | dialect: 'mysql' 10 | } 11 | }; 12 | -------------------------------------------------------------------------------- /helm/charts/influxdb/ci/auth-init-script-values.yaml: -------------------------------------------------------------------------------- 1 | config: 2 | http: 3 | auth-enabled: true 4 | 5 | setDefaultUser: 6 | enabled: true 7 | 8 | initScripts: 9 | enabled: true 10 | scripts: 11 | init.iql: |+ 12 | CREATE DATABASE "telegraf" WITH DURATION 30d REPLICATION 1 NAME "rp_30d" 13 | CREATE DATABASE "iot" WITH DURATION 7d REPLICATION 1 NAME "rp_7d" 14 | -------------------------------------------------------------------------------- /todo-angular/src/ToDoApp.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /helm/charts/influxdb/templates/backup-retention-configmap.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.backupRetention.enabled }} 2 | apiVersion: v1 3 | kind: ConfigMap 4 | metadata: 5 | name: {{ include "influxdb.fullname" . }}-backup-retention 6 | labels: 7 | {{- include "influxdb.labels" . | nindent 4 }} 8 | data: 9 | backup-retention.sh: |- 10 | {{- .Files.Get "files/backup-retention-script.sh" | nindent 4 }} 11 | {{- end }} 12 | -------------------------------------------------------------------------------- /helm/charts/influxdb/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.serviceAccount.create -}} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | name: {{ include "influxdb.serviceAccountName" . }} 6 | labels: 7 | {{- include "influxdb.labels" . | nindent 4 }} 8 | {{- with .Values.serviceAccount.annotations }} 9 | annotations: 10 | {{- toYaml . | nindent 4 }} 11 | {{- end }} 12 | {{- end -}} 13 | -------------------------------------------------------------------------------- /helm/charts/mysql-persistent/values.yaml: -------------------------------------------------------------------------------- 1 | database_service_name: mysql 2 | memory_limit: 512Mi 3 | mysql_database: testdb 4 | mysql_password: testp # TODO: must define a default value for .mysql_password' 5 | mysql_root_password: testur # TODO: must define a default value for .mysql_root_password' 6 | mysql_user: testu # TODO: must define a default value for .mysql_user' 7 | mysql_version: 8.0-el8 8 | namespace: openshift 9 | volume_capacity: 1Gi 10 | -------------------------------------------------------------------------------- /todo-angular/src/assets/js/app/ui/filters.js: -------------------------------------------------------------------------------- 1 | angular.module('todoItemsApp') 2 | 3 | .filter('truncate', function(){ 4 | return function(input, limit){ 5 | return (input.length > limit) ? input.substr(0, limit)+'…' : input; 6 | }; 7 | }) 8 | 9 | .filter('paragraph', function(){ 10 | return function(input){ 11 | return input.replace(/\n/g, '
'); 12 | }; 13 | }) 14 | 15 | ; 16 | -------------------------------------------------------------------------------- /helm/charts/influxdb/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *~ 18 | # Various IDEs 19 | .project 20 | .idea/ 21 | *.tmproj 22 | -------------------------------------------------------------------------------- /helm/charts/mysql-persistent/templates/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | annotations: 5 | template.openshift.io/expose-uri: mysql://{.spec.clusterIP}:{.spec.ports[?(.name=="mysql")].port} 6 | labels: 7 | template: mysql-persistent-template 8 | name: {{ .Values.database_service_name }} 9 | spec: 10 | ports: 11 | - name: mysql 12 | port: 3306 13 | selector: 14 | name: {{ .Values.database_service_name }} 15 | -------------------------------------------------------------------------------- /todo-angular/nginx/dhparam.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN DH PARAMETERS----- 2 | MIIBCAKCAQEAngpO95MkTY4tq05n3c4PWrsZbGdQBuKrOm8u8RzMRr1LgLvSHcZ3 3 | JHEpWwa78Iwh1Wu5U0rjSC/37ooN6qUB7dY++zulaF+r3UPABu2VVp5Hi48i2n6z 4 | xAAOj4kci9GvFnqZQGTx+1Vx1ICnRgpKc0CaCgMlGZ6aNP5Q8pW1V08uzH80xG9G 5 | djDnhyJIY7QKDIJuavJ1AOikzM4tYlliDoIaE2H9P2nNqiIhD8HdS/8TXfr2NLiB 6 | OGWC8E6ro3SWl/x1Anwg5Hy7YGBrLMDRZkPeoU6gFb2Y2DCnHA8ANLMgr05P6Ue8 7 | C15kRTtRE1waYY/NKoGWxHGcwMZLaeT5UwIBAg== 8 | -----END DH PARAMETERS----- -------------------------------------------------------------------------------- /helm/charts/etherpad-0.0.6/templates/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: {{ include "etherpad.fullname" . }} 5 | labels: 6 | {{- include "etherpad.labels" . | nindent 4 }} 7 | spec: 8 | type: {{ .Values.service.type }} 9 | ports: 10 | - port: {{ .Values.service.port }} 11 | targetPort: http 12 | protocol: TCP 13 | name: http 14 | selector: 15 | {{- include "etherpad.selectorLabels" . | nindent 4 }} 16 | -------------------------------------------------------------------------------- /helm/charts/etherpad-0.0.7/templates/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: {{ include "etherpad.fullname" . }} 5 | labels: 6 | {{- include "etherpad.labels" . | nindent 4 }} 7 | spec: 8 | type: {{ .Values.service.type }} 9 | ports: 10 | - port: {{ .Values.service.port }} 11 | targetPort: http 12 | protocol: TCP 13 | name: http 14 | selector: 15 | {{- include "etherpad.selectorLabels" . | nindent 4 }} 16 | -------------------------------------------------------------------------------- /helm/charts/etherpad-0.0.6/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *.orig 18 | *~ 19 | # Various IDEs 20 | .project 21 | .idea/ 22 | *.tmproj 23 | .vscode/ 24 | -------------------------------------------------------------------------------- /helm/charts/etherpad-0.0.7/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *.orig 18 | *~ 19 | # Various IDEs 20 | .project 21 | .idea/ 22 | *.tmproj 23 | .vscode/ 24 | -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/tooltip.tpl.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | "use strict";angular.module("mgcrea.ngStrap.tooltip").run(["$templateCache",function(t){t.put("tooltip/tooltip.tpl.html",'
')}]); -------------------------------------------------------------------------------- /todo-angular/src/assets/js/app/ui/gravatar.js: -------------------------------------------------------------------------------- 1 | angular.module('todoItemsApp') 2 | 3 | .directive('gravatar', function(){ 4 | return { 5 | restrict: 'AE', 6 | template: '', 7 | replace: true, 8 | link: function(scope, elem, attrs){ 9 | var size = (attrs.size) ? attrs.size : 64; 10 | scope.img = 'http://gravatar.com/avatar/'+md5(attrs.email)+'?s='+size; 11 | scope.class = attrs.class; 12 | } 13 | } 14 | }) 15 | ; 16 | -------------------------------------------------------------------------------- /books/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "database/sql" 5 | "log" 6 | "os" 7 | ) 8 | 9 | func main() { 10 | var ( 11 | db *sql.DB 12 | books *Books 13 | ) 14 | 15 | if os.Getenv("DB_HOST") != "" { 16 | db = dbConnect(dbInfo{ 17 | host: os.Getenv("DB_HOST"), 18 | port: os.Getenv("DB_PORT"), 19 | user: os.Getenv("DB_USER"), 20 | password: os.Getenv("DB_PASSWORD"), 21 | dbname: os.Getenv("DB_NAME")}) 22 | defer db.Close() 23 | } 24 | 25 | books = &Books{DB: db} 26 | books.populate() 27 | 28 | log.Fatal(listenAndServe("8080", books)) 29 | } 30 | -------------------------------------------------------------------------------- /hello-world-nginx/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM registry.access.redhat.com/ubi8:8.0 2 | 3 | RUN dnf -y module enable nginx:1.20 4 | RUN dnf -y -q --setopt=tsflags=nodocs --setopt=skip_missing_names_on_install=False install nginx 5 | RUN dnf -y -q clean all 6 | 7 | ADD index.html /usr/share/nginx/html 8 | 9 | ADD nginxconf.sed /tmp/ 10 | RUN sed -i -f /tmp/nginxconf.sed /etc/nginx/nginx.conf 11 | 12 | RUN touch /run/nginx.pid \ 13 | && chgrp -R 0 /var/log/nginx /run/nginx.pid \ 14 | && chmod -R g+rwx /var/log/nginx /run/nginx.pid 15 | 16 | EXPOSE 8080 17 | USER 1001 18 | 19 | CMD nginx -g "daemon off;" 20 | -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/popover.tpl.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | "use strict";angular.module("mgcrea.ngStrap.popover").run(["$templateCache",function(t){t.put("popover/popover.tpl.html",'

')}]); -------------------------------------------------------------------------------- /todo-single/nodejs-source/README.md: -------------------------------------------------------------------------------- 1 | # DO276 JavaScript/Node.js To Do List App 2 | 3 | Based on Restify 4.0 and Sequelize 3.14. Tested on Node.js 0.10 from SCL with 4 | Mariadb 5.5. 5 | 6 | Do `npm install` do download dependencies. 7 | 8 | Run as `node app.js` 9 | 10 | * Don't do pagination yet. 11 | 12 | * Database connection parameters hardcoded (as a novice developer would usually do). 13 | 14 | * There is a lot of boiler plate code in the controller and the model. There should 15 | be a way to have more centralized error handling. 16 | 17 | * Access app as http://localhost:30080/todo 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | 8 | # Test binary, build with `go test -c` 9 | *.test 10 | 11 | # Output of the go coverage tool, specifically when used with LiteIDE 12 | *.out 13 | vendor/ 14 | **/*.log 15 | **/*.sqlite 16 | .idea/ 17 | bin/ 18 | tmp/ 19 | node_modules/ 20 | .sass-cache/ 21 | *-packr.go 22 | public/assets/ 23 | .grifter/ 24 | .env 25 | *.swp 26 | *.swo 27 | vendor/ 28 | **/*.log 29 | **/*.sqlite 30 | .idea/ 31 | bin/ 32 | tmp/ 33 | node_modules/ 34 | .sass-cache/ 35 | *-packr.go 36 | public/assets/ 37 | .vscode/ 38 | .grifter/ 39 | .env 40 | 41 | -------------------------------------------------------------------------------- /exoplanets/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "database/sql" 5 | "log" 6 | "os" 7 | ) 8 | 9 | func main() { 10 | var ( 11 | db *sql.DB 12 | exoplanets *Exoplanets 13 | ) 14 | 15 | if os.Getenv("DB_HOST") != "" { 16 | db = dbConnect(dbInfo{ 17 | host: os.Getenv("DB_HOST"), 18 | port: os.Getenv("DB_PORT"), 19 | user: os.Getenv("DB_USER"), 20 | password: os.Getenv("DB_PASSWORD"), 21 | dbname: os.Getenv("DB_NAME")}) 22 | defer db.Close() 23 | } 24 | 25 | exoplanets = &Exoplanets{DB: db} 26 | exoplanets.populate() 27 | 28 | log.Fatal(listenAndServe("8080", exoplanets)) 29 | } 30 | -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/tooltip.tpl.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | 'use strict'; 9 | angular.module('mgcrea.ngStrap.tooltip').run([ 10 | '$templateCache', 11 | function ($templateCache) { 12 | $templateCache.put('tooltip/tooltip.tpl.html', '
'); 13 | } 14 | ]); -------------------------------------------------------------------------------- /php-ssl/httpd/www.conf: -------------------------------------------------------------------------------- 1 | [www] 2 | user = apache 3 | group = apache 4 | listen = /run/php-fpm/www.sock 5 | listen.allowed_clients = 127.0.0.1 6 | 7 | pm = dynamic 8 | pm.max_children = 50 9 | pm.start_servers = 5 10 | pm.min_spare_servers = 5 11 | pm.max_spare_servers = 35 12 | 13 | slowlog = /var/log/php-fpm/www-slow.log 14 | 15 | php_admin_value[error_log] = /var/log/php-fpm/www-error.log 16 | php_admin_flag[log_errors] = on 17 | 18 | php_value[session.save_handler] = files 19 | php_value[session.save_path] = /var/lib/php/session 20 | php_value[soap.wsdl_cache_dir] = /var/lib/php/wsdlcache 21 | ;php_value[opcache.file_cache] = /var/lib/php/opcache -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/alert.tpl.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | "use strict";angular.module("mgcrea.ngStrap.alert").run(["$templateCache",function(t){t.put("alert/alert.tpl.html",'
 
')}]); -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/popover.tpl.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | 'use strict'; 9 | angular.module('mgcrea.ngStrap.popover').run([ 10 | '$templateCache', 11 | function ($templateCache) { 12 | $templateCache.put('popover/popover.tpl.html', '

'); 13 | } 14 | ]); -------------------------------------------------------------------------------- /helm/charts/influxdb/templates/secret.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.setDefaultUser.enabled -}} 2 | {{- if not (.Values.setDefaultUser.user.existingSecret) -}} 3 | apiVersion: v1 4 | kind: Secret 5 | metadata: 6 | name: {{ include "influxdb.fullname" . }}-auth 7 | labels: 8 | {{- include "influxdb.labels" . | nindent 4 }} 9 | data: 10 | {{- if .Values.setDefaultUser.user.password }} 11 | influxdb-password: {{ .Values.setDefaultUser.user.password | b64enc | quote }} 12 | {{- else }} 13 | influxdb-password: {{ randAlphaNum 10 | b64enc | quote }} 14 | {{- end }} 15 | influxdb-user: {{ .Values.setDefaultUser.user.username | b64enc | quote }} 16 | {{- end -}} 17 | {{- end -}} 18 | -------------------------------------------------------------------------------- /helm/charts/influxdb/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | name: influxdb 3 | version: 4.12.1 4 | appVersion: 1.8.10 5 | description: Scalable datastore for metrics, events, and real-time analytics. 6 | keywords: 7 | - influxdb 8 | - database 9 | - timeseries 10 | - influxdata 11 | home: https://www.influxdata.com/time-series-platform/influxdb/ 12 | sources: 13 | - https://github.com/influxdata/influxdb 14 | maintainers: 15 | - name: rawkode 16 | email: rawkode@influxdata.com 17 | - name: gitirabassi 18 | email: giacomo@influxdata.com 19 | - name: aisuko 20 | email: urakiny@gmail.com 21 | - name: naseemkullah 22 | email: naseem@transit.app 23 | engine: gotpl 24 | -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular/angular-csp.css: -------------------------------------------------------------------------------- 1 | /* Include this file in your html if you are using the CSP mode. */ 2 | 3 | @charset "UTF-8"; 4 | 5 | [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], 6 | .ng-cloak, .x-ng-cloak, 7 | .ng-hide { 8 | display: none !important; 9 | } 10 | 11 | ng\:form { 12 | display: block; 13 | } 14 | 15 | .ng-animate-block-transitions { 16 | transition:0s all!important; 17 | -webkit-transition:0s all!important; 18 | } 19 | 20 | /* show the element during a show/hide animation when the 21 | * animation is ongoing, but the .ng-hide class is active */ 22 | .ng-hide-add-active, .ng-hide-remove { 23 | display: block!important; 24 | } 25 | -------------------------------------------------------------------------------- /todo-frontend/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM registry.access.redhat.com/ubi8:8.0 2 | 3 | LABEL version="1.0" \ 4 | description="To Do List application front-end" \ 5 | creationDate="2017-12-25" \ 6 | updatedDate="2019-11-28" 7 | 8 | ENV BACKEND_HOST=localhost:8081 9 | 10 | RUN yum install -y --disableplugin=subscription-manager --nodocs \ 11 | nginx nginx-mod-http-perl \ 12 | && yum clean all 13 | 14 | COPY nginx.conf /etc/nginx/ 15 | 16 | RUN touch /run/nginx.pid \ 17 | && chgrp -R 0 /var/log/nginx /run/nginx.pid \ 18 | && chmod -R g+rwx /var/log/nginx /run/nginx.pid 19 | 20 | COPY src/ /usr/share/nginx/html 21 | 22 | EXPOSE 8080 23 | 24 | USER 1001 25 | 26 | CMD nginx -g "daemon off;" 27 | -------------------------------------------------------------------------------- /books/Dockerfile: -------------------------------------------------------------------------------- 1 | # -- Build stage -- 2 | 3 | FROM registry.redhat.io/ubi8/go-toolset:1.12.8 AS builder 4 | 5 | WORKDIR $HOME/go/src/books 6 | COPY *.go . 7 | 8 | RUN go get -u \ 9 | github.com/gorilla/mux \ 10 | github.com/lib/pq && \ 11 | go build 12 | 13 | 14 | # -- App stage -- 15 | 16 | FROM registry.redhat.io/ubi8-minimal:8.0-213 17 | LABEL maintainer="jbirchler@redhat.com" \ 18 | version="v1.0.0" 19 | 20 | WORKDIR /home 21 | 22 | COPY --from=builder /opt/app-root/src/go/src/books/books . 23 | COPY template.html . 24 | 25 | RUN chmod 440 template.html && \ 26 | chgrp -R 0 . && \ 27 | chmod -R g=u . 28 | 29 | USER 1001 30 | EXPOSE 8080 31 | 32 | CMD ["./books"] 33 | -------------------------------------------------------------------------------- /todo-angular/src/README.md: -------------------------------------------------------------------------------- 1 | AngularJS-todoapp 2 | ================= 3 | 4 | Pure client-side todoapp, implemented in AngularJS. There is no REST interaction here, the objects are stored in memory. 5 | 6 | Integrates: 7 | - angularjs 8 | - bootstrap 9 | - angular-ui-router 10 | - angular-xeditable 11 | - angular-strap 12 | 13 | 14 | Running in Firefox 15 | ------ 16 | Will run directly in Firefox; just open up index.html 17 | 18 | Running in Chrome 19 | ------ 20 | Chrome does not support XMLHttpRequest calls to file://, so the app must be hosted. 21 | 22 | If you have Python installed, use: 23 | 24 | python -m SimpleHTTPServer 8080 25 | 26 | Then navigate to [http://localhost:8080](http://localhost:8080) 27 | -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/typeahead.tpl.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | "use strict";angular.module("mgcrea.ngStrap.typeahead").run(["$templateCache",function(e){e.put("typeahead/typeahead.tpl.html",'')}]); -------------------------------------------------------------------------------- /todo-angular/src/assets/js/app/ui/focus.js: -------------------------------------------------------------------------------- 1 | angular.module('todoItemsApp') 2 | 3 | // see http://stackoverflow.com/questions/14833326/how-to-set-focus-in-angularjs 4 | .directive('focusOn', function() { 5 | return function(scope, elem, attr) { 6 | scope.$on('focusOn', function(e, name) { 7 | if(name === attr.focusOn) { 8 | elem[0].focus(); 9 | } 10 | }); 11 | }; 12 | }) 13 | 14 | .factory('focus', function ($rootScope, $timeout) { 15 | return function(name) { 16 | $timeout(function (){ 17 | $rootScope.$broadcast('focusOn', name); 18 | }); 19 | } 20 | }) 21 | ; 22 | -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/alert.tpl.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | 'use strict'; 9 | angular.module('mgcrea.ngStrap.alert').run([ 10 | '$templateCache', 11 | function ($templateCache) { 12 | $templateCache.put('alert/alert.tpl.html', '
 
'); 13 | } 14 | ]); -------------------------------------------------------------------------------- /exoplanets/Dockerfile: -------------------------------------------------------------------------------- 1 | # -- Build stage -- 2 | 3 | FROM registry.redhat.io/ubi8/go-toolset:1.12.8 AS builder 4 | 5 | RUN mkdir -p $HOME/go/src/exoplanets 6 | WORKDIR $HOME/go/src/exoplanets 7 | COPY *.go . 8 | 9 | RUN go get -u \ 10 | github.com/gorilla/mux \ 11 | github.com/lib/pq && \ 12 | go build 13 | 14 | 15 | # -- App stage -- 16 | 17 | FROM registry.redhat.io/ubi8-minimal:8.0-213 18 | LABEL maintainer="jbirchler@redhat.com" \ 19 | version="v1.0.0" 20 | 21 | WORKDIR /home 22 | 23 | COPY --from=builder /opt/app-root/src/go/src/exoplanets/exoplanets . 24 | COPY template.html . 25 | 26 | RUN chmod 440 template.html && \ 27 | chgrp -R 0 . && \ 28 | chmod -R g=u . 29 | 30 | USER 1001 31 | EXPOSE 8080 32 | 33 | CMD ["./exoplanets"] 34 | -------------------------------------------------------------------------------- /helm/charts/influxdb/templates/backup-pvc.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.backup.enabled .Values.backup.persistence.enabled }} 2 | kind: PersistentVolumeClaim 3 | apiVersion: v1 4 | metadata: 5 | name: {{ include "influxdb.fullname" . }}-backup 6 | labels: 7 | {{- include "influxdb.labels" . | nindent 4 }} 8 | spec: 9 | accessModes: 10 | - {{ .Values.backup.persistence.accessMode | quote }} 11 | resources: 12 | requests: 13 | storage: {{ .Values.backup.persistence.size | quote }} 14 | {{- if .Values.backup.persistence.storageClass }} 15 | {{- if (eq "-" .Values.backup.persistence.storageClass) }} 16 | storageClassName: "" 17 | {{- else }} 18 | storageClassName: "{{ .Values.backup.persistence.storageClass }}" 19 | {{- end }} 20 | {{- end }} 21 | {{- end }} 22 | -------------------------------------------------------------------------------- /helm/charts/mysql-persistent/templates/secret.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | annotations: 5 | template.openshift.io/expose-database_name: '{.data[''database-name'']}' 6 | template.openshift.io/expose-password: '{.data[''database-password'']}' 7 | template.openshift.io/expose-root_password: '{.data[''database-root-password'']}' 8 | template.openshift.io/expose-username: '{.data[''database-user'']}' 9 | labels: 10 | template: mysql-persistent-template 11 | name: {{ .Values.database_service_name }} 12 | stringData: 13 | database-name: {{ .Values.mysql_database }} 14 | database-password: {{ .Values.mysql_password }} 15 | database-root-password: {{ .Values.mysql_root_password }} 16 | database-user: {{ .Values.mysql_user }} 17 | -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/raf.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | "use strict";angular.version.minor<3&&angular.version.dot<14&&angular.module("ng").factory("$$rAF",["$window","$timeout",function(n,e){var a=n.requestAnimationFrame||n.webkitRequestAnimationFrame||n.mozRequestAnimationFrame,t=n.cancelAnimationFrame||n.webkitCancelAnimationFrame||n.mozCancelAnimationFrame||n.webkitCancelRequestAnimationFrame,i=!!a,r=i?function(n){var e=a(n);return function(){t(e)}}:function(n){var a=e(n,16.66,!1);return function(){e.cancel(a)}};return r.supported=i,r}]); -------------------------------------------------------------------------------- /books/database.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "database/sql" 5 | "fmt" 6 | "log" 7 | 8 | _ "github.com/lib/pq" 9 | ) 10 | 11 | type dbInfo struct { 12 | host, port, user, password, dbname string 13 | } 14 | 15 | func (d dbInfo) String() string { 16 | return fmt.Sprintf( 17 | "host=%s port=%s user=%s password=%s dbname=%s sslmode=disable", 18 | d.host, d.port, d.user, d.password, d.dbname) 19 | } 20 | 21 | func dbConnect(info dbInfo) *sql.DB { 22 | log.Printf("Connecting to database with: %s", info) 23 | 24 | db, err := sql.Open("postgres", info.String()) 25 | if err != nil { 26 | log.Fatal(err) 27 | } 28 | 29 | err = db.Ping() 30 | if err != nil { 31 | log.Fatal(err) 32 | } 33 | 34 | log.Println("Connected to database") 35 | 36 | return db 37 | } 38 | -------------------------------------------------------------------------------- /exoplanets/database.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "database/sql" 5 | "fmt" 6 | "log" 7 | 8 | _ "github.com/lib/pq" 9 | ) 10 | 11 | type dbInfo struct { 12 | host, port, user, password, dbname string 13 | } 14 | 15 | func (d dbInfo) String() string { 16 | return fmt.Sprintf( 17 | "host=%s port=%s user=%s password=%s dbname=%s sslmode=disable", 18 | d.host, d.port, d.user, d.password, d.dbname) 19 | } 20 | 21 | func dbConnect(info dbInfo) *sql.DB { 22 | log.Printf("Connecting to database with: %s", info) 23 | 24 | db, err := sql.Open("postgres", info.String()) 25 | if err != nil { 26 | log.Fatal(err) 27 | } 28 | 29 | err = db.Ping() 30 | if err != nil { 31 | log.Fatal(err) 32 | } 33 | 34 | log.Println("Connected to database") 35 | 36 | return db 37 | } 38 | -------------------------------------------------------------------------------- /famous-quotes/layout.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Quotes 4 | 5 | 6 | 7 |

Quote List

8 | {{ if .Quotes }} 9 | 14 | {{ else }} 15 |

Database Environment Variables

16 | 22 | {{ end }} 23 | 24 | 25 | -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/tab.tpl.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | "use strict";angular.module("mgcrea.ngStrap.tab").run(["$templateCache",function(a){a.put("tab/tab.tpl.html",'
')}]); -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/typeahead.tpl.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | 'use strict'; 9 | angular.module('mgcrea.ngStrap.typeahead').run([ 10 | '$templateCache', 11 | function ($templateCache) { 12 | $templateCache.put('typeahead/typeahead.tpl.html', ''); 13 | } 14 | ]); -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/select.tpl.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | "use strict";angular.module("mgcrea.ngStrap.select").run(["$templateCache",function(e){e.put("select/select.tpl.html",'')}]); -------------------------------------------------------------------------------- /helm/charts/etherpad-0.0.6/templates/route.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.route.enabled -}} 2 | {{- $fullName := include "etherpad.fullname" . -}} 3 | {{- $svcPort := .Values.service.port -}} 4 | --- 5 | apiVersion: route.openshift.io/v1 6 | kind: Route 7 | metadata: 8 | annotations: 9 | openshift.io/host.generated: "true" 10 | name: {{ $fullName }} 11 | labels: 12 | {{- include "etherpad.labels" . | nindent 4 }} 13 | spec: 14 | host: {{ .Values.route.host | quote }} 15 | port: 16 | targetPort: {{ .Values.route.targetPort | default "8080-tcp" }} 17 | to: 18 | kind: Service 19 | name: {{ $fullName }} 20 | weight: 100 21 | tls: 22 | insecureEdgeTerminationPolicy: Redirect 23 | termination: edge 24 | status: 25 | ingress: 26 | - conditions: 27 | - status: 'True' 28 | type: Admitted 29 | {{ end }} -------------------------------------------------------------------------------- /helm/charts/etherpad-0.0.7/templates/route.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.route.enabled -}} 2 | {{- $fullName := include "etherpad.fullname" . -}} 3 | {{- $svcPort := .Values.service.port -}} 4 | --- 5 | apiVersion: route.openshift.io/v1 6 | kind: Route 7 | metadata: 8 | annotations: 9 | openshift.io/host.generated: "true" 10 | name: {{ $fullName }} 11 | labels: 12 | {{- include "etherpad.labels" . | nindent 4 }} 13 | spec: 14 | host: {{ .Values.route.host | quote }} 15 | port: 16 | targetPort: {{ .Values.route.targetPort | default "8080-tcp" }} 17 | to: 18 | kind: Service 19 | name: {{ $fullName }} 20 | weight: 100 21 | tls: 22 | insecureEdgeTerminationPolicy: Redirect 23 | termination: edge 24 | status: 25 | ingress: 26 | - conditions: 27 | - status: 'True' 28 | type: Admitted 29 | {{ end }} -------------------------------------------------------------------------------- /todo-single/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubi7/ubi:7.7 2 | 3 | MAINTAINER username 4 | 5 | ENV NODEJS_VERSION=8.0 \ 6 | HOME=/opt/app-root/src 7 | 8 | RUN yum install -y --setopt=tsflags=nodocs rh-nodejs8 make && \ 9 | yum clean all -y && \ 10 | mkdir -p /opt/app-root && \ 11 | groupadd -r appuser -f -g 1001 && \ 12 | useradd -u 1001 -r -g appuser -m -d ${HOME} -s /sbin/nologin \ 13 | -c "Application User" appuser && \ 14 | chown -R appuser:appuser /opt/app-root && \ 15 | chmod -R 755 /opt/app-root 16 | 17 | ADD ./enable-rh-nodejs8.sh /etc/profile.d/ 18 | 19 | COPY run.sh build ${HOME}/ 20 | WORKDIR ${HOME} 21 | RUN scl enable rh-nodejs8 'npm install' 22 | 23 | EXPOSE 8080 24 | USER 1001 25 | 26 | CMD ["scl","enable","rh-nodejs8","./run.sh"] 27 | -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/aside.tpl.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | "use strict";angular.module("mgcrea.ngStrap.aside").run(["$templateCache",function(t){t.put("aside/aside.tpl.html",'')}]); -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/modal.tpl.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | "use strict";angular.module("mgcrea.ngStrap.modal").run(["$templateCache",function(t){t.put("modal/modal.tpl.html",'')}]); -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/tab.tpl.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | 'use strict'; 9 | angular.module('mgcrea.ngStrap.tab').run([ 10 | '$templateCache', 11 | function ($templateCache) { 12 | $templateCache.put('tab/tab.tpl.html', '
'); 13 | } 14 | ]); -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/dropdown.tpl.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | "use strict";angular.module("mgcrea.ngStrap.dropdown").run(["$templateCache",function(e){e.put("dropdown/dropdown.tpl.html",'')}]); -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular/angular-cookies.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | AngularJS v1.2.18 3 | (c) 2010-2014 Google, Inc. http://angularjs.org 4 | License: MIT 5 | */ 6 | (function(p,f,n){'use strict';f.module("ngCookies",["ng"]).factory("$cookies",["$rootScope","$browser",function(e,b){var c={},g={},h,k=!1,l=f.copy,m=f.isUndefined;b.addPollFn(function(){var a=b.cookies();h!=a&&(h=a,l(a,g),l(a,c),k&&e.$apply())})();k=!0;e.$watch(function(){var a,d,e;for(a in g)m(c[a])&&b.cookies(a,n);for(a in c)d=c[a],f.isString(d)||(d=""+d,c[a]=d),d!==g[a]&&(b.cookies(a,d),e=!0);if(e)for(a in d=b.cookies(),c)c[a]!==d[a]&&(m(d[a])?delete c[a]:c[a]=d[a])});return c}]).factory("$cookieStore", 7 | ["$cookies",function(e){return{get:function(b){return(b=e[b])?f.fromJson(b):b},put:function(b,c){e[b]=f.toJson(c)},remove:function(b){delete e[b]}}}])})(window,window.angular); 8 | //# sourceMappingURL=angular-cookies.min.js.map 9 | -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/select.tpl.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | 'use strict'; 9 | angular.module('mgcrea.ngStrap.select').run([ 10 | '$templateCache', 11 | function ($templateCache) { 12 | $templateCache.put('select/select.tpl.html', ''); 13 | } 14 | ]); -------------------------------------------------------------------------------- /helm/charts/influxdb/templates/meta-service.yaml: -------------------------------------------------------------------------------- 1 | {{ if .Values.enterprise.enabled -}} 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | {{- if .Values.service.annotations }} 6 | annotations: 7 | {{ toYaml .Values.service.annotations | indent 4 }} 8 | {{- end }} 9 | name: {{ include "influxdb.fullname" . }}-meta 10 | labels: 11 | {{- include "influxdb.labels" . | nindent 4 }} 12 | app.kubernets.io/component: meta 13 | spec: 14 | type: ClusterIP 15 | clusterIP: None 16 | # publishNotReadyAddresses is used for service discovery of meta and data nodes by querying the service's SRV record. 17 | publishNotReadyAddresses: true 18 | ports: 19 | - name: meta 20 | port: {{ .Values.config.meta.bind_address | default 8091 }} 21 | targetPort: meta 22 | selector: 23 | {{- include "influxdb.selectorLabels" . | nindent 4 }} 24 | app.kubernets.io/component: meta 25 | {{- end }} 26 | -------------------------------------------------------------------------------- /todo-angular/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | FROM registry.access.redhat.com/ubi8:8.0 3 | 4 | LABEL version="1.0" \ 5 | description="A simple To Do Application" \ 6 | creationDate="2017-12-25" \ 7 | updatedDate="2019-11-28" 8 | 9 | RUN yum install -y --disableplugin=subscription-manager --nodocs \ 10 | nginx nginx-mod-http-perl \ 11 | && yum clean all 12 | 13 | COPY nginx/nginx.conf /etc/nginx/nginx.conf 14 | # SSL - these two directive install the SSL configuration file 15 | # This copies the Diffie-Hellman settings. Used by NGinx 16 | COPY nginx/dhparam.pem /etc/ssl/conf/dhparam.pem 17 | COPY nginx/conf.d/ssl.conf /etc/nginx/conf.d/ssl.conf 18 | ## End of SSL 19 | 20 | RUN touch /run/nginx.pid \ 21 | && chgrp -R 0 /var/log/nginx /run/nginx.pid \ 22 | && chmod -R g+rwx /var/log/nginx /run/nginx.pid 23 | 24 | COPY src/ /usr/share/nginx/html 25 | 26 | EXPOSE 8080 8443 27 | 28 | USER 1001 29 | 30 | CMD nginx -g "daemon off;" 31 | -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/debounce.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | "use strict";angular.module("mgcrea.ngStrap.helpers.debounce",[]).constant("debounce",function(n,t,e){var a,r,u,l,i;return function(){u=this,r=arguments,l=new Date;var o=function(){var c=new Date-l;t>c?a=setTimeout(o,t-c):(a=null,e||(i=n.apply(u,r)))},c=e&&!a;return a||(a=setTimeout(o,t)),c&&(i=n.apply(u,r)),i}}).constant("throttle",function(n,t,e){var a,r,u,l=null,i=0;e||(e={});var o=function(){i=e.leading===!1?0:new Date,l=null,u=n.apply(a,r)};return function(){var c=new Date;i||e.leading!==!1||(i=c);var s=t-(c-i);return a=this,r=arguments,0>=s?(clearTimeout(l),l=null,i=c,u=n.apply(a,r)):l||e.trailing===!1||(l=setTimeout(o,s)),u}}); -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/aside.tpl.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | 'use strict'; 9 | angular.module('mgcrea.ngStrap.aside').run([ 10 | '$templateCache', 11 | function ($templateCache) { 12 | $templateCache.put('aside/aside.tpl.html', ''); 13 | } 14 | ]); -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/modal.tpl.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | 'use strict'; 9 | angular.module('mgcrea.ngStrap.modal').run([ 10 | '$templateCache', 11 | function ($templateCache) { 12 | $templateCache.put('modal/modal.tpl.html', ''); 13 | } 14 | ]); -------------------------------------------------------------------------------- /helm/charts/etherpad-0.0.6/templates/pvc.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }} 2 | kind: PersistentVolumeClaim 3 | apiVersion: v1 4 | metadata: 5 | name: {{ include "etherpad.fullname" . }} 6 | labels: 7 | {{- include "etherpad.labels" . | nindent 4 }} 8 | {{ if .Values.persistence.annotations}} 9 | annotations: 10 | {{- range $key, $value := .Values.persistence.annotations }} 11 | {{ $key }}: {{ $value | quote }} 12 | {{- end }} 13 | {{- end }} 14 | spec: 15 | accessModes: 16 | - {{ .Values.persistence.accessMode | quote }} 17 | resources: 18 | requests: 19 | storage: {{ .Values.persistence.size | quote }} 20 | {{- if .Values.persistence.storageClass }} 21 | {{- if (eq "-" .Values.persistence.storageClass) }} 22 | storageClassName: "" 23 | {{- else }} 24 | storageClassName: "{{ .Values.persistence.storageClass }}" 25 | {{- end }} 26 | {{- end }} 27 | {{- end }} 28 | -------------------------------------------------------------------------------- /helm/charts/etherpad-0.0.7/templates/pvc.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }} 2 | kind: PersistentVolumeClaim 3 | apiVersion: v1 4 | metadata: 5 | name: {{ include "etherpad.fullname" . }} 6 | labels: 7 | {{- include "etherpad.labels" . | nindent 4 }} 8 | {{ if .Values.persistence.annotations}} 9 | annotations: 10 | {{- range $key, $value := .Values.persistence.annotations }} 11 | {{ $key }}: {{ $value | quote }} 12 | {{- end }} 13 | {{- end }} 14 | spec: 15 | accessModes: 16 | - {{ .Values.persistence.accessMode | quote }} 17 | resources: 18 | requests: 19 | storage: {{ .Values.persistence.size | quote }} 20 | {{- if .Values.persistence.storageClass }} 21 | {{- if (eq "-" .Values.persistence.storageClass) }} 22 | storageClassName: "" 23 | {{- else }} 24 | storageClassName: "{{ .Values.persistence.storageClass }}" 25 | {{- end }} 26 | {{- end }} 27 | {{- end }} 28 | -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/dropdown.tpl.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | 'use strict'; 9 | angular.module('mgcrea.ngStrap.dropdown').run([ 10 | '$templateCache', 11 | function ($templateCache) { 12 | $templateCache.put('dropdown/dropdown.tpl.html', ''); 13 | } 14 | ]); -------------------------------------------------------------------------------- /helm/charts/mysql-persistent/Chart.yaml: -------------------------------------------------------------------------------- 1 | dependencies: 2 | - name: mysql-imagestreams 3 | version: "0.0.1" 4 | repository: https://github.com/openshift-helm-charts/charts 5 | description: |- 6 | This content is expermental, do not use it in production. MySQL database service, with persistent storage. For more information about using this template, including OpenShift considerations, see https://github.com/sclorg/mysql-container/blob/master/8.0/root/usr/share/container-scripts/mysql/README.md. 7 | 8 | NOTE: Scaling to more than one replica is not supported. You must have persistent volumes available in your cluster to use this template. 9 | name: mysql-persistent 10 | tags: database,mysql 11 | version: 0.0.2 12 | annotations: 13 | charts.openshift.io/name: Red Hat MySQL database service, with persistent storage (experimental). 14 | apiVersion: v2 15 | appVersion: 0.0.2 16 | kubeVersion: '>=1.20.0' 17 | sources: 18 | - https://github.com/sclorg/helm-charts 19 | -------------------------------------------------------------------------------- /exoplanets/server.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "github.com/gorilla/mux" 6 | "html/template" 7 | "log" 8 | "net/http" 9 | "time" 10 | ) 11 | 12 | var homeTemplate *template.Template 13 | 14 | func init() { 15 | homeTemplate = template.Must(template.ParseFiles("template.html")) 16 | } 17 | 18 | func listenAndServe(port string, exoplanets *Exoplanets) error { 19 | r := mux.NewRouter() 20 | 21 | r.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { 22 | exoplanets.fetch() 23 | w.WriteHeader(http.StatusOK) 24 | homeTemplate.Execute(w, exoplanets.List) 25 | }) 26 | 27 | r.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) { 28 | w.WriteHeader(http.StatusOK) 29 | fmt.Fprint(w, "ok") 30 | }) 31 | 32 | srv := &http.Server{ 33 | Handler: r, 34 | Addr: "0.0.0.0:" + port, 35 | WriteTimeout: 10 * time.Second, 36 | ReadTimeout: 10 * time.Second, 37 | } 38 | 39 | log.Printf("Listening on :%s", port) 40 | return srv.ListenAndServe() 41 | } 42 | -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/navbar.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | "use strict";angular.module("mgcrea.ngStrap.navbar",[]).provider("$navbar",function(){var t=this.defaults={activeClass:"active",routeAttr:"data-match-route",strict:!1};this.$get=function(){return{defaults:t}}}).directive("bsNavbar",["$window","$location","$navbar",function(t,a,r){var e=r.defaults;return{restrict:"A",link:function(t,r,n){var i=angular.copy(e);angular.forEach(Object.keys(e),function(t){angular.isDefined(n[t])&&(i[t]=n[t])}),t.$watch(function(){return a.path()},function(t){var a=r[0].querySelectorAll("li["+i.routeAttr+"]");angular.forEach(a,function(a){var r=angular.element(a),e=r.attr(i.routeAttr).replace("/","\\/");i.strict&&(e="^"+e+"$");var n=new RegExp(e,["i"]);n.test(t)?r.addClass(i.activeClass):r.removeClass(i.activeClass)})})}}}]); -------------------------------------------------------------------------------- /python-load/load.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | """ 3 | Produces load on all available CPU cores 4 | Updated with suggestion to prevent Zombie processes 5 | Linted for Python 3 6 | Source: 7 | insaner @ https://danielflannery.ie/simulate-cpu-load-with-python/#comment-34130 8 | """ 9 | import numpy 10 | from multiprocessing import Pool 11 | from multiprocessing import cpu_count 12 | import signal 13 | 14 | # Change the xrange (allocation) value accordingly. 15 | allocation = 1512 16 | 17 | stop_loop = 0 18 | def exit_chld(x, y): 19 | global stop_loop 20 | stop_loop = 1 21 | 22 | def f(x): 23 | global stop_loop 24 | while not stop_loop: 25 | x*x 26 | [numpy.random.bytes(1024*1024) for x in range(allocation)] 27 | signal.signal(signal.SIGINT, exit_chld) 28 | 29 | if __name__ == '__main__': 30 | processes = cpu_count() 31 | print('-' * 20) 32 | print('Running load on CPU(s)') 33 | print('Utilizing %d cores' % processes) 34 | print('-' * 20) 35 | pool = Pool(processes) 36 | pool.map(f, range(processes)) 37 | -------------------------------------------------------------------------------- /helm/charts/mysql-persistent/templates/tests/test-mysql-connection.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: "{{ .Release.Name }}-connection-test" 5 | namespace: "{{ .Release.Namespace }}" 6 | annotations: 7 | "helm.sh/hook": test 8 | labels: 9 | name: {{ .Values.database_service_name }} 10 | spec: 11 | #serviceAccount: {{ .Values.serviceAccount }} 12 | containers: 13 | - name: "mysql-connection-test" 14 | image: "registry.redhat.io/rhel8/mysql-80:latest" 15 | imagePullPolicy: IfNotPresent 16 | env: 17 | - name: MARIADB_USER 18 | value: "{{ .Values.mysql_user }}" 19 | - name: MARIADB_PASSWORD 20 | value: "{{ .Values.mysql_password }}" 21 | - name: MARIADB_DATABASE 22 | value: "{{ .Values.mysql_database }}" 23 | command: 24 | - /bin/bash 25 | - -ec 26 | - "echo \"SELECT 42 as testval\\g\" | mysql --connect-timeout=15 -h {{ .Values.database_service_name }} $MARIADB_DATABASE -u$MARIADB_USER -p$MARIADB_PASSWORD" 27 | restartPolicy: Never 28 | -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/parse-options.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | "use strict";angular.module("mgcrea.ngStrap.helpers.parseOptions",[]).provider("$parseOptions",function(){var n=this.defaults={regexp:/^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+group\s+by\s+(.*))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+(.*?)(?:\s+track\s+by\s+(.*?))?$/};this.$get=["$parse","$q",function(s,r){function e(e,t){function a(n,s){return n.map(function(n,r){var e,t,a={};return a[c]=n,e=o(s,a),t=f(s,a)||r,{label:e,value:t}})}var u={},i=angular.extend({},n,t);u.$values=[];var $,o,c,l,p,f,v;return u.init=function(){u.$match=$=e.match(i.regexp),o=s($[2]||$[1]),c=$[4]||$[6],l=$[5],p=s($[3]||""),f=s($[2]?$[1]:c),v=s($[7])},u.valuesFn=function(n,s){return r.when(v(n,s)).then(function(s){return u.$values=s?a(s,n):{},u.$values})},u.init(),u}return e}]}); -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/tab.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | "use strict";angular.module("mgcrea.ngStrap.tab",[]).run(["$templateCache",function(t){t.put("$pane","{{pane.content}}")}]).provider("$tab",function(){var t=this.defaults={animation:"am-fade",template:"tab/tab.tpl.html"};this.$get=function(){return{defaults:t}}}).directive("bsTabs",["$window","$animate","$tab",function(t,a,e){var n=e.defaults;return{restrict:"EAC",scope:!0,require:"?ngModel",templateUrl:function(t,a){return a.template||n.template},link:function(t,a,e,i){var r=n;angular.forEach(["animation"],function(t){angular.isDefined(e[t])&&(r[t]=e[t])}),e.bsTabs&&t.$watch(e.bsTabs,function(a){t.panes=a},!0),a.addClass("tabs"),r.animation&&a.addClass(r.animation),t.active=t.activePane=0,t.setActive=function(a){t.active=a,i&&i.$setViewValue(a)},i&&(i.$render=function(){t.active=1*i.$modelValue})}}}]); -------------------------------------------------------------------------------- /books/Makefile: -------------------------------------------------------------------------------- 1 | version = v1.4 2 | repo = quay.io/redhattraining 3 | 4 | all: fmt build run 5 | 6 | fmt: 7 | gofmt -w *.go 8 | 9 | build: 10 | sudo buildah bud -t books:latest . 11 | 12 | run: 13 | sudo podman run \ 14 | -p 8080:8080 \ 15 | -e DB_HOST=$$(sudo podman inspect postgres --format '{{ .NetworkSettings.IPAddress }}') \ 16 | -e DB_PORT=5432 \ 17 | -e DB_USER=user \ 18 | -e DB_PASSWORD=password \ 19 | -e DB_NAME=postgres \ 20 | books:latest 21 | 22 | run-without-db: 23 | sudo podman run \ 24 | -p 8080:8080 \ 25 | books:latest 26 | 27 | tag: 28 | sudo buildah tag books:latest $(repo)/books:latest 29 | sudo buildah tag books:latest $(repo)/books:$(version) 30 | 31 | push: 32 | sudo podman push $(repo)/books:latest 33 | sudo podman push $(repo)/books:$(version) 34 | 35 | pg-up: 36 | sudo podman run -d \ 37 | --name postgres \ 38 | -p 5432:5432 \ 39 | -e POSTGRES_PASSWORD=password \ 40 | -e POSTGRES_USER=user \ 41 | postgres:12.1-alpine 42 | 43 | pg-down: 44 | sudo podman rm -f postgres 45 | 46 | .PHONY: fmt build run run-without-db tag push pg-up pg-down 47 | -------------------------------------------------------------------------------- /famous-quotes/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.12 2 | LABEL maintainer="ichavero@chavero.com.mx" 3 | 4 | ENV QUOTES_VERSION=2.1 \ 5 | SUMMARY="Famous Quotes" \ 6 | DESCRIPTION="Famous Quotes is a PoC application for Go and MySQL" 7 | 8 | LABEL summary="$SUMMARY" \ 9 | description="$DESCRIPTION" \ 10 | io.k8s.description="$DESCRIPTION" \ 11 | io.k8s.display-name="Quotes 2.1" \ 12 | io.openshift.expose-services="8000:quotes" \ 13 | io.openshift.tags="poc,mysql,golang" \ 14 | name="redhattraining/famous-quotes" \ 15 | version="2.1" \ 16 | usage="docker run -d -e QUOTES_USER=user -e QUOTES_PASSWORD=pass -e QUOTES_DATABASE=db -p 8000:8000 redhattraining/famous-quotes" \ 17 | maintainer="Iván Chavero " 18 | 19 | EXPOSE 8000 20 | 21 | RUN mkdir -p /go/src/github.com/openshift/famous-quotes 22 | WORKDIR /go/src/github.com/openshift/famous-quotes 23 | 24 | COPY . /go/src/github.com/openshift/famous-quotes 25 | RUN go get -u github.com/go-sql-driver/mysql github.com/gorilla/mux && \ 26 | go build 27 | 28 | CMD ["./famous-quotes"] 29 | -------------------------------------------------------------------------------- /exoplanets/fetch_planets.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import xml.etree.ElementTree as ET, urllib.request, gzip, io 3 | 4 | # Grab and parse the data 5 | url = "https://github.com/OpenExoplanetCatalogue/oec_gzip/raw/master/systems.xml.gz" 6 | resp = urllib.request.urlopen(url).read() 7 | body = gzip.GzipFile(fileobj=io.BytesIO(resp)) 8 | oec = ET.parse(body) 9 | 10 | fields = ["name", "mass", "radius", "period"] 11 | count = 0 12 | limit = 50 13 | 14 | # Print out a GoLang formatted struct seed, if we have all of the values 15 | print("package main\n") 16 | print("var seed = []Exoplanet{") 17 | for planet in oec.findall(".//planet"): 18 | p = { k:planet.findtext(k) for k in fields } 19 | if all(p.values()): 20 | print("\t{") 21 | print('\t\tName: "{}",'.format(p.get("name"))) 22 | print('\t\tMass: {},'.format(p.get("mass"))) 23 | print('\t\tRadius: {},'.format(p.get("radius"))) 24 | print('\t\tPeriod: {},'.format(p.get("period"))) 25 | print("\t},") 26 | count += 1 27 | if count > limit: 28 | break 29 | 30 | print("}") 31 | -------------------------------------------------------------------------------- /books/template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Books Example Application 7 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | {{range .}} 46 | 47 | 48 | 49 | 50 | 51 | {{end}} 52 | 53 |
AuthorTitleYear
{{.Author}}{{.Title}}{{.Year}}
54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /exoplanets/Makefile: -------------------------------------------------------------------------------- 1 | version = v1.0 2 | repo = quay.io/redhattraining 3 | local_address = $(shell hostname -i | cut -f 2 -d ' ') 4 | 5 | all: fmt build run 6 | 7 | fmt: 8 | gofmt -w *.go 9 | 10 | build: 11 | buildah bud -t exoplanets:latest . 12 | 13 | run: 14 | podman run \ 15 | -p 8080:8080 \ 16 | -e DB_HOST=$(local_address) \ 17 | -e DB_PORT=5432 \ 18 | -e DB_USER=user \ 19 | -e DB_PASSWORD=password \ 20 | -e DB_NAME=postgres \ 21 | exoplanets:latest 22 | 23 | run-without-db: 24 | podman run \ 25 | -p 8080:8080 \ 26 | exoplanets:latest 27 | 28 | tag: 29 | buildah tag exoplanets:latest $(repo)/exoplanets:latest 30 | buildah tag exoplanets:latest $(repo)/exoplanets:$(version) 31 | 32 | push: 33 | podman push $(repo)/exoplanets:latest 34 | podman push $(repo)/exoplanets:$(version) 35 | 36 | pg-up: 37 | podman run -d \ 38 | --name postgres \ 39 | -p $(local_address):5432:5432 \ 40 | -e POSTGRES_PASSWORD=password \ 41 | -e POSTGRES_USER=user \ 42 | postgres:12-alpine 43 | 44 | pg-down: 45 | podman rm -f postgres 46 | 47 | .PHONY: fmt build run run-without-db tag push pg-up pg-down 48 | -------------------------------------------------------------------------------- /php-ssl/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | FROM registry.access.redhat.com/ubi8:8.0 3 | LABEL version="1.0" \ 4 | description="A simple PHP application that tests TLS encryption" \ 5 | creationDate="2019-12-13" \ 6 | updatedDate="2019-12-13" 7 | 8 | RUN yum install -y --disableplugin=subscription-manager --nodocs \ 9 | httpd php php-common net-tools procps-ng \ 10 | mod_ssl \ 11 | && yum clean all 12 | 13 | COPY httpd/httpd.conf /etc/httpd/conf/httpd.conf 14 | # PHP FPM configuration both compatible with Docker and Podman 15 | # Allows us to run php-fpm as a non-root user yet still let 16 | # Apache read the socket 17 | COPY httpd/www.conf /etc/php-fpm.d/www.conf 18 | 19 | ## SSL - This directive configures SSL support for the container 20 | COPY httpd/ssl.conf /etc/httpd/conf.d/ssl.conf 21 | ## End of SSL 22 | 23 | COPY index.php /var/www/html/index.php 24 | 25 | RUN mkdir /run/php-fpm && \ 26 | chgrp -R 0 /var/www/html /var/log/httpd /var/run/httpd/ /run/php-fpm \ 27 | && chmod -R g+rwx /var/www/html /var/log/httpd /var/run/httpd/ /run/php-fpm 28 | 29 | EXPOSE 8080 8443 30 | USER 1001 31 | 32 | CMD php-fpm && httpd -D FOREGROUND 33 | -------------------------------------------------------------------------------- /todo-angular/src/assets/js/app/ui/editable.js: -------------------------------------------------------------------------------- 1 | angular.module('todoItemsApp') 2 | 3 | .directive('editable', function(){ 4 | return { 5 | restrict: 'AE', 6 | templateUrl: '/assets/partials/editable.html', 7 | scope: { 8 | value: '=editable', 9 | field: '@fieldType' 10 | }, 11 | controller: function($scope){ 12 | 13 | // create a new model to edit, and something for ng-show/ng-hide to watch 14 | $scope.editor = { 15 | showing: false, 16 | value: $scope.value 17 | }; 18 | 19 | $scope.toggleEditor = function(){ 20 | $scope.editor.showing = !$scope.editor.showing; 21 | }; 22 | 23 | $scope.field = ($scope.field) ? $scope.field : 'text'; 24 | 25 | $scope.save = function(){ 26 | $scope.value = $scope.editor.value; 27 | $scope.toggleEditor(); 28 | }; 29 | } 30 | 31 | 32 | }; 33 | }) 34 | 35 | 36 | ; 37 | -------------------------------------------------------------------------------- /todo-angular/src/assets/js/app/module.js: -------------------------------------------------------------------------------- 1 | angular.module('todoItemsApp', ['ngRoute', 'ngSanitize', 'mgcrea.ngStrap', 'ui.router', 'xeditable']) 2 | 3 | .run([ '$rootScope', '$state', '$stateParams', 'editableOptions', 4 | function ($rootScope, $state, $stateParams, editableOptions) { 5 | 6 | // from angular-ui-router example 7 | 8 | // It's very handy to add references to $state and $stateParams to the $rootScope 9 | // so that you can access them from any scope within your applications.For example, 10 | //
  • will set the
  • // to active whenever 11 | // 'todoItems.list' or one of its decendents is active. 12 | $rootScope.$state = $state; 13 | $rootScope.$stateParams = $stateParams; 14 | 15 | 16 | // http://vitalets.github.io/angular-xeditable/#getstarted 17 | editableOptions.theme = 'bs3'; // bootstrap3 theme. Can be also 'bs2', 'default' 18 | }]) 19 | 20 | .controller('appCtl', function($scope, $location) { 21 | 22 | $scope.startSearch = function(){ 23 | $location.path('/'); 24 | }; 25 | }); 26 | 27 | ; 28 | -------------------------------------------------------------------------------- /helm/charts/influxdb/templates/meta-configmap.yaml: -------------------------------------------------------------------------------- 1 | {{ if .Values.enterprise.enabled -}} 2 | apiVersion: v1 3 | kind: ConfigMap 4 | metadata: 5 | name: {{ include "influxdb.fullname" . }}-meta 6 | labels: 7 | {{- include "influxdb.labels" . | nindent 4 }} 8 | app.kubernetes.io/component: meta 9 | data: 10 | influxdb-meta.conf: |+ 11 | reporting-disabled = {{ .Values.config.reporting_disabled | default false }} 12 | bind-address = ":{{ .Values.config.meta.bind_address | default 8091 }}" 13 | 14 | [enterprise] 15 | license-key = {{ .Values.enterprise.licensekey | quote }} 16 | 17 | [meta] 18 | dir = "/var/lib/influxdb/meta" 19 | {{- range $key, $value := index .Values.config.meta }} 20 | {{ $key }} = {{ $value }} 21 | {{- end }} 22 | {{- if .Values.enterprise.enabled }} 23 | meta-auth-enabled = {{ .Values.config.meta.authEnabled }} 24 | {{- end }} 25 | 26 | [logging] 27 | {{- range $key, $value := index .Values.config.logging }} 28 | {{ $key }} = {{ $value }} 29 | {{- end }} 30 | 31 | [tls] 32 | {{- range $key, $value := index .Values.config.tls }} 33 | {{ $key }} = {{ $value }} 34 | {{- end }} 35 | {{- end }} 36 | -------------------------------------------------------------------------------- /helm/charts/etherpad-0.0.7/templates/ingress.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.ingress.enabled -}} 2 | {{- $fullName := include "etherpad.fullname" . -}} 3 | {{- $svcPort := .Values.service.port -}} 4 | {{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} 5 | apiVersion: networking.k8s.io/v1 6 | {{- else -}} 7 | apiVersion: extensions/v1beta1 8 | {{- end }} 9 | kind: Ingress 10 | metadata: 11 | name: {{ $fullName }} 12 | labels: 13 | {{- include "etherpad.labels" . | nindent 4 }} 14 | {{- with .Values.ingress.annotations }} 15 | annotations: 16 | {{- toYaml . | nindent 4 }} 17 | {{- end }} 18 | spec: 19 | {{- if .Values.ingress.tls }} 20 | tls: 21 | {{- range .Values.ingress.tls }} 22 | - hosts: 23 | {{- range .hosts }} 24 | - {{ . | quote }} 25 | {{- end }} 26 | secretName: {{ .secretName }} 27 | {{- end }} 28 | {{- end }} 29 | rules: 30 | {{- range .Values.ingress.hosts }} 31 | - host: {{ .host | quote }} 32 | http: 33 | paths: 34 | {{- range .paths }} 35 | - path: {{ . }} 36 | backend: 37 | serviceName: {{ $fullName }} 38 | servicePort: {{ $svcPort }} 39 | {{- end }} 40 | {{- end }} 41 | {{- end }} 42 | -------------------------------------------------------------------------------- /todo-angular/src/assets/partials/list.html: -------------------------------------------------------------------------------- 1 | 4 | 5 |
    6 | 7 |
    8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 24 | 25 | 26 | 27 | 30 | 31 | 32 |
    DescriptionCategoryComplete?Due byActions
    22 | {{todoItem.description}} 23 | {{todoItem.category}}{{todoItem.complete}}{{todoItem.dueBy | date:'dd-MMM-yyyy'}} 28 | 29 |
    33 |
    34 | -------------------------------------------------------------------------------- /helm/charts/etherpad-0.0.6/templates/ingress.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.ingress.enabled -}} 2 | {{- $fullName := include "etherpad.fullname" . -}} 3 | {{- $svcPort := .Values.service.port -}} 4 | {{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} 5 | apiVersion: networking.k8s.io/v1beta1 6 | {{- else -}} 7 | apiVersion: extensions/v1beta1 8 | {{- end }} 9 | kind: Ingress 10 | metadata: 11 | name: {{ $fullName }} 12 | labels: 13 | {{- include "etherpad.labels" . | nindent 4 }} 14 | {{- with .Values.ingress.annotations }} 15 | annotations: 16 | {{- toYaml . | nindent 4 }} 17 | {{- end }} 18 | spec: 19 | {{- if .Values.ingress.tls }} 20 | tls: 21 | {{- range .Values.ingress.tls }} 22 | - hosts: 23 | {{- range .hosts }} 24 | - {{ . | quote }} 25 | {{- end }} 26 | secretName: {{ .secretName }} 27 | {{- end }} 28 | {{- end }} 29 | rules: 30 | {{- range .Values.ingress.hosts }} 31 | - host: {{ .host | quote }} 32 | http: 33 | paths: 34 | {{- range .paths }} 35 | - path: {{ . }} 36 | backend: 37 | serviceName: {{ $fullName }} 38 | servicePort: {{ $svcPort }} 39 | {{- end }} 40 | {{- end }} 41 | {{- end }} 42 | -------------------------------------------------------------------------------- /todo-angular/src/assets/css/libs/angular-motion/modules/fade.min.css: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-motion 3 | * @version v0.3.2 - 2014-02-11 4 | * @link https://github.com/mgcrea/angular-motion 5 | * @author Olivier Louvignes 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | .am-fade{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-fill-mode:backwards;animation-fill-mode:backwards;opacity:1}.am-fade.am-fade-add,.am-fade.ng-hide-remove,.am-fade.ng-move{-webkit-animation-name:fadeIn;animation-name:fadeIn}.am-fade.am-fade-remove,.am-fade.ng-hide{-webkit-animation-name:fadeOut;animation-name:fadeOut}.am-fade.ng-enter{visibility:hidden;-webkit-animation-name:fadeIn;animation-name:fadeIn}.am-fade.ng-enter.ng-enter-active{visibility:visible}.am-fade.ng-leave{-webkit-animation-name:fadeOut;animation-name:fadeOut}@-webkit-keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@-webkit-keyframes fadeOut{from{opacity:1}to{opacity:0}}@keyframes fadeOut{from{opacity:1}to{opacity:0}}.modal-backdrop.am-fade,.aside-backdrop.am-fade{background:rgba(0,0,0,.5);-webkit-animation-duration:.15s;animation-duration:.15s} -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/aside.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | "use strict";angular.module("mgcrea.ngStrap.aside",["mgcrea.ngStrap.modal"]).provider("$aside",function(){var e=this.defaults={animation:"am-fade-and-slide-right",prefixClass:"aside",placement:"right",template:"aside/aside.tpl.html",contentTemplate:!1,container:!1,element:null,backdrop:!0,keyboard:!0,html:!1,show:!0};this.$get=["$modal",function(t){function n(n){var a={},i=angular.extend({},e,n);return a=t(i)}return n}]}).directive("bsAside",["$window","$sce","$aside",function(e,t,n){e.requestAnimationFrame||e.setTimeout;return{restrict:"EAC",scope:!0,link:function(e,a,i){var r={scope:e,element:a,show:!1};angular.forEach(["template","contentTemplate","placement","backdrop","keyboard","html","container","animation"],function(e){angular.isDefined(i[e])&&(r[e]=i[e])}),angular.forEach(["title","content"],function(n){i[n]&&i.$observe(n,function(a){e[n]=t.trustAsHtml(a)})}),i.bsAside&&e.$watch(i.bsAside,function(t){angular.isObject(t)?angular.extend(e,t):e.content=t},!0);var o=n(r);a.on(i.trigger||"click",o.toggle),e.$on("$destroy",function(){o.destroy(),r=null,o=null})}}}]); -------------------------------------------------------------------------------- /helm/charts/etherpad-0.0.6/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | trap "exit 1" TERM 4 | export TOP_PID=$$ 5 | 6 | export project_name="etherpad-$(date +'%d%m%Y')" 7 | 8 | install() { 9 | echo "install - $(pwd)" 10 | 11 | oc new-project ${project_name} 12 | helm template etherpad --skip-tests . | oc apply -f - 13 | } 14 | 15 | test() { 16 | echo "test - $(pwd)" 17 | 18 | oc rollout status Deployment/etherpad -n ${project_name} --watch=true 19 | 20 | timeout 2m bash <<"EOT" 21 | run() { 22 | host=$(oc get route/etherpad -o jsonpath='{.spec.host}' -n ${project_name}) 23 | echo "Attempting $host" 24 | 25 | while [[ $(curl -L -k -s -o /dev/null -w '%{http_code}' https://${host}) != '200' ]]; do 26 | sleep 10 27 | done 28 | } 29 | 30 | run 31 | EOT 32 | 33 | if [[ $? != 0 ]]; then 34 | echo "CURL timed-out. Failing" 35 | 36 | host=$(oc get route/etherpad -o jsonpath='{.spec.host}' -n ${project_name}) 37 | curl -L -k -vvv "https://${host}" 38 | exit 1 39 | fi 40 | 41 | echo "Test complete" 42 | } 43 | 44 | cleanup() { 45 | echo "cleanup - $(pwd)" 46 | oc delete project/${project_name} 47 | } 48 | 49 | # Process arguments 50 | case $1 in 51 | install) 52 | install 53 | ;; 54 | test) 55 | test 56 | ;; 57 | cleanup) 58 | cleanup 59 | ;; 60 | *) 61 | echo "Not an option" 62 | exit 1 63 | esac -------------------------------------------------------------------------------- /helm/charts/etherpad-0.0.7/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | trap "exit 1" TERM 4 | export TOP_PID=$$ 5 | 6 | export project_name="etherpad-$(date +'%d%m%Y')" 7 | 8 | install() { 9 | echo "install - $(pwd)" 10 | 11 | oc new-project ${project_name} 12 | helm template etherpad --skip-tests . | oc apply -f - 13 | } 14 | 15 | test() { 16 | echo "test - $(pwd)" 17 | 18 | oc rollout status Deployment/etherpad -n ${project_name} --watch=true 19 | 20 | timeout 2m bash <<"EOT" 21 | run() { 22 | host=$(oc get route/etherpad -o jsonpath='{.spec.host}' -n ${project_name}) 23 | echo "Attempting $host" 24 | 25 | while [[ $(curl -L -k -s -o /dev/null -w '%{http_code}' https://${host}) != '200' ]]; do 26 | sleep 10 27 | done 28 | } 29 | 30 | run 31 | EOT 32 | 33 | if [[ $? != 0 ]]; then 34 | echo "CURL timed-out. Failing" 35 | 36 | host=$(oc get route/etherpad -o jsonpath='{.spec.host}' -n ${project_name}) 37 | curl -L -k -vvv "https://${host}" 38 | exit 1 39 | fi 40 | 41 | echo "Test complete" 42 | } 43 | 44 | cleanup() { 45 | echo "cleanup - $(pwd)" 46 | oc delete project/${project_name} 47 | } 48 | 49 | # Process arguments 50 | case $1 in 51 | install) 52 | install 53 | ;; 54 | test) 55 | test 56 | ;; 57 | cleanup) 58 | cleanup 59 | ;; 60 | *) 61 | echo "Not an option" 62 | exit 1 63 | esac -------------------------------------------------------------------------------- /books/server.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "github.com/gorilla/mux" 6 | "html/template" 7 | "log" 8 | "net/http" 9 | "time" 10 | ) 11 | 12 | var homeTemplate *template.Template 13 | 14 | func init() { 15 | homeTemplate = template.Must(template.ParseFiles("template.html")) 16 | } 17 | 18 | func listenAndServe(port string, books *Books) error { 19 | leak := [][]byte{} 20 | 21 | r := mux.NewRouter() 22 | 23 | r.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { 24 | books.fetch() 25 | w.WriteHeader(http.StatusOK) 26 | homeTemplate.Execute(w, books.List) 27 | }) 28 | 29 | r.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) { 30 | w.WriteHeader(http.StatusOK) 31 | fmt.Fprint(w, "ok") 32 | }) 33 | 34 | // WARNING! This endpoint is intentionally a memory leak for demonstration purposes. 35 | // We grab a large byte array and appends it to a global slice. 36 | r.HandleFunc("/leak", func(w http.ResponseWriter, r *http.Request) { 37 | leak = append(leak, make([]byte, 1<<28)) 38 | w.WriteHeader(http.StatusOK) 39 | fmt.Fprintf(w, "len: %d", len(leak)) 40 | }) 41 | 42 | srv := &http.Server{ 43 | Handler: r, 44 | Addr: "0.0.0.0:" + port, 45 | WriteTimeout: 10 * time.Second, 46 | ReadTimeout: 10 * time.Second, 47 | } 48 | 49 | log.Printf("Listening on :%s", port) 50 | return srv.ListenAndServe() 51 | } 52 | -------------------------------------------------------------------------------- /helm/charts/influxdb/templates/ingress.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.ingress.enabled -}} 2 | {{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }} 3 | apiVersion: networking.k8s.io/v1 4 | {{- else }} 5 | apiVersion: networking.k8s.io/v1beta1 6 | {{- end }} 7 | kind: Ingress 8 | metadata: 9 | name: {{ include "influxdb.fullname" . }} 10 | labels: 11 | {{- include "influxdb.labels" . | nindent 4 }} 12 | annotations: 13 | {{ toYaml .Values.ingress.annotations | indent 4 }} 14 | spec: 15 | {{- if .Values.ingress.tls }} 16 | tls: 17 | - hosts: 18 | - {{ .Values.ingress.hostname | quote }} 19 | secretName: {{ .Values.ingress.secretName }} 20 | {{- end }} 21 | {{- if .Values.ingress.className }} 22 | ingressClassName: {{ .Values.ingress.className }} 23 | {{- end }} 24 | rules: 25 | - host: {{ .Values.ingress.hostname }} 26 | http: 27 | paths: 28 | - path: {{ .Values.ingress.path }} 29 | {{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }} 30 | pathType: Prefix 31 | {{- end }} 32 | backend: 33 | {{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }} 34 | service: 35 | name: {{ include "influxdb.fullname" . }} 36 | port: 37 | number: 8086 38 | {{- else }} 39 | serviceName: {{ include "influxdb.fullname" . }} 40 | servicePort: 8086 41 | {{- end }} 42 | {{- end -}} 43 | -------------------------------------------------------------------------------- /todo-angular/src/assets/css/libs/angular-xeditable/xeditable.css: -------------------------------------------------------------------------------- 1 | /*! 2 | angular-xeditable - 0.1.8 3 | Edit-in-place for angular.js 4 | Build date: 2014-01-10 5 | */ 6 | 7 | .editable-wrap{display:inline-block;white-space:nowrap;margin:0}.editable-wrap .editable-controls,.editable-wrap .editable-error{margin-bottom:0}.editable-wrap .editable-controls>input,.editable-wrap .editable-controls>select,.editable-wrap .editable-controls>textarea{margin-bottom:0}.editable-wrap .editable-input{display:inline-block}.editable-buttons{display:inline-block;vertical-align:top}.editable-buttons button{margin-left:5px}.editable-input.editable-has-buttons{width:auto}.editable-bstime .editable-input input[type=text]{width:46px}.editable-bstime .well-small{margin-bottom:0;padding:10px}.editable-range output{display:inline-block;min-width:30px;vertical-align:top;text-align:center}.editable-color input[type=color]{width:50px}.editable-checkbox label span,.editable-checklist label span,.editable-radiolist label span{margin-left:7px;margin-right:10px}.editable-hide{display:none!important}.editable-click,a.editable-click{text-decoration:none;color:#428bca;border-bottom:dashed 1px #428bca}.editable-click:hover,a.editable-click:hover{text-decoration:none;color:#2a6496;border-bottom-color:#2a6496}.editable-empty,.editable-empty:hover,.editable-empty:focus,a.editable-empty,a.editable-empty:hover,a.editable-empty:focus{font-style:italic;color:#D14;text-decoration:none} -------------------------------------------------------------------------------- /helm/charts/etherpad-0.0.6/values.yaml: -------------------------------------------------------------------------------- 1 | # Default values for etherpad. 2 | replicaCount: 1 3 | 4 | defaultTitle: "Labs Etherpad" 5 | defaultText: "✍️ Assign yourself a user and share your ideas! ✍️" 6 | 7 | image: 8 | repository: etherpad 9 | name: 10 | tag: 11 | pullPolicy: IfNotPresent 12 | 13 | imagePullSecrets: [] 14 | nameOverride: "" 15 | fullnameOverride: "" 16 | 17 | podSecurityContext: {} 18 | securityContext: {} 19 | 20 | service: 21 | type: ClusterIP 22 | port: 9001 23 | 24 | ingress: 25 | enabled: false 26 | hosts: 27 | - name: etherpad.organization.com 28 | annotations: {} 29 | 30 | route: 31 | enabled: true 32 | host: null 33 | targetPort: http 34 | 35 | resources: {} 36 | # We usually recommend not to specify default resources and to leave this as a conscious 37 | # choice for the user. This also increases chances charts run on environments with little 38 | # resources, such as Minikube. If you do want to specify resources, uncomment the following 39 | # lines, adjust them as necessary, and remove the curly braces after 'resources:'. 40 | # limits: 41 | # cpu: 100m 42 | # memory: 128Mi 43 | # requests: 44 | # cpu: 100m 45 | # memory: 128Mi 46 | 47 | nodeSelector: {} 48 | 49 | tolerations: [] 50 | 51 | affinity: {} 52 | 53 | persistence: 54 | enabled: true 55 | annotations: {} 56 | storageClass: 57 | accessMode: ReadWriteOnce 58 | size: 1Gi 59 | mountPath: /opt/etherpad-lite/var 60 | -------------------------------------------------------------------------------- /helm/charts/etherpad-0.0.7/values.yaml: -------------------------------------------------------------------------------- 1 | # Default values for etherpad. 2 | replicaCount: 1 3 | 4 | defaultTitle: "Labs Etherpad" 5 | defaultText: "✍️ Assign yourself a user and share your ideas! ✍️" 6 | 7 | image: 8 | repository: etherpad 9 | name: 10 | tag: 11 | pullPolicy: IfNotPresent 12 | 13 | imagePullSecrets: [] 14 | nameOverride: "" 15 | fullnameOverride: "" 16 | 17 | podSecurityContext: {} 18 | securityContext: {} 19 | 20 | service: 21 | type: ClusterIP 22 | port: 9001 23 | 24 | ingress: 25 | enabled: false 26 | hosts: 27 | - name: etherpad.organization.com 28 | annotations: {} 29 | 30 | route: 31 | enabled: true 32 | host: null 33 | targetPort: http 34 | 35 | resources: {} 36 | # We usually recommend not to specify default resources and to leave this as a conscious 37 | # choice for the user. This also increases chances charts run on environments with little 38 | # resources, such as Minikube. If you do want to specify resources, uncomment the following 39 | # lines, adjust them as necessary, and remove the curly braces after 'resources:'. 40 | # limits: 41 | # cpu: 100m 42 | # memory: 128Mi 43 | # requests: 44 | # cpu: 100m 45 | # memory: 128Mi 46 | 47 | nodeSelector: {} 48 | 49 | tolerations: [] 50 | 51 | affinity: {} 52 | 53 | persistence: 54 | enabled: true 55 | annotations: {} 56 | storageClass: 57 | accessMode: ReadWriteOnce 58 | size: 1Gi 59 | mountPath: /opt/etherpad-lite/var 60 | -------------------------------------------------------------------------------- /todo-single/nodejs-source/todo/css/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | width: 90%; 3 | margin-left: auto; 4 | margin-right: auto; 5 | text-align: center; 6 | } 7 | 8 | h3 { 9 | margin: 0 0 20px; 10 | text-align: left; 11 | } 12 | 13 | .message { 14 | margin-left: 5%; 15 | margin-right: 5%; 16 | } 17 | 18 | .grid { 19 | width: 40%; 20 | float: left; 21 | margin-left: 5%; 22 | margin-right: 5%; 23 | } 24 | 25 | .grid .remove { 26 | width: 20px; 27 | height: 20px; 28 | margin-top: 8px; 29 | color: #a94442; 30 | } 31 | 32 | .gridStyle { 33 | border: 1px solid rgb(212, 212, 212); 34 | height: 335px; 35 | } 36 | 37 | .form { 38 | width: 40%; 39 | float: right; 40 | margin-left: 5%; 41 | margin-right: 5%; 42 | text-align: left; 43 | } 44 | 45 | .form label { 46 | width: 100px; 47 | } 48 | 49 | .form input { 50 | width: 300px; 51 | float: right; 52 | } 53 | 54 | .form .form-group span { 55 | float: right; 56 | width: 20px; 57 | height: 20px; 58 | margin-top: 5px; 59 | margin-left: 5px; 60 | color: #5cb85c; 61 | } 62 | 63 | .form .form-group p { 64 | margin-top: 15px; 65 | margin-left: 200px; 66 | color: #a94442; 67 | } 68 | 69 | .form .avatar { 70 | height: 250px; 71 | float: right; 72 | margin-right: 25px; 73 | } 74 | 75 | .form .buttons { 76 | clear: both; 77 | float: right; 78 | margin-top: 10px; 79 | margin-right: 25px; 80 | } 81 | -------------------------------------------------------------------------------- /loadtest/app.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | from flask import Flask, request, jsonify, make_response 3 | import requests 4 | from multiprocessing import Pool 5 | from multiprocessing import cpu_count 6 | import time 7 | 8 | application = Flask(__name__) 9 | 10 | @application.route('/api/loadtest/v1/healthz') 11 | def healthz(): 12 | return make_response(jsonify({"health": "ok"}), 200) 13 | 14 | @application.route('/api/loadtest/v1/mem//') 15 | def memory(size, seconds): 16 | try: 17 | dummy = ' ' * 1024 * 1024 * size 18 | except MemoryError: 19 | return make_response("Ran out of memory", 400) 20 | time.sleep(seconds) 21 | dummy = '' 22 | 23 | return make_response("", 200) 24 | 25 | def f(x): 26 | loop_count = 1000 * 1024 * 250 27 | while loop_count > 0: 28 | x*x 29 | loop_count = loop_count - 1 30 | 31 | @application.route('/api/loadtest/v1/cpu/') 32 | def cpu(cpus): 33 | 34 | print('Number of cpus available: %d' % cpu_count()) 35 | if (cpus > cpu_count()): 36 | return make_response("Requested cpus > number of cores available.", 400) 37 | 38 | print('-' * 20) 39 | print('Running load on CPU(s)') 40 | print('Utilizing %d cores' % cpus) 41 | print('-' * 20) 42 | pool = Pool(cpus) 43 | pool.map(f, range(cpus)) 44 | pool.close() 45 | 46 | return make_response("", 200) 47 | 48 | if __name__ == '__main__': 49 | application.run(host='0.0.0.0',port=8080) 50 | -------------------------------------------------------------------------------- /todo-single/nodejs-source/app.js: -------------------------------------------------------------------------------- 1 | var restify = require('restify'); 2 | 3 | var controller = require('./controllers/items'); 4 | 5 | var db = require('./models/db'); 6 | var model = require('./models/items'); 7 | 8 | model.connect(db.params, function(err) { 9 | if (err) throw err; 10 | }); 11 | 12 | var server = restify.createServer() 13 | .use(restify.plugins.fullResponse()) 14 | .use(restify.plugins.queryParser()) 15 | .use(restify.plugins.bodyParser()); 16 | 17 | controller.context(server, '/todo/api', model); 18 | 19 | server.get({ 20 | path: '/todo/api/items/:id' 21 | }, controller.read); 22 | 23 | 24 | server.get({ 25 | path: '/todo/api/items' 26 | }, controller.list); 27 | 28 | server.post({ 29 | path: '/todo/api/items' 30 | }, controller.save); 31 | 32 | server.del({ 33 | path: '/todo/api/items/:id' 34 | }, controller.destroy); 35 | 36 | 37 | server.get({ 38 | path: '/todo/*', 39 | name: 'todoapi' 40 | }, restify.plugins.serveStatic({ 41 | 'directory': __dirname, 42 | 'default': 'index.html' 43 | })); 44 | 45 | var port = process.env.APP_PORT || 8080; 46 | server.listen(port, function (err) { 47 | if (err) 48 | console.error(err); 49 | else 50 | console.log('App is ready at : ' + port); 51 | }); 52 | 53 | if (process.env.environment == 'production') 54 | process.on('uncaughtException', function (err) { 55 | console.error(JSON.parse(JSON.stringify(err, ['stack', 'message', 'inner'], 2))) 56 | }); 57 | -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/popover.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | "use strict";angular.module("mgcrea.ngStrap.popover",["mgcrea.ngStrap.tooltip"]).provider("$popover",function(){var t=this.defaults={animation:"am-fade",container:!1,target:!1,placement:"right",template:"popover/popover.tpl.html",contentTemplate:!1,trigger:"click",keyboard:!0,html:!1,title:"",content:"",delay:0};this.$get=["$tooltip",function(e){function n(n,o){var a=angular.extend({},t,o),r=e(n,a);return a.content&&(r.$scope.content=a.content),r}return n}]}).directive("bsPopover",["$window","$location","$sce","$popover",function(t,e,n,o){var a=t.requestAnimationFrame||t.setTimeout;return{restrict:"EAC",scope:!0,link:function(t,e,r){var i={scope:t};angular.forEach(["template","contentTemplate","placement","container","target","delay","trigger","keyboard","html","animation"],function(t){angular.isDefined(r[t])&&(i[t]=r[t])}),angular.forEach(["title","content"],function(e){r[e]&&r.$observe(e,function(o,r){t[e]=n.trustAsHtml(o),angular.isDefined(r)&&a(function(){c&&c.$applyPlacement()})})}),r.bsPopover&&t.$watch(r.bsPopover,function(e,n){angular.isObject(e)?angular.extend(t,e):t.content=e,angular.isDefined(n)&&a(function(){c&&c.$applyPlacement()})},!0);var c=o(e,i);t.$on("$destroy",function(){c.destroy(),i=null,c=null})}}}]); -------------------------------------------------------------------------------- /helm/charts/mysql-persistent/values.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema#", 3 | "type": "object", 4 | "properties": { 5 | "database_service_name": { 6 | "type": "string", 7 | "pattern": "^[a-z0-9-_]+$" 8 | }, 9 | "namespace": { 10 | "type": "string" 11 | }, 12 | "mysql_database": { 13 | "type": "string" 14 | }, 15 | "mysql_password": { 16 | "type": "string" 17 | }, 18 | "mysql_root_password": { 19 | "type": "string" 20 | }, 21 | "mysql_user": { 22 | "type": "string" 23 | }, 24 | "volume_capacity": { 25 | "type": "string", 26 | "title": "Persistent Volume Size", 27 | "form": true, 28 | "render": "slider", 29 | "sliderMin": 1, 30 | "sliderMax": 100, 31 | "sliderUnit": "Gi" 32 | }, 33 | "memory_limit": { 34 | "type": "string", 35 | "title": "Database memory limit", 36 | "form": true, 37 | "render": "slider", 38 | "sliderMin": 512, 39 | "sliderMax": 65536, 40 | "sliderUnit": "Mi" 41 | }, 42 | "mysql_version": { 43 | "type": "string", 44 | "description": "Specify mysql imagestream tag", 45 | "enum": [ "latest", "8.0-el9", "8.0-el8", "8.0-el7" ] 46 | } 47 | } 48 | } 49 | 50 | -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/alert.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | "use strict";angular.module("mgcrea.ngStrap.alert",["mgcrea.ngStrap.modal"]).provider("$alert",function(){var t=this.defaults={animation:"am-fade",prefixClass:"alert",placement:null,template:"alert/alert.tpl.html",container:!1,element:null,backdrop:!1,keyboard:!0,show:!0,duration:!1,type:!1,dismissable:!0};this.$get=["$modal","$timeout",function(e,n){function a(a){var r={},i=angular.extend({},t,a);r=e(i),r.$scope.dismissable=!!i.dismissable,i.type&&(r.$scope.type=i.type);var o=r.show;return i.duration&&(r.show=function(){o(),n(function(){r.hide()},1e3*i.duration)}),r}return a}]}).directive("bsAlert",["$window","$location","$sce","$alert",function(t,e,n,a){t.requestAnimationFrame||t.setTimeout;return{restrict:"EAC",scope:!0,link:function(t,e,r){var i={scope:t,element:e,show:!1};angular.forEach(["template","placement","keyboard","html","container","animation","duration","dismissable"],function(t){angular.isDefined(r[t])&&(i[t]=r[t])}),angular.forEach(["title","content","type"],function(e){r[e]&&r.$observe(e,function(a){t[e]=n.trustAsHtml(a)})}),r.bsAlert&&t.$watch(r.bsAlert,function(e){angular.isObject(e)?angular.extend(t,e):t.content=e},!0);var o=a(i);e.on(r.trigger||"click",o.toggle),t.$on("$destroy",function(){o.destroy(),i=null,o=null})}}}]); -------------------------------------------------------------------------------- /php-ssl/ssl/certs/tls.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIEDTCCAvWgAwIBAgIUZ2ILvNHGb6kIggcIKY5ibQ5m1u4wDQYJKoZIhvcNAQEL 3 | BQAwgZUxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJOQzEQMA4GA1UEBwwHUmFsZWln 4 | aDEQMA4GA1UECgwHUmVkIEhhdDERMA8GA1UECwwIVHJhaW5pbmcxHjAcBgNVBAMM 5 | FXRvZG8uYXBwcy5leGFtcGxlLmNvbTEiMCAGCSqGSIb3DQEJARYTdHJhaW5pbmdA 6 | cmVkaGF0LmNvbTAeFw0xOTExMjgyMDQyMDJaFw0yMDExMjcyMDQyMDJaMIGVMQsw 7 | CQYDVQQGEwJVUzELMAkGA1UECAwCTkMxEDAOBgNVBAcMB1JhbGVpZ2gxEDAOBgNV 8 | BAoMB1JlZCBIYXQxETAPBgNVBAsMCFRyYWluaW5nMR4wHAYDVQQDDBV0b2RvLmFw 9 | cHMuZXhhbXBsZS5jb20xIjAgBgkqhkiG9w0BCQEWE3RyYWluaW5nQHJlZGhhdC5j 10 | b20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCurfjfmTVju+uJxanJ 11 | cio6DYs1lAQyzKuJeJeKlzIxdY1RT48QN8iBQ6egLCwgZxqUMKhEEHYfxAi6/aKl 12 | cQdr3n77xMVQv+Bub34XX3H2aOE1V9kKh0og0srrvKBUb8su6uiqu0Jpq0eu+Xe7 13 | gVe5WP1b4SeA4ZpAtPugqFRxXLufsyqpVCoGJKvi3XQGHOini/h+Oz/sirpUGJ60 14 | P4IhYOsC3vNPTVB4Bgmcm7AsgEfK19+AQLqYqnmCc8iq2XFmHiAvd7VrqnLFOjpN 15 | FR+x7xrDRAkEB/WiQ+s2HHWMpAYOJb9qfbBCKr1JUH7cX0ZHaEtwMxVvqNcjxpEI 16 | CshpAgMBAAGjUzBRMB0GA1UdDgQWBBSkr4M7N/rBhHeVyBEU0MHlE0i67zAfBgNV 17 | HSMEGDAWgBSkr4M7N/rBhHeVyBEU0MHlE0i67zAPBgNVHRMBAf8EBTADAQH/MA0G 18 | CSqGSIb3DQEBCwUAA4IBAQA01PSkcS8SOgQpNSfIoJ8s2pMOlhQ/0VoEFofheGVt 19 | kekFaPRGn0Z2DEorKXRuclR2Ye4+4zvvAsNXeZZa2jAbhFXA9Zs2SzUDK7xXebUc 20 | azzGd4JFST5KqroV5lAgeEeZdW1r39PCFPLZ36c0jh5g6fbFws7atzO+dqATU2mX 21 | c0qywhEZDz4PfUwyP6B2oG39oNGKj457WMg39oWjopZJ9NK0SKqFybeTjO/13pDr 22 | CWJNC//Eralcdu8zoWF6U5BFiEQTXlmeD4J+AZTmBBT5vaAW1ypEkmRAhPIkAwVs 23 | HryISUxmPg2JCrlU+52jCM3RCXoXCZerrdC+l/xirTgd 24 | -----END CERTIFICATE----- 25 | -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular/angular-loader.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | AngularJS v1.2.18 3 | (c) 2010-2014 Google, Inc. http://angularjs.org 4 | License: MIT 5 | */ 6 | (function(){'use strict';function d(a){return function(){var c=arguments[0],b,c="["+(a?a+":":"")+c+"] http://errors.angularjs.org/1.2.18/"+(a?a+"/":"")+c;for(b=1;b 6 | # 7 | LoadModule ssl_module modules/mod_ssl.so 8 | Listen 8443 9 | SSLPassPhraseDialog builtin 10 | SSLSessionCache shmcb:/var/cache/mod_ssl/scache(512000) 11 | SSLSessionCacheTimeout 300 12 | SSLRandomSeed startup file:/dev/urandom 256 13 | SSLRandomSeed connect builtin 14 | 15 | 16 | ServerName localhost.localdomain:8443 17 | ErrorLog logs/ssl_error_log 18 | TransferLog logs/ssl_access_log 19 | LogLevel warn 20 | SSLEngine on 21 | 22 | SSLProtocol all -SSLv2 23 | SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW 24 | SSLCertificateFile /usr/local/etc/ssl/certs/tls.crt 25 | SSLCertificateKeyFile /usr/local/etc/ssl/certs/tls.key 26 | # SSLCertificateChainFile /usr/local/etc/ssl/certs/tls-chain.crt 27 | 28 | SetEnvIf User-Agent ".*MSIE.*" \ 29 | nokeepalive ssl-unclean-shutdown \ 30 | downgrade-1.0 force-response-1.0 31 | CustomLog logs/ssl_request_log "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" 32 | 33 | SSLOptions +StdEnvVars 34 | 35 | 36 | SSLOptions +StdEnvVars 37 | 38 | 39 | -------------------------------------------------------------------------------- /todo-angular/ssl/certs/tls.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIEDTCCAvWgAwIBAgIUZ2ILvNHGb6kIggcIKY5ibQ5m1u4wDQYJKoZIhvcNAQEL 3 | BQAwgZUxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJOQzEQMA4GA1UEBwwHUmFsZWln 4 | aDEQMA4GA1UECgwHUmVkIEhhdDERMA8GA1UECwwIVHJhaW5pbmcxHjAcBgNVBAMM 5 | FXRvZG8uYXBwcy5leGFtcGxlLmNvbTEiMCAGCSqGSIb3DQEJARYTdHJhaW5pbmdA 6 | cmVkaGF0LmNvbTAeFw0xOTExMjgyMDQyMDJaFw0yMDExMjcyMDQyMDJaMIGVMQsw 7 | CQYDVQQGEwJVUzELMAkGA1UECAwCTkMxEDAOBgNVBAcMB1JhbGVpZ2gxEDAOBgNV 8 | BAoMB1JlZCBIYXQxETAPBgNVBAsMCFRyYWluaW5nMR4wHAYDVQQDDBV0b2RvLmFw 9 | cHMuZXhhbXBsZS5jb20xIjAgBgkqhkiG9w0BCQEWE3RyYWluaW5nQHJlZGhhdC5j 10 | b20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCurfjfmTVju+uJxanJ 11 | cio6DYs1lAQyzKuJeJeKlzIxdY1RT48QN8iBQ6egLCwgZxqUMKhEEHYfxAi6/aKl 12 | cQdr3n77xMVQv+Bub34XX3H2aOE1V9kKh0og0srrvKBUb8su6uiqu0Jpq0eu+Xe7 13 | gVe5WP1b4SeA4ZpAtPugqFRxXLufsyqpVCoGJKvi3XQGHOini/h+Oz/sirpUGJ60 14 | P4IhYOsC3vNPTVB4Bgmcm7AsgEfK19+AQLqYqnmCc8iq2XFmHiAvd7VrqnLFOjpN 15 | FR+x7xrDRAkEB/WiQ+s2HHWMpAYOJb9qfbBCKr1JUH7cX0ZHaEtwMxVvqNcjxpEI 16 | CshpAgMBAAGjUzBRMB0GA1UdDgQWBBSkr4M7N/rBhHeVyBEU0MHlE0i67zAfBgNV 17 | HSMEGDAWgBSkr4M7N/rBhHeVyBEU0MHlE0i67zAPBgNVHRMBAf8EBTADAQH/MA0G 18 | CSqGSIb3DQEBCwUAA4IBAQA01PSkcS8SOgQpNSfIoJ8s2pMOlhQ/0VoEFofheGVt 19 | kekFaPRGn0Z2DEorKXRuclR2Ye4+4zvvAsNXeZZa2jAbhFXA9Zs2SzUDK7xXebUc 20 | azzGd4JFST5KqroV5lAgeEeZdW1r39PCFPLZ36c0jh5g6fbFws7atzO+dqATU2mX 21 | c0qywhEZDz4PfUwyP6B2oG39oNGKj457WMg39oWjopZJ9NK0SKqFybeTjO/13pDr 22 | CWJNC//Eralcdu8zoWF6U5BFiEQTXlmeD4J+AZTmBBT5vaAW1ypEkmRAhPIkAwVs 23 | HryISUxmPg2JCrlU+52jCM3RCXoXCZerrdC+l/xirTgd 24 | -----END CERTIFICATE----- 25 | -------------------------------------------------------------------------------- /books/seed.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | var seed = []Book{ 4 | { 5 | Title: "The Hitchhiker's Guide to the Galaxy", 6 | Author: "Adams, Douglas", 7 | Year: 1979, 8 | }, 9 | { 10 | Title: "The Restaurant at the End of the Universe", 11 | Author: "Adams, Douglas", 12 | Year: 1980, 13 | }, 14 | { 15 | Title: "So Long, and Thanks for All the Fish", 16 | Author: "Adams, Douglas", 17 | Year: 1984, 18 | }, 19 | { 20 | Title: "Dirk Gently's Holistic Detective Agency", 21 | Author: "Adams, Douglas", 22 | Year: 1987, 23 | }, 24 | { 25 | Title: "The Long Dark Tea-Time of the Soul", 26 | Author: "Adams, Douglas", 27 | Year: 1988, 28 | }, 29 | { 30 | Title: "Zodiac", 31 | Author: "Stephenson, Neal", 32 | Year: 1988, 33 | }, 34 | { 35 | Title: "Snow Crash", 36 | Author: "Stephenson, Neal", 37 | Year: 1992, 38 | }, 39 | { 40 | Title: "Cryptonomicon", 41 | Author: "Stephenson, Neal", 42 | Year: 1999, 43 | }, 44 | { 45 | Title: "Neuromancer", 46 | Author: "Gibson, William", 47 | Year: 1984, 48 | }, 49 | { 50 | Title: "Count Zero", 51 | Author: "Gibson, William", 52 | Year: 1986, 53 | }, 54 | { 55 | Title: "Virtual Light", 56 | Author: "Gibson, William", 57 | Year: 1993, 58 | }, 59 | { 60 | Title: "What If?", 61 | Author: "Munroe, Randall", 62 | Year: 2014, 63 | }, 64 | { 65 | Title: "Thing Explainer", 66 | Author: "Munroe, Randall", 67 | Year: 2015, 68 | }, 69 | { 70 | Title: "How To", 71 | Author: "Munroe, Randall", 72 | Year: 2019, 73 | }, 74 | } 75 | -------------------------------------------------------------------------------- /todo-angular/src/assets/css/libs/angular-motion/modules/fade-and-scale.min.css: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-motion 3 | * @version v0.3.2 - 2014-02-11 4 | * @link https://github.com/mgcrea/angular-motion 5 | * @author Olivier Louvignes 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | .am-fade-and-scale{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out;-webkit-animation-fill-mode:backwards;animation-fill-mode:backwards}.am-fade-and-scale.ng-enter,.am-fade-and-scale.am-fade-and-scale-add,.am-fade-and-scale.ng-hide-remove,.am-fade-and-scale.ng-move{-webkit-animation-name:fadeAndScaleIn;animation-name:fadeAndScaleIn}.am-fade-and-scale.ng-leave,.am-fade-and-scale.am-fade-and-scale-remove,.am-fade-and-scale.ng-hide{-webkit-animation-name:fadeAndScaleOut;animation-name:fadeAndScaleOut}.am-fade-and-scale.ng-enter{visibility:hidden;-webkit-animation-name:fadeAndScaleIn;animation-name:fadeAndScaleIn}.am-fade-and-scale.ng-enter.ng-enter-active{visibility:visible}.am-fade-and-scale.ng-leave{-webkit-animation-name:fadeAndScaleOut;animation-name:fadeAndScaleOut}@-webkit-keyframes fadeAndScaleIn{from{opacity:0;-webkit-transform:scale(0.7);transform:scale(0.7)}to{opacity:1}}@keyframes fadeAndScaleIn{from{opacity:0;-webkit-transform:scale(0.7);transform:scale(0.7)}to{opacity:1}}@-webkit-keyframes fadeAndScaleOut{from{opacity:1}to{opacity:0;-webkit-transform:scale(0.7);transform:scale(0.7)}}@keyframes fadeAndScaleOut{from{opacity:1}to{opacity:0;-webkit-transform:scale(0.7);transform:scale(0.7)}} -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/datepicker.tpl.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | "use strict";angular.module("mgcrea.ngStrap.datepicker").run(["$templateCache",function(t){t.put("datepicker/datepicker.tpl.html",'')}]); -------------------------------------------------------------------------------- /php-ssl/README.md: -------------------------------------------------------------------------------- 1 | ## About this container 2 | This container deploys a stand-alone PHP page to display some basic information about 3 | the container. It is mostly used to determine whether this application is served via 4 | TLS or is exposed via HTTP. 5 | 6 | ## How to build 7 | Run the following command to build the container image: 8 | `$ podman build -t php-ssl .` 9 | 10 | The container expects a certificate and a key at `/usr/local/etc/ssl/certs`. 11 | Run the following command to generate a self-signed certificate: 12 | `$ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout tls.key -out tls.crt` 13 | 14 | ## How to run 15 | 16 | ### In HTTP mode 17 | ``` 18 | podman run --name todo -p 8080:8080 php-ssl:latest` 19 | ``` 20 | 21 | ### In HTTPs mode 22 | ``` 23 | podman run --userns keep-id \ 24 | -v ./ssl/certs:/usr/local/etc/ssl/certs:Z \ 25 | --name todo -p 8443:8443 php-ssl:latest` 26 | ``` 27 | 28 | ### In HTTP & HTTPS mode 29 | Notice the port range: 30 | 31 | ``` 32 | podman run --userns keep-id \ 33 | -v ./ssl/certs:/usr/local/etc/ssl/certs:Z \ 34 | --name test \ 35 | -p 8080-8443:8080-8443 \ 36 | php-ssl:latest 37 | ``` 38 | 39 | ### Disable HTTPs support 40 | If you need to disable HTTPs support, run the following steps: 41 | 42 | 1. In `Dockerfile` -- comment lines 11 & 20: 43 | ``` 44 | # mod_ssl \ 45 | ... 46 | # COPY httpd/ssl.conf /etc/httpd/conf.d/ssl.conf 47 | ``` 48 | 3. Rebuild the image: 49 | ``` 50 | `$ podman build -t php-ssl:latest .` 51 | ``` 52 | 4. Run the following command to create the container: 53 | ``` 54 | `$ podman run --name todo -p 8080:8080 php-ssl:latest` 55 | ``` 56 | -------------------------------------------------------------------------------- /todo-frontend/src/css/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | width: 90%; 3 | margin-left: auto; 4 | margin-right: auto; 5 | text-align: center; 6 | } 7 | 8 | h3 { 9 | margin: 0 0 20px; 10 | text-align: left; 11 | } 12 | 13 | .message { 14 | margin-left: 5%; 15 | margin-right: 5%; 16 | } 17 | 18 | .grid { 19 | width: 40%; 20 | float: left; 21 | margin-left: 5%; 22 | margin-right: 5%; 23 | } 24 | 25 | .grid .remove { 26 | width: 20px; 27 | height: 20px; 28 | margin-top: 8px; 29 | color: #a94442; 30 | } 31 | 32 | .gridStyle { 33 | border: 1px solid rgb(212, 212, 212); 34 | height: 335px; 35 | } 36 | 37 | .form { 38 | width: 40%; 39 | float: right; 40 | margin-left: 5%; 41 | margin-right: 5%; 42 | text-align: left; 43 | } 44 | 45 | .form label { 46 | width: 100px; 47 | } 48 | 49 | .form input { 50 | width: 300px; 51 | float: right; 52 | } 53 | 54 | .form .form-group span { 55 | float: right; 56 | width: 20px; 57 | height: 20px; 58 | margin-top: 5px; 59 | margin-left: 5px; 60 | color: #5cb85c; 61 | } 62 | 63 | .form .form-group p { 64 | margin-top: 15px; 65 | margin-left: 200px; 66 | color: #a94442; 67 | } 68 | 69 | .form .avatar { 70 | height: 250px; 71 | float: right; 72 | margin-right: 25px; 73 | } 74 | 75 | .form .buttons { 76 | clear: both; 77 | float: right; 78 | margin-top: 10px; 79 | margin-right: 25px; 80 | } 81 | 82 | .footer { 83 | width: 100%; 84 | clear: both; 85 | float: left; 86 | text-align: left; 87 | margin-top: 20 px; 88 | font-size: medium; 89 | border-top: 1px solid #e0e0e0; 90 | } 91 | -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/datepicker.tpl.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | 'use strict'; 9 | angular.module('mgcrea.ngStrap.datepicker').run([ 10 | '$templateCache', 11 | function ($templateCache) { 12 | $templateCache.put('datepicker/datepicker.tpl.html', ''); 13 | } 14 | ]); -------------------------------------------------------------------------------- /exoplanets/template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Exoplanets 7 | 38 | 39 | 40 | 41 | 42 |

    Exoplanets

    43 | 44 |

    45 | The planets listed here are a small subset of the known planets found outside of our solar system. 46 | Mass and radius are listed in "Jupiter mass" and "Jupiter radius" units. The orbital period is measured in Earth days. 47 | The full dataset is available from the Open Exoplanet Catalogue. 48 |

    49 | 50 | {{range .}} 51 |
    52 |

    {{.Name}}

    53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 |
    MassRadiusPeriod
    {{.Mass}}{{.Radius}}{{.Period}}
    70 |
    71 | {{end}} 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /helm/charts/etherpad-0.0.6/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "etherpad.name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 7 | {{- end -}} 8 | 9 | {{/* 10 | Create a default fully qualified app name. 11 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 12 | If release name contains chart name it will be used as a full name. 13 | */}} 14 | {{- define "etherpad.fullname" -}} 15 | {{- if .Values.fullnameOverride -}} 16 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} 17 | {{- else -}} 18 | {{- $name := default .Chart.Name .Values.nameOverride -}} 19 | {{- if contains $name .Release.Name -}} 20 | {{- .Release.Name | trunc 63 | trimSuffix "-" -}} 21 | {{- else -}} 22 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 23 | {{- end -}} 24 | {{- end -}} 25 | {{- end -}} 26 | 27 | {{/* 28 | Create chart name and version as used by the chart label. 29 | */}} 30 | {{- define "etherpad.chart" -}} 31 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} 32 | {{- end -}} 33 | 34 | {{/* 35 | Common labels 36 | */}} 37 | {{- define "etherpad.labels" -}} 38 | helm.sh/chart: {{ include "etherpad.chart" . }} 39 | {{ include "etherpad.selectorLabels" . }} 40 | {{- if .Chart.AppVersion }} 41 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 42 | {{- end }} 43 | app.kubernetes.io/managed-by: {{ .Release.Service }} 44 | {{- end -}} 45 | 46 | {{/* 47 | Selector labels 48 | */}} 49 | {{- define "etherpad.selectorLabels" -}} 50 | app.kubernetes.io/name: {{ include "etherpad.name" . }} 51 | app.kubernetes.io/instance: {{ .Release.Name }} 52 | {{- end -}} 53 | -------------------------------------------------------------------------------- /helm/charts/etherpad-0.0.7/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "etherpad.name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 7 | {{- end -}} 8 | 9 | {{/* 10 | Create a default fully qualified app name. 11 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 12 | If release name contains chart name it will be used as a full name. 13 | */}} 14 | {{- define "etherpad.fullname" -}} 15 | {{- if .Values.fullnameOverride -}} 16 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} 17 | {{- else -}} 18 | {{- $name := default .Chart.Name .Values.nameOverride -}} 19 | {{- if contains $name .Release.Name -}} 20 | {{- .Release.Name | trunc 63 | trimSuffix "-" -}} 21 | {{- else -}} 22 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 23 | {{- end -}} 24 | {{- end -}} 25 | {{- end -}} 26 | 27 | {{/* 28 | Create chart name and version as used by the chart label. 29 | */}} 30 | {{- define "etherpad.chart" -}} 31 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} 32 | {{- end -}} 33 | 34 | {{/* 35 | Common labels 36 | */}} 37 | {{- define "etherpad.labels" -}} 38 | helm.sh/chart: {{ include "etherpad.chart" . }} 39 | {{ include "etherpad.selectorLabels" . }} 40 | {{- if .Chart.AppVersion }} 41 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 42 | {{- end }} 43 | app.kubernetes.io/managed-by: {{ .Release.Service }} 44 | {{- end -}} 45 | 46 | {{/* 47 | Selector labels 48 | */}} 49 | {{- define "etherpad.selectorLabels" -}} 50 | app.kubernetes.io/name: {{ include "etherpad.name" . }} 51 | app.kubernetes.io/instance: {{ .Release.Name }} 52 | {{- end -}} 53 | -------------------------------------------------------------------------------- /php-ssl/ssl/certs/tls.key: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCurfjfmTVju+uJ 3 | xanJcio6DYs1lAQyzKuJeJeKlzIxdY1RT48QN8iBQ6egLCwgZxqUMKhEEHYfxAi6 4 | /aKlcQdr3n77xMVQv+Bub34XX3H2aOE1V9kKh0og0srrvKBUb8su6uiqu0Jpq0eu 5 | +Xe7gVe5WP1b4SeA4ZpAtPugqFRxXLufsyqpVCoGJKvi3XQGHOini/h+Oz/sirpU 6 | GJ60P4IhYOsC3vNPTVB4Bgmcm7AsgEfK19+AQLqYqnmCc8iq2XFmHiAvd7VrqnLF 7 | OjpNFR+x7xrDRAkEB/WiQ+s2HHWMpAYOJb9qfbBCKr1JUH7cX0ZHaEtwMxVvqNcj 8 | xpEICshpAgMBAAECggEBAIWXJZOTr2I0EMHP+rbGagb13rY+GivjnXjIUlU6prdu 9 | qII77zS/BMffPu5feevaDlixEa7kTAKlQOwJF/+g/sT/Z2wTI7hK1lB/UhZ790M1 10 | GK9cHPBRYV7S9z/shU2uJd0e6IvSJMt9o5fs0CYFmFp29WT0P+rwHrFH+Hz434PF 11 | 3WYswUyZLLpuC2bkOPam7AEHQgZ7UHW38GWC72zDVOCUZnxbqknWw9PKIHdMK5EK 12 | 7CNkRc9KwTOPnT4uE+h/RiO2LUapxPz9NSfCuGNVmRRPezNajIY8TELNXL4DxC8x 13 | G7IXW3DXCqkHexg0e2YKWWPq9V/iiAJRVUcdTP8sQRECgYEA2NWNgBt1P5seRLy/ 14 | 77Vz/w57r6Ds7rk/uDPC96SZVSTIHcwKx+UOSNIyzmbBAfW0QGaWnAz/XyUSe6Vj 15 | 5KKDHKSKUd7p4w3dzJFfgWl1/M+HyC2eTrDYYaqSAsqKcWLavF2sHU2ISYrGsVrI 16 | czrGqK2LN4xwCFX1Q9hIs3G5mf0CgYEAzjsu+up9gudPdAfavYVyppNh8LABKVcV 17 | 1lIlz0UfS4aWq+C6gWjnEqrOKHkvWwzlgozvaEyIChHlTpc/zMo0/DMx+BngYNhh 18 | uvMv7AgbBmo1MEHH/ZFwTKoWF2nlx9ER+FqyeTR8rfuff7fsNp/qwnTWJnY9QdEu 19 | c7EPKXqrDd0CgYAjGcbTMx6y0jh/JhLoCfaiFkUddC6GooRXHEH2drW/m7mtYSdp 20 | noHGdgh1cxrRZ2Xreu/siQoZ69VnIKngDBKvY09k23H/KHJ8OBg+ycSozSuM0x2q 21 | XWRZwxPp0cHBgyAnl/5RrAhg508szKZgSOZ5zcYYkupb3xZaCjwSmFlUPQKBgBEm 22 | Zs/C9FEQf1D83jnogRJNK1XirRYNAenixvYnn2SeeqUseRYN7TlmLuK6wS9nMSbc 23 | JYSc6Ks9tb4FYe7b2fAnKb6iGEC1fdsYIiIUwnqUFnw+3CzADYCynEeyLMOjJUVr 24 | 9W+S59NoG2l5mBEq11D4el6Ucp+oj55bWRFv/A2ZAoGBAMehwcekk/7PhroCvuSf 25 | nwsZAfKEC5jrcDkrhZ/Um5q2ca/E0HMKqLB1xscPrNHyNzuxORMPzKQpcQHOQIPW 26 | isRyRaSbbJO23pDlgImY4LZYVjNwYM6bbJZGwr7K1IjPsosiE6j7jMNRVZVlmHA4 27 | E0Gy+qsU9BPz6msZ2LFYRkWX 28 | -----END PRIVATE KEY----- 29 | -------------------------------------------------------------------------------- /todo-angular/ssl/certs/tls.key: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCurfjfmTVju+uJ 3 | xanJcio6DYs1lAQyzKuJeJeKlzIxdY1RT48QN8iBQ6egLCwgZxqUMKhEEHYfxAi6 4 | /aKlcQdr3n77xMVQv+Bub34XX3H2aOE1V9kKh0og0srrvKBUb8su6uiqu0Jpq0eu 5 | +Xe7gVe5WP1b4SeA4ZpAtPugqFRxXLufsyqpVCoGJKvi3XQGHOini/h+Oz/sirpU 6 | GJ60P4IhYOsC3vNPTVB4Bgmcm7AsgEfK19+AQLqYqnmCc8iq2XFmHiAvd7VrqnLF 7 | OjpNFR+x7xrDRAkEB/WiQ+s2HHWMpAYOJb9qfbBCKr1JUH7cX0ZHaEtwMxVvqNcj 8 | xpEICshpAgMBAAECggEBAIWXJZOTr2I0EMHP+rbGagb13rY+GivjnXjIUlU6prdu 9 | qII77zS/BMffPu5feevaDlixEa7kTAKlQOwJF/+g/sT/Z2wTI7hK1lB/UhZ790M1 10 | GK9cHPBRYV7S9z/shU2uJd0e6IvSJMt9o5fs0CYFmFp29WT0P+rwHrFH+Hz434PF 11 | 3WYswUyZLLpuC2bkOPam7AEHQgZ7UHW38GWC72zDVOCUZnxbqknWw9PKIHdMK5EK 12 | 7CNkRc9KwTOPnT4uE+h/RiO2LUapxPz9NSfCuGNVmRRPezNajIY8TELNXL4DxC8x 13 | G7IXW3DXCqkHexg0e2YKWWPq9V/iiAJRVUcdTP8sQRECgYEA2NWNgBt1P5seRLy/ 14 | 77Vz/w57r6Ds7rk/uDPC96SZVSTIHcwKx+UOSNIyzmbBAfW0QGaWnAz/XyUSe6Vj 15 | 5KKDHKSKUd7p4w3dzJFfgWl1/M+HyC2eTrDYYaqSAsqKcWLavF2sHU2ISYrGsVrI 16 | czrGqK2LN4xwCFX1Q9hIs3G5mf0CgYEAzjsu+up9gudPdAfavYVyppNh8LABKVcV 17 | 1lIlz0UfS4aWq+C6gWjnEqrOKHkvWwzlgozvaEyIChHlTpc/zMo0/DMx+BngYNhh 18 | uvMv7AgbBmo1MEHH/ZFwTKoWF2nlx9ER+FqyeTR8rfuff7fsNp/qwnTWJnY9QdEu 19 | c7EPKXqrDd0CgYAjGcbTMx6y0jh/JhLoCfaiFkUddC6GooRXHEH2drW/m7mtYSdp 20 | noHGdgh1cxrRZ2Xreu/siQoZ69VnIKngDBKvY09k23H/KHJ8OBg+ycSozSuM0x2q 21 | XWRZwxPp0cHBgyAnl/5RrAhg508szKZgSOZ5zcYYkupb3xZaCjwSmFlUPQKBgBEm 22 | Zs/C9FEQf1D83jnogRJNK1XirRYNAenixvYnn2SeeqUseRYN7TlmLuK6wS9nMSbc 23 | JYSc6Ks9tb4FYe7b2fAnKb6iGEC1fdsYIiIUwnqUFnw+3CzADYCynEeyLMOjJUVr 24 | 9W+S59NoG2l5mBEq11D4el6Ucp+oj55bWRFv/A2ZAoGBAMehwcekk/7PhroCvuSf 25 | nwsZAfKEC5jrcDkrhZ/Um5q2ca/E0HMKqLB1xscPrNHyNzuxORMPzKQpcQHOQIPW 26 | isRyRaSbbJO23pDlgImY4LZYVjNwYM6bbJZGwr7K1IjPsosiE6j7jMNRVZVlmHA4 27 | E0Gy+qsU9BPz6msZ2LFYRkWX 28 | -----END PRIVATE KEY----- 29 | -------------------------------------------------------------------------------- /helm/charts/mysql-persistent/README.md: -------------------------------------------------------------------------------- 1 | # MySQL helm chart 2 | 3 | A Helm chart for building and deploying a [MySQL](https://github/sclorg/mysql-container) application on OpenShift. 4 | 5 | For more information about helm charts see the official [Helm Charts Documentation](https://helm.sh/). 6 | 7 | You need to have access to a cluster for each operation with OpenShift 4, like deploying and testing. 8 | 9 | ## Values 10 | Below is a table of each value used to configure this chart. 11 | 12 | | Value | Description | Default | Additional Information | 13 | |---------------------------------------------| ----------- | -- | ---------------------- | 14 | | `database_service_name` | The name of the OpenShift Service exposed for the database. | `mysql` | - | 15 | | `mysql_user` | Username for MySQL user that will be used for accessing the database. | `testu` | Expresion like: `user[A-Z0-9]{3}` | 16 | | `mysql_root_password` | Password for the MySQL root user. | `testur` | Expression like: `[a-zA-Z0-9]{16}` | 17 | | `mysql_database` | Name of the MySQL database accessed. | `testdb` | | 18 | | `mysql_password` | Password for the MySQL connection user. | `testp` | Expression like: `[a-zA-Z0-9]{16}` | 19 | | `mysql_version` | Version of MySQL image to be used (8.0-el8, or latest). | `8.0-el8` | | 20 | | `namespace` | The OpenShift Namespace where the ImageStream resides. | `mysql-persistent-testing` | | 21 | | `memory_limit` | Maximum amount of memory the container can use. | `521Mi` | | 22 | | `volume_capacity` | Volume space available for data, e.g. 512Mi, 2Gi. | `1Gi` | | 23 | -------------------------------------------------------------------------------- /todo-angular/src/assets/css/libs/angular-motion/modules/fade.css: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-motion 3 | * @version v0.3.2 - 2014-02-11 4 | * @link https://github.com/mgcrea/angular-motion 5 | * @author Olivier Louvignes 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | .am-fade { 9 | -webkit-animation-duration: 0.3s; 10 | animation-duration: 0.3s; 11 | -webkit-animation-timing-function: linear; 12 | animation-timing-function: linear; 13 | -webkit-animation-fill-mode: backwards; 14 | animation-fill-mode: backwards; 15 | opacity: 1; 16 | } 17 | .am-fade.am-fade-add, 18 | .am-fade.ng-hide-remove, 19 | .am-fade.ng-move { 20 | -webkit-animation-name: fadeIn; 21 | animation-name: fadeIn; 22 | } 23 | .am-fade.am-fade-remove, 24 | .am-fade.ng-hide { 25 | -webkit-animation-name: fadeOut; 26 | animation-name: fadeOut; 27 | } 28 | .am-fade.ng-enter { 29 | visibility: hidden; 30 | -webkit-animation-name: fadeIn; 31 | animation-name: fadeIn; 32 | } 33 | .am-fade.ng-enter.ng-enter-active { 34 | visibility: visible; 35 | } 36 | .am-fade.ng-leave { 37 | -webkit-animation-name: fadeOut; 38 | animation-name: fadeOut; 39 | } 40 | @-webkit-keyframes fadeIn { 41 | from { 42 | opacity: 0; 43 | } 44 | to { 45 | opacity: 1; 46 | } 47 | } 48 | @keyframes fadeIn { 49 | from { 50 | opacity: 0; 51 | } 52 | to { 53 | opacity: 1; 54 | } 55 | } 56 | @-webkit-keyframes fadeOut { 57 | from { 58 | opacity: 1; 59 | } 60 | to { 61 | opacity: 0; 62 | } 63 | } 64 | @keyframes fadeOut { 65 | from { 66 | opacity: 1; 67 | } 68 | to { 69 | opacity: 0; 70 | } 71 | } 72 | .modal-backdrop.am-fade, 73 | .aside-backdrop.am-fade { 74 | background: rgba(0, 0, 0, 0.5); 75 | -webkit-animation-duration: 0.15s; 76 | animation-duration: 0.15s; 77 | } 78 | -------------------------------------------------------------------------------- /todo-angular/nginx/conf.d/ssl.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 8443 http2 ssl; 3 | listen [::]:8443 http2 ssl; 4 | 5 | server_name _; 6 | root /usr/share/nginx/html; 7 | 8 | ssl_certificate /usr/local/etc/ssl/certs/tls.crt; 9 | ssl_certificate_key /usr/local/etc/ssl/certs/tls.key; 10 | ssl_dhparam /etc/ssl/conf/dhparam.pem; 11 | 12 | ######################################################################## 13 | # from https://cipherli.st/ # 14 | # and https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html # 15 | ######################################################################## 16 | 17 | ssl_protocols TLSv1 TLSv1.1 TLSv1.2; 18 | ssl_prefer_server_ciphers on; 19 | ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH"; 20 | ssl_ecdh_curve secp384r1; 21 | ssl_session_cache shared:SSL:10m; 22 | ssl_session_tickets off; 23 | ssl_stapling on; 24 | ssl_stapling_verify on; 25 | resolver 8.8.8.8 8.8.4.4 valid=300s; 26 | resolver_timeout 5s; 27 | # Disable preloading HSTS for now. You can use the commented out header line that includes 28 | # the "preload" directive if you understand the implications. 29 | #add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload"; 30 | add_header Strict-Transport-Security "max-age=63072000; includeSubdomains"; 31 | add_header X-Frame-Options DENY; 32 | add_header X-Content-Type-Options nosniff; 33 | 34 | ################################## 35 | # END https://cipherli.st/ BLOCK # 36 | ################################## 37 | 38 | location / { 39 | } 40 | 41 | error_page 404 /404.html; 42 | location = /404.html { 43 | } 44 | 45 | error_page 500 502 503 504 /50x.html; 46 | location = /50x.html { 47 | } 48 | } -------------------------------------------------------------------------------- /todo-frontend/nginx.conf: -------------------------------------------------------------------------------- 1 | # For more information on configuration, see: 2 | # * Official English Documentation: http://nginx.org/en/docs/ 3 | # * Official Russian Documentation: http://nginx.org/ru/docs/ 4 | 5 | env BACKEND_HOST; 6 | 7 | worker_processes auto; 8 | error_log stderr; 9 | pid /run/nginx.pid; 10 | 11 | # Load dynamic modules. See /usr/share/doc/nginx/README.dynamic. 12 | include /usr/share/nginx/modules/*.conf; 13 | 14 | events { 15 | worker_connections 1024; 16 | } 17 | 18 | http { 19 | log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 20 | '$status $body_bytes_sent "$http_referer" ' 21 | '"$http_user_agent" "$http_x_forwarded_for"'; 22 | 23 | sendfile on; 24 | tcp_nopush on; 25 | tcp_nodelay on; 26 | keepalive_timeout 65; 27 | types_hash_max_size 2048; 28 | 29 | include /etc/nginx/mime.types; 30 | default_type application/octet-stream; 31 | 32 | # Load modular configuration files from the /etc/nginx/conf.d directory. 33 | # See http://nginx.org/en/docs/ngx_core_module.html#include 34 | # for more information. 35 | include /etc/nginx/conf.d/*.conf; 36 | 37 | perl_set $backend 'sub { return $ENV{"BACKEND_HOST"}; }'; 38 | 39 | server { 40 | listen 8080 default_server; 41 | listen [::]:8080 default_server; 42 | server_name _; 43 | root /usr/share/nginx/html; 44 | 45 | # Load configuration files for the default server block. 46 | include /etc/nginx/default.d/*.conf; 47 | 48 | sub_filter_types application/javascript; 49 | sub_filter '_BACKEND_' $backend; 50 | sub_filter_once off; 51 | 52 | location / { 53 | } 54 | 55 | error_page 404 /404.html; 56 | location = /40x.html { 57 | } 58 | 59 | error_page 500 502 503 504 /50x.html; 60 | location = /50x.html { 61 | } 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/debounce.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | 'use strict'; 9 | angular.module('mgcrea.ngStrap.helpers.debounce', []).constant('debounce', function (func, wait, immediate) { 10 | var timeout, args, context, timestamp, result; 11 | return function () { 12 | context = this; 13 | args = arguments; 14 | timestamp = new Date(); 15 | var later = function () { 16 | var last = new Date() - timestamp; 17 | if (last < wait) { 18 | timeout = setTimeout(later, wait - last); 19 | } else { 20 | timeout = null; 21 | if (!immediate) 22 | result = func.apply(context, args); 23 | } 24 | }; 25 | var callNow = immediate && !timeout; 26 | if (!timeout) { 27 | timeout = setTimeout(later, wait); 28 | } 29 | if (callNow) 30 | result = func.apply(context, args); 31 | return result; 32 | }; 33 | }).constant('throttle', function (func, wait, options) { 34 | var context, args, result; 35 | var timeout = null; 36 | var previous = 0; 37 | options || (options = {}); 38 | var later = function () { 39 | previous = options.leading === false ? 0 : new Date(); 40 | timeout = null; 41 | result = func.apply(context, args); 42 | }; 43 | return function () { 44 | var now = new Date(); 45 | if (!previous && options.leading === false) 46 | previous = now; 47 | var remaining = wait - (now - previous); 48 | context = this; 49 | args = arguments; 50 | if (remaining <= 0) { 51 | clearTimeout(timeout); 52 | timeout = null; 53 | previous = now; 54 | result = func.apply(context, args); 55 | } else if (!timeout && options.trailing !== false) { 56 | timeout = setTimeout(later, remaining); 57 | } 58 | return result; 59 | }; 60 | }); -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/dimensions.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | "use strict";angular.module("mgcrea.ngStrap.helpers.dimensions",[]).factory("dimensions",["$document","$window",function(){var t=(angular.element,{}),e=t.nodeName=function(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()};t.css=function(t,e,o){var n;return n=t.currentStyle?t.currentStyle[e]:window.getComputedStyle?window.getComputedStyle(t)[e]:t.style[e],o===!0?parseFloat(n)||0:n},t.offset=function(t){var e=t.getBoundingClientRect(),o=t.ownerDocument;return{width:e.width||t.offsetWidth,height:e.height||t.offsetHeight,top:e.top+(window.pageYOffset||o.documentElement.scrollTop)-(o.documentElement.clientTop||0),left:e.left+(window.pageXOffset||o.documentElement.scrollLeft)-(o.documentElement.clientLeft||0)}},t.position=function(n){var s,i,r={top:0,left:0};return"fixed"===t.css(n,"position")?i=n.getBoundingClientRect():(s=o(n),i=t.offset(n),i=t.offset(n),e(s,"html")||(r=t.offset(s)),r.top+=t.css(s,"borderTopWidth",!0),r.left+=t.css(s,"borderLeftWidth",!0)),{width:n.offsetWidth,height:n.offsetHeight,top:i.top-r.top-t.css(n,"marginTop",!0),left:i.left-r.left-t.css(n,"marginLeft",!0)}};var o=function(o){var n=o.ownerDocument,s=o.offsetParent||n;if(e(s,"#document"))return n.documentElement;for(;s&&!e(s,"html")&&"static"===t.css(s,"position");)s=s.offsetParent;return s||n.documentElement};return t.height=function(e,o){var n=e.offsetHeight;return o?n+=t.css(e,"marginTop",!0)+t.css(e,"marginBottom",!0):n-=t.css(e,"paddingTop",!0)+t.css(e,"paddingBottom",!0)+t.css(e,"borderTopWidth",!0)+t.css(e,"borderBottomWidth",!0),n},t.width=function(e,o){var n=e.offsetWidth;return o?n+=t.css(e,"marginLeft",!0)+t.css(e,"marginRight",!0):n-=t.css(e,"paddingLeft",!0)+t.css(e,"paddingRight",!0)+t.css(e,"borderLeftWidth",!0)+t.css(e,"borderRightWidth",!0),n},t}]); -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/navbar.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | 'use strict'; 9 | angular.module('mgcrea.ngStrap.navbar', []).provider('$navbar', function () { 10 | var defaults = this.defaults = { 11 | activeClass: 'active', 12 | routeAttr: 'data-match-route', 13 | strict: false 14 | }; 15 | this.$get = function () { 16 | return { defaults: defaults }; 17 | }; 18 | }).directive('bsNavbar', [ 19 | '$window', 20 | '$location', 21 | '$navbar', 22 | function ($window, $location, $navbar) { 23 | var defaults = $navbar.defaults; 24 | return { 25 | restrict: 'A', 26 | link: function postLink(scope, element, attr, controller) { 27 | // Directive options 28 | var options = angular.copy(defaults); 29 | angular.forEach(Object.keys(defaults), function (key) { 30 | if (angular.isDefined(attr[key])) 31 | options[key] = attr[key]; 32 | }); 33 | // Watch for the $location 34 | scope.$watch(function () { 35 | return $location.path(); 36 | }, function (newValue, oldValue) { 37 | var liElements = element[0].querySelectorAll('li[' + options.routeAttr + ']'); 38 | angular.forEach(liElements, function (li) { 39 | var liElement = angular.element(li); 40 | var pattern = liElement.attr(options.routeAttr).replace('/', '\\/'); 41 | if (options.strict) { 42 | pattern = '^' + pattern + '$'; 43 | } 44 | var regexp = new RegExp(pattern, ['i']); 45 | if (regexp.test(newValue)) { 46 | liElement.addClass(options.activeClass); 47 | } else { 48 | liElement.removeClass(options.activeClass); 49 | } 50 | }); 51 | }); 52 | } 53 | }; 54 | } 55 | ]); -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/dropdown.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | "use strict";angular.module("mgcrea.ngStrap.dropdown",["mgcrea.ngStrap.tooltip"]).provider("$dropdown",function(){var e=this.defaults={animation:"am-fade",prefixClass:"dropdown",placement:"bottom-left",template:"dropdown/dropdown.tpl.html",trigger:"click",container:!1,keyboard:!0,html:!1,delay:0};this.$get=["$window","$rootScope","$tooltip",function(o,t,n){function r(o,r){function c(e){return e.target!==o[0]?e.target!==o[0]&&i.hide():void 0}{var i={},d=angular.extend({},e,r);i.$scope=d.scope&&d.scope.$new()||t.$new()}i=n(o,d),i.$onKeyDown=function(e){if(/(38|40)/.test(e.keyCode)){e.preventDefault(),e.stopPropagation();var o=angular.element(i.$element[0].querySelectorAll("li:not(.divider) a"));if(o.length){var t;angular.forEach(o,function(e,o){l&&l.call(e,":focus")&&(t=o)}),38===e.keyCode&&t>0?t--:40===e.keyCode&&t 10 | AllowOverride none 11 | Require all denied 12 | 13 | 14 | DocumentRoot "/var/www/html" 15 | 16 | 17 | AllowOverride None 18 | # Allow open access: 19 | Require all granted 20 | 21 | 22 | # Further relax access to the default document root: 23 | 24 | Options Indexes FollowSymLinks 25 | AllowOverride None 26 | Require all granted 27 | 28 | 29 | 30 | DirectoryIndex index.html 31 | 32 | 33 | # 34 | # The following lines prevent .htaccess and .htpasswd files from being 35 | # viewed by Web clients. 36 | # 37 | 38 | Require all denied 39 | 40 | 41 | # Changed by Steve Pousty 42 | # ErrorLog "logs/error_log" 43 | ErrorLog "|/bin/more" 44 | LogLevel warn 45 | 46 | 47 | LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined 48 | LogFormat "%h %l %u %t \"%r\" %>s %b" common 49 | 50 | 51 | # You need to enable mod_logio.c to use %I and %O 52 | LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio 53 | 54 | 55 | CustomLog "|/bin/more" combined 56 | 57 | 58 | 59 | ScriptAlias /cgi-bin/ "/var/www/cgi-bin/" 60 | 61 | 62 | 63 | AllowOverride None 64 | Options None 65 | Require all granted 66 | 67 | 68 | 69 | TypesConfig /etc/mime.types 70 | AddType application/x-compress .Z 71 | AddType application/x-gzip .gz .tgz 72 | AddType text/html .shtml 73 | AddOutputFilter INCLUDES .shtml 74 | 75 | 76 | AddDefaultCharset UTF-8 77 | 78 | 79 | MIMEMagicFile conf/magic 80 | 81 | 82 | EnableSendfile on 83 | IncludeOptional conf.d/*.conf 84 | -------------------------------------------------------------------------------- /helm/charts/influxdb/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "influxdb.name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 7 | {{- end -}} 8 | 9 | {{/* 10 | Create a default fully qualified app name. 11 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 12 | If release name contains chart name it will be used as a full name. 13 | */}} 14 | {{- define "influxdb.fullname" -}} 15 | {{- if .Values.fullnameOverride -}} 16 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} 17 | {{- else -}} 18 | {{- $name := default .Chart.Name .Values.nameOverride -}} 19 | {{- if contains $name .Release.Name -}} 20 | {{- .Release.Name | trunc 63 | trimSuffix "-" -}} 21 | {{- else -}} 22 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 23 | {{- end -}} 24 | {{- end -}} 25 | {{- end -}} 26 | 27 | {{/* 28 | Create chart name and version as used by the chart label. 29 | */}} 30 | {{- define "influxdb.chart" -}} 31 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} 32 | {{- end -}} 33 | 34 | {{/* 35 | Common labels 36 | */}} 37 | {{- define "influxdb.labels" -}} 38 | helm.sh/chart: {{ include "influxdb.chart" . }} 39 | {{ include "influxdb.selectorLabels" . }} 40 | {{- if .Chart.AppVersion }} 41 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 42 | {{- end }} 43 | app.kubernetes.io/managed-by: {{ .Release.Service }} 44 | {{- end -}} 45 | 46 | {{/* 47 | Selector labels 48 | */}} 49 | {{- define "influxdb.selectorLabels" -}} 50 | app.kubernetes.io/name: {{ include "influxdb.name" . }} 51 | app.kubernetes.io/instance: {{ .Release.Name }} 52 | {{- end -}} 53 | 54 | {{/* 55 | Create the name of the service account to use 56 | */}} 57 | {{- define "influxdb.serviceAccountName" -}} 58 | {{- if .Values.serviceAccount.create -}} 59 | {{ default (include "influxdb.fullname" .) .Values.serviceAccount.name }} 60 | {{- else -}} 61 | {{ default "default" .Values.serviceAccount.name }} 62 | {{- end -}} 63 | {{- end -}} 64 | -------------------------------------------------------------------------------- /todo-angular/src/assets/css/libs/angular-motion/modules/fade-and-scale.css: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-motion 3 | * @version v0.3.2 - 2014-02-11 4 | * @link https://github.com/mgcrea/angular-motion 5 | * @author Olivier Louvignes 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | .am-fade-and-scale { 9 | -webkit-animation-duration: 0.3s; 10 | animation-duration: 0.3s; 11 | -webkit-animation-timing-function: ease-in-out; 12 | animation-timing-function: ease-in-out; 13 | -webkit-animation-fill-mode: backwards; 14 | animation-fill-mode: backwards; 15 | } 16 | .am-fade-and-scale.ng-enter, 17 | .am-fade-and-scale.am-fade-and-scale-add, 18 | .am-fade-and-scale.ng-hide-remove, 19 | .am-fade-and-scale.ng-move { 20 | -webkit-animation-name: fadeAndScaleIn; 21 | animation-name: fadeAndScaleIn; 22 | } 23 | .am-fade-and-scale.ng-leave, 24 | .am-fade-and-scale.am-fade-and-scale-remove, 25 | .am-fade-and-scale.ng-hide { 26 | -webkit-animation-name: fadeAndScaleOut; 27 | animation-name: fadeAndScaleOut; 28 | } 29 | .am-fade-and-scale.ng-enter { 30 | visibility: hidden; 31 | -webkit-animation-name: fadeAndScaleIn; 32 | animation-name: fadeAndScaleIn; 33 | } 34 | .am-fade-and-scale.ng-enter.ng-enter-active { 35 | visibility: visible; 36 | } 37 | .am-fade-and-scale.ng-leave { 38 | -webkit-animation-name: fadeAndScaleOut; 39 | animation-name: fadeAndScaleOut; 40 | } 41 | @-webkit-keyframes fadeAndScaleIn { 42 | from { 43 | opacity: 0; 44 | -webkit-transform: scale(0.7); 45 | transform: scale(0.7); 46 | } 47 | to { 48 | opacity: 1; 49 | } 50 | } 51 | @keyframes fadeAndScaleIn { 52 | from { 53 | opacity: 0; 54 | -webkit-transform: scale(0.7); 55 | transform: scale(0.7); 56 | } 57 | to { 58 | opacity: 1; 59 | } 60 | } 61 | @-webkit-keyframes fadeAndScaleOut { 62 | from { 63 | opacity: 1; 64 | } 65 | to { 66 | opacity: 0; 67 | -webkit-transform: scale(0.7); 68 | transform: scale(0.7); 69 | } 70 | } 71 | @keyframes fadeAndScaleOut { 72 | from { 73 | opacity: 1; 74 | } 75 | to { 76 | opacity: 0; 77 | -webkit-transform: scale(0.7); 78 | transform: scale(0.7); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /todo-angular/README.md: -------------------------------------------------------------------------------- 1 | ## About this container 2 | This container deploys a stand-alone To Do application written in AngularJS. 3 | The web server supports both HTTP and HTTPs connection. 4 | 5 | ## How to build 6 | Run the following command to build the container image: 7 | `$ podman build -t do280/todo-angular:latest .` 8 | 9 | The current application provides a self-signed certificate in `ssl`. Their names 10 | would match the certificates name in OpenShift. 11 | If you need to regenerate a self-signed certificate,run the following command: 12 | `$ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout tls.key -out tls.crt` 13 | 14 | If you need to recreate a Diffie-Hellman group, run the following command: 15 | `$ openssl dhparam -out dhparam.pem 2048` 16 | 17 | ## How to run 18 | 19 | ### In HTTP mode 20 | ``` 21 | podman run --userns keep-id \ 22 | -v ./ssl/certs:/usr/local/etc/ssl/certs:Z \ 23 | --name todo -p 8080:8080 \ 24 | do280/todo-angular:latest` 25 | ``` 26 | 27 | ### In HTTPs mode 28 | ``` 29 | podman run --userns keep-id \ 30 | -v ./ssl/certs:/usr/local/etc/ssl/certs:Z \ 31 | --name todo -p 8443:8443 \ 32 | do280/todo-angular:latest` 33 | ``` 34 | 35 | ### In HTTP & HTTPS mode 36 | Notice the port range: 37 | 38 | ``` 39 | podman run --userns keep-id \ 40 | -v ./ssl/certs:/usr/local/etc/ssl/certs:Z \ 41 | --name test \ 42 | -p 8080-8443:8080-8443 \ 43 | do280/todo-angular:latest 44 | ``` 45 | 46 | ### Disable HTTPs support 47 | If you need to disable HTTPs support, run the following steps: 48 | 49 | 1. In `Dockerfile` -- comment lines 16 and 17: 50 | ``` 51 | # COPY nginx/dhparam.pem /etc/ssl/conf/dhparam.pem 52 | # COPY nginx/conf.d/ssl.conf /etc/nginx/conf.d/ssl.conf 53 | ``` 54 | 2. In `nginx/nginx.conf`comment line 38 & 66-67: 55 | ``` 56 | # include /etc/nginx/conf.d/*.conf; 57 | ... 58 | # error_page 497 https://$host:8443$request_uri; 59 | # return 301 https://$host:8443$request_uri; 60 | ``` 61 | 3. Rebuild the image: 62 | ``` 63 | `$ podman build -t do280/todo-angular:latest .` 64 | ``` 65 | 4. Run the following command to create the container: 66 | ``` 67 | `$ podman run --name todo -p 8080:8080 do280/todo-angular:latest` 68 | ``` 69 | -------------------------------------------------------------------------------- /helm/charts/influxdb/files/backup-retention-script.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | 3 | set -e 4 | 5 | # This script wants these variable to be set. 6 | 7 | ## S3_BUCKET <- The name of the bucket where the backups are stored 8 | ## S3_ENDPOINT <- The endpoint of the S3 service 9 | ## AWS_ACCESS_KEY_ID <- Access credentials 10 | ## AWS_SECRET_ACCESS_KEY <- Access credentials 11 | ## DAYS_TO_RETAIN <- The TTL for the backups === number of backups to keep. 12 | 13 | # Sanity check to avoid removing all backups. 14 | [[ "$DAYS_TO_RETAIN" -lt 1 ]] && DAYS_TO_RETAIN=1 15 | 16 | # Prepare endpoint-url argument 17 | [[ -z "$S3_ENDPOINT" ]] && endpoint_arg="" || endpoint_arg="--endpoint-url ${S3_ENDPOINT}" 18 | 19 | function get_records { 20 | before_date="$1" 21 | 22 | aws s3api list-objects \ 23 | --bucket ${S3_BUCKET} \ 24 | ${endpoint_arg} \ 25 | --query "Contents[?LastModified<='${before_date}'][].{Key: Key}" 26 | } 27 | 28 | function remove_old_backups { 29 | before_date=$(date --iso-8601=seconds -d "-${DAYS_TO_RETAIN} days") 30 | now=$(date --iso-8601=seconds) 31 | 32 | del_records=$(get_records "${before_date}") 33 | all_records=$(get_records "${now}") 34 | 35 | del_paths=() 36 | all_paths=() 37 | 38 | function _jq { 39 | echo ${row} | base64 --decode | jq -r ${1} 40 | } 41 | 42 | for row in $(echo "${del_records}" | jq -r '.[] | @base64'); do 43 | del_paths+=($(_jq '.Key')) 44 | done 45 | 46 | for row in $(echo "${all_records}" | jq -r '.[] | @base64'); do 47 | all_paths+=($(_jq '.Key')) 48 | done 49 | 50 | # Number of backups left if all old backups are removed. 51 | left=$((${#all_paths[@]} - ${#del_paths[@]})) 52 | 53 | # We ALWAYS keep N backups even if their TTL has expired! 54 | if (( ${left} < ${DAYS_TO_RETAIN} )); then 55 | num_to_delete=$((${#all_paths[@]} - ${DAYS_TO_RETAIN})) 56 | else 57 | num_to_delete=${#del_paths[@]} 58 | fi 59 | 60 | for path in "${del_paths[@]::${num_to_delete}}"; do 61 | aws s3 rm "s3://${S3_BUCKET}/${path}" \ 62 | ${endpoint_arg} 63 | done 64 | } 65 | 66 | # Installs jq. 67 | yum install -y jq 68 | 69 | remove_old_backups 70 | -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular/angular-cookies.min.js.map: -------------------------------------------------------------------------------- 1 | { 2 | "version":3, 3 | "file":"angular-cookies.min.js", 4 | "lineCount":7, 5 | "mappings":"A;;;;;aAKC,SAAQ,CAACA,CAAD,CAASC,CAAT,CAAkBC,CAAlB,CAA6B,CAmBtCD,CAAAE,OAAA,CAAe,WAAf,CAA4B,CAAC,IAAD,CAA5B,CAAAC,QAAA,CAyBW,UAzBX,CAyBuB,CAAC,YAAD,CAAe,UAAf,CAA2B,QAAS,CAACC,CAAD,CAAaC,CAAb,CAAuB,CAAA,IACxEC,EAAU,EAD8D,CAExEC,EAAc,EAF0D,CAGxEC,CAHwE,CAIxEC,EAAU,CAAA,CAJ8D,CAKxEC,EAAOV,CAAAU,KALiE,CAMxEC,EAAcX,CAAAW,YAGlBN,EAAAO,UAAA,CAAmB,QAAQ,EAAG,CAC5B,IAAIC,EAAiBR,CAAAC,QAAA,EACjBE,EAAJ,EAA0BK,CAA1B,GACEL,CAGA,CAHqBK,CAGrB,CAFAH,CAAA,CAAKG,CAAL,CAAqBN,CAArB,CAEA,CADAG,CAAA,CAAKG,CAAL,CAAqBP,CAArB,CACA,CAAIG,CAAJ,EAAaL,CAAAU,OAAA,EAJf,CAF4B,CAA9B,CAAA,EAUAL,EAAA,CAAU,CAAA,CAKVL,EAAAW,OAAA,CASAC,QAAa,EAAG,CAAA,IACVC,CADU,CAEVC,CAFU,CAIVC,CAGJ,KAAKF,CAAL,GAAaV,EAAb,CACMI,CAAA,CAAYL,CAAA,CAAQW,CAAR,CAAZ,CAAJ,EACEZ,CAAAC,QAAA,CAAiBW,CAAjB,CAAuBhB,CAAvB,CAKJ,KAAIgB,CAAJ,GAAYX,EAAZ,CACEY,CAKA,CALQZ,CAAA,CAAQW,CAAR,CAKR,CAJKjB,CAAAoB,SAAA,CAAiBF,CAAjB,CAIL,GAHEA,CACA,CADQ,EACR,CADaA,CACb,CAAAZ,CAAA,CAAQW,CAAR,CAAA,CAAgBC,CAElB,EAAIA,CAAJ,GAAcX,CAAA,CAAYU,CAAZ,CAAd,GACEZ,CAAAC,QAAA,CAAiBW,CAAjB,CAAuBC,CAAvB,CACA,CAAAC,CAAA,CAAU,CAAA,CAFZ,CAOF,IAAIA,CAAJ,CAIE,IAAKF,CAAL,GAFAI,EAEaf,CAFID,CAAAC,QAAA,EAEJA,CAAAA,CAAb,CACMA,CAAA,CAAQW,CAAR,CAAJ,GAAsBI,CAAA,CAAeJ,CAAf,CAAtB,GAEMN,CAAA,CAAYU,CAAA,CAAeJ,CAAf,CAAZ,CAAJ,CACE,OAAOX,CAAA,CAAQW,CAAR,CADT,CAGEX,CAAA,CAAQW,CAAR,CAHF,CAGkBI,CAAA,CAAeJ,CAAf,CALpB,CAhCU,CAThB,CAEA,OAAOX,EA1BqE,CAA3D,CAzBvB,CAAAH,QAAA,CAkIW,cAlIX;AAkI2B,CAAC,UAAD,CAAa,QAAQ,CAACmB,CAAD,CAAW,CAErD,MAAO,KAWAC,QAAQ,CAACC,CAAD,CAAM,CAEjB,MAAO,CADHN,CACG,CADKI,CAAA,CAASE,CAAT,CACL,EAAQxB,CAAAyB,SAAA,CAAiBP,CAAjB,CAAR,CAAkCA,CAFxB,CAXd,KA0BAQ,QAAQ,CAACF,CAAD,CAAMN,CAAN,CAAa,CACxBI,CAAA,CAASE,CAAT,CAAA,CAAgBxB,CAAA2B,OAAA,CAAeT,CAAf,CADQ,CA1BrB,QAuCGU,QAAQ,CAACJ,CAAD,CAAM,CACpB,OAAOF,CAAA,CAASE,CAAT,CADa,CAvCjB,CAF8C,CAAhC,CAlI3B,CAnBsC,CAArC,CAAA,CAsMEzB,MAtMF,CAsMUA,MAAAC,QAtMV;", 6 | "sources":["angular-cookies.js"], 7 | "names":["window","angular","undefined","module","factory","$rootScope","$browser","cookies","lastCookies","lastBrowserCookies","runEval","copy","isUndefined","addPollFn","currentCookies","$apply","$watch","push","name","value","updated","isString","browserCookies","$cookies","get","key","fromJson","put","toJson","remove"] 8 | } 9 | -------------------------------------------------------------------------------- /books/books.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "database/sql" 5 | "log" 6 | 7 | _ "github.com/lib/pq" 8 | ) 9 | 10 | // Book is a simple record 11 | type Book struct { 12 | Title, Author string 13 | Year int 14 | } 15 | 16 | // Books handles database interactions for lists of books 17 | type Books struct { 18 | DB *sql.DB 19 | List []Book 20 | } 21 | 22 | // fetch retrieves a fresh list from the database 23 | func (b *Books) fetch() { 24 | if b.DB == nil { 25 | log.Println("Not connected to database") 26 | return 27 | } 28 | 29 | log.Printf("Fetching books") 30 | 31 | rows, err := b.DB.Query(`SELECT title, author, year FROM book ORDER BY author ASC, year ASC`) 32 | if err != nil { 33 | log.Printf("Unable to select book table:", err) 34 | return 35 | } 36 | defer rows.Close() 37 | 38 | // clear the List and rebuild it from the returned rows 39 | b.List = []Book{} 40 | var ( 41 | title, author string 42 | year int 43 | ) 44 | 45 | for rows.Next() { 46 | err = rows.Scan(&title, &author, &year) 47 | if err != nil { 48 | log.Printf("Error: %v", err.Error()) 49 | } 50 | b.List = append(b.List, Book{Title: title, Author: author, Year: year}) 51 | } 52 | } 53 | 54 | // populate creates and populates a book table from the seed 55 | func (b *Books) populate() { 56 | if b.DB == nil { 57 | log.Println("Not connected to database") 58 | return 59 | } 60 | 61 | log.Printf("Recreating book table") 62 | 63 | // drop the table (in case it already exists) 64 | _, err := b.DB.Query(`DROP TABLE book`) 65 | if err != nil { 66 | log.Println("Unable to drop book table (may not exist)") 67 | } 68 | 69 | // create the book table 70 | _, err = b.DB.Query(`CREATE TABLE book 71 | (id serial primary key, 72 | title text NOT NULL, 73 | author varchar(255) NOT NULL, 74 | year smallint)`) 75 | if err != nil { 76 | log.Fatalf("Unable to create book table:", err) 77 | } 78 | 79 | // populate the table from the seed book list 80 | log.Printf("Populating book table") 81 | 82 | for _, book := range seed { 83 | _, err = b.DB.Query(`INSERT INTO book (title, author, year) VALUES ($1,$2,$3)`, book.Title, book.Author, book.Year) 84 | if err != nil { 85 | log.Fatalf("Unable to populate book table:", err) 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/tab.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | 'use strict'; 9 | angular.module('mgcrea.ngStrap.tab', []).run([ 10 | '$templateCache', 11 | function ($templateCache) { 12 | $templateCache.put('$pane', '{{pane.content}}'); 13 | } 14 | ]).provider('$tab', function () { 15 | var defaults = this.defaults = { 16 | animation: 'am-fade', 17 | template: 'tab/tab.tpl.html' 18 | }; 19 | this.$get = function () { 20 | return { defaults: defaults }; 21 | }; 22 | }).directive('bsTabs', [ 23 | '$window', 24 | '$animate', 25 | '$tab', 26 | function ($window, $animate, $tab) { 27 | var defaults = $tab.defaults; 28 | return { 29 | restrict: 'EAC', 30 | scope: true, 31 | require: '?ngModel', 32 | templateUrl: function (element, attr) { 33 | return attr.template || defaults.template; 34 | }, 35 | link: function postLink(scope, element, attr, controller) { 36 | // Directive options 37 | var options = defaults; 38 | angular.forEach(['animation'], function (key) { 39 | if (angular.isDefined(attr[key])) 40 | options[key] = attr[key]; 41 | }); 42 | // Require scope as an object 43 | attr.bsTabs && scope.$watch(attr.bsTabs, function (newValue, oldValue) { 44 | scope.panes = newValue; 45 | }, true); 46 | // Add base class 47 | element.addClass('tabs'); 48 | // Support animations 49 | if (options.animation) { 50 | element.addClass(options.animation); 51 | } 52 | scope.active = scope.activePane = 0; 53 | // view -> model 54 | scope.setActive = function (index, ev) { 55 | scope.active = index; 56 | if (controller) { 57 | controller.$setViewValue(index); 58 | } 59 | }; 60 | // model -> view 61 | if (controller) { 62 | controller.$render = function () { 63 | scope.active = controller.$modelValue * 1; 64 | }; 65 | } 66 | } 67 | }; 68 | } 69 | ]); -------------------------------------------------------------------------------- /todo-angular/nginx/nginx.conf: -------------------------------------------------------------------------------- 1 | # For more information on configuration, see: 2 | # * Official English Documentation: http://nginx.org/en/docs/ 3 | # * Official Russian Documentation: http://nginx.org/ru/docs/ 4 | 5 | env BACKEND_HOST; 6 | 7 | worker_processes auto; 8 | error_log stderr; 9 | pid /run/nginx.pid; 10 | 11 | # Load dynamic modules. See /usr/share/doc/nginx/README.dynamic. 12 | include /usr/share/nginx/modules/*.conf; 13 | 14 | events { 15 | worker_connections 1024; 16 | } 17 | 18 | http { 19 | log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 20 | '$status $body_bytes_sent "$http_referer" ' 21 | '"$http_user_agent" "$http_x_forwarded_for"'; 22 | 23 | sendfile on; 24 | tcp_nopush on; 25 | tcp_nodelay on; 26 | keepalive_timeout 65; 27 | types_hash_max_size 2048; 28 | 29 | include /etc/nginx/mime.types; 30 | default_type application/octet-stream; 31 | 32 | # Load modular configuration files from the /etc/nginx/conf.d directory. 33 | # See http://nginx.org/en/docs/ngx_core_module.html#include 34 | # for more information. 35 | include /etc/nginx/default.d/*.conf; 36 | 37 | # Comment the following to disable the SSL configuration 38 | include /etc/nginx/conf.d/*.conf; 39 | 40 | perl_set $backend 'sub { return $ENV{"BACKEND_HOST"}; }'; 41 | 42 | server { 43 | listen 8080 default_server; 44 | listen [::]:8080 default_server; 45 | server_name _; 46 | root /usr/share/nginx/html; 47 | 48 | # Load configuration files for the default server block. 49 | # include /etc/nginx/conf.d/*.conf; 50 | 51 | sub_filter_types application/javascript; 52 | sub_filter '_BACKEND_' $backend; 53 | sub_filter_once off; 54 | 55 | location / { 56 | } 57 | 58 | error_page 404 /404.html; 59 | location = /40x.html { 60 | } 61 | 62 | error_page 500 502 503 504 /50x.html; 63 | location = /50x.html { 64 | } 65 | # Comment the following lines to disable SSL support 66 | error_page 497 https://$host:8443$request_uri; 67 | return 301 https://$host:8443$request_uri; 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/parse-options.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | 'use strict'; 9 | angular.module('mgcrea.ngStrap.helpers.parseOptions', []).provider('$parseOptions', function () { 10 | var defaults = this.defaults = { regexp: /^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+group\s+by\s+(.*))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+(.*?)(?:\s+track\s+by\s+(.*?))?$/ }; 11 | this.$get = [ 12 | '$parse', 13 | '$q', 14 | function ($parse, $q) { 15 | function ParseOptionsFactory(attr, config) { 16 | var $parseOptions = {}; 17 | // Common vars 18 | var options = angular.extend({}, defaults, config); 19 | $parseOptions.$values = []; 20 | // Private vars 21 | var match, displayFn, valueName, keyName, groupByFn, valueFn, valuesFn; 22 | $parseOptions.init = function () { 23 | $parseOptions.$match = match = attr.match(options.regexp); 24 | displayFn = $parse(match[2] || match[1]), valueName = match[4] || match[6], keyName = match[5], groupByFn = $parse(match[3] || ''), valueFn = $parse(match[2] ? match[1] : valueName), valuesFn = $parse(match[7]); 25 | }; 26 | $parseOptions.valuesFn = function (scope, controller) { 27 | return $q.when(valuesFn(scope, controller)).then(function (values) { 28 | $parseOptions.$values = values ? parseValues(values, scope) : {}; 29 | return $parseOptions.$values; 30 | }); 31 | }; 32 | // Private functions 33 | function parseValues(values, scope) { 34 | return values.map(function (match, index) { 35 | var locals = {}, label, value; 36 | locals[valueName] = match; 37 | label = displayFn(scope, locals); 38 | value = valueFn(scope, locals) || index; 39 | return { 40 | label: label, 41 | value: value 42 | }; 43 | }); 44 | } 45 | $parseOptions.init(); 46 | return $parseOptions; 47 | } 48 | return ParseOptionsFactory; 49 | } 50 | ]; 51 | }); -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/button.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | "use strict";angular.module("mgcrea.ngStrap.button",[]).provider("$button",function(){var e=this.defaults={activeClass:"active",toggleEvent:"click"};this.$get=function(){return{defaults:e}}}).directive("bsCheckboxGroup",function(){return{restrict:"A",require:"ngModel",compile:function(e,t){e.attr("data-toggle","buttons"),e.removeAttr("ng-model");var a=e[0].querySelectorAll('input[type="checkbox"]');angular.forEach(a,function(e){var a=angular.element(e);a.attr("bs-checkbox",""),a.attr("ng-model",t.ngModel+"."+a.attr("value"))})}}}).directive("bsCheckbox",["$button","$$rAF",function(e,t){var a=e.defaults,n=/^(true|false|\d+)$/;return{restrict:"A",require:"ngModel",link:function(e,r,l,u){var o=a,i="INPUT"===r[0].nodeName,c=i?r.parent():r,s=angular.isDefined(l.trueValue)?l.trueValue:!0;n.test(l.trueValue)&&(s=e.$eval(l.trueValue));var d=angular.isDefined(l.falseValue)?l.falseValue:!1;n.test(l.falseValue)&&(d=e.$eval(l.falseValue));var f="boolean"!=typeof s||"boolean"!=typeof d;f&&(u.$parsers.push(function(e){return e?s:d}),e.$watch(l.ngModel,function(){u.$render()})),u.$render=function(){var e=angular.equals(u.$modelValue,s);t(function(){i&&(r[0].checked=e),c.toggleClass(o.activeClass,e)})},r.bind(o.toggleEvent,function(){e.$apply(function(){i||u.$setViewValue(!c.hasClass("active")),f||u.$render()})})}}}]).directive("bsRadioGroup",function(){return{restrict:"A",require:"ngModel",compile:function(e,t){e.attr("data-toggle","buttons"),e.removeAttr("ng-model");var a=e[0].querySelectorAll('input[type="radio"]');angular.forEach(a,function(e){angular.element(e).attr("bs-radio",""),angular.element(e).attr("ng-model",t.ngModel)})}}}).directive("bsRadio",["$button","$$rAF",function(e,t){var a=e.defaults,n=/^(true|false|\d+)$/;return{restrict:"A",require:"ngModel",link:function(e,r,l,u){var o=a,i="INPUT"===r[0].nodeName,c=i?r.parent():r,s=n.test(l.value)?e.$eval(l.value):l.value;u.$render=function(){var e=angular.equals(u.$modelValue,s);t(function(){i&&(r[0].checked=e),c.toggleClass(o.activeClass,e)})},r.bind(o.toggleEvent,function(){e.$apply(function(){u.$setViewValue(s),u.$render()})})}}}]); -------------------------------------------------------------------------------- /helm/charts/influxdb/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | InfluxDB can be accessed via port {{ .Values.config.http.bind_address | default 8086 }} on the following DNS name from within your cluster: 2 | 3 | http://{{ include "influxdb.fullname" . }}.{{ .Release.Namespace }}:{{ .Values.config.http.bind_address | default 8086 }} 4 | 5 | You can connect to the remote instance with the influx CLI. To forward the API port to localhost:8086, run the following: 6 | 7 | kubectl port-forward --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ include "influxdb.fullname" . }} -o jsonpath='{ .items[0].metadata.name }') 8086:{{ .Values.config.http.bind_address | default 8086 }} 8 | 9 | You can also connect to the influx CLI from inside the container. To open a shell session in the InfluxDB pod, run the following: 10 | 11 | kubectl exec -i -t --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ include "influxdb.fullname" . }} -o jsonpath='{.items[0].metadata.name}') /bin/sh 12 | 13 | To view the logs for the InfluxDB pod, run the following: 14 | 15 | kubectl logs -f --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app={{ include "influxdb.fullname" . }} -o jsonpath='{ .items[0].metadata.name }') 16 | 17 | {{- if .Values.setDefaultUser.enabled }} 18 | 19 | To retrieve the default user name: 20 | 21 | {{- if .Values.setDefaultUser.user.existingSecret }} 22 | 23 | echo $(kubectl get secret {{ .Values.setDefaultUser.user.existingSecret }} -o "jsonpath={.data['influxdb-user']}" --namespace {{ .Release.Namespace }} | base64 --decode) 24 | 25 | {{- else }} 26 | 27 | echo $(kubectl get secret {{ include "influxdb.fullname" . }}-auth -o "jsonpath={.data['influxdb-user']}" --namespace {{ .Release.Namespace }} | base64 --decode) 28 | 29 | {{- end }} 30 | 31 | To retrieve the default user password: 32 | 33 | {{- if .Values.setDefaultUser.user.existingSecret }} 34 | 35 | echo $(kubectl get secret {{ .Values.setDefaultUser.user.existingSecret }} -o "jsonpath={.data['influxdb-password']}" --namespace {{ .Release.Namespace }} | base64 --decode) 36 | 37 | {{- else }} 38 | 39 | echo $(kubectl get secret {{ include "influxdb.fullname" . }}-auth -o "jsonpath={.data['influxdb-password']}" --namespace {{ .Release.Namespace }} | base64 --decode) 40 | 41 | {{- end }} 42 | {{- end }} 43 | -------------------------------------------------------------------------------- /exoplanets/README.md: -------------------------------------------------------------------------------- 1 | A simple example application for use with PostgreSQL. 2 | 3 | 4 | ## Similarities to the Books Application 5 | 6 | This application is similar to the "books" application in the same repository, and 7 | there is currently some code duplication between the two. We considered combining 8 | the applications into a single codebase, but the forking logic to juggle different 9 | datasets and templates proved more complex than the value. 10 | 11 | The exoplanets application does not include the "memory leak" feature that is 12 | available in the books application. 13 | 14 | 15 | ## Table Drop Warning 16 | 17 | The app drops and creates a new "exoplanets" table on start up. This is not 18 | ideal in a deployment or any real scenario, but makes everything easy from an 19 | instructional point of view. A better approach would be to create a job that populates 20 | the initial data. 21 | 22 | 23 | ## Environment Variables 24 | 25 | We use the following ENVs to connect to the database: 26 | 27 | * `DB_HOST` 28 | * `DB_PORT` 29 | * `DB_USER` 30 | * `DB_PASSWORD` 31 | * `DB_NAME` 32 | 33 | If the variables are not present, the application will run but not attempt to connect 34 | to the database. 35 | 36 | 37 | ## Fetching Exoplanets 38 | 39 | The exoplanet data comes from the [Open Exoplanet Catalogue](https://github.com/openexoplanetcatalogue/open_exoplanet_catalogue/). 40 | We've included a script in this repository that pulls data from the catalog and 41 | then outputs a small subset of the planets as a Go struct. This approach makes it 42 | easy to refresh the data: `python3 fetch_planets.py > seed.go` 43 | 44 | 45 | ## Building 46 | 47 | A Makefile exists to avoid the burden of remembering things. 48 | 49 | * `make build`: Builds a container 50 | * `make`: Gofmt, build, and run (locally). 51 | 52 | 53 | ## Pushing 54 | 55 | First log podman in to quay.io/redhattraining and verify the `version` and `repo` variables in the Makefile. 56 | 57 | Once that's all good: `make tag push`. 58 | 59 | 60 | ## Local Development 61 | 62 | There are a few helper tasks in the Makefile that might be of use: 63 | 64 | * `make pg-up`: Starts a PostgreSQL container. 65 | * `make pg-down`: Completely stops (rm -f) PostgreSQL. 66 | * `make run`: Runs the app (you'll need to build it first) with DB_HOST to the ip 67 | of the postgres container. 68 | * `make`: Gofmt, build, and run (locally). 69 | -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/timepicker.tpl.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | "use strict";angular.module("mgcrea.ngStrap.timepicker").run(["$templateCache",function(t){t.put("timepicker/timepicker.tpl.html",'')}]); -------------------------------------------------------------------------------- /exoplanets/exoplanets.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "database/sql" 5 | "log" 6 | 7 | _ "github.com/lib/pq" 8 | ) 9 | 10 | // Exoplanet is a simple record 11 | type Exoplanet struct { 12 | Name string 13 | Mass, Period, Radius float64 14 | } 15 | 16 | // Exoplanets handles database interactions for lists of exoplanets 17 | type Exoplanets struct { 18 | DB *sql.DB 19 | List []Exoplanet 20 | } 21 | 22 | // fetch retrieves a fresh list from the database 23 | func (b *Exoplanets) fetch() { 24 | if b.DB == nil { 25 | log.Println("Not connected to database") 26 | return 27 | } 28 | 29 | log.Printf("Fetching exoplanets") 30 | 31 | rows, err := b.DB.Query(`SELECT name, mass, period, radius FROM exoplanet ORDER BY name ASC`) 32 | if err != nil { 33 | log.Printf("Unable to select exoplanet table:", err) 34 | return 35 | } 36 | defer rows.Close() 37 | 38 | // clear the List and rebuild it from the returned rows 39 | b.List = []Exoplanet{} 40 | var ( 41 | name string 42 | mass, period, radius float64 43 | ) 44 | 45 | for rows.Next() { 46 | err = rows.Scan(&name, &mass, &period, &radius) 47 | if err != nil { 48 | log.Printf("Error: %v", err.Error()) 49 | } 50 | b.List = append(b.List, Exoplanet{Name: name, Mass: mass, Period: period, Radius: radius}) 51 | } 52 | } 53 | 54 | // populate creates and populates an exoplanet table from the seed 55 | func (b *Exoplanets) populate() { 56 | if b.DB == nil { 57 | log.Println("Not connected to database") 58 | return 59 | } 60 | 61 | log.Printf("Recreating exoplanets table") 62 | 63 | // drop the table (in case it already exists) 64 | _, err := b.DB.Query(`DROP TABLE exoplanet`) 65 | if err != nil { 66 | log.Println("Unable to drop exoplanet table (may not exist)") 67 | } 68 | 69 | // create the exoplanet table 70 | _, err = b.DB.Query(`CREATE TABLE exoplanet 71 | (id serial primary key, 72 | name varchar(255), 73 | mass double precision, 74 | period double precision, 75 | radius double precision)`) 76 | if err != nil { 77 | log.Fatalf("Unable to create exoplanet table:", err) 78 | } 79 | 80 | // populate the table from the seed exoplanet list 81 | log.Printf("Populating exoplanet table") 82 | 83 | for _, p := range seed { 84 | _, err = b.DB.Query(`INSERT INTO exoplanet (name, mass, period, radius) VALUES ($1,$2,$3, $4)`, p.Name, p.Mass, p.Period, p.Radius) 85 | if err != nil { 86 | log.Fatalf("Unable to populate exoplanet table:", err) 87 | } 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/timepicker.tpl.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | 'use strict'; 9 | angular.module('mgcrea.ngStrap.timepicker').run([ 10 | '$templateCache', 11 | function ($templateCache) { 12 | $templateCache.put('timepicker/timepicker.tpl.html', ''); 13 | } 14 | ]); -------------------------------------------------------------------------------- /helm/charts/etherpad-0.0.6/templates/deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: {{ include "etherpad.fullname" . }} 5 | labels: 6 | {{- include "etherpad.labels" . | nindent 4 }} 7 | spec: 8 | replicas: {{ .Values.replicaCount }} 9 | selector: 10 | matchLabels: 11 | {{- include "etherpad.selectorLabels" . | nindent 6 }} 12 | template: 13 | metadata: 14 | labels: 15 | {{- include "etherpad.selectorLabels" . | nindent 8 }} 16 | spec: 17 | {{- with .Values.imagePullSecrets }} 18 | imagePullSecrets: 19 | {{- toYaml . | nindent 8 }} 20 | {{- end }} 21 | securityContext: 22 | {{- toYaml .Values.podSecurityContext | nindent 8 }} 23 | containers: 24 | - env: 25 | - name: TITLE 26 | value: {{ .Values.defaultTitle }} 27 | - name: DEFAULT_PAD_TEXT 28 | value: {{ .Values.defaultText }} 29 | name: {{ .Chart.Name }} 30 | securityContext: 31 | {{- toYaml .Values.securityContext | nindent 12 }} 32 | image: "{{ .Values.image.repository }}/{{ default .Chart.Name .Values.image.name }}:{{ default .Chart.AppVersion .Values.image.tag }}" 33 | imagePullPolicy: {{ .Values.image.pullPolicy }} 34 | ports: 35 | - name: http 36 | containerPort: 9001 37 | protocol: TCP 38 | livenessProbe: 39 | httpGet: 40 | path: / 41 | port: http 42 | readinessProbe: 43 | httpGet: 44 | path: / 45 | port: http 46 | resources: 47 | {{- toYaml .Values.resources | nindent 12 }} 48 | volumeMounts: 49 | - name: etherpad-data 50 | mountPath: {{ .Values.persistence.mountPath }} 51 | {{- with .Values.nodeSelector }} 52 | nodeSelector: 53 | {{- toYaml . | nindent 8 }} 54 | {{- end }} 55 | {{- with .Values.affinity }} 56 | affinity: 57 | {{- toYaml . | nindent 8 }} 58 | {{- end }} 59 | {{- with .Values.tolerations }} 60 | tolerations: 61 | {{- toYaml . | nindent 8 }} 62 | {{- end }} 63 | volumes: 64 | - name: etherpad-data 65 | {{- if .Values.persistence.enabled }} 66 | persistentVolumeClaim: 67 | claimName: {{ .Values.persistence.existingClaim | default (printf "%s" (include "etherpad.fullname" .)) }} 68 | {{- else }} 69 | emptyDir: {} 70 | {{- end }} 71 | -------------------------------------------------------------------------------- /helm/charts/etherpad-0.0.7/templates/deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: {{ include "etherpad.fullname" . }} 5 | labels: 6 | {{- include "etherpad.labels" . | nindent 4 }} 7 | spec: 8 | replicas: {{ .Values.replicaCount }} 9 | selector: 10 | matchLabels: 11 | {{- include "etherpad.selectorLabels" . | nindent 6 }} 12 | template: 13 | metadata: 14 | labels: 15 | {{- include "etherpad.selectorLabels" . | nindent 8 }} 16 | spec: 17 | {{- with .Values.imagePullSecrets }} 18 | imagePullSecrets: 19 | {{- toYaml . | nindent 8 }} 20 | {{- end }} 21 | securityContext: 22 | {{- toYaml .Values.podSecurityContext | nindent 8 }} 23 | containers: 24 | - env: 25 | - name: TITLE 26 | value: {{ .Values.defaultTitle }} 27 | - name: DEFAULT_PAD_TEXT 28 | value: {{ .Values.defaultText }} 29 | name: {{ .Chart.Name }} 30 | securityContext: 31 | {{- toYaml .Values.securityContext | nindent 12 }} 32 | image: "{{ .Values.image.repository }}/{{ default .Chart.Name .Values.image.name }}:{{ default .Chart.AppVersion .Values.image.tag }}" 33 | imagePullPolicy: {{ .Values.image.pullPolicy }} 34 | ports: 35 | - name: http 36 | containerPort: 9001 37 | protocol: TCP 38 | livenessProbe: 39 | httpGet: 40 | path: / 41 | port: http 42 | readinessProbe: 43 | httpGet: 44 | path: / 45 | port: http 46 | resources: 47 | {{- toYaml .Values.resources | nindent 12 }} 48 | volumeMounts: 49 | - name: etherpad-data 50 | mountPath: {{ .Values.persistence.mountPath }} 51 | {{- with .Values.nodeSelector }} 52 | nodeSelector: 53 | {{- toYaml . | nindent 8 }} 54 | {{- end }} 55 | {{- with .Values.affinity }} 56 | affinity: 57 | {{- toYaml . | nindent 8 }} 58 | {{- end }} 59 | {{- with .Values.tolerations }} 60 | tolerations: 61 | {{- toYaml . | nindent 8 }} 62 | {{- end }} 63 | volumes: 64 | - name: etherpad-data 65 | {{- if .Values.persistence.enabled }} 66 | persistentVolumeClaim: 67 | claimName: {{ .Values.persistence.existingClaim | default (printf "%s" (include "etherpad.fullname" .)) }} 68 | {{- else }} 69 | emptyDir: {} 70 | {{- end }} 71 | -------------------------------------------------------------------------------- /php-ssl/index.php: -------------------------------------------------------------------------------- 1 | = 1 && 3 <= $interval ? $interval : 1; 5 | $load = $rs[$interval]; 6 | return round(($load * 100) / $coreCount,2); 7 | } 8 | 9 | function get_connections() { 10 | if (function_exists('exec')) { 11 | $www_total_count = 0; 12 | @exec ('netstat -an | egrep \':80|:443\' | awk \'{print $5}\' | grep -v \':::\*\' | grep -v \'0.0.0.0\'', $results); 13 | 14 | foreach ($results as $result) { 15 | $array = explode(':', $result); 16 | $www_total_count ++; 17 | if (preg_match('/^::/', $result)) { 18 | $ipaddr = $array[3]; 19 | } else { 20 | $ipaddr = $array[0]; 21 | } 22 | if (!in_array($ipaddr, $unique)) { 23 | $unique[] = $ipaddr; 24 | $www_unique_count ++; 25 | } 26 | } 27 | unset ($results); 28 | 29 | return count($unique); 30 | } 31 | } 32 | 33 | function get_memory_usage() { 34 | $free = shell_exec('free'); 35 | $free = (string)trim($free); 36 | $free_arr = explode("\n", $free); 37 | $mem = explode(" ", $free_arr[1]); 38 | $mem = array_filter($mem); 39 | $mem = array_merge($mem); 40 | $memory_usage = $mem[2] / $mem[1] * 100; 41 | 42 | return $memory_usage; 43 | } 44 | ?> 45 | 46 | 47 | 48 | 49 | 50 | PHP Application 51 | 52 | 53 |

    About this application

    54 | 56 | 57 | 58 | 59 | 61 | 62 | 63 | 64 | 65 |
      66 |
    • 67 | Current system load: 68 |
    • 69 |
    • 70 | Number of connections: 71 |
    • 72 |
    • 73 | Memory usage: 74 |
    • 75 |
    76 | 77 | -------------------------------------------------------------------------------- /todo-angular/src/assets/partials/edit.html: -------------------------------------------------------------------------------- 1 | 5 | 6 |
    7 |
    8 |
    9 |
    10 | 11 |
    12 |

    {{todoItem.description}}

    13 |
    14 |
    15 |
    16 | 17 | 22 |
    23 | 29 |
    30 |
    31 | 37 |
    38 | 39 | 42 |
    43 |
    44 | 45 | 48 |
    49 |
    50 |
    51 |
    -------------------------------------------------------------------------------- /todo-angular/src/assets/partials/create.html: -------------------------------------------------------------------------------- 1 | 4 | 5 |
    6 | 7 |
    8 |
    9 |
    10 |
    11 | 12 |
    13 | 14 |
    15 |
    16 |
    17 | 18 |
    19 | 20 |
    21 |
    22 |
    23 | 24 |
    25 | 26 |
    27 |
    28 |
    29 |
    30 |
    31 | 32 |
    33 | 34 |
    35 |
    36 |
    37 | 38 |
    39 | 40 |
    41 |
    42 |
    43 | 44 |
    45 | 48 |
    49 |
    50 |
    51 |
    52 |
    53 |
    54 | 55 |
    56 |
    57 |
    -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/date-parser.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | "use strict";angular.module("mgcrea.ngStrap.helpers.dateParser",[]).provider("$dateParser",["$localeProvider",function(){var t=Date.prototype,e=this.defaults={format:"shortDate",strict:!1};this.$get=["$locale",function(r){var s=function(s){function n(t){var e,r=Object.keys(f),s=[],n=[],i=t;for(e=0;e1){var a=i.search(r[e]);t=t.split(r[e]).join(""),f[r[e]]&&(s[a]=f[r[e]])}return angular.forEach(s,function(t){n.push(t)}),n}function i(t){return t.replace(/\//g,"[\\/]").replace("/-/g","[-]").replace(/\./g,"[.]").replace(/\\s/g,"[\\s]")}function a(t){var e,r=Object.keys(l),s=t;for(e=0;e=n?"top":null!==t&&n+t<=e.top?"middle":null!==$&&e.top+o+h>=f-$?"bottom":"middle"}function a(){return d[0]===e?e.pageYOffset:d[0]===e}function l(){return d[0]===e?e.document.body.scrollHeight:d[0].scrollHeight}var u={},p=angular.extend({},t,r),d=p.target,m="affix affix-top affix-bottom",h=0,g=0,P=0,$=0,v=null,T=null,x=f.parent();if(p.offsetParent)if(p.offsetParent.match(/^\d+$/))for(var b=0;b<1*p.offsetParent-1;b++)x=x.parent();else x=angular.element(p.offsetParent);return u.init=function(){u.$parseOffsets(),g=n.offset(f[0]).top+h,d.on("scroll",u.checkPosition),d.on("click",u.checkPositionWithEventLoop),i.on("resize",u.$debouncedOnResize),u.checkPosition(),u.checkPositionWithEventLoop()},u.destroy=function(){d.off("scroll",u.checkPosition),d.off("click",u.checkPositionWithEventLoop),i.off("resize",u.$debouncedOnResize)},u.checkPositionWithEventLoop=function(){setTimeout(u.checkPosition,1)},u.checkPosition=function(){var t=a(),e=n.offset(f[0]),o=n.height(f[0]),i=c(T,e,o);v!==i&&(v=i,f.removeClass(m).addClass("affix"+("middle"!==i?"-"+i:"")),"top"===i?(T=null,f.css("position",p.offsetParent?"":"relative"),f.css("top","")):"bottom"===i?(T=p.offsetUnpin?-(1*p.offsetUnpin):e.top-t,f.css("position",p.offsetParent?"":"relative"),f.css("top",p.offsetParent?"":s[0].offsetHeight-$-o-g+"px")):(T=null,f.css("position","fixed"),f.css("top",h+"px")))},u.$onResize=function(){u.$parseOffsets(),u.checkPosition()},u.$debouncedOnResize=o(u.$onResize,50),u.$parseOffsets=function(){f.css("position",p.offsetParent?"":"relative"),p.offsetTop&&("auto"===p.offsetTop&&(p.offsetTop="+0"),p.offsetTop.match(/^[-+]\d+$/)?(h=1*-p.offsetTop,P=p.offsetParent?n.offset(x[0]).top+1*p.offsetTop:n.offset(f[0]).top-n.css(f[0],"marginTop",!0)+1*p.offsetTop):P=1*p.offsetTop),p.offsetBottom&&($=p.offsetParent&&p.offsetBottom.match(/^[-+]\d+$/)?l()-(n.offset(x[0]).top+n.height(x[0]))+1*p.offsetBottom+1:1*p.offsetBottom)},u.init(),u}var s=angular.element(e.document.body),i=angular.element(e);return f}]}).directive("bsAffix",["$affix","$window",function(t,e){return{restrict:"EAC",require:"^?bsAffixTarget",link:function(o,n,f,s){var i={scope:o,offsetTop:"auto",target:s?s.$element:angular.element(e)};angular.forEach(["offsetTop","offsetBottom","offsetParent","offsetUnpin"],function(t){angular.isDefined(f[t])&&(i[t]=f[t])});var r=t(n,i);o.$on("$destroy",function(){i=null,r=null})}}}]).directive("bsAffixTarget",function(){return{controller:["$element",function(t){this.$element=t}]}}); -------------------------------------------------------------------------------- /todo-angular/src/assets/js/libs/angular-strap/modules/aside.js: -------------------------------------------------------------------------------- 1 | /** 2 | * angular-strap 3 | * @version v2.0.3 - 2014-05-30 4 | * @link http://mgcrea.github.io/angular-strap 5 | * @author Olivier Louvignes (olivier@mg-crea.com) 6 | * @license MIT License, http://www.opensource.org/licenses/MIT 7 | */ 8 | 'use strict'; 9 | angular.module('mgcrea.ngStrap.aside', ['mgcrea.ngStrap.modal']).provider('$aside', function () { 10 | var defaults = this.defaults = { 11 | animation: 'am-fade-and-slide-right', 12 | prefixClass: 'aside', 13 | placement: 'right', 14 | template: 'aside/aside.tpl.html', 15 | contentTemplate: false, 16 | container: false, 17 | element: null, 18 | backdrop: true, 19 | keyboard: true, 20 | html: false, 21 | show: true 22 | }; 23 | this.$get = [ 24 | '$modal', 25 | function ($modal) { 26 | function AsideFactory(config) { 27 | var $aside = {}; 28 | // Common vars 29 | var options = angular.extend({}, defaults, config); 30 | $aside = $modal(options); 31 | return $aside; 32 | } 33 | return AsideFactory; 34 | } 35 | ]; 36 | }).directive('bsAside', [ 37 | '$window', 38 | '$sce', 39 | '$aside', 40 | function ($window, $sce, $aside) { 41 | var requestAnimationFrame = $window.requestAnimationFrame || $window.setTimeout; 42 | return { 43 | restrict: 'EAC', 44 | scope: true, 45 | link: function postLink(scope, element, attr, transclusion) { 46 | // Directive options 47 | var options = { 48 | scope: scope, 49 | element: element, 50 | show: false 51 | }; 52 | angular.forEach([ 53 | 'template', 54 | 'contentTemplate', 55 | 'placement', 56 | 'backdrop', 57 | 'keyboard', 58 | 'html', 59 | 'container', 60 | 'animation' 61 | ], function (key) { 62 | if (angular.isDefined(attr[key])) 63 | options[key] = attr[key]; 64 | }); 65 | // Support scope as data-attrs 66 | angular.forEach([ 67 | 'title', 68 | 'content' 69 | ], function (key) { 70 | attr[key] && attr.$observe(key, function (newValue, oldValue) { 71 | scope[key] = $sce.trustAsHtml(newValue); 72 | }); 73 | }); 74 | // Support scope as an object 75 | attr.bsAside && scope.$watch(attr.bsAside, function (newValue, oldValue) { 76 | if (angular.isObject(newValue)) { 77 | angular.extend(scope, newValue); 78 | } else { 79 | scope.content = newValue; 80 | } 81 | }, true); 82 | // Initialize aside 83 | var aside = $aside(options); 84 | // Trigger 85 | element.on(attr.trigger || 'click', aside.toggle); 86 | // Garbage collection 87 | scope.$on('$destroy', function () { 88 | aside.destroy(); 89 | options = null; 90 | aside = null; 91 | }); 92 | } 93 | }; 94 | } 95 | ]); --------------------------------------------------------------------------------