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 |
Mass
58 |
Radius
59 |
Period
60 |
61 |
62 |
63 |
64 |
{{.Mass}}
65 |
{{.Radius}}
66 |
{{.Period}}
67 |
68 |
69 |
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', '