├── provision ├── balancer.sh ├── database.sh ├── docker.sh ├── provision.sh ├── gitea.sh ├── automation.sh └── jenkins.sh ├── .gitignore ├── exercicios ├── 02-vagrant │ ├── resposta │ │ ├── .gitignore │ │ ├── Vagrantfile │ │ └── README.md │ └── README.md ├── 09-jenkins │ └── README.md ├── 07-docker │ ├── respostas │ │ ├── Dockerfile-flask │ │ ├── Dockerfile-dancer │ │ ├── validador-01.sh │ │ └── README.md │ └── README.md ├── 03-git │ ├── resposta │ │ └── README.md │ └── README.md ├── 05-ssh │ ├── README.md │ └── resposta │ │ └── README.md ├── 06-rundeck │ ├── README.md │ └── resposta │ │ └── README.md ├── 04-gitea │ ├── README.md │ └── resposta │ │ └── README.md └── 08-ansible │ └── README.md ├── files ├── role-lighttpd │ ├── lighttpd │ │ ├── tests │ │ │ ├── inventory │ │ │ └── test.yml │ │ ├── vars │ │ │ ├── main.yml │ │ │ ├── centos.yml │ │ │ └── debian.yml │ │ ├── defaults │ │ │ └── main.yml │ │ ├── handlers │ │ │ └── main.yml │ │ ├── tasks │ │ │ ├── debian.yml │ │ │ ├── centos.yml │ │ │ └── main.yml │ │ ├── .travis.yml │ │ ├── templates │ │ │ └── lighttpd.conf │ │ ├── README.md │ │ └── meta │ │ │ └── main.yml │ ├── infra.yml │ ├── ansible.cfg │ └── inventory │ │ └── hosts ├── php │ ├── images │ │ ├── bg-01.jpg │ │ └── icons │ │ │ └── favicon.ico │ ├── fonts │ │ ├── poppins │ │ │ ├── Poppins-Black.ttf │ │ │ ├── Poppins-Bold.ttf │ │ │ ├── Poppins-Light.ttf │ │ │ ├── Poppins-Thin.ttf │ │ │ ├── Poppins-Italic.ttf │ │ │ ├── Poppins-Medium.ttf │ │ │ ├── Poppins-Regular.ttf │ │ │ ├── Poppins-BoldItalic.ttf │ │ │ ├── Poppins-ExtraBold.ttf │ │ │ ├── Poppins-ExtraLight.ttf │ │ │ ├── Poppins-SemiBold.ttf │ │ │ ├── Poppins-ThinItalic.ttf │ │ │ ├── Poppins-BlackItalic.ttf │ │ │ ├── Poppins-LightItalic.ttf │ │ │ ├── Poppins-MediumItalic.ttf │ │ │ ├── Poppins-ExtraBoldItalic.ttf │ │ │ ├── Poppins-SemiBoldItalic.ttf │ │ │ └── Poppins-ExtraLightItalic.ttf │ │ ├── font-awesome-4.7.0 │ │ │ ├── fonts │ │ │ │ ├── FontAwesome.otf │ │ │ │ ├── fontawesome-webfont.eot │ │ │ │ ├── fontawesome-webfont.ttf │ │ │ │ ├── fontawesome-webfont.woff │ │ │ │ └── fontawesome-webfont.woff2 │ │ │ ├── less │ │ │ │ ├── screen-reader.less │ │ │ │ ├── fixed-width.less │ │ │ │ ├── larger.less │ │ │ │ ├── list.less │ │ │ │ ├── core.less │ │ │ │ ├── stacked.less │ │ │ │ ├── font-awesome.less │ │ │ │ ├── bordered-pulled.less │ │ │ │ ├── rotated-flipped.less │ │ │ │ ├── path.less │ │ │ │ ├── animated.less │ │ │ │ └── mixins.less │ │ │ ├── scss │ │ │ │ ├── _fixed-width.scss │ │ │ │ ├── _screen-reader.scss │ │ │ │ ├── _larger.scss │ │ │ │ ├── _list.scss │ │ │ │ ├── _core.scss │ │ │ │ ├── font-awesome.scss │ │ │ │ ├── _stacked.scss │ │ │ │ ├── _bordered-pulled.scss │ │ │ │ ├── _rotated-flipped.scss │ │ │ │ ├── _path.scss │ │ │ │ ├── _animated.scss │ │ │ │ └── _mixins.scss │ │ │ └── HELP-US-OUT.txt │ │ └── iconic │ │ │ └── fonts │ │ │ ├── Material-Design-Iconic-Font.eot │ │ │ ├── Material-Design-Iconic-Font.ttf │ │ │ ├── Material-Design-Iconic-Font.woff │ │ │ └── Material-Design-Iconic-Font.woff2 │ ├── logout.php │ ├── db │ │ └── dump.sql │ ├── vendor │ │ ├── countdowntime │ │ │ └── countdowntime.js │ │ ├── perfect-scrollbar │ │ │ └── perfect-scrollbar.css │ │ ├── bootstrap │ │ │ └── css │ │ │ │ ├── bootstrap-reboot.min.css │ │ │ │ └── bootstrap-reboot.css │ │ └── animsition │ │ │ └── js │ │ │ └── animsition.min.js │ ├── README.md │ ├── js │ │ └── main.js │ ├── index.php │ └── login.php ├── ansible │ ├── ansible.cfg │ ├── playbooks │ │ ├── files │ │ │ ├── lighttpd-block.conf │ │ │ ├── haproxy.cfg │ │ │ ├── dump.sql │ │ │ └── lighttpd.conf │ │ ├── haproxy.yml │ │ ├── templates │ │ │ └── lighttpd.conf │ │ ├── database-cache.yml │ │ ├── lighttpd.yml │ │ └── docker.yml │ └── inventory │ │ └── hosts ├── jenkins │ ├── 4542-php │ │ ├── images │ │ │ ├── bg-01.jpg │ │ │ └── icons │ │ │ │ └── favicon.ico │ │ ├── fonts │ │ │ ├── poppins │ │ │ │ ├── Poppins-Bold.ttf │ │ │ │ ├── Poppins-Thin.ttf │ │ │ │ ├── Poppins-Black.ttf │ │ │ │ ├── Poppins-Italic.ttf │ │ │ │ ├── Poppins-Light.ttf │ │ │ │ ├── Poppins-Medium.ttf │ │ │ │ ├── Poppins-Regular.ttf │ │ │ │ ├── Poppins-ExtraBold.ttf │ │ │ │ ├── Poppins-SemiBold.ttf │ │ │ │ ├── Poppins-BlackItalic.ttf │ │ │ │ ├── Poppins-BoldItalic.ttf │ │ │ │ ├── Poppins-ExtraLight.ttf │ │ │ │ ├── Poppins-LightItalic.ttf │ │ │ │ ├── Poppins-MediumItalic.ttf │ │ │ │ ├── Poppins-ThinItalic.ttf │ │ │ │ ├── Poppins-SemiBoldItalic.ttf │ │ │ │ ├── Poppins-ExtraBoldItalic.ttf │ │ │ │ └── Poppins-ExtraLightItalic.ttf │ │ │ ├── font-awesome-4.7.0 │ │ │ │ ├── fonts │ │ │ │ │ ├── FontAwesome.otf │ │ │ │ │ ├── fontawesome-webfont.eot │ │ │ │ │ ├── fontawesome-webfont.ttf │ │ │ │ │ ├── fontawesome-webfont.woff │ │ │ │ │ └── fontawesome-webfont.woff2 │ │ │ │ ├── less │ │ │ │ │ ├── fixed-width.less │ │ │ │ │ ├── screen-reader.less │ │ │ │ │ ├── larger.less │ │ │ │ │ ├── list.less │ │ │ │ │ ├── core.less │ │ │ │ │ ├── stacked.less │ │ │ │ │ ├── font-awesome.less │ │ │ │ │ ├── bordered-pulled.less │ │ │ │ │ ├── rotated-flipped.less │ │ │ │ │ ├── path.less │ │ │ │ │ ├── animated.less │ │ │ │ │ └── mixins.less │ │ │ │ ├── scss │ │ │ │ │ ├── _fixed-width.scss │ │ │ │ │ ├── _screen-reader.scss │ │ │ │ │ ├── _larger.scss │ │ │ │ │ ├── _list.scss │ │ │ │ │ ├── _core.scss │ │ │ │ │ ├── font-awesome.scss │ │ │ │ │ ├── _stacked.scss │ │ │ │ │ ├── _bordered-pulled.scss │ │ │ │ │ ├── _rotated-flipped.scss │ │ │ │ │ ├── _path.scss │ │ │ │ │ ├── _animated.scss │ │ │ │ │ └── _mixins.scss │ │ │ │ └── HELP-US-OUT.txt │ │ │ └── iconic │ │ │ │ └── fonts │ │ │ │ ├── Material-Design-Iconic-Font.eot │ │ │ │ ├── Material-Design-Iconic-Font.ttf │ │ │ │ ├── Material-Design-Iconic-Font.woff │ │ │ │ └── Material-Design-Iconic-Font.woff2 │ │ ├── logout.php │ │ ├── docker │ │ │ ├── Dockerfile │ │ │ ├── docker-compose.yml │ │ │ └── docker-compose-ha.yml │ │ ├── db │ │ │ └── dump.sql │ │ ├── vendor │ │ │ ├── countdowntime │ │ │ │ └── countdowntime.js │ │ │ ├── perfect-scrollbar │ │ │ │ └── perfect-scrollbar.css │ │ │ ├── bootstrap │ │ │ │ └── css │ │ │ │ │ ├── bootstrap-reboot.min.css │ │ │ │ │ └── bootstrap-reboot.css │ │ │ └── animsition │ │ │ │ └── js │ │ │ │ └── animsition.min.js │ │ ├── config │ │ │ └── php.ini │ │ ├── js │ │ │ └── main.js │ │ ├── index.php │ │ ├── jenkins │ │ │ └── Jenkinsfile.groovy │ │ ├── login.php │ │ └── README.md │ └── README.md ├── daemon.json ├── adiciona-user-rundeck-no-sudo ├── adiciona-usuario-rundeck ├── copia-chave-publica-rundeck ├── id_rsa.pub ├── playbooks │ ├── haproxy.yml │ ├── lighttpd.yml │ └── database-cache.yml ├── rundeck │ ├── mysql.sh │ └── adicionar-usuario.sh ├── database.sh ├── docker.pl ├── healthz.pl ├── lighttpd │ └── lighttpd.conf ├── id_rsa ├── gitea.service └── app.ini ├── infra-agil.png ├── Vagrantfile └── README.md /provision/balancer.sh: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /provision/database.sh: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /provision/docker.sh: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | .vagrant 3 | -------------------------------------------------------------------------------- /exercicios/02-vagrant/resposta/.gitignore: -------------------------------------------------------------------------------- 1 | .vagrant 2 | -------------------------------------------------------------------------------- /files/role-lighttpd/lighttpd/tests/inventory: -------------------------------------------------------------------------------- 1 | localhost 2 | 3 | -------------------------------------------------------------------------------- /exercicios/09-jenkins/README.md: -------------------------------------------------------------------------------- 1 | # Jenkins 2 | 3 | Em transferência 4 | -------------------------------------------------------------------------------- /files/role-lighttpd/lighttpd/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # vars file for lighttpd -------------------------------------------------------------------------------- /infra-agil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/infra-agil.png -------------------------------------------------------------------------------- /files/role-lighttpd/lighttpd/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file for lighttpd -------------------------------------------------------------------------------- /files/role-lighttpd/lighttpd/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # handlers file for lighttpd -------------------------------------------------------------------------------- /files/role-lighttpd/lighttpd/tasks/debian.yml: -------------------------------------------------------------------------------- 1 | # Tarefas específicas do Debian 2 | --- 3 | -------------------------------------------------------------------------------- /files/php/images/bg-01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/php/images/bg-01.jpg -------------------------------------------------------------------------------- /files/role-lighttpd/infra.yml: -------------------------------------------------------------------------------- 1 | - hosts: docker 2 | become: yes 3 | roles: 4 | - lighttpd 5 | -------------------------------------------------------------------------------- /files/php/images/icons/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/php/images/icons/favicon.ico -------------------------------------------------------------------------------- /files/role-lighttpd/lighttpd/vars/centos.yml: -------------------------------------------------------------------------------- 1 | # Variáveis CentOS 2 | --- 3 | user: lighttpd 4 | group: lighttpd 5 | -------------------------------------------------------------------------------- /files/role-lighttpd/lighttpd/vars/debian.yml: -------------------------------------------------------------------------------- 1 | # Variáveis Debian 2 | --- 3 | user: www-data 4 | group: www-data 5 | -------------------------------------------------------------------------------- /files/ansible/ansible.cfg: -------------------------------------------------------------------------------- 1 | [defaults] 2 | inventory = ./inventory/ 3 | remote_user = ansible 4 | host_key_checking = false 5 | -------------------------------------------------------------------------------- /files/jenkins/4542-php/images/bg-01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/jenkins/4542-php/images/bg-01.jpg -------------------------------------------------------------------------------- /files/php/fonts/poppins/Poppins-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/php/fonts/poppins/Poppins-Black.ttf -------------------------------------------------------------------------------- /files/php/fonts/poppins/Poppins-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/php/fonts/poppins/Poppins-Bold.ttf -------------------------------------------------------------------------------- /files/php/fonts/poppins/Poppins-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/php/fonts/poppins/Poppins-Light.ttf -------------------------------------------------------------------------------- /files/php/fonts/poppins/Poppins-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/php/fonts/poppins/Poppins-Thin.ttf -------------------------------------------------------------------------------- /files/role-lighttpd/lighttpd/tests/test.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - hosts: localhost 3 | remote_user: root 4 | roles: 5 | - lighttpd -------------------------------------------------------------------------------- /files/php/fonts/poppins/Poppins-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/php/fonts/poppins/Poppins-Italic.ttf -------------------------------------------------------------------------------- /files/php/fonts/poppins/Poppins-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/php/fonts/poppins/Poppins-Medium.ttf -------------------------------------------------------------------------------- /files/php/fonts/poppins/Poppins-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/php/fonts/poppins/Poppins-Regular.ttf -------------------------------------------------------------------------------- /files/role-lighttpd/ansible.cfg: -------------------------------------------------------------------------------- 1 | [defaults] 2 | inventory = ./inventory/ 3 | remote_user = ansible 4 | host_key_checking = false 5 | -------------------------------------------------------------------------------- /files/php/fonts/poppins/Poppins-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/php/fonts/poppins/Poppins-BoldItalic.ttf -------------------------------------------------------------------------------- /files/php/fonts/poppins/Poppins-ExtraBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/php/fonts/poppins/Poppins-ExtraBold.ttf -------------------------------------------------------------------------------- /files/php/fonts/poppins/Poppins-ExtraLight.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/php/fonts/poppins/Poppins-ExtraLight.ttf -------------------------------------------------------------------------------- /files/php/fonts/poppins/Poppins-SemiBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/php/fonts/poppins/Poppins-SemiBold.ttf -------------------------------------------------------------------------------- /files/php/fonts/poppins/Poppins-ThinItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/php/fonts/poppins/Poppins-ThinItalic.ttf -------------------------------------------------------------------------------- /files/jenkins/4542-php/images/icons/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/jenkins/4542-php/images/icons/favicon.ico -------------------------------------------------------------------------------- /files/php/fonts/poppins/Poppins-BlackItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/php/fonts/poppins/Poppins-BlackItalic.ttf -------------------------------------------------------------------------------- /files/php/fonts/poppins/Poppins-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/php/fonts/poppins/Poppins-LightItalic.ttf -------------------------------------------------------------------------------- /files/php/fonts/poppins/Poppins-MediumItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/php/fonts/poppins/Poppins-MediumItalic.ttf -------------------------------------------------------------------------------- /files/php/fonts/poppins/Poppins-ExtraBoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/php/fonts/poppins/Poppins-ExtraBoldItalic.ttf -------------------------------------------------------------------------------- /files/php/fonts/poppins/Poppins-SemiBoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/php/fonts/poppins/Poppins-SemiBoldItalic.ttf -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/poppins/Poppins-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/jenkins/4542-php/fonts/poppins/Poppins-Bold.ttf -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/poppins/Poppins-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/jenkins/4542-php/fonts/poppins/Poppins-Thin.ttf -------------------------------------------------------------------------------- /files/php/fonts/poppins/Poppins-ExtraLightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/php/fonts/poppins/Poppins-ExtraLightItalic.ttf -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/poppins/Poppins-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/jenkins/4542-php/fonts/poppins/Poppins-Black.ttf -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/poppins/Poppins-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/jenkins/4542-php/fonts/poppins/Poppins-Italic.ttf -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/poppins/Poppins-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/jenkins/4542-php/fonts/poppins/Poppins-Light.ttf -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/poppins/Poppins-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/jenkins/4542-php/fonts/poppins/Poppins-Medium.ttf -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/poppins/Poppins-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/jenkins/4542-php/fonts/poppins/Poppins-Regular.ttf -------------------------------------------------------------------------------- /files/php/fonts/font-awesome-4.7.0/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/php/fonts/font-awesome-4.7.0/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/poppins/Poppins-ExtraBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/jenkins/4542-php/fonts/poppins/Poppins-ExtraBold.ttf -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/poppins/Poppins-SemiBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/jenkins/4542-php/fonts/poppins/Poppins-SemiBold.ttf -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/poppins/Poppins-BlackItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/jenkins/4542-php/fonts/poppins/Poppins-BlackItalic.ttf -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/poppins/Poppins-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/jenkins/4542-php/fonts/poppins/Poppins-BoldItalic.ttf -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/poppins/Poppins-ExtraLight.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/jenkins/4542-php/fonts/poppins/Poppins-ExtraLight.ttf -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/poppins/Poppins-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/jenkins/4542-php/fonts/poppins/Poppins-LightItalic.ttf -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/poppins/Poppins-MediumItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/jenkins/4542-php/fonts/poppins/Poppins-MediumItalic.ttf -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/poppins/Poppins-ThinItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/jenkins/4542-php/fonts/poppins/Poppins-ThinItalic.ttf -------------------------------------------------------------------------------- /files/php/fonts/iconic/fonts/Material-Design-Iconic-Font.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/php/fonts/iconic/fonts/Material-Design-Iconic-Font.eot -------------------------------------------------------------------------------- /files/php/fonts/iconic/fonts/Material-Design-Iconic-Font.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/php/fonts/iconic/fonts/Material-Design-Iconic-Font.ttf -------------------------------------------------------------------------------- /files/php/fonts/iconic/fonts/Material-Design-Iconic-Font.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/php/fonts/iconic/fonts/Material-Design-Iconic-Font.woff -------------------------------------------------------------------------------- /files/ansible/playbooks/files/lighttpd-block.conf: -------------------------------------------------------------------------------- 1 | $SERVER["socket"] == ":8080" { 2 | proxy.server = ( "" => ( ( "host" => "192.168.10.10", "port" => "80" ))) 3 | } 4 | -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/poppins/Poppins-SemiBoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/jenkins/4542-php/fonts/poppins/Poppins-SemiBoldItalic.ttf -------------------------------------------------------------------------------- /files/php/fonts/iconic/fonts/Material-Design-Iconic-Font.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/php/fonts/iconic/fonts/Material-Design-Iconic-Font.woff2 -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/poppins/Poppins-ExtraBoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/jenkins/4542-php/fonts/poppins/Poppins-ExtraBoldItalic.ttf -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/poppins/Poppins-ExtraLightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/jenkins/4542-php/fonts/poppins/Poppins-ExtraLightItalic.ttf -------------------------------------------------------------------------------- /files/php/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/php/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /files/php/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/php/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /files/php/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/php/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /files/php/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/php/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/font-awesome-4.7.0/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/jenkins/4542-php/fonts/font-awesome-4.7.0/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /files/daemon.json: -------------------------------------------------------------------------------- 1 | { 2 | "exec-opts": ["native.cgroupdriver=systemd"], 3 | "log-driver": "json-file", 4 | "log-opts": { 5 | "max-size": "5m", 6 | "max-file": "3" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/iconic/fonts/Material-Design-Iconic-Font.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/jenkins/4542-php/fonts/iconic/fonts/Material-Design-Iconic-Font.eot -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/iconic/fonts/Material-Design-Iconic-Font.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/jenkins/4542-php/fonts/iconic/fonts/Material-Design-Iconic-Font.ttf -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/iconic/fonts/Material-Design-Iconic-Font.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/jenkins/4542-php/fonts/iconic/fonts/Material-Design-Iconic-Font.woff -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/iconic/fonts/Material-Design-Iconic-Font.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/jenkins/4542-php/fonts/iconic/fonts/Material-Design-Iconic-Font.woff2 -------------------------------------------------------------------------------- /files/php/fonts/font-awesome-4.7.0/less/screen-reader.less: -------------------------------------------------------------------------------- 1 | // Screen Readers 2 | // ------------------------- 3 | 4 | .sr-only { .sr-only(); } 5 | .sr-only-focusable { .sr-only-focusable(); } 6 | -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/jenkins/4542-php/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/jenkins/4542-php/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/jenkins/4542-php/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /files/php/fonts/font-awesome-4.7.0/less/fixed-width.less: -------------------------------------------------------------------------------- 1 | // Fixed Width Icons 2 | // ------------------------- 3 | .@{fa-css-prefix}-fw { 4 | width: (18em / 14); 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /files/php/fonts/font-awesome-4.7.0/scss/_fixed-width.scss: -------------------------------------------------------------------------------- 1 | // Fixed Width Icons 2 | // ------------------------- 3 | .#{$fa-css-prefix}-fw { 4 | width: (18em / 14); 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4linux/525/HEAD/files/jenkins/4542-php/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/font-awesome-4.7.0/less/fixed-width.less: -------------------------------------------------------------------------------- 1 | // Fixed Width Icons 2 | // ------------------------- 3 | .@{fa-css-prefix}-fw { 4 | width: (18em / 14); 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/font-awesome-4.7.0/less/screen-reader.less: -------------------------------------------------------------------------------- 1 | // Screen Readers 2 | // ------------------------- 3 | 4 | .sr-only { .sr-only(); } 5 | .sr-only-focusable { .sr-only-focusable(); } 6 | -------------------------------------------------------------------------------- /files/php/fonts/font-awesome-4.7.0/scss/_screen-reader.scss: -------------------------------------------------------------------------------- 1 | // Screen Readers 2 | // ------------------------- 3 | 4 | .sr-only { @include sr-only(); } 5 | .sr-only-focusable { @include sr-only-focusable(); } 6 | -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/font-awesome-4.7.0/scss/_fixed-width.scss: -------------------------------------------------------------------------------- 1 | // Fixed Width Icons 2 | // ------------------------- 3 | .#{$fa-css-prefix}-fw { 4 | width: (18em / 14); 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/font-awesome-4.7.0/scss/_screen-reader.scss: -------------------------------------------------------------------------------- 1 | // Screen Readers 2 | // ------------------------- 3 | 4 | .sr-only { @include sr-only(); } 5 | .sr-only-focusable { @include sr-only-focusable(); } 6 | -------------------------------------------------------------------------------- /files/adiciona-user-rundeck-no-sudo: -------------------------------------------------------------------------------- 1 | CMD="sudo sed 's/vagrant/rundeck/g' /etc/sudoers.d/vagrant | sudo tee /etc/sudoers.d/rundeck" 2 | for M in $(vagrant status | grep 'running' | cut -d' ' -f1); do vagrant ssh $M -c "$CMD"; done 3 | -------------------------------------------------------------------------------- /files/adiciona-usuario-rundeck: -------------------------------------------------------------------------------- 1 | CMD='sudo useradd --system --shell /bin/bash --create-home --home-dir /var/lib/rundeck rundeck' 2 | for M in $(vagrant status | grep 'running' | cut -d' ' -f1); do vagrant ssh $M -c "$CMD"; done 3 | -------------------------------------------------------------------------------- /exercicios/07-docker/respostas/Dockerfile-flask: -------------------------------------------------------------------------------- 1 | FROM alpine 2 | 3 | COPY . /opt/app 4 | 5 | RUN apk add --no-cache py3-pip && pip3 install -r /opt/app/requirements.txt 6 | 7 | WORKDIR /opt/app 8 | 9 | CMD python3 app.py 10 | -------------------------------------------------------------------------------- /exercicios/07-docker/respostas/Dockerfile-dancer: -------------------------------------------------------------------------------- 1 | FROM debian:buster-slim 2 | 3 | COPY . /opt/app 4 | 5 | RUN apt-get update && apt-get install -y perl cpanminus make gcc 6 | 7 | WORKDIR /opt/app 8 | 9 | RUN cpanm --installdeps . 10 | 11 | CMD plackup bin/app.psgi 12 | -------------------------------------------------------------------------------- /files/role-lighttpd/lighttpd/tasks/centos.yml: -------------------------------------------------------------------------------- 1 | # Tarefas específicas do CentOS 2 | - name: Garantindo o epel-release em CentOS 3 | package: 4 | name: epel-release 5 | state: present 6 | - name: Desabilitando o SELinux em CentOS 7 | selinux: 8 | state: disabled 9 | -------------------------------------------------------------------------------- /files/ansible/inventory/hosts: -------------------------------------------------------------------------------- 1 | [all:vars] 2 | ansible_python_interpreter=python3 3 | ansible_ssh_private_key_file = /root/keys/ansible 4 | 5 | [automation] 6 | 172.27.11.10 7 | 8 | [balancer] 9 | 172.27.11.20 10 | 11 | [database] 12 | 172.27.11.30 13 | 14 | [docker] 15 | 172.27.11.100 16 | 172.27.11.200 17 | -------------------------------------------------------------------------------- /files/copia-chave-publica-rundeck: -------------------------------------------------------------------------------- 1 | KEY="$(vagrant ssh automation -c 'sudo cat /root/keys/rundeck.pub' < /dev/null)" 2 | CMD="sudo -u rundeck -s /bin/bash -c \'mkdir -p ~/.ssh && echo "$KEY" > ~/.ssh/authorized_keys\'" 3 | for M in $(vagrant status | grep 'running' | cut -d' ' -f1); do vagrant ssh $M -c "$CMD"; done 4 | -------------------------------------------------------------------------------- /files/role-lighttpd/inventory/hosts: -------------------------------------------------------------------------------- 1 | [all:vars] 2 | ansible_python_interpreter=python3 3 | ansible_ssh_private_key_file = /root/keys/ansible 4 | 5 | [automation] 6 | 172.27.11.10 7 | 8 | [balancer] 9 | 172.27.11.20 10 | 11 | [database] 12 | 172.27.11.30 13 | 14 | [docker] 15 | 172.27.11.100 16 | 172.27.11.200 17 | -------------------------------------------------------------------------------- /files/php/logout.php: -------------------------------------------------------------------------------- 1 | > /etc/fstab 14 | fi 15 | -------------------------------------------------------------------------------- /files/ansible/playbooks/files/haproxy.cfg: -------------------------------------------------------------------------------- 1 | global 2 | daemon 3 | maxconn 1024 4 | 5 | defaults 6 | mode http 7 | timeout connect 5000ms 8 | timeout client 50000ms 9 | timeout server 50000ms 10 | 11 | frontend http 12 | bind *:80 13 | default_backend http 14 | 15 | backend http 16 | balance roundrobin 17 | default-server check maxconn 512 18 | server docker1 172.27.11.100:8080 19 | server docker2 172.27.11.200:8080 20 | -------------------------------------------------------------------------------- /files/php/fonts/font-awesome-4.7.0/less/larger.less: -------------------------------------------------------------------------------- 1 | // Icon Sizes 2 | // ------------------------- 3 | 4 | /* makes the font 33% larger relative to the icon container */ 5 | .@{fa-css-prefix}-lg { 6 | font-size: (4em / 3); 7 | line-height: (3em / 4); 8 | vertical-align: -15%; 9 | } 10 | .@{fa-css-prefix}-2x { font-size: 2em; } 11 | .@{fa-css-prefix}-3x { font-size: 3em; } 12 | .@{fa-css-prefix}-4x { font-size: 4em; } 13 | .@{fa-css-prefix}-5x { font-size: 5em; } 14 | -------------------------------------------------------------------------------- /files/php/fonts/font-awesome-4.7.0/scss/_larger.scss: -------------------------------------------------------------------------------- 1 | // Icon Sizes 2 | // ------------------------- 3 | 4 | /* makes the font 33% larger relative to the icon container */ 5 | .#{$fa-css-prefix}-lg { 6 | font-size: (4em / 3); 7 | line-height: (3em / 4); 8 | vertical-align: -15%; 9 | } 10 | .#{$fa-css-prefix}-2x { font-size: 2em; } 11 | .#{$fa-css-prefix}-3x { font-size: 3em; } 12 | .#{$fa-css-prefix}-4x { font-size: 4em; } 13 | .#{$fa-css-prefix}-5x { font-size: 5em; } 14 | -------------------------------------------------------------------------------- /files/rundeck/mysql.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source /etc/os-release 4 | 5 | function _debian { 6 | dpkg -l | grep mariadb-server > /dev/null 7 | test $? -eq 0 && return 8 | apt-get update && apt-get install -y --simulate mariadb-server 9 | } 10 | 11 | function _centos { 12 | rpm -qa | grep mariadb-server > /dev/null 13 | test $? -eq 0 && return 14 | dnf install -y mariadb-server 15 | systemctl start mariadb 16 | systemctl enable mariadb 17 | } 18 | 19 | _$ID 20 | -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/font-awesome-4.7.0/less/larger.less: -------------------------------------------------------------------------------- 1 | // Icon Sizes 2 | // ------------------------- 3 | 4 | /* makes the font 33% larger relative to the icon container */ 5 | .@{fa-css-prefix}-lg { 6 | font-size: (4em / 3); 7 | line-height: (3em / 4); 8 | vertical-align: -15%; 9 | } 10 | .@{fa-css-prefix}-2x { font-size: 2em; } 11 | .@{fa-css-prefix}-3x { font-size: 3em; } 12 | .@{fa-css-prefix}-4x { font-size: 4em; } 13 | .@{fa-css-prefix}-5x { font-size: 5em; } 14 | -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/font-awesome-4.7.0/scss/_larger.scss: -------------------------------------------------------------------------------- 1 | // Icon Sizes 2 | // ------------------------- 3 | 4 | /* makes the font 33% larger relative to the icon container */ 5 | .#{$fa-css-prefix}-lg { 6 | font-size: (4em / 3); 7 | line-height: (3em / 4); 8 | vertical-align: -15%; 9 | } 10 | .#{$fa-css-prefix}-2x { font-size: 2em; } 11 | .#{$fa-css-prefix}-3x { font-size: 3em; } 12 | .#{$fa-css-prefix}-4x { font-size: 4em; } 13 | .#{$fa-css-prefix}-5x { font-size: 5em; } 14 | -------------------------------------------------------------------------------- /files/php/fonts/font-awesome-4.7.0/less/list.less: -------------------------------------------------------------------------------- 1 | // List Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-ul { 5 | padding-left: 0; 6 | margin-left: @fa-li-width; 7 | list-style-type: none; 8 | > li { position: relative; } 9 | } 10 | .@{fa-css-prefix}-li { 11 | position: absolute; 12 | left: -@fa-li-width; 13 | width: @fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.@{fa-css-prefix}-lg { 17 | left: (-@fa-li-width + (4em / 14)); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /files/php/fonts/font-awesome-4.7.0/scss/_list.scss: -------------------------------------------------------------------------------- 1 | // List Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-ul { 5 | padding-left: 0; 6 | margin-left: $fa-li-width; 7 | list-style-type: none; 8 | > li { position: relative; } 9 | } 10 | .#{$fa-css-prefix}-li { 11 | position: absolute; 12 | left: -$fa-li-width; 13 | width: $fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.#{$fa-css-prefix}-lg { 17 | left: -$fa-li-width + (4em / 14); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/font-awesome-4.7.0/less/list.less: -------------------------------------------------------------------------------- 1 | // List Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-ul { 5 | padding-left: 0; 6 | margin-left: @fa-li-width; 7 | list-style-type: none; 8 | > li { position: relative; } 9 | } 10 | .@{fa-css-prefix}-li { 11 | position: absolute; 12 | left: -@fa-li-width; 13 | width: @fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.@{fa-css-prefix}-lg { 17 | left: (-@fa-li-width + (4em / 14)); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/font-awesome-4.7.0/scss/_list.scss: -------------------------------------------------------------------------------- 1 | // List Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-ul { 5 | padding-left: 0; 6 | margin-left: $fa-li-width; 7 | list-style-type: none; 8 | > li { position: relative; } 9 | } 10 | .#{$fa-css-prefix}-li { 11 | position: absolute; 12 | left: -$fa-li-width; 13 | width: $fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.#{$fa-css-prefix}-lg { 17 | left: -$fa-li-width + (4em / 14); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /files/database.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source /etc/os-release # ID = centos,debian, NAME 4 | 5 | function _debian { 6 | dpkg -l | grep mariadb-server > /dev/null 7 | test $? -eq 0 && return 8 | apt-get update && apt-get install -y mariadb-server 9 | } 10 | 11 | function _centos { 12 | rpm -qa | grep mariadb-server > /dev/null 13 | test $? -eq 0 && return 14 | dnf install -y mariadb-server 15 | systemctl start mariadb 16 | systemctl enable mariadb 17 | } 18 | 19 | _$ID # executa _debian ou _centos 20 | -------------------------------------------------------------------------------- /files/php/fonts/font-awesome-4.7.0/less/core.less: -------------------------------------------------------------------------------- 1 | // Base Class Definition 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix} { 5 | display: inline-block; 6 | font: normal normal normal @fa-font-size-base/@fa-line-height-base FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /exercicios/02-vagrant/resposta/Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | Vagrant.configure("2") do |config| 5 | 6 | config.vm.box = "centos/8" 7 | config.vm.box_check_update = false 8 | 9 | config.vm.network "private_network", ip: "172.27.11.150" 10 | 11 | config.vm.provision "shell", inline: <<-SHELL 12 | dnf install -y httpd git 13 | cd /var/www/html 14 | rm -rf * 15 | git clone https://github.com/4linux/4542-site . 16 | systemctl start httpd 17 | systemctl enable httpd 18 | SHELL 19 | end 20 | -------------------------------------------------------------------------------- /files/php/fonts/font-awesome-4.7.0/scss/_core.scss: -------------------------------------------------------------------------------- 1 | // Base Class Definition 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix} { 5 | display: inline-block; 6 | font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /files/rundeck/adicionar-usuario.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # sudo useradd -m -d /home/${option.user} -s /bin/bash ${option.user} 4 | # getent passwd ${option.user} 5 | 6 | su -c 'mkdir -p ~/.ssh' @option.user@ 7 | 8 | grep "@option.key@" /home/@option.user@/.ssh/authorized_keys > /dev/null 9 | 10 | if [ $? != 0 ]; then 11 | su -c 'echo "@option.key@" >> ~/.ssh/authorized_keys' @option.user@ 12 | echo 'Chave adicionada' 13 | else 14 | echo 'Chave já existe' 15 | fi 16 | 17 | echo '@option.user@ ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/@option.user@ 18 | -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/font-awesome-4.7.0/less/core.less: -------------------------------------------------------------------------------- 1 | // Base Class Definition 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix} { 5 | display: inline-block; 6 | font: normal normal normal @fa-font-size-base/@fa-line-height-base FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /files/php/fonts/font-awesome-4.7.0/scss/font-awesome.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */ 5 | 6 | @import "variables"; 7 | @import "mixins"; 8 | @import "path"; 9 | @import "core"; 10 | @import "larger"; 11 | @import "fixed-width"; 12 | @import "list"; 13 | @import "bordered-pulled"; 14 | @import "animated"; 15 | @import "rotated-flipped"; 16 | @import "stacked"; 17 | @import "icons"; 18 | @import "screen-reader"; 19 | -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/font-awesome-4.7.0/scss/_core.scss: -------------------------------------------------------------------------------- 1 | // Base Class Definition 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix} { 5 | display: inline-block; 6 | font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /exercicios/02-vagrant/README.md: -------------------------------------------------------------------------------- 1 | # Vagrant 2 | 3 | Exercícios práticos o capítulo de Vagrant. 4 | 5 | ## 01 - Webserver 6 | 7 | Criar um `Vagrantfile` capaz de atender as seguintes exigências: 8 | 9 | - A máquina deverá ser um **CentOS 8**; 10 | - O ip da máquina deverá ser 172.27.11.150; 11 | - configurar automaticamente um servidor Apache; 12 | - o servidor deve exibir o site baixado do repositório https://github.com/4linux/4542-site; 13 | - o script de provisionamento deve estar dentro do próprio `Vagrantfile`; 14 | - o Apache deve iniciar junto com o sistema 15 | -------------------------------------------------------------------------------- /files/jenkins/4542-php/docker/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.3' 2 | 3 | services: 4 | mysql: 5 | image: mariadb 6 | environment: 7 | MYSQL_ROOT_PASSWORD: Abc123! 8 | MYSQL_DATABASE: php 9 | MYSQL_USER: php 10 | MYSQL_PASSWORD: 4linux 11 | memcached: 12 | image: memcached:alpine 13 | app: 14 | depends_on: 15 | - mysql 16 | image: viniciusfelix1/php-login 17 | environment: 18 | DB_HOST: mysql 19 | DB_PORT: 3306 20 | DB_USER: php 21 | DB_PASS: 4linux 22 | DB_NAME: php 23 | -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/font-awesome-4.7.0/scss/font-awesome.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */ 5 | 6 | @import "variables"; 7 | @import "mixins"; 8 | @import "path"; 9 | @import "core"; 10 | @import "larger"; 11 | @import "fixed-width"; 12 | @import "list"; 13 | @import "bordered-pulled"; 14 | @import "animated"; 15 | @import "rotated-flipped"; 16 | @import "stacked"; 17 | @import "icons"; 18 | @import "screen-reader"; 19 | -------------------------------------------------------------------------------- /files/php/fonts/font-awesome-4.7.0/less/stacked.less: -------------------------------------------------------------------------------- 1 | // Stacked Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-stack { 5 | position: relative; 6 | display: inline-block; 7 | width: 2em; 8 | height: 2em; 9 | line-height: 2em; 10 | vertical-align: middle; 11 | } 12 | .@{fa-css-prefix}-stack-1x, .@{fa-css-prefix}-stack-2x { 13 | position: absolute; 14 | left: 0; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | .@{fa-css-prefix}-stack-1x { line-height: inherit; } 19 | .@{fa-css-prefix}-stack-2x { font-size: 2em; } 20 | .@{fa-css-prefix}-inverse { color: @fa-inverse; } 21 | -------------------------------------------------------------------------------- /files/php/fonts/font-awesome-4.7.0/scss/_stacked.scss: -------------------------------------------------------------------------------- 1 | // Stacked Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-stack { 5 | position: relative; 6 | display: inline-block; 7 | width: 2em; 8 | height: 2em; 9 | line-height: 2em; 10 | vertical-align: middle; 11 | } 12 | .#{$fa-css-prefix}-stack-1x, .#{$fa-css-prefix}-stack-2x { 13 | position: absolute; 14 | left: 0; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | .#{$fa-css-prefix}-stack-1x { line-height: inherit; } 19 | .#{$fa-css-prefix}-stack-2x { font-size: 2em; } 20 | .#{$fa-css-prefix}-inverse { color: $fa-inverse; } 21 | -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/font-awesome-4.7.0/less/stacked.less: -------------------------------------------------------------------------------- 1 | // Stacked Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-stack { 5 | position: relative; 6 | display: inline-block; 7 | width: 2em; 8 | height: 2em; 9 | line-height: 2em; 10 | vertical-align: middle; 11 | } 12 | .@{fa-css-prefix}-stack-1x, .@{fa-css-prefix}-stack-2x { 13 | position: absolute; 14 | left: 0; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | .@{fa-css-prefix}-stack-1x { line-height: inherit; } 19 | .@{fa-css-prefix}-stack-2x { font-size: 2em; } 20 | .@{fa-css-prefix}-inverse { color: @fa-inverse; } 21 | -------------------------------------------------------------------------------- /files/php/fonts/font-awesome-4.7.0/less/font-awesome.less: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */ 5 | 6 | @import "variables.less"; 7 | @import "mixins.less"; 8 | @import "path.less"; 9 | @import "core.less"; 10 | @import "larger.less"; 11 | @import "fixed-width.less"; 12 | @import "list.less"; 13 | @import "bordered-pulled.less"; 14 | @import "animated.less"; 15 | @import "rotated-flipped.less"; 16 | @import "stacked.less"; 17 | @import "icons.less"; 18 | @import "screen-reader.less"; 19 | -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/font-awesome-4.7.0/scss/_stacked.scss: -------------------------------------------------------------------------------- 1 | // Stacked Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-stack { 5 | position: relative; 6 | display: inline-block; 7 | width: 2em; 8 | height: 2em; 9 | line-height: 2em; 10 | vertical-align: middle; 11 | } 12 | .#{$fa-css-prefix}-stack-1x, .#{$fa-css-prefix}-stack-2x { 13 | position: absolute; 14 | left: 0; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | .#{$fa-css-prefix}-stack-1x { line-height: inherit; } 19 | .#{$fa-css-prefix}-stack-2x { font-size: 2em; } 20 | .#{$fa-css-prefix}-inverse { color: $fa-inverse; } 21 | -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/font-awesome-4.7.0/less/font-awesome.less: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */ 5 | 6 | @import "variables.less"; 7 | @import "mixins.less"; 8 | @import "path.less"; 9 | @import "core.less"; 10 | @import "larger.less"; 11 | @import "fixed-width.less"; 12 | @import "list.less"; 13 | @import "bordered-pulled.less"; 14 | @import "animated.less"; 15 | @import "rotated-flipped.less"; 16 | @import "stacked.less"; 17 | @import "icons.less"; 18 | @import "screen-reader.less"; 19 | -------------------------------------------------------------------------------- /files/role-lighttpd/lighttpd/.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | language: python 3 | python: "2.7" 4 | 5 | # Use the new container infrastructure 6 | sudo: false 7 | 8 | # Install ansible 9 | addons: 10 | apt: 11 | packages: 12 | - python-pip 13 | 14 | install: 15 | # Install ansible 16 | - pip install ansible 17 | 18 | # Check ansible version 19 | - ansible --version 20 | 21 | # Create ansible.cfg with correct roles_path 22 | - printf '[defaults]\nroles_path=../' >ansible.cfg 23 | 24 | script: 25 | # Basic role syntax check 26 | - ansible-playbook tests/test.yml -i tests/inventory --syntax-check 27 | 28 | notifications: 29 | webhooks: https://galaxy.ansible.com/api/v1/notifications/ -------------------------------------------------------------------------------- /files/docker.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | my $needed = < } : ''; 19 | 20 | if ($needed ne $found) { 21 | system('apt-get', 'update'); 22 | system('apt-get', 'install', '-y', 'docker.io'); 23 | open(FH, '>', '/etc/docker/daemon.json') or die $!; 24 | print FH $needed; 25 | system('systemctl', 'restart', 'docker'); 26 | } 27 | -------------------------------------------------------------------------------- /files/php/fonts/font-awesome-4.7.0/less/bordered-pulled.less: -------------------------------------------------------------------------------- 1 | // Bordered & Pulled 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-border { 5 | padding: .2em .25em .15em; 6 | border: solid .08em @fa-border-color; 7 | border-radius: .1em; 8 | } 9 | 10 | .@{fa-css-prefix}-pull-left { float: left; } 11 | .@{fa-css-prefix}-pull-right { float: right; } 12 | 13 | .@{fa-css-prefix} { 14 | &.@{fa-css-prefix}-pull-left { margin-right: .3em; } 15 | &.@{fa-css-prefix}-pull-right { margin-left: .3em; } 16 | } 17 | 18 | /* Deprecated as of 4.4.0 */ 19 | .pull-right { float: right; } 20 | .pull-left { float: left; } 21 | 22 | .@{fa-css-prefix} { 23 | &.pull-left { margin-right: .3em; } 24 | &.pull-right { margin-left: .3em; } 25 | } 26 | -------------------------------------------------------------------------------- /files/php/fonts/font-awesome-4.7.0/less/rotated-flipped.less: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-rotate-90 { .fa-icon-rotate(90deg, 1); } 5 | .@{fa-css-prefix}-rotate-180 { .fa-icon-rotate(180deg, 2); } 6 | .@{fa-css-prefix}-rotate-270 { .fa-icon-rotate(270deg, 3); } 7 | 8 | .@{fa-css-prefix}-flip-horizontal { .fa-icon-flip(-1, 1, 0); } 9 | .@{fa-css-prefix}-flip-vertical { .fa-icon-flip(1, -1, 2); } 10 | 11 | // Hook for IE8-9 12 | // ------------------------- 13 | 14 | :root .@{fa-css-prefix}-rotate-90, 15 | :root .@{fa-css-prefix}-rotate-180, 16 | :root .@{fa-css-prefix}-rotate-270, 17 | :root .@{fa-css-prefix}-flip-horizontal, 18 | :root .@{fa-css-prefix}-flip-vertical { 19 | filter: none; 20 | } 21 | -------------------------------------------------------------------------------- /files/php/fonts/font-awesome-4.7.0/scss/_bordered-pulled.scss: -------------------------------------------------------------------------------- 1 | // Bordered & Pulled 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-border { 5 | padding: .2em .25em .15em; 6 | border: solid .08em $fa-border-color; 7 | border-radius: .1em; 8 | } 9 | 10 | .#{$fa-css-prefix}-pull-left { float: left; } 11 | .#{$fa-css-prefix}-pull-right { float: right; } 12 | 13 | .#{$fa-css-prefix} { 14 | &.#{$fa-css-prefix}-pull-left { margin-right: .3em; } 15 | &.#{$fa-css-prefix}-pull-right { margin-left: .3em; } 16 | } 17 | 18 | /* Deprecated as of 4.4.0 */ 19 | .pull-right { float: right; } 20 | .pull-left { float: left; } 21 | 22 | .#{$fa-css-prefix} { 23 | &.pull-left { margin-right: .3em; } 24 | &.pull-right { margin-left: .3em; } 25 | } 26 | -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/font-awesome-4.7.0/less/bordered-pulled.less: -------------------------------------------------------------------------------- 1 | // Bordered & Pulled 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-border { 5 | padding: .2em .25em .15em; 6 | border: solid .08em @fa-border-color; 7 | border-radius: .1em; 8 | } 9 | 10 | .@{fa-css-prefix}-pull-left { float: left; } 11 | .@{fa-css-prefix}-pull-right { float: right; } 12 | 13 | .@{fa-css-prefix} { 14 | &.@{fa-css-prefix}-pull-left { margin-right: .3em; } 15 | &.@{fa-css-prefix}-pull-right { margin-left: .3em; } 16 | } 17 | 18 | /* Deprecated as of 4.4.0 */ 19 | .pull-right { float: right; } 20 | .pull-left { float: left; } 21 | 22 | .@{fa-css-prefix} { 23 | &.pull-left { margin-right: .3em; } 24 | &.pull-right { margin-left: .3em; } 25 | } 26 | -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/font-awesome-4.7.0/scss/_bordered-pulled.scss: -------------------------------------------------------------------------------- 1 | // Bordered & Pulled 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-border { 5 | padding: .2em .25em .15em; 6 | border: solid .08em $fa-border-color; 7 | border-radius: .1em; 8 | } 9 | 10 | .#{$fa-css-prefix}-pull-left { float: left; } 11 | .#{$fa-css-prefix}-pull-right { float: right; } 12 | 13 | .#{$fa-css-prefix} { 14 | &.#{$fa-css-prefix}-pull-left { margin-right: .3em; } 15 | &.#{$fa-css-prefix}-pull-right { margin-left: .3em; } 16 | } 17 | 18 | /* Deprecated as of 4.4.0 */ 19 | .pull-right { float: right; } 20 | .pull-left { float: left; } 21 | 22 | .#{$fa-css-prefix} { 23 | &.pull-left { margin-right: .3em; } 24 | &.pull-right { margin-left: .3em; } 25 | } 26 | -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/font-awesome-4.7.0/less/rotated-flipped.less: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-rotate-90 { .fa-icon-rotate(90deg, 1); } 5 | .@{fa-css-prefix}-rotate-180 { .fa-icon-rotate(180deg, 2); } 6 | .@{fa-css-prefix}-rotate-270 { .fa-icon-rotate(270deg, 3); } 7 | 8 | .@{fa-css-prefix}-flip-horizontal { .fa-icon-flip(-1, 1, 0); } 9 | .@{fa-css-prefix}-flip-vertical { .fa-icon-flip(1, -1, 2); } 10 | 11 | // Hook for IE8-9 12 | // ------------------------- 13 | 14 | :root .@{fa-css-prefix}-rotate-90, 15 | :root .@{fa-css-prefix}-rotate-180, 16 | :root .@{fa-css-prefix}-rotate-270, 17 | :root .@{fa-css-prefix}-flip-horizontal, 18 | :root .@{fa-css-prefix}-flip-vertical { 19 | filter: none; 20 | } 21 | -------------------------------------------------------------------------------- /files/jenkins/4542-php/docker/docker-compose-ha.yml: -------------------------------------------------------------------------------- 1 | version: '3.7' 2 | 3 | services: 4 | mysql: 5 | image: mysql 6 | command: --default-authentication-plugin=mysql_native_password 7 | environment: 8 | MYSQL_ROOT_PASSWORD: Abc123! 9 | MYSQL_DATABASE: php 10 | MYSQL_USER: php 11 | MYSQL_PASSWORD: 4linux 12 | 13 | memcached1: 14 | image: memcached 15 | memcached2: 16 | image: memcached 17 | 18 | app: 19 | depends_on: 20 | - mysql 21 | - memcached1 22 | - memcached2 23 | image: php-ms 24 | deploy: 25 | mode: global 26 | ports: 27 | - "8080:8080" 28 | environment: 29 | DB_HOST: mysql 30 | DB_PORT: 3306 31 | DB_USER: php 32 | DB_PASS: 4linux 33 | DB_NAME: php 34 | -------------------------------------------------------------------------------- /exercicios/03-git/README.md: -------------------------------------------------------------------------------- 1 | # Git 2 | 3 | ## 01 - Ignorando Arquivos e Diretórios 4 | 5 | Execute o seguinte script na máquina **automation** (basta copiar e colá-lo no terminal: 6 | 7 | ```bash 8 | mkdir /tmp/repo 9 | cd /tmp/repo 10 | for X in README.md app.pyc app.py requirements.txt; do 11 | echo 123 > $X 12 | done 13 | mkdir -p {lib,src,bin} 14 | mkdir -p {src,lib}/__pycache__ 15 | echo 123 > src/libs.pyc 16 | echo 123 > src/__pycache__/a.py 17 | echo 123 > src/core.py 18 | echo 123 > lib/__pycache__/b.py 19 | echo 123 > lib/libs.py 20 | git init 21 | ``` 22 | 23 | Crie um arquivo `.gitignore` capaz de ignorar os arquivos de final `.pyc` e os diretórios `__pycache__`. 24 | 25 | > **Atenção:** Tome cuidado pois os diretórios `src` e `lib` não mostram seus arquivos na listagem do comando `git status`. 26 | -------------------------------------------------------------------------------- /files/php/fonts/font-awesome-4.7.0/scss/_rotated-flipped.scss: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-rotate-90 { @include fa-icon-rotate(90deg, 1); } 5 | .#{$fa-css-prefix}-rotate-180 { @include fa-icon-rotate(180deg, 2); } 6 | .#{$fa-css-prefix}-rotate-270 { @include fa-icon-rotate(270deg, 3); } 7 | 8 | .#{$fa-css-prefix}-flip-horizontal { @include fa-icon-flip(-1, 1, 0); } 9 | .#{$fa-css-prefix}-flip-vertical { @include fa-icon-flip(1, -1, 2); } 10 | 11 | // Hook for IE8-9 12 | // ------------------------- 13 | 14 | :root .#{$fa-css-prefix}-rotate-90, 15 | :root .#{$fa-css-prefix}-rotate-180, 16 | :root .#{$fa-css-prefix}-rotate-270, 17 | :root .#{$fa-css-prefix}-flip-horizontal, 18 | :root .#{$fa-css-prefix}-flip-vertical { 19 | filter: none; 20 | } 21 | -------------------------------------------------------------------------------- /exercicios/05-ssh/README.md: -------------------------------------------------------------------------------- 1 | # SSH 2 | 3 | ## 01 - Muitos comandos Remotos 4 | 5 | Crie um usuário para acessar a máquina **balancer** através da máquina **automation** chamado "executor". Este usuário poderá acessar através de senha ou chaves SSH. 6 | 7 | Temos o seguinte script: 8 | 9 | ```bash 10 | #!/bin/bash 11 | apt-cache search nginx 12 | systemctl status cron 13 | mkdir /tmp/site 14 | cd /tmp/site 15 | wget https://github.com/4linux/4542-site/archive/master.zip 16 | ``` 17 | 18 | Salve este script em `/tmp/script.sh`. 19 | 20 | O objetivo é executar esse script a partir da máquina **automation** dentro da máquina **balancer** sem copiar este arquivo para lá e utilizando no máximo dois comandos. 21 | 22 | > **Dica:** Você pode utilizar o subshell para realizar esta tarefa com apenas "1 comando no terminal". 23 | -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/font-awesome-4.7.0/scss/_rotated-flipped.scss: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-rotate-90 { @include fa-icon-rotate(90deg, 1); } 5 | .#{$fa-css-prefix}-rotate-180 { @include fa-icon-rotate(180deg, 2); } 6 | .#{$fa-css-prefix}-rotate-270 { @include fa-icon-rotate(270deg, 3); } 7 | 8 | .#{$fa-css-prefix}-flip-horizontal { @include fa-icon-flip(-1, 1, 0); } 9 | .#{$fa-css-prefix}-flip-vertical { @include fa-icon-flip(1, -1, 2); } 10 | 11 | // Hook for IE8-9 12 | // ------------------------- 13 | 14 | :root .#{$fa-css-prefix}-rotate-90, 15 | :root .#{$fa-css-prefix}-rotate-180, 16 | :root .#{$fa-css-prefix}-rotate-270, 17 | :root .#{$fa-css-prefix}-flip-horizontal, 18 | :root .#{$fa-css-prefix}-flip-vertical { 19 | filter: none; 20 | } 21 | -------------------------------------------------------------------------------- /files/php/db/dump.sql: -------------------------------------------------------------------------------- 1 | -- version 0.1 2 | -- mysql -h 127.0.0.1 -u 'user' -p'password' database < db.sql 3 | -- docker exec -i conteineres_mysql_1 mysql -u php -p'4linux' php < db/dump.sql 4 | 5 | DROP TABLE IF EXISTS usuarios; 6 | 7 | CREATE TABLE usuarios ( 8 | id INT AUTO_INCREMENT PRIMARY KEY, 9 | nome VARCHAR(50), 10 | email VARCHAR(100), 11 | senha CHAR(60), 12 | cadastro TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP 13 | ); 14 | 15 | INSERT INTO usuarios (nome, email, senha) VALUES ('Paramahansa Yogananda', 'paramahansa@yogananda.in', '$2y$10$qTdhcJ8CkKztrvRhBN7EG.UB/YqfwjXpV2iKrZjvTIp2HTzqcflvi'); 16 | INSERT INTO usuarios (nome, email, senha) VALUES ('Mary Shelley', 'victor@frankenstein.co.uk', '$2y$10$mKvUbxiLFx9V4WPcNT3dWehd9xJ5xyZi2wkmadK8UlJBnYrLpwAqi'); 17 | -- Ambas as senhas são um hash de 123 18 | -------------------------------------------------------------------------------- /files/jenkins/4542-php/db/dump.sql: -------------------------------------------------------------------------------- 1 | -- version 0.1 2 | -- mysql -h 127.0.0.1 -u 'user' -p'password' database < db.sql 3 | -- docker exec -i conteineres_mysql_1 mysql -u php -p'4linux' php < db/dump.sql 4 | 5 | DROP TABLE IF EXISTS usuarios; 6 | 7 | CREATE TABLE usuarios ( 8 | id INT AUTO_INCREMENT PRIMARY KEY, 9 | nome VARCHAR(50), 10 | email VARCHAR(100), 11 | senha CHAR(60), 12 | cadastro TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP 13 | ); 14 | 15 | INSERT INTO usuarios (nome, email, senha) VALUES ('Paramahansa Yogananda', 'paramahansa@yogananda.in', '$2y$10$qTdhcJ8CkKztrvRhBN7EG.UB/YqfwjXpV2iKrZjvTIp2HTzqcflvi'); 16 | INSERT INTO usuarios (nome, email, senha) VALUES ('Mary Shelley', 'victor@frankenstein.co.uk', '$2y$10$mKvUbxiLFx9V4WPcNT3dWehd9xJ5xyZi2wkmadK8UlJBnYrLpwAqi'); 17 | -- Ambas as senhas são um hash de 123 18 | -------------------------------------------------------------------------------- /files/ansible/playbooks/files/dump.sql: -------------------------------------------------------------------------------- 1 | -- version 0.1 2 | -- mysql -h 127.0.0.1 -u 'user' -p'password' database < db.sql 3 | -- docker exec -i conteineres_mysql_1 mysql -u php -p'4linux' php < db/dump.sql 4 | 5 | DROP TABLE IF EXISTS usuarios; 6 | 7 | CREATE TABLE usuarios ( 8 | id INT AUTO_INCREMENT PRIMARY KEY, 9 | nome VARCHAR(50), 10 | email VARCHAR(100), 11 | senha CHAR(60), 12 | cadastro TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP 13 | ); 14 | 15 | INSERT INTO usuarios (nome, email, senha) VALUES ('Paramahansa Yogananda', 'paramahansa@yogananda.in', '$2y$10$qTdhcJ8CkKztrvRhBN7EG.UB/YqfwjXpV2iKrZjvTIp2HTzqcflvi'); 16 | INSERT INTO usuarios (nome, email, senha) VALUES ('Mary Shelley', 'victor@frankenstein.co.uk', '$2y$10$mKvUbxiLFx9V4WPcNT3dWehd9xJ5xyZi2wkmadK8UlJBnYrLpwAqi'); 17 | -- Ambas as senhas são um hash de 123 18 | -------------------------------------------------------------------------------- /files/php/fonts/font-awesome-4.7.0/less/path.less: -------------------------------------------------------------------------------- 1 | /* FONT PATH 2 | * -------------------------- */ 3 | 4 | @font-face { 5 | font-family: 'FontAwesome'; 6 | src: url('@{fa-font-path}/fontawesome-webfont.eot?v=@{fa-version}'); 7 | src: url('@{fa-font-path}/fontawesome-webfont.eot?#iefix&v=@{fa-version}') format('embedded-opentype'), 8 | url('@{fa-font-path}/fontawesome-webfont.woff2?v=@{fa-version}') format('woff2'), 9 | url('@{fa-font-path}/fontawesome-webfont.woff?v=@{fa-version}') format('woff'), 10 | url('@{fa-font-path}/fontawesome-webfont.ttf?v=@{fa-version}') format('truetype'), 11 | url('@{fa-font-path}/fontawesome-webfont.svg?v=@{fa-version}#fontawesomeregular') format('svg'); 12 | // src: url('@{fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts 13 | font-weight: normal; 14 | font-style: normal; 15 | } 16 | -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/font-awesome-4.7.0/less/path.less: -------------------------------------------------------------------------------- 1 | /* FONT PATH 2 | * -------------------------- */ 3 | 4 | @font-face { 5 | font-family: 'FontAwesome'; 6 | src: url('@{fa-font-path}/fontawesome-webfont.eot?v=@{fa-version}'); 7 | src: url('@{fa-font-path}/fontawesome-webfont.eot?#iefix&v=@{fa-version}') format('embedded-opentype'), 8 | url('@{fa-font-path}/fontawesome-webfont.woff2?v=@{fa-version}') format('woff2'), 9 | url('@{fa-font-path}/fontawesome-webfont.woff?v=@{fa-version}') format('woff'), 10 | url('@{fa-font-path}/fontawesome-webfont.ttf?v=@{fa-version}') format('truetype'), 11 | url('@{fa-font-path}/fontawesome-webfont.svg?v=@{fa-version}#fontawesomeregular') format('svg'); 12 | // src: url('@{fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts 13 | font-weight: normal; 14 | font-style: normal; 15 | } 16 | -------------------------------------------------------------------------------- /files/php/fonts/font-awesome-4.7.0/scss/_path.scss: -------------------------------------------------------------------------------- 1 | /* FONT PATH 2 | * -------------------------- */ 3 | 4 | @font-face { 5 | font-family: 'FontAwesome'; 6 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?v=#{$fa-version}'); 7 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?#iefix&v=#{$fa-version}') format('embedded-opentype'), 8 | url('#{$fa-font-path}/fontawesome-webfont.woff2?v=#{$fa-version}') format('woff2'), 9 | url('#{$fa-font-path}/fontawesome-webfont.woff?v=#{$fa-version}') format('woff'), 10 | url('#{$fa-font-path}/fontawesome-webfont.ttf?v=#{$fa-version}') format('truetype'), 11 | url('#{$fa-font-path}/fontawesome-webfont.svg?v=#{$fa-version}#fontawesomeregular') format('svg'); 12 | // src: url('#{$fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts 13 | font-weight: normal; 14 | font-style: normal; 15 | } 16 | -------------------------------------------------------------------------------- /provision/gitea.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -f /usr/local/bin/gitea ]; then 4 | exit 5 | fi 6 | 7 | wget -q -O gitea https://dl.gitea.io/gitea/1.12.2/gitea-1.12.2-linux-amd64 8 | chmod +x gitea 9 | useradd --system --shell /bin/bash --comment 'Git Version Control' --home-dir /home/git --create-home git 10 | cp gitea /usr/local/bin/gitea 11 | mkdir -p /var/lib/gitea/{custom,data,log} 12 | chown -R git: /var/lib/gitea/ 13 | chmod -R 750 /var/lib/gitea/ 14 | mkdir /etc/gitea 15 | chown root:git /etc/gitea 16 | chmod 770 /etc/gitea 17 | cp /vagrant/files/app.ini /etc/gitea/ 18 | chown git: /etc/gitea/app.ini 19 | 20 | sqlite3 /var/lib/gitea/data/gitea.db < /vagrant/files/gitea.sql 21 | chown git: /var/lib/gitea/data/gitea.db 22 | 23 | cp /vagrant/files/gitea.service /etc/systemd/system/gitea.service 24 | systemctl daemon-reload 25 | systemctl start gitea 26 | systemctl enable gitea 27 | -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/font-awesome-4.7.0/scss/_path.scss: -------------------------------------------------------------------------------- 1 | /* FONT PATH 2 | * -------------------------- */ 3 | 4 | @font-face { 5 | font-family: 'FontAwesome'; 6 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?v=#{$fa-version}'); 7 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?#iefix&v=#{$fa-version}') format('embedded-opentype'), 8 | url('#{$fa-font-path}/fontawesome-webfont.woff2?v=#{$fa-version}') format('woff2'), 9 | url('#{$fa-font-path}/fontawesome-webfont.woff?v=#{$fa-version}') format('woff'), 10 | url('#{$fa-font-path}/fontawesome-webfont.ttf?v=#{$fa-version}') format('truetype'), 11 | url('#{$fa-font-path}/fontawesome-webfont.svg?v=#{$fa-version}#fontawesomeregular') format('svg'); 12 | // src: url('#{$fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts 13 | font-weight: normal; 14 | font-style: normal; 15 | } 16 | -------------------------------------------------------------------------------- /files/php/fonts/font-awesome-4.7.0/less/animated.less: -------------------------------------------------------------------------------- 1 | // Animated Icons 2 | // -------------------------- 3 | 4 | .@{fa-css-prefix}-spin { 5 | -webkit-animation: fa-spin 2s infinite linear; 6 | animation: fa-spin 2s infinite linear; 7 | } 8 | 9 | .@{fa-css-prefix}-pulse { 10 | -webkit-animation: fa-spin 1s infinite steps(8); 11 | animation: fa-spin 1s infinite steps(8); 12 | } 13 | 14 | @-webkit-keyframes fa-spin { 15 | 0% { 16 | -webkit-transform: rotate(0deg); 17 | transform: rotate(0deg); 18 | } 19 | 100% { 20 | -webkit-transform: rotate(359deg); 21 | transform: rotate(359deg); 22 | } 23 | } 24 | 25 | @keyframes fa-spin { 26 | 0% { 27 | -webkit-transform: rotate(0deg); 28 | transform: rotate(0deg); 29 | } 30 | 100% { 31 | -webkit-transform: rotate(359deg); 32 | transform: rotate(359deg); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /files/php/fonts/font-awesome-4.7.0/scss/_animated.scss: -------------------------------------------------------------------------------- 1 | // Spinning Icons 2 | // -------------------------- 3 | 4 | .#{$fa-css-prefix}-spin { 5 | -webkit-animation: fa-spin 2s infinite linear; 6 | animation: fa-spin 2s infinite linear; 7 | } 8 | 9 | .#{$fa-css-prefix}-pulse { 10 | -webkit-animation: fa-spin 1s infinite steps(8); 11 | animation: fa-spin 1s infinite steps(8); 12 | } 13 | 14 | @-webkit-keyframes fa-spin { 15 | 0% { 16 | -webkit-transform: rotate(0deg); 17 | transform: rotate(0deg); 18 | } 19 | 100% { 20 | -webkit-transform: rotate(359deg); 21 | transform: rotate(359deg); 22 | } 23 | } 24 | 25 | @keyframes fa-spin { 26 | 0% { 27 | -webkit-transform: rotate(0deg); 28 | transform: rotate(0deg); 29 | } 30 | 100% { 31 | -webkit-transform: rotate(359deg); 32 | transform: rotate(359deg); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/font-awesome-4.7.0/less/animated.less: -------------------------------------------------------------------------------- 1 | // Animated Icons 2 | // -------------------------- 3 | 4 | .@{fa-css-prefix}-spin { 5 | -webkit-animation: fa-spin 2s infinite linear; 6 | animation: fa-spin 2s infinite linear; 7 | } 8 | 9 | .@{fa-css-prefix}-pulse { 10 | -webkit-animation: fa-spin 1s infinite steps(8); 11 | animation: fa-spin 1s infinite steps(8); 12 | } 13 | 14 | @-webkit-keyframes fa-spin { 15 | 0% { 16 | -webkit-transform: rotate(0deg); 17 | transform: rotate(0deg); 18 | } 19 | 100% { 20 | -webkit-transform: rotate(359deg); 21 | transform: rotate(359deg); 22 | } 23 | } 24 | 25 | @keyframes fa-spin { 26 | 0% { 27 | -webkit-transform: rotate(0deg); 28 | transform: rotate(0deg); 29 | } 30 | 100% { 31 | -webkit-transform: rotate(359deg); 32 | transform: rotate(359deg); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/font-awesome-4.7.0/scss/_animated.scss: -------------------------------------------------------------------------------- 1 | // Spinning Icons 2 | // -------------------------- 3 | 4 | .#{$fa-css-prefix}-spin { 5 | -webkit-animation: fa-spin 2s infinite linear; 6 | animation: fa-spin 2s infinite linear; 7 | } 8 | 9 | .#{$fa-css-prefix}-pulse { 10 | -webkit-animation: fa-spin 1s infinite steps(8); 11 | animation: fa-spin 1s infinite steps(8); 12 | } 13 | 14 | @-webkit-keyframes fa-spin { 15 | 0% { 16 | -webkit-transform: rotate(0deg); 17 | transform: rotate(0deg); 18 | } 19 | 100% { 20 | -webkit-transform: rotate(359deg); 21 | transform: rotate(359deg); 22 | } 23 | } 24 | 25 | @keyframes fa-spin { 26 | 0% { 27 | -webkit-transform: rotate(0deg); 28 | transform: rotate(0deg); 29 | } 30 | 100% { 31 | -webkit-transform: rotate(359deg); 32 | transform: rotate(359deg); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /files/healthz.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | use strict; 4 | use IO::Socket; 5 | 6 | my %machines = ( 7 | 'jenkins' => '172.27.11.10:8080', 8 | 'gitea' => '172.27.11.10:3000', 9 | 'docker' => '255.255.255.255:65535' 10 | ); 11 | 12 | my $status = 0; 13 | 14 | while (my ($machine, $address) = each %machines) { 15 | 16 | my ($host, $port) = split(/:/, $address); 17 | my $socket = IO::Socket::INET->new(PeerAddr => $host, 18 | PeerPort => $port, 19 | Proto => "tcp"); 20 | my $msg = "ok"; 21 | if (!$socket) { 22 | $status = 1; 23 | $msg = "erro"; 24 | } 25 | 26 | printf "%-10s em %-22s %s!\n", $machine, $address, $msg; 27 | eval { 28 | close($socket); 29 | } 30 | } 31 | 32 | exit $status; # diferente de zero, problemas 33 | -------------------------------------------------------------------------------- /exercicios/06-rundeck/README.md: -------------------------------------------------------------------------------- 1 | # Rundeck 2 | 3 | ## 01 - Adicionando um Node 4 | 5 | Crie uma nova máquina no `Vagrantfile` do curso chamada **minion** com **256 MB** de memória RAM e 1 CPU. Utilize a box do `debian/buster64` e configure a vm para utilizar o ip 172.27.11.250. 6 | 7 | Adicione esta máquina ao Rundeck. 8 | 9 | ## 02 - Garantindo Idempotência 10 | 11 | Crie um job no Rundeck que configure a máquina do exercício anterior instalando um servidor **nginx** e baixando o site https://github.com/4linux/4542-site. 12 | 13 | - O Rundeck deverá instalar o nginx apenas quando o pacote não estiver instalado; 14 | - O site só poderá ser baixado (ou clonado) somente quando o diretório `/var/www/html/` não possuir nenhuma versão do site 15 | 16 | ## 03 - Ignorando as Precauções 17 | 18 | Adicionar um parâmetro no Job anterior chamado **force** que poderá receber apenas o valor "yes" ou "no". 19 | 20 | Caso o job seja executado com o parâmetro **force=yes** tanto o pacote do nginx como o site devem ser atualizados. 21 | -------------------------------------------------------------------------------- /exercicios/02-vagrant/resposta/README.md: -------------------------------------------------------------------------------- 1 | # Resposta 2 | 3 | O `Vagrantfile` pode ser gerado com `vagrant init centos/8` e então removido todos os comentários desnecessários. 4 | 5 | O script de instalação precisava estar dentro do `Vagrantfile`, neste caso utilizamos o próprio exemplo do arquivo gerado alterando os comandos para os desejados. Além de instalar o apache, instalamos o git para fazer um **clone** do repositório no diretório padrão do apache, tomando o cuidado para remover qualquer arquivo ali presente antes da clonagem. 6 | 7 | ```ruby 8 | # -*- mode: ruby -*- 9 | # vi: set ft=ruby : 10 | 11 | Vagrant.configure("2") do |config| 12 | 13 | config.vm.box = "centos/8" 14 | config.vm.box_check_update = false 15 | 16 | config.vm.network "private_network", ip: "172.27.11.150" 17 | 18 | config.vm.provision "shell", inline: <<-SHELL 19 | dnf install -y httpd git 20 | cd /var/www/html 21 | rm -rf * 22 | git clone https://github.com/4linux/4542-site . 23 | systemctl start httpd 24 | systemctl enable httpd 25 | SHELL 26 | end 27 | ``` 28 | -------------------------------------------------------------------------------- /files/lighttpd/lighttpd.conf: -------------------------------------------------------------------------------- 1 | var.basedir = "/srv/www/" 2 | var.logdir = "/var/log/lighttpd" 3 | 4 | server.modules = ( 5 | "mod_access", 6 | "mod_compress", 7 | "mod_accesslog" 8 | ) 9 | 10 | include "mime-types.conf" 11 | 12 | server.username = "lighttpd" 13 | server.groupname = "lighttpd" 14 | server.document-root = var.basedir + "/htdocs" 15 | server.pid-file = "/run/lighttpd.pid" 16 | server.indexfiles = ("index.html") 17 | server.tag = "lighttpd" 18 | server.follow-symlink = "enable" 19 | server.event-handler = "linux-sysepoll" 20 | server.port = 80 21 | server.bind = "0.0.0.0" 22 | server.errorfile-prefix = var.basedir + "/handlers/" 23 | server.stat-cache-engine = "simple" 24 | accesslog.filename = "/dev/stderr" 25 | dir-listing.activate = "disable" 26 | url.access-deny = ("~", ".inc") 27 | compress.cache-dir = "/tmp/lighttpd-compressed" 28 | compress.filetype = ("text/plain", "text/css", "text/xml", "text/javascript") 29 | # vim: set ft=conf foldmethod=marker et : 30 | -------------------------------------------------------------------------------- /files/ansible/playbooks/files/lighttpd.conf: -------------------------------------------------------------------------------- 1 | var.basedir = "/srv/www/" 2 | var.logdir = "/var/log/lighttpd" 3 | 4 | server.modules = ( 5 | "mod_access", 6 | "mod_compress", 7 | "mod_accesslog", 8 | "mod_proxy" 9 | ) 10 | 11 | include "mime-types.conf" 12 | include "proxy.conf" 13 | 14 | server.username = "{{ user }}" 15 | server.groupname = "{{ group }}" 16 | server.document-root = var.basedir + "/html" 17 | server.pid-file = "/run/lighttpd.pid" 18 | server.indexfiles = ("index.html") 19 | server.tag = "lighttpd" 20 | server.follow-symlink = "enable" 21 | server.event-handler = "linux-sysepoll" 22 | server.port = 80 23 | server.bind = "0.0.0.0" 24 | server.stat-cache-engine = "simple" 25 | accesslog.filename = var.logdir + "/access.log" 26 | dir-listing.activate = "disable" 27 | url.access-deny = ("~", ".inc") 28 | compress.cache-dir = "/var/cache/lighttpd" 29 | compress.filetype = ("text/plain", "text/css", "text/xml", "text/javascript") 30 | 31 | # vim: set ft=conf foldmethod=marker et : 32 | -------------------------------------------------------------------------------- /files/ansible/playbooks/templates/lighttpd.conf: -------------------------------------------------------------------------------- 1 | var.basedir = "/srv/www/" 2 | var.logdir = "/var/log/lighttpd" 3 | 4 | server.modules = ( 5 | "mod_access", 6 | "mod_compress", 7 | "mod_accesslog", 8 | "mod_proxy" 9 | ) 10 | 11 | include "mime-types.conf" 12 | include "proxy.conf" 13 | 14 | server.username = "{{ user }}" 15 | server.groupname = "{{ group }}" 16 | server.document-root = var.basedir + "/html" 17 | server.pid-file = "/run/lighttpd.pid" 18 | server.indexfiles = ("index.html") 19 | server.tag = "lighttpd" 20 | server.follow-symlink = "enable" 21 | server.event-handler = "linux-sysepoll" 22 | server.port = 80 23 | server.bind = "0.0.0.0" 24 | server.stat-cache-engine = "simple" 25 | accesslog.filename = var.logdir + "/access.log" 26 | dir-listing.activate = "disable" 27 | url.access-deny = ("~", ".inc") 28 | compress.cache-dir = "/var/cache/lighttpd" 29 | compress.filetype = ("text/plain", "text/css", "text/xml", "text/javascript") 30 | 31 | # vim: set ft=conf foldmethod=marker et : 32 | -------------------------------------------------------------------------------- /files/role-lighttpd/lighttpd/templates/lighttpd.conf: -------------------------------------------------------------------------------- 1 | var.basedir = "/srv/www/" 2 | var.logdir = "/var/log/lighttpd" 3 | 4 | server.modules = ( 5 | "mod_access", 6 | "mod_compress", 7 | "mod_accesslog", 8 | "mod_proxy" 9 | ) 10 | 11 | include "mime-types.conf" 12 | include "proxy.conf" 13 | 14 | server.username = "{{ user }}" 15 | server.groupname = "{{ group }}" 16 | server.document-root = var.basedir + "/html" 17 | server.pid-file = "/run/lighttpd.pid" 18 | server.indexfiles = ("index.html") 19 | server.tag = "lighttpd" 20 | server.follow-symlink = "enable" 21 | server.event-handler = "linux-sysepoll" 22 | server.port = 80 23 | server.bind = "0.0.0.0" 24 | server.stat-cache-engine = "simple" 25 | accesslog.filename = var.logdir + "/access.log" 26 | dir-listing.activate = "disable" 27 | url.access-deny = ("~", ".inc") 28 | compress.cache-dir = "/var/cache/lighttpd" 29 | compress.filetype = ("text/plain", "text/css", "text/xml", "text/javascript") 30 | 31 | # vim: set ft=conf foldmethod=marker et : 32 | -------------------------------------------------------------------------------- /exercicios/05-ssh/resposta/README.md: -------------------------------------------------------------------------------- 1 | # Resposta 2 | 3 | Vamos criar o usuário na máquina balancer: 4 | 5 | ```bash 6 | vagrant ssh balancer 7 | sudo -i 8 | useradd -m -d /home/executor -s /bin/bash executor 9 | echo -e '4linux\n4linux\n' | passwd executor 10 | sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config 11 | systemctl restart sshd 12 | ``` 13 | 14 | Agora crie o script na máquina **automation**: 15 | 16 | ```bash 17 | cat > /tmp/script.sh <<'EOF' 18 | #!/bin/bash 19 | apt-cache search nginx 20 | systemctl status cron 21 | mkdir /tmp/site 22 | cd /tmp/site 23 | wget https://github.com/4linux/4542-site/archive/master.zip 24 | EOF 25 | ``` 26 | 27 | Execute o script utilizando um subshell da seguinte forma: 28 | 29 | ```bash 30 | ssh executor@172.27.11.20 "$(cat /tmp/script.sh)" 31 | ``` 32 | 33 | Outra forma de execução poderia ser a seguinte: 34 | 35 | ```bash 36 | cat /tmp/script.sh | ssh executor@172.27.11.20 bash 37 | ``` 38 | 39 | È possível guardar o conteúdo arquivo em uma variável e utilizar a variável: 40 | 41 | ```bash 42 | SCRIPT=$(cat /tmp/script.sh) 43 | ssh executor@172.27.11.20 "$SCRIPT" 44 | ``` 45 | -------------------------------------------------------------------------------- /provision/automation.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | apt-get --allow-releaseinfo-change update 4 | apt-get install -y vim ansible openjdk-11-jdk gnupg2 curl git sqlite3 ca-certificates 5 | 6 | # Jenkins 7 | wget -q -O - 'https://pkg.jenkins.io/debian-stable/jenkins.io.key' | apt-key add - 8 | echo 'deb [trusted=yes] https://pkg.jenkins.io/debian-stable binary/' > /etc/apt/sources.list.d/jenkins.list 9 | 10 | # Rundeck 11 | #wget -q -O - 'https://bintray.com/user/downloadSubjectPublicKey?username=bintray' | apt-key add - 12 | #echo 'deb https://rundeck.bintray.com/rundeck-deb /' > /etc/apt/sources.list.d/rundeck.list 13 | curl -s https://packagecloud.io/install/repositories/pagerduty/rundeck/script.deb.sh | os=any dist=any bash 14 | 15 | apt-get --allow-releaseinfo-change update 16 | apt-get install -y jenkins rundeck rundeck-cli 17 | 18 | # Rundeck 19 | sed -i s/admin:admin/devops:4linux/g /etc/rundeck/realm.properties 20 | sed -i s/localhost/172.27.11.10/g /etc/rundeck/framework.properties 21 | sed -i s/localhost/172.27.11.10/g /etc/rundeck/rundeck-config.properties 22 | 23 | systemctl enable jenkins rundeckd 24 | systemctl restart jenkins rundeckd 25 | 26 | bash /vagrant/provision/gitea.sh & 27 | bash /vagrant/provision/jenkins.sh & 28 | -------------------------------------------------------------------------------- /files/role-lighttpd/lighttpd/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Incluindo variáveis 3 | include_vars: '{{ ansible_distribution|lower }}.yml' 4 | - name: Incluindo tarefas 5 | include_tasks: '{{ ansible_distribution|lower }}.yml' 6 | - name: Garantindo Lighttpd 7 | package: 8 | name: lighttpd 9 | state: present 10 | - name: Garantindo lighttpd.conf 11 | template: 12 | src: lighttpd.conf 13 | dest: /etc/lighttpd 14 | - name: Garantindo mime-types.conf 15 | copy: 16 | src: mime-types.conf 17 | dest: /etc/lighttpd 18 | owner: root 19 | - name: Garantindo diretórios 20 | file: 21 | path: '{{ item }}' 22 | owner: '{{ user }}' 23 | group: '{{ group }}' 24 | state: directory 25 | loop: 26 | - /srv/www/html 27 | - /var/cache/lighttpd 28 | - /var/logs/lighttpd 29 | - name: Garantindo configurações de proxy 30 | blockinfile: 31 | path: /etc/lighttpd/proxy.conf 32 | create: yes 33 | block: | 34 | $SERVER["socket"] == ":8080" { 35 | proxy.server = ( "" => ( ( "host" => "192.168.10.10", "port" => "80" ))) 36 | } 37 | - name: Garantindo serviço do Lighttpd 38 | service: 39 | name: lighttpd 40 | state: started 41 | enabled: yes 42 | - name: Testando conexão com load balancer 43 | uri: 44 | url: http://172.27.11.20 45 | status_code: [200, 302, 304] 46 | delegate_to: localhost 47 | run_once: yes 48 | -------------------------------------------------------------------------------- /files/playbooks/lighttpd.yml: -------------------------------------------------------------------------------- 1 | - hosts: docker 2 | become: yes 3 | vars: 4 | user: lighttpd 5 | group: lighttpd 6 | tasks: 7 | - name: Verificando distribuição 8 | set_fact: 9 | user: www-data 10 | group: www-data 11 | when: ansible_distribution|lower == 'debian' 12 | - name: Garantindo o epel-release em CentOS 13 | package: 14 | name: epel-release 15 | state: present 16 | when: ansible_distribution|lower == 'centos' 17 | - name: Garantindo Lighttpd 18 | package: 19 | name: lighttpd 20 | state: present 21 | - name: Garantindo configurações 22 | template: 23 | src: '{{ item }}' 24 | dest: /etc/lighttpd 25 | owner: root 26 | loop: 27 | - /root/playbooks/files/lighttpd.conf 28 | - /root/playbooks/files/mime-types.conf 29 | - name: Garantindo diretórios 30 | file: 31 | path: '{{ item }}' 32 | owner: '{{ user }}' 33 | group: '{{ group }}' 34 | state: directory 35 | loop: 36 | - /srv/www/html 37 | - /var/cache/lighttpd 38 | - /var/logs/lighttpd 39 | - name: Garantindo serviço do Lighttpd 40 | service: 41 | name: lighttpd 42 | state: started 43 | enabled: yes 44 | - name: Testando conexão com load balancer 45 | uri: 46 | url: http://172.27.11.20 47 | status_code: [200, 302, 304] 48 | delegate_to: localhost 49 | run_once: yes 50 | -------------------------------------------------------------------------------- /exercicios/04-gitea/README.md: -------------------------------------------------------------------------------- 1 | # Gitea 2 | 3 | ## 01 - Trazendo um repositório do Github para o Gitea 4 | 5 | Crie um usuário chamado **exercicio** dentro do gitea e um repositório chamado **site** dentro deste usuário. 6 | 7 | Clone o repositório https://github.com/4linux/4542-site na máquina **automation** e envio-o via HTTP para o Gitea com o usuário **exercicio** sem remover o **origin**, chame o repositório remoto de **gitea-http**. 8 | 9 | ## 02 - Utilizando uma chave SSH de forma diferente 10 | 11 | Esta parte exigirá um pouco da criatividade do aluno, não se preocupe se não conseguir resolver este exercício, estes passos não foram ensinados no curso e está aqui exatamente como um desafio. 12 | 13 | Crie uma nova chave SSH com o seguinte comando: 14 | 15 | ```bash 16 | mkdir /root/git-ex02 17 | ssh-keygen -m PEM -N '' -f /root/git-ex02/ex02 18 | ``` 19 | Cadastre a chave no gitea e adicione o repositório remoto através de **ssh** `git@172.27.11.10:exercicio/site.git` no repositório criado no exercício **01**, chame-o de **gitea-ssh**. 20 | 21 | Ao invés de utilizar o comando `git config core.sshCommand`, faça da forma mais antiga, modifique o arquivo `/root/.ssh/config` para fazer com que o comando do git para o repositório do Gitea utilize a chave correta. 22 | 23 | > **Observação:** O ideal é criar um apelido para o repositório no arquivo `~/.ssh/config` e utilizar este apelido no comando `git remote add ...`. 24 | -------------------------------------------------------------------------------- /files/playbooks/database-cache.yml: -------------------------------------------------------------------------------- 1 | - hosts: database 2 | become: yes 3 | tasks: 4 | - name: Garantindo MariaDB e Memcached 5 | package: 6 | name: ['mariadb', 'memcached'] 7 | state: present 8 | - name: Garantindo MariaDB e Memcached na interface privada 9 | lineinfile: 10 | path: '{{ item.path }}' 11 | line: '{{ item.line }}' 12 | regex: '{{ item.regex }}' 13 | loop: 14 | - path: /etc/sysconfig/memcached 15 | line: OPTIONS="-l 172.27.11.30" 16 | regex: OPTIONS="-l 17 | - path: /etc/my.cnf.d/mariadb-server.cnf 18 | line: bind-address=172.27.11.30 19 | regex: '#?bind-address\s*=\s*[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}' 20 | - name: Garantindo serviço do MariaDB e Memcached 21 | service: 22 | name: '{{ item }}' 23 | state: started 24 | enabled: yes 25 | loop: 26 | - mariadb 27 | - memcached 28 | - name: Garantindo base de dados da Aplicação 29 | community.mysql.mysql_db: 30 | name: infraagil 31 | login_unix_socket: /var/lib/mysql/mysql.sock 32 | register: database 33 | - name: Garantindo dados iniciais 34 | community.mysql.mysql_db: 35 | name: infraagil 36 | login_unix_socket: /var/lib/mysql/mysql.sock 37 | state: import 38 | target: /tmp/dump.sql 39 | when: database.changed 40 | - name: Garantindo usuário da Aplicação 41 | community.mysql.mysql_user: 42 | name: devops 43 | password: 4linux 44 | priv: infraagil.*:ALL 45 | -------------------------------------------------------------------------------- /files/role-lighttpd/lighttpd/README.md: -------------------------------------------------------------------------------- 1 | Role Name 2 | ========= 3 | 4 | A brief description of the role goes here. 5 | 6 | Requirements 7 | ------------ 8 | 9 | Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. 10 | 11 | Role Variables 12 | -------------- 13 | 14 | A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. 15 | 16 | Dependencies 17 | ------------ 18 | 19 | A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. 20 | 21 | Example Playbook 22 | ---------------- 23 | 24 | Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: 25 | 26 | - hosts: servers 27 | roles: 28 | - { role: username.rolename, x: 42 } 29 | 30 | License 31 | ------- 32 | 33 | BSD 34 | 35 | Author Information 36 | ------------------ 37 | 38 | An optional section for the role authors to include contact information, or a website (HTML is not allowed). 39 | -------------------------------------------------------------------------------- /files/php/vendor/countdowntime/countdowntime.js: -------------------------------------------------------------------------------- 1 | (function ($) { 2 | "use strict"; 3 | 4 | function getTimeRemaining(endtime) { 5 | var t = Date.parse(endtime) - Date.parse(new Date()); 6 | var seconds = Math.floor((t / 1000) % 60); 7 | var minutes = Math.floor((t / 1000 / 60) % 60); 8 | var hours = Math.floor((t / (1000 * 60 * 60)) % 24); 9 | var days = Math.floor(t / (1000 * 60 * 60 * 24)); 10 | return { 11 | 'total': t, 12 | 'days': days, 13 | 'hours': hours, 14 | 'minutes': minutes, 15 | 'seconds': seconds 16 | }; 17 | } 18 | 19 | function initializeClock(id, endtime) { 20 | var daysSpan = $('.days'); 21 | var hoursSpan = $('.hours'); 22 | var minutesSpan = $('.minutes'); 23 | var secondsSpan = $('.seconds'); 24 | 25 | function updateClock() { 26 | var t = getTimeRemaining(endtime); 27 | 28 | daysSpan.html(t.days); 29 | hoursSpan.html(('0' + t.hours).slice(-2)); 30 | minutesSpan.html(('0' + t.minutes).slice(-2)); 31 | secondsSpan.html(('0' + t.seconds).slice(-2)) 32 | 33 | if (t.total <= 0) { 34 | clearInterval(timeinterval); 35 | } 36 | } 37 | 38 | updateClock(); 39 | var timeinterval = setInterval(updateClock, 1000); 40 | } 41 | 42 | var deadline = new Date(Date.parse(new Date()) + 25 * 24 * 60 * 60 * 1000 + 13 * 60 * 60 * 1000); 43 | initializeClock('clockdiv', deadline); 44 | 45 | })(jQuery); -------------------------------------------------------------------------------- /files/jenkins/4542-php/vendor/countdowntime/countdowntime.js: -------------------------------------------------------------------------------- 1 | (function ($) { 2 | "use strict"; 3 | 4 | function getTimeRemaining(endtime) { 5 | var t = Date.parse(endtime) - Date.parse(new Date()); 6 | var seconds = Math.floor((t / 1000) % 60); 7 | var minutes = Math.floor((t / 1000 / 60) % 60); 8 | var hours = Math.floor((t / (1000 * 60 * 60)) % 24); 9 | var days = Math.floor(t / (1000 * 60 * 60 * 24)); 10 | return { 11 | 'total': t, 12 | 'days': days, 13 | 'hours': hours, 14 | 'minutes': minutes, 15 | 'seconds': seconds 16 | }; 17 | } 18 | 19 | function initializeClock(id, endtime) { 20 | var daysSpan = $('.days'); 21 | var hoursSpan = $('.hours'); 22 | var minutesSpan = $('.minutes'); 23 | var secondsSpan = $('.seconds'); 24 | 25 | function updateClock() { 26 | var t = getTimeRemaining(endtime); 27 | 28 | daysSpan.html(t.days); 29 | hoursSpan.html(('0' + t.hours).slice(-2)); 30 | minutesSpan.html(('0' + t.minutes).slice(-2)); 31 | secondsSpan.html(('0' + t.seconds).slice(-2)) 32 | 33 | if (t.total <= 0) { 34 | clearInterval(timeinterval); 35 | } 36 | } 37 | 38 | updateClock(); 39 | var timeinterval = setInterval(updateClock, 1000); 40 | } 41 | 42 | var deadline = new Date(Date.parse(new Date()) + 25 * 24 * 60 * 60 * 1000 + 13 * 60 * 60 * 1000); 43 | initializeClock('clockdiv', deadline); 44 | 45 | })(jQuery); -------------------------------------------------------------------------------- /provision/jenkins.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function _curl { 4 | curl -vsL --cookie cookie.txt --cookie-jar cookie.txt "$@" 5 | sleep 5 6 | } 7 | 8 | curl -sL localhost:8080 > /dev/null 9 | while [ $? != 0 ]; do 10 | sleep 5 11 | curl -sL localhost:8080 > /dev/null 12 | done 13 | 14 | while [ "$(curl -sL localhost:8080 | grep 'Please wait')" != "" ]; do 15 | sleep 5 16 | done 17 | 18 | if [ ! -f /var/lib/jenkins/secrets/initialAdminPassword ]; then 19 | exit 0 20 | fi 21 | 22 | TOKEN=$(cat /var/lib/jenkins/secrets/initialAdminPassword) 23 | 24 | _curl localhost:8080/j_acegi_security_check -d 'from=/&j_username=admin&j_password='$TOKEN > /dev/null 25 | 26 | CRUMB=$(_curl localhost:8080/crumbIssuer/api/json -u admin:$TOKEN | grep -Eo '\w{64}') 27 | 28 | BODY='{"dynamicLoad":true,"plugins":["cloudbees-folder","antisamy-markup-formatter","build-timeout","credentials-binding","timestamper","ws-cleanup","workflow-aggregator","github-branch-source","pipeline-github-lib","pipeline-stage-view","git","matrix-auth"]}' 29 | _curl localhost:8080/pluginManager/installPlugins -H 'Content-Type: application/json' -H "Jenkins-Crumb: $CRUMB" -d "$BODY" > /dev/null 30 | 31 | BODY='username=devops&password1=4linux&password2=4linux&fullname=devops@example.com' 32 | _curl localhost:8080/setupWizard/createAdminUser -H "Jenkins-Crumb: $CRUMB" -d "$BODY" > /dev/null 33 | 34 | CRUMB=$(_curl localhost:8080/crumbIssuer/api/json -u devops:4linux | grep -Eo '\w{64}') 35 | 36 | BODY='rootUrl=http://172.27.11.10:8080/core:apply=&Submit=Save' 37 | _curl localhost:8080/setupWizard/configureInstance -H "Jenkins-Crumb: $CRUMB" -d "$BODY" > /dev/null 38 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | vms = { 5 | 'automation' => {'memory' => '2048', 'cpus' => 2, 'ip' => '10', 'box' => 'debian/bullseye64', 'provision' => 'automation.sh'}, 6 | 'balancer' => {'memory' => '256', 'cpus' => 1, 'ip' => '20', 'box' => 'debian/bullseye64','provision' => 'balancer.sh'}, 7 | 'database' => {'memory' => '512', 'cpus' => 1, 'ip' => '30', 'box' => 'devopsbox/centos-8.5', 'provision' => 'database.sh'}, 8 | 'docker1' => {'memory' => '512', 'cpus' => 1, 'ip' => '100', 'box' => 'debian/bullseye64', 'provision' => 'docker.sh'}, 9 | 'docker2' => {'memory' => '512', 'cpus' => 1, 'ip' => '200', 'box' => 'devopsbox/centos-8.5', 'provision' => 'docker.sh'} 10 | } 11 | 12 | Vagrant.configure('2') do |config| 13 | 14 | config.vm.box_check_update = false 15 | 16 | vms.each do |name, conf| 17 | config.vm.define "#{name}" do |k| 18 | k.vm.box = "#{conf['box']}" 19 | k.vm.hostname = "#{name}.example.com" 20 | k.vm.network 'private_network', ip: "172.27.11.#{conf['ip']}" 21 | k.vm.provider 'virtualbox' do |vb| 22 | vb.customize ["modifyvm", :id, "--groups", "/InfraAgil"] 23 | vb.memory = conf['memory'] 24 | vb.cpus = conf['cpus'] 25 | end 26 | k.vm.provider 'libvirt' do |lv| 27 | lv.memory = conf['memory'] 28 | lv.cpus = conf['cpus'] 29 | lv.cputopology :sockets => 1, :cores => conf['cpus'], :threads => '1' 30 | end 31 | k.vm.provision 'shell', path: "provision/#{conf['provision']}", args: "#{conf['ip']}" 32 | end 33 | end 34 | 35 | config.vm.provision 'shell', path: 'provision/provision.sh' 36 | end 37 | -------------------------------------------------------------------------------- /files/ansible/playbooks/database-cache.yml: -------------------------------------------------------------------------------- 1 | - hosts: database 2 | become: yes 3 | tasks: 4 | - name: Garantindo MariaDB e Memcached 5 | package: 6 | name: ['mariadb', 'memcached'] 7 | state: present 8 | - name: Garantindo MariaDB e Memcached na interface privada 9 | lineinfile: 10 | path: '{{ item.path }}' 11 | line: '{{ item.line }}' 12 | regex: '{{ item.regex }}' 13 | loop: 14 | - path: /etc/sysconfig/memcached 15 | line: OPTIONS="-l 0.0.0.0" 16 | regex: OPTIONS="-l 17 | - path: /etc/my.cnf.d/mariadb-server.cnf 18 | line: bind-address=172.27.11.30 19 | regex: '#?bind-address\s*=\s*[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}' 20 | - name: Garantindo serviço do MariaDB e Memcached 21 | service: 22 | name: '{{ item }}' 23 | state: started 24 | enabled: yes 25 | loop: 26 | - mariadb 27 | - memcached 28 | - name: Garantindo dependência 29 | pip: 30 | name: PyMySQL 31 | - name: Enviando dump da base 32 | copy: 33 | src: dump.sql 34 | dest: /tmp/dump.sql 35 | - name: Garantindo base de dados da Aplicação 36 | community.mysql.mysql_db: 37 | name: infraagil 38 | login_unix_socket: /var/lib/mysql/mysql.sock 39 | register: database 40 | - name: Garantindo dados iniciais 41 | community.mysql.mysql_db: 42 | name: infraagil 43 | login_unix_socket: /var/lib/mysql/mysql.sock 44 | state: import 45 | target: /tmp/dump.sql 46 | when: database.changed 47 | - name: Garantindo usuário da Aplicação 48 | community.mysql.mysql_user: 49 | name: devops 50 | password: 4linux 51 | priv: infraagil.*:ALL 52 | host: '%' 53 | login_unix_socket: /var/lib/mysql/mysql.sock 54 | -------------------------------------------------------------------------------- /files/id_rsa: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEpQIBAAKCAQEAqzIe6i0tHicww5TWy5dbSdJNYCK9so/JkfGqgQPBkSXS7Kw9 3 | f5BdJwRqNTdVpYsyJ68vAkWkQ1andLQk7L6L/gavQn6PJuTui8UZdfD1qy4AVj1Q 4 | 80doly8Xxhwe1Ow695rpz/AdFa1FTIjnS9eyNBurQ3Vjl8xbydyd9WgKifrvUXbt 5 | LaH4hrm9U1k27ClGUpmfzDaYM8Oz8aV1yg8BQKYAkVcJB7EHDYvzLqNyoMbf3qXq 6 | 9X9bLX7tO+N19rtiVsew+lJoyjbrCPzMMCLT/uWVKDZj7YN4eLi/lBPp18GeXCaZ 7 | IE029JSQJ7xsL/5lIpGoGIN6QiCnMGy8dTjbXwIDAQABAoIBAAfRfSnysDnNTmPQ 8 | O1MG8YtYiGIYlBNAj9MTd1b3BfMMCCr43sIhpK9wey08/rNVvQ+k53+yEINmxLUG 9 | uRz6wsfyJDTkNMNw9xf5A2WogH+11RwbJsRFgZhN9Ub958aPl03RjFYLwDhKNnz9 10 | T5reGexZSyQEi2zWT2bTpX8cpkaQ1Q//BBmsBQ3ER5VMmRhBCFcEpBlkHtUyQRNh 11 | n20nUcz8H34eoh5SO0APQBYzZlgkvXjlmvXcMbZRzD0QTUF/GBHaJe2sEw2I1yyz 12 | zpKQUFYeWSyHsfMGSK2Uuzk5gj40WJcPkjOwytmzCPjsX5PuJ58vwbBLqNjDQZSE 13 | ZUaDs7ECgYEA3a13FLuIizOJY+Kt1AT8mp2pKUaPSJKKm0ftm5tD23P2/np6yndN 14 | ts1q4I0IXG2PCgU/RkObRD6vVEJQviQFuWKeyB+D1UUHct1QvHu9K9X4X+q/dBvT 15 | TojkVZ5XSdCAfePGJkCa8+emvA0/IuI+uETXXjRRIY7a+aTKn+dreUkCgYEAxbO7 16 | EZu+W6NN/9ZwKfNlEleJ/AlFGaGkrGjTEXTH/KHWka2k4l0JzBPHw49uZFSnfRjc 17 | F5x+mT221LBPjCIN4aqrHATNqK4qMPX1grb5CeMSu124wZHcUwEShwt8Lcfo39uq 18 | qze1ztrRCDJS0bPl3HqQC8pAGujOljbfSQnpl2cCgYEAuhEc7+ENFlJW0ul0oI7i 19 | /GCzmXqpT+/4uafhMAheJ7iprCZgJMuJBpRbTknyp6oqMu3+k1qx29GF1wKmxUJ1 20 | L4sw3adeP8fmHarYVqzCNyYtiU0AEFQ+xB+xEJCMkd+ZypFCQ99ccLeTQysXQI+I 21 | t6DI6UCejL1c3chNb3SOyEkCgYEAixg5zFi0JEsQDKi1f35kJPR7+1wWRsNIVZjm 22 | r0hnj+HZUeNGt5BX3UIpcPiP5Xz93fDIoMAU/gHCiX+GaARpmdT20B69BymKO6pA 23 | 0nejXYZqXnLBE0dpKOj/PQ4ijx8wQ5eMSyxF+MRQ/yBQzoNwfJ+qivEACy6yclMm 24 | 439a3o8CgYEAwbU3C0CR7AJy12M0je5rqzR/VqNPo0T/CfGV+T+INdQc8TfMPG2E 25 | TDQs4AoHV6ibmjvurJTrT0GA0WMyupQu3NawllO++64gX09OUuZ9o05S+66SFqQA 26 | gnuhaTDsPvqGiueLK0ZCuZKsUR/t5O+CXKS/oip/e66Op5Zk2yzbA24= 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /exercicios/07-docker/respostas/validador-01.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | docker container inspect postgres > /dev/null 4 | if [ "$?" -ne 0 ]; then 5 | echo -e '\e[31mContêiner chamado "postgres" não encontrado\e[0m' 6 | exit 1 7 | else 8 | echo -e '\e[32mEncontramos o contêiner!\e[0m' 9 | fi 10 | docker exec -t postgres bash -c 'env' | grep POSTGRES_ | sed 's/\r//g' > /tmp/env 11 | . /tmp/env 12 | 13 | for X in 'DB|devops' 'USER|devops' 'PASSWORD|4linux'; do 14 | SUFIX=$(echo $X | cut -d '|' -f1) 15 | EXPECTED=$(echo $X | cut -d '|' -f2) 16 | eval "CURRENT=\$POSTGRES_$SUFIX" 17 | if [ "$CURRENT" != "$EXPECTED" ]; then 18 | echo -e "\e[31mVariável POSTGRES_$SUFIX com valor errado: '$CURRENT' deveria ser '$EXPECTED'\e[0m" 19 | exit 2 20 | else 21 | echo -e "\e[32mVariável POSTGRES_$SUFIX com valor correto\e[0m" 22 | fi 23 | done 24 | 25 | docker exec postgres psql -U devops -w devops -c 'CREATE TABLE devops (id SERIAL, nome VARCHAR(255));' &> /dev/null 26 | docker exec postgres psql -U devops -w devops -c "INSERT INTO devops (nome) VALUES ('Infra Ágil') ON CONFLICT DO NOTHING" > /dev/null 27 | echo 'Removendo contêiner para testar persistência...' 28 | docker rm -f postgres > /dev/null 29 | docker run --name postgres -e POSTGRES_PASSWORD=4linux -e POSTGRES_USER=devops -e POSTGRES_DB=devops -v pg_data:/var/lib/postgresql/data -d postgres > /dev/null 30 | echo 'Esperando banco iniciar...' 31 | sleep 10 32 | docker exec postgres psql -U devops -w devops -c "SELECT * FROM devops WHERE nome = 'Infra Ágil' LIMIT 1" -t | grep 'Infra Ágil' 33 | if [ "$?" -ne 0 ]; then 34 | echo -e '\e[31mNão foi possível acessar o banco de dados, verifique as variáveis e o nome do contêiner\e[0m' 35 | exit 3 36 | else 37 | echo -e '\e[32mTudo certo!\e[0m' 38 | fi 39 | 40 | -------------------------------------------------------------------------------- /files/ansible/playbooks/lighttpd.yml: -------------------------------------------------------------------------------- 1 | - hosts: docker 2 | become: yes 3 | vars: 4 | user: lighttpd 5 | group: lighttpd 6 | tasks: 7 | - name: Verificando distribuição 8 | set_fact: 9 | user: www-data 10 | group: www-data 11 | when: ansible_distribution|lower == 'debian' 12 | - name: Garantindo o epel-release em CentOS 13 | package: 14 | name: epel-release 15 | state: present 16 | when: ansible_distribution|lower == 'centos' 17 | - name: Desabilitando o SELinux em CentOS 18 | selinux: 19 | state: disabled 20 | when: ansible_distribution|lower == 'centos' 21 | - name: Garantindo Lighttpd 22 | package: 23 | name: lighttpd 24 | state: present 25 | - name: Garantindo configurações 26 | template: 27 | src: '{{ item }}' 28 | dest: /etc/lighttpd 29 | owner: root 30 | loop: 31 | - lighttpd.conf 32 | - mime-types.conf 33 | - name: Garantindo diretórios 34 | file: 35 | path: '{{ item }}' 36 | owner: '{{ user }}' 37 | group: '{{ group }}' 38 | state: directory 39 | loop: 40 | - /srv/www/html 41 | - /var/cache/lighttpd 42 | - /var/logs/lighttpd 43 | - name: Garantindo configurações de proxy 44 | blockinfile: 45 | path: /etc/lighttpd/proxy.conf 46 | create: yes 47 | block: | 48 | $SERVER["socket"] == ":8080" { 49 | proxy.server = ( "" => ( ( "host" => "192.168.10.10", "port" => "80" ))) 50 | } 51 | - name: Garantindo serviço do Lighttpd 52 | service: 53 | name: lighttpd 54 | state: restarted 55 | enabled: yes 56 | - name: Testando conexão com load balancer 57 | uri: 58 | url: http://172.27.11.20 59 | status_code: [200, 302, 304] 60 | delegate_to: localhost 61 | run_once: yes 62 | -------------------------------------------------------------------------------- /files/role-lighttpd/lighttpd/meta/main.yml: -------------------------------------------------------------------------------- 1 | galaxy_info: 2 | author: your name 3 | description: your role description 4 | company: your company (optional) 5 | 6 | # If the issue tracker for your role is not on github, uncomment the 7 | # next line and provide a value 8 | # issue_tracker_url: http://example.com/issue/tracker 9 | 10 | # Choose a valid license ID from https://spdx.org - some suggested licenses: 11 | # - BSD-3-Clause (default) 12 | # - MIT 13 | # - GPL-2.0-or-later 14 | # - GPL-3.0-only 15 | # - Apache-2.0 16 | # - CC-BY-4.0 17 | license: license (GPL-2.0-or-later, MIT, etc) 18 | 19 | min_ansible_version: 2.9 20 | 21 | # If this a Container Enabled role, provide the minimum Ansible Container version. 22 | # min_ansible_container_version: 23 | 24 | # 25 | # Provide a list of supported platforms, and for each platform a list of versions. 26 | # If you don't wish to enumerate all versions for a particular platform, use 'all'. 27 | # To view available platforms and versions (or releases), visit: 28 | # https://galaxy.ansible.com/api/v1/platforms/ 29 | # 30 | # platforms: 31 | # - name: Fedora 32 | # versions: 33 | # - all 34 | # - 25 35 | # - name: SomePlatform 36 | # versions: 37 | # - all 38 | # - 1.0 39 | # - 7 40 | # - 99.99 41 | 42 | galaxy_tags: [] 43 | # List tags for your role here, one per line. A tag is a keyword that describes 44 | # and categorizes the role. Users find roles by searching for tags. Be sure to 45 | # remove the '[]' above, if you add tags to this list. 46 | # 47 | # NOTE: A tag is limited to a single word comprised of alphanumeric characters. 48 | # Maximum 20 tags per role. 49 | 50 | dependencies: [] 51 | # List your role dependencies here, one per line. Be sure to remove the '[]' above, 52 | # if you add dependencies to this list. 53 | -------------------------------------------------------------------------------- /files/php/fonts/font-awesome-4.7.0/less/mixins.less: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------- 3 | 4 | .fa-icon() { 5 | display: inline-block; 6 | font: normal normal normal @fa-font-size-base/@fa-line-height-base FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | 14 | .fa-icon-rotate(@degrees, @rotation) { 15 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=@{rotation})"; 16 | -webkit-transform: rotate(@degrees); 17 | -ms-transform: rotate(@degrees); 18 | transform: rotate(@degrees); 19 | } 20 | 21 | .fa-icon-flip(@horiz, @vert, @rotation) { 22 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=@{rotation}, mirror=1)"; 23 | -webkit-transform: scale(@horiz, @vert); 24 | -ms-transform: scale(@horiz, @vert); 25 | transform: scale(@horiz, @vert); 26 | } 27 | 28 | 29 | // Only display content to screen readers. A la Bootstrap 4. 30 | // 31 | // See: http://a11yproject.com/posts/how-to-hide-content/ 32 | 33 | .sr-only() { 34 | position: absolute; 35 | width: 1px; 36 | height: 1px; 37 | padding: 0; 38 | margin: -1px; 39 | overflow: hidden; 40 | clip: rect(0,0,0,0); 41 | border: 0; 42 | } 43 | 44 | // Use in conjunction with .sr-only to only display content when it's focused. 45 | // 46 | // Useful for "Skip to main content" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1 47 | // 48 | // Credit: HTML5 Boilerplate 49 | 50 | .sr-only-focusable() { 51 | &:active, 52 | &:focus { 53 | position: static; 54 | width: auto; 55 | height: auto; 56 | margin: 0; 57 | overflow: visible; 58 | clip: auto; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/font-awesome-4.7.0/less/mixins.less: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------- 3 | 4 | .fa-icon() { 5 | display: inline-block; 6 | font: normal normal normal @fa-font-size-base/@fa-line-height-base FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | 14 | .fa-icon-rotate(@degrees, @rotation) { 15 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=@{rotation})"; 16 | -webkit-transform: rotate(@degrees); 17 | -ms-transform: rotate(@degrees); 18 | transform: rotate(@degrees); 19 | } 20 | 21 | .fa-icon-flip(@horiz, @vert, @rotation) { 22 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=@{rotation}, mirror=1)"; 23 | -webkit-transform: scale(@horiz, @vert); 24 | -ms-transform: scale(@horiz, @vert); 25 | transform: scale(@horiz, @vert); 26 | } 27 | 28 | 29 | // Only display content to screen readers. A la Bootstrap 4. 30 | // 31 | // See: http://a11yproject.com/posts/how-to-hide-content/ 32 | 33 | .sr-only() { 34 | position: absolute; 35 | width: 1px; 36 | height: 1px; 37 | padding: 0; 38 | margin: -1px; 39 | overflow: hidden; 40 | clip: rect(0,0,0,0); 41 | border: 0; 42 | } 43 | 44 | // Use in conjunction with .sr-only to only display content when it's focused. 45 | // 46 | // Useful for "Skip to main content" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1 47 | // 48 | // Credit: HTML5 Boilerplate 49 | 50 | .sr-only-focusable() { 51 | &:active, 52 | &:focus { 53 | position: static; 54 | width: auto; 55 | height: auto; 56 | margin: 0; 57 | overflow: visible; 58 | clip: auto; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /files/php/fonts/font-awesome-4.7.0/scss/_mixins.scss: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------- 3 | 4 | @mixin fa-icon() { 5 | display: inline-block; 6 | font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | 14 | @mixin fa-icon-rotate($degrees, $rotation) { 15 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation})"; 16 | -webkit-transform: rotate($degrees); 17 | -ms-transform: rotate($degrees); 18 | transform: rotate($degrees); 19 | } 20 | 21 | @mixin fa-icon-flip($horiz, $vert, $rotation) { 22 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation}, mirror=1)"; 23 | -webkit-transform: scale($horiz, $vert); 24 | -ms-transform: scale($horiz, $vert); 25 | transform: scale($horiz, $vert); 26 | } 27 | 28 | 29 | // Only display content to screen readers. A la Bootstrap 4. 30 | // 31 | // See: http://a11yproject.com/posts/how-to-hide-content/ 32 | 33 | @mixin sr-only { 34 | position: absolute; 35 | width: 1px; 36 | height: 1px; 37 | padding: 0; 38 | margin: -1px; 39 | overflow: hidden; 40 | clip: rect(0,0,0,0); 41 | border: 0; 42 | } 43 | 44 | // Use in conjunction with .sr-only to only display content when it's focused. 45 | // 46 | // Useful for "Skip to main content" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1 47 | // 48 | // Credit: HTML5 Boilerplate 49 | 50 | @mixin sr-only-focusable { 51 | &:active, 52 | &:focus { 53 | position: static; 54 | width: auto; 55 | height: auto; 56 | margin: 0; 57 | overflow: visible; 58 | clip: auto; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /files/ansible/playbooks/docker.yml: -------------------------------------------------------------------------------- 1 | - hosts: docker 2 | become: yes 3 | tasks: 4 | - name: Removendo pacotes antigos 5 | package: 6 | name: ['docker', 'docker-engine', 'docker.io', 'containerd', 'runc'] 7 | state: absent 8 | - name: Bloco do Debian 9 | block: 10 | - name: Garantindo pré-dependências 11 | package: 12 | name: ['apt-transport-https', 'ca-certificates', 'gnupg-agent', 'software-properties-common'] 13 | state: present 14 | - name: Garantindo chave do repositório 15 | apt_key: 16 | url: https://download.docker.com/linux/debian/gpg 17 | state: present 18 | - name: Garantindo repositório 19 | apt_repository: 20 | repo: "deb [arch=amd64] https://download.docker.com/linux/debian {{ ansible_lsb.codename }} stable" 21 | state: present 22 | filename: docker-ce 23 | when: ansible_distribution|lower == 'debian' 24 | - name: Bloco do CentOS 25 | block: 26 | - name: Garantindo chave do repositório 27 | rpm_key: 28 | state: present 29 | key: https://download.docker.com/linux/centos/gpg 30 | - name: Garantindo repositório 31 | yum_repository: 32 | name: docker-ce 33 | baseurl: https://download.docker.com/linux/centos/$releasever/$basearch/stable 34 | description: Docker CE Stable 35 | file: docker-ce 36 | when: ansible_distribution|lower == 'centos' 37 | - name: Garantindo pacote docker-ce 38 | package: 39 | name: docker-ce 40 | state: present 41 | - name: Garantindo execução do daemon 42 | service: 43 | name: docker 44 | enabled: yes 45 | state: started 46 | - name: Garantindo binário docker-compose 47 | get_url: 48 | url: "https://github.com/docker/compose/releases/download/1.28.5/docker-compose-{{ ansible_system }}-{{ ansible_architecture }}" 49 | dest: /usr/bin/docker-compose 50 | mode: '0755' 51 | -------------------------------------------------------------------------------- /files/gitea.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Gitea (Git with a cup of tea) 3 | After=syslog.target 4 | After=network.target 5 | ### 6 | # Don't forget to add the database service requirements 7 | ### 8 | # 9 | #Requires=mysql.service 10 | #Requires=mariadb.service 11 | #Requires=postgresql.service 12 | #Requires=memcached.service 13 | #Requires=redis.service 14 | # 15 | ### 16 | # If using socket activation for main http/s 17 | ### 18 | # 19 | #After=gitea.main.socket 20 | #Requires=gitea.main.socket 21 | # 22 | ### 23 | # (You can also provide gitea an http fallback and/or ssh socket too) 24 | # 25 | # An example of /etc/systemd/system/gitea.main.socket 26 | ### 27 | ## 28 | ## [Unit] 29 | ## Description=Gitea Web Socket 30 | ## PartOf=gitea.service 31 | ## 32 | ## [Socket] 33 | ## Service=gitea.service 34 | ## ListenStream= 35 | ## NoDelay=true 36 | ## 37 | ## [Install] 38 | ## WantedBy=sockets.target 39 | ## 40 | ### 41 | 42 | [Service] 43 | # Modify these two values and uncomment them if you have 44 | # repos with lots of files and get an HTTP error 500 because 45 | # of that 46 | ### 47 | #LimitMEMLOCK=infinity 48 | #LimitNOFILE=65535 49 | RestartSec=2s 50 | Type=simple 51 | User=git 52 | Group=git 53 | WorkingDirectory=/var/lib/gitea/ 54 | # If using Unix socket: tells systemd to create the /run/gitea folder, which will contain the gitea.sock file 55 | # (manually creating /run/gitea doesn't work, because it would not persist across reboots) 56 | #RuntimeDirectory=gitea 57 | ExecStart=/usr/local/bin/gitea web --config /etc/gitea/app.ini 58 | Restart=always 59 | Environment=USER=git HOME=/home/git GITEA_WORK_DIR=/var/lib/gitea 60 | # If you want to bind Gitea to a port below 1024, uncomment 61 | # the two values below, or use socket activation to pass Gitea its ports as above 62 | ### 63 | #CapabilityBoundingSet=CAP_NET_BIND_SERVICE 64 | #AmbientCapabilities=CAP_NET_BIND_SERVICE 65 | ### 66 | 67 | [Install] 68 | WantedBy=multi-user.target 69 | -------------------------------------------------------------------------------- /files/jenkins/4542-php/fonts/font-awesome-4.7.0/scss/_mixins.scss: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------- 3 | 4 | @mixin fa-icon() { 5 | display: inline-block; 6 | font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | 14 | @mixin fa-icon-rotate($degrees, $rotation) { 15 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation})"; 16 | -webkit-transform: rotate($degrees); 17 | -ms-transform: rotate($degrees); 18 | transform: rotate($degrees); 19 | } 20 | 21 | @mixin fa-icon-flip($horiz, $vert, $rotation) { 22 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation}, mirror=1)"; 23 | -webkit-transform: scale($horiz, $vert); 24 | -ms-transform: scale($horiz, $vert); 25 | transform: scale($horiz, $vert); 26 | } 27 | 28 | 29 | // Only display content to screen readers. A la Bootstrap 4. 30 | // 31 | // See: http://a11yproject.com/posts/how-to-hide-content/ 32 | 33 | @mixin sr-only { 34 | position: absolute; 35 | width: 1px; 36 | height: 1px; 37 | padding: 0; 38 | margin: -1px; 39 | overflow: hidden; 40 | clip: rect(0,0,0,0); 41 | border: 0; 42 | } 43 | 44 | // Use in conjunction with .sr-only to only display content when it's focused. 45 | // 46 | // Useful for "Skip to main content" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1 47 | // 48 | // Credit: HTML5 Boilerplate 49 | 50 | @mixin sr-only-focusable { 51 | &:active, 52 | &:focus { 53 | position: static; 54 | width: auto; 55 | height: auto; 56 | margin: 0; 57 | overflow: visible; 58 | clip: auto; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /files/app.ini: -------------------------------------------------------------------------------- 1 | APP_NAME = Infra Ágil 2 | RUN_USER = git 3 | RUN_MODE = prod 4 | 5 | [oauth2] 6 | JWT_SECRET = xdoniRbfQk49PDGjciM7B_dhdsAgsIMRDTmkT3_n41k 7 | 8 | [security] 9 | INTERNAL_TOKEN = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE1OTkxNzc5NzV9.ej42Jj9-7ZYWU2QTmiyY2NxA0FtmPQkl60-AlZXJh_Q 10 | INSTALL_LOCK = true 11 | SECRET_KEY = rvfs63rnptowSzO2epQ7vNiSv0qVExhT5zozuzL3Qj9KimpfC0bSNZyW6NN7IIql 12 | 13 | [database] 14 | DB_TYPE = sqlite3 15 | HOST = 127.0.0.1:3306 16 | NAME = gitea 17 | USER = gitea 18 | PASSWD = 19 | SCHEMA = 20 | SSL_MODE = disable 21 | CHARSET = utf8 22 | PATH = /var/lib/gitea/data/gitea.db 23 | 24 | [repository] 25 | ROOT = /home/git/gitea-repositories 26 | 27 | [server] 28 | SSH_DOMAIN = 172.27.11.10 29 | DOMAIN = 172.27.11.10 30 | HTTP_PORT = 3000 31 | ROOT_URL = http://172.27.11.10:3000/ 32 | DISABLE_SSH = false 33 | SSH_PORT = 22 34 | LFS_START_SERVER = true 35 | LFS_CONTENT_PATH = /var/lib/gitea/data/lfs 36 | LFS_JWT_SECRET = yvZiVojIe7sW8j7NRb8YB1bc4TPbOKjxbgt9_ZrVppI 37 | OFFLINE_MODE = false 38 | 39 | [mailer] 40 | ENABLED = false 41 | 42 | [service] 43 | REGISTER_EMAIL_CONFIRM = false 44 | ENABLE_NOTIFY_MAIL = false 45 | DISABLE_REGISTRATION = false 46 | ALLOW_ONLY_EXTERNAL_REGISTRATION = false 47 | ENABLE_CAPTCHA = false 48 | REQUIRE_SIGNIN_VIEW = false 49 | DEFAULT_KEEP_EMAIL_PRIVATE = false 50 | DEFAULT_ALLOW_CREATE_ORGANIZATION = true 51 | DEFAULT_ENABLE_TIMETRACKING = true 52 | NO_REPLY_ADDRESS = noreply.localhost 53 | 54 | [picture] 55 | DISABLE_GRAVATAR = false 56 | ENABLE_FEDERATED_AVATAR = true 57 | 58 | [openid] 59 | ENABLE_OPENID_SIGNIN = true 60 | ENABLE_OPENID_SIGNUP = true 61 | 62 | [session] 63 | PROVIDER = file 64 | 65 | [log] 66 | MODE = file 67 | LEVEL = info 68 | ROOT_PATH = /var/lib/gitea/log 69 | 70 | -------------------------------------------------------------------------------- /files/php/README.md: -------------------------------------------------------------------------------- 1 | # PHP 2 | 3 | Esta pequena aplicação faz parte de um dos exercícios do curso de Openshift da 4Linux, e neste caso ela servirá para o curso de Infraestrutura Ágil. 4 | 5 | ## Dependências 6 | 7 | Para o **alpine** precisaremos instalar os seguintes pacotes: 8 | 9 | ``` 10 | php-cli php-mysqli php-session php7-pecl-memcached 11 | ``` 12 | 13 | ## Aplicação 14 | 15 | Esta aplicação utiliza 5 variáveis de ambiente, todas elas servem para se conectar ao banco de dados: 16 | 17 | - DB_HOST 18 | - DB_PORT 19 | - DB_USER 20 | - DB_NAME 21 | - DB_PASS 22 | 23 | O PHP utiliza o php.ini para configurar o servidor externo de cache, como por exemplo o memcached. Neste caso, dentro do php.ini adicionar: 24 | 25 | ```ini 26 | [Session] 27 | session.save_handler = memcached 28 | session.save_path = "m1:11211,m2:11211,m3:11211...m9:11211" 29 | ``` 30 | 31 | ## MySQL 32 | 33 | O banco de ter o seguinte **dump** recuperado: 34 | 35 | ```sql 36 | -- version 0.1 37 | -- mysql -h 127.0.0.1 -u 'user' -p'password' database < db.sql 38 | -- docker exec -i conteineres_mysql_1 mysql -u php -p'4linux' php < db/dump.sql 39 | 40 | DROP TABLE IF EXISTS usuarios; 41 | 42 | CREATE TABLE usuarios ( 43 | id INT AUTO_INCREMENT PRIMARY KEY, 44 | nome VARCHAR(50), 45 | email VARCHAR(100), 46 | senha CHAR(60), 47 | cadastro TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP 48 | ); 49 | 50 | INSERT INTO usuarios (nome, email, senha) VALUES ('Paramahansa Yogananda', 'paramahansa@yogananda.in', '$2y$10$qTdhcJ8CkKztrvRhBN7EG.UB/YqfwjXpV2iKrZjvTIp2HTzqcflvi'); 51 | INSERT INTO usuarios (nome, email, senha) VALUES ('Mary Shelley', 'victor@frankenstein.co.uk', '$2y$10$mKvUbxiLFx9V4WPcNT3dWehd9xJ5xyZi2wkmadK8UlJBnYrLpwAqi'); 52 | -- Ambas as senhas são um hash de 123 53 | ``` 54 | 55 | Existem várias formas de restaurar o dump, utilize a sua criatividade! 56 | 57 | ## Testando a Aplicação 58 | 59 | Existem dois usuários para testar o login da aplicação: 60 | 61 | - paramahansa@yogananda.in com senha **123** 62 | - victor@frankenstein.co.uk com senha **123** 63 | -------------------------------------------------------------------------------- /exercicios/04-gitea/resposta/README.md: -------------------------------------------------------------------------------- 1 | # Resposta 2 | 3 | Este exercício tem duas partes, a segunda parte não foi ensinada no curso. 4 | 5 | ## Parte 01 6 | 7 | Será necessário acessar o Gitea em http://172.27.11.10:3000/user/sign_up, criar o usuário **exercicio**, fazer o login com este usuário e então criar o repositório **site**. 8 | 9 | > **Observação:** O e-mail pode ser qualquer um, por exemplo **exercicio@example.com**, mas as políticas de senha exigirão uma senha um pouco mais forte do que "4linux". 10 | 11 | Em seguida, acesse a máquina **automation** e execute: 12 | 13 | ``` 14 | git clone https://github.com/4linux/4542-site site 15 | cd site 16 | git remote add gitea-http http://172.27.11.10:3000/exercicio/site.git 17 | git push gitea-http master 18 | ``` 19 | 20 | Basta digitar o usuário **exercicio** e senha que você definiu. 21 | 22 | ## Parte 02 23 | 24 | Agora é preciso criar a chave: 25 | 26 | ```bash 27 | mkdir ~/git-ex02 28 | ssh-keygen -m PEM -N '' -f ~/git-ex02/ex02 29 | ``` 30 | 31 | Extraia a parte pública da chave e cadastre no Gitea dentro do usuário **exercicio**: 32 | 33 | ```bash 34 | cat ~/git-ex02/ex02 35 | ``` 36 | 37 | Agora vem a parte mais difícil para os novos usuários do git, a configuração do `~/.ssh/config`. Este arquivo contém algumas informações sobre endereços, usuários e chaves utilizadas para acessar outras máquinas e serviços através de SSH. Provavelmente o arquivo ainda não existe, então precisaremos criá-lo: 38 | 39 | ```bash 40 | vim ~/.ssh/config 41 | ``` 42 | 43 | O conteúdo do arquivo deverá ser o seguinte: 44 | 45 | ``` 46 | Host gitea 47 | Hostname 172.27.11.10 48 | User git 49 | IdentityFile ~/git-ex02/ex02 50 | ``` 51 | 52 | Como nosso repositório está utilizando um endereço IP e não queremos bagunçar as outras conexões, fazendo com que elas utilizem a mesma chave até mesmo para outros propósitos, adicionamos um apelido alí em **host**. Agora precisamos adicionar "este repositório remoto" no nosso repositório local. 53 | 54 | ```bash 55 | cd ~/site 56 | git remote add gitea-ssh gitea:exercicio/site.git 57 | echo -e '\nPronto!' >> README.md 58 | git add . 59 | git commit -m 'Finalizado exercício' 60 | git push gitea-ssh 61 | ``` 62 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Infraestrutura Ágil 2 | 3 | Este repositório é o ambiente do curso de Infraestrutura Ágil da [4Linux](https://4linux.com.br/). 4 | 5 | ![Infraestrutura Ágil](infra-agil.png) 6 | 7 | Ao executar os passos de configuração, sua máquina, através do **Vagrant**, criará as máquinas virtuais no **VirtualBox** de forma automática, com todos os softwares que utilizaremos durante o curso. O **Vagrant** nos auxiliará a criar e gerenciar as máquinas de uma maneira muito mais simples e rápida do que se precisássemos instalá-las manualmente. 8 | 9 | ## Pré-requisitos 10 | 11 | Para utilizar este repositório você deverá instalar o [Vagrant](https://www.vagrantup.com/) e o [VirtualBox](https://www.virtualbox.org/). 12 | 13 | Para clonar o repositório você precisará do [git](https://git-scm.com/), para os usuários do Windows recomendamos [https://gitforwindows.org/](https://gitforwindows.org/). 14 | 15 | ## Configuração 16 | 17 | Nesse ambiente, que está centralizado no arquivo [Vagrantfile](https://github.com/4linux/525/blob/master/Vagrantfile), serão criados 5 máquinas com as seguintes características: 18 | 19 | Nome | vCPUs | Memoria RAM | IP | S.O. 20 | ----------------|:-----:|:-----------:|:-------------:|:---------------: 21 | automation | 2 | 2048MB | 172.27.11.10 | debian/bullseye64 22 | balancer | 1 | 256MB | 172.27.11.20 | debian/bullseye64 23 | database | 1 | 512MB | 172.27.11.30 | centos-8.5 24 | docker1 | 1 | 512MB | 172.27.11.100 | debian/bullseye64 25 | docker2 | 1 | 512MB | 172.27.11.200 | centos-8.5 26 | 27 | 28 | Clone o repositório em algum diretório da sua máquina e inicie as vms: 29 | 30 | ```bash 31 | git clone https://github.com/4linux/4525.git 32 | cd 4525 33 | vagrant up 34 | ``` 35 | 36 | As máquinas serão provisionadas, este processo leva alguns minutos e depende da sua velocidade de conexão com a internet. 37 | 38 | ## Utilização 39 | 40 | Todos os comandos devem ser utilizados dentro do diretório clonado. 41 | 42 | Para listar as máquinas: 43 | 44 | ```bash 45 | vagrant status 46 | ``` 47 | 48 | Para entrar em uma máquina: 49 | 50 | ```bash 51 | vagrant ssh automation 52 | ``` 53 | 54 | Para iniciar as máquinas: 55 | 56 | ```bash 57 | vagrant up 58 | ``` 59 | 60 | Para desligar as máquinas: 61 | 62 | ```bash 63 | vagrant halt 64 | ``` 65 | -------------------------------------------------------------------------------- /files/jenkins/4542-php/config/php.ini: -------------------------------------------------------------------------------- 1 | [PHP] 2 | engine = On 3 | short_open_tag = Off 4 | precision = 14 5 | output_buffering = 4096 6 | zlib.output_compression = Off 7 | implicit_flush = Off 8 | unserialize_callback_func = 9 | serialize_precision = -1 10 | disable_functions = 11 | disable_classes = 12 | zend.enable_gc = On 13 | expose_php = On 14 | max_execution_time = 30 15 | max_input_time = 60 16 | memory_limit = 128M 17 | error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT 18 | display_errors = Off 19 | display_startup_errors = Off 20 | log_errors = On 21 | log_errors_max_len = 1024 22 | ignore_repeated_errors = Off 23 | ignore_repeated_source = Off 24 | report_memleaks = On 25 | html_errors = On 26 | variables_order = "GPCS" 27 | request_order = "GP" 28 | register_argc_argv = Off 29 | auto_globals_jit = On 30 | post_max_size = 8M 31 | auto_prepend_file = 32 | auto_append_file = 33 | default_mimetype = "text/html" 34 | default_charset = "UTF-8" 35 | include_path = ".:/usr/share/php7" 36 | doc_root = 37 | user_dir = 38 | enable_dl = Off 39 | file_uploads = On 40 | upload_max_filesize = 2M 41 | max_file_uploads = 20 42 | allow_url_fopen = On 43 | allow_url_include = Off 44 | default_socket_timeout = 60 45 | 46 | [CLI Server] 47 | cli_server.color = On 48 | 49 | [MySQLi] 50 | mysqli.max_persistent = -1 51 | mysqli.allow_persistent = On 52 | mysqli.max_links = -1 53 | mysqli.cache_size = 2000 54 | mysqli.default_port = 3306 55 | mysqli.default_socket = 56 | mysqli.default_host = 57 | mysqli.default_user = 58 | mysqli.default_pw = 59 | mysqli.reconnect = Off 60 | 61 | [mysqlnd] 62 | mysqlnd.collect_statistics = On 63 | mysqlnd.collect_memory_statistics = Off 64 | 65 | [bcmath] 66 | bcmath.scale = 0 67 | 68 | [Session] 69 | session.save_handler = memcached 70 | session.save_path = "memcached:11211" 71 | session.use_strict_mode = 0 72 | session.use_cookies = 1 73 | session.use_only_cookies = 1 74 | session.name = PHPSESSID 75 | session.auto_start = 0 76 | session.cookie_lifetime = 0 77 | session.cookie_path = / 78 | session.cookie_domain = 79 | session.cookie_httponly = 80 | session.serialize_handler = php 81 | session.gc_probability = 1 82 | session.gc_divisor = 1000 83 | session.gc_maxlifetime = 1440 84 | session.referer_check = 85 | session.cache_limiter = nocache 86 | session.cache_expire = 180 87 | session.use_trans_sid = 0 88 | session.sid_length = 26 89 | session.trans_sid_tags = "a=href,area=href,frame=src,form=" 90 | session.sid_bits_per_character = 5 91 | -------------------------------------------------------------------------------- /files/php/js/main.js: -------------------------------------------------------------------------------- 1 | 2 | (function ($) { 3 | "use strict"; 4 | 5 | 6 | /*================================================================== 7 | [ Focus input ]*/ 8 | $('.input100').each(function(){ 9 | $(this).on('blur', function(){ 10 | if($(this).val().trim() != "") { 11 | $(this).addClass('has-val'); 12 | } 13 | else { 14 | $(this).removeClass('has-val'); 15 | } 16 | }) 17 | }) 18 | 19 | 20 | /*================================================================== 21 | [ Validate ]*/ 22 | var input = $('.validate-input .input100'); 23 | 24 | $('.validate-form').on('submit',function(){ 25 | var check = true; 26 | 27 | for(var i=0; i/dancer . 72 | ``` 73 | 74 | #### Docker Hub 75 | 76 | ```bash 77 | docker login 78 | docker push /dancer 79 | ``` 80 | 81 | ## Docker Compose 82 | 83 | ```yml 84 | version: "3.0" 85 | 86 | services: 87 | redis: 88 | image: redis:alpine 89 | dancer: 90 | image: hectorvido/dancer 91 | environment: 92 | - "REDIS_SERVER=redis" 93 | - "REDIS_PORT=6379" 94 | depends_on: 95 | - redis 96 | ports: 97 | - 8080:5000 98 | ``` 99 | 100 | Para iniciar este compose: 101 | 102 | ```bash 103 | docker-compose up 104 | ``` 105 | 106 | Para testar se a aplicação modifica a página no redis: 107 | 108 | ```bash 109 | curl -X POST -H 'Content-Type: application/json' -d '{"html" : "

Atualizado via API REST!

Estes valores foram gravados no Redis

  1. HTML Cache

    É claro que esta pequena página não justifica a utilização do Redis, mas ao menos demonstra a integração entre duas aplicações.

  2. "}' http://localhost:8080/update 110 | ``` 111 | -------------------------------------------------------------------------------- /files/php/index.php: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | 15 | Home - Microserviço 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
    33 |
    34 |
    35 |
    36 | 39 | 40 | 41 | Bem Vindo! 42 | 43 | 44 |
    45 | 46 |
    47 | 48 | 53 | 54 |
    55 | 56 | 57 | 58 |
    59 |
    60 |
    61 |
    62 |
    63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /files/jenkins/4542-php/index.php: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | 15 | Home - Microserviço 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
    33 |
    34 |
    35 |
    36 | 39 | 40 | 41 | Bem Vindo! 42 | 43 | 44 |
    45 | 46 |
    47 | 48 | 53 | 54 |
    55 | 56 | 57 | 58 |
    59 |
    60 |
    61 |
    62 |
    63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /files/php/vendor/perfect-scrollbar/perfect-scrollbar.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Container style 3 | */ 4 | .ps { 5 | overflow: hidden !important; 6 | overflow-anchor: none; 7 | -ms-overflow-style: none; 8 | touch-action: auto; 9 | -ms-touch-action: auto; 10 | } 11 | 12 | /* 13 | * Scrollbar rail styles 14 | */ 15 | .ps__rail-x { 16 | display: none; 17 | opacity: 0; 18 | transition: background-color .2s linear, opacity .2s linear; 19 | -webkit-transition: background-color .2s linear, opacity .2s linear; 20 | height: 15px; 21 | /* there must be 'bottom' or 'top' for ps__rail-x */ 22 | bottom: 0px; 23 | /* please don't change 'position' */ 24 | position: absolute; 25 | } 26 | 27 | .ps__rail-y { 28 | display: none; 29 | opacity: 0; 30 | transition: background-color .2s linear, opacity .2s linear; 31 | -webkit-transition: background-color .2s linear, opacity .2s linear; 32 | width: 15px; 33 | /* there must be 'right' or 'left' for ps__rail-y */ 34 | right: 0; 35 | /* please don't change 'position' */ 36 | position: absolute; 37 | } 38 | 39 | .ps--active-x > .ps__rail-x, 40 | .ps--active-y > .ps__rail-y { 41 | display: block; 42 | background-color: transparent; 43 | } 44 | 45 | .ps:hover > .ps__rail-x, 46 | .ps:hover > .ps__rail-y, 47 | .ps--focus > .ps__rail-x, 48 | .ps--focus > .ps__rail-y, 49 | .ps--scrolling-x > .ps__rail-x, 50 | .ps--scrolling-y > .ps__rail-y { 51 | opacity: 0.6; 52 | } 53 | 54 | .ps__rail-x:hover, 55 | .ps__rail-y:hover, 56 | .ps__rail-x:focus, 57 | .ps__rail-y:focus { 58 | background-color: #eee; 59 | opacity: 0.9; 60 | } 61 | 62 | /* 63 | * Scrollbar thumb styles 64 | */ 65 | .ps__thumb-x { 66 | background-color: #aaa; 67 | border-radius: 6px; 68 | transition: background-color .2s linear, height .2s ease-in-out; 69 | -webkit-transition: background-color .2s linear, height .2s ease-in-out; 70 | height: 6px; 71 | /* there must be 'bottom' for ps__thumb-x */ 72 | bottom: 2px; 73 | /* please don't change 'position' */ 74 | position: absolute; 75 | } 76 | 77 | .ps__thumb-y { 78 | background-color: #aaa; 79 | border-radius: 6px; 80 | transition: background-color .2s linear, width .2s ease-in-out; 81 | -webkit-transition: background-color .2s linear, width .2s ease-in-out; 82 | width: 6px; 83 | /* there must be 'right' for ps__thumb-y */ 84 | right: 2px; 85 | /* please don't change 'position' */ 86 | position: absolute; 87 | } 88 | 89 | .ps__rail-x:hover > .ps__thumb-x, 90 | .ps__rail-x:focus > .ps__thumb-x { 91 | background-color: #999; 92 | height: 11px; 93 | } 94 | 95 | .ps__rail-y:hover > .ps__thumb-y, 96 | .ps__rail-y:focus > .ps__thumb-y { 97 | background-color: #999; 98 | width: 11px; 99 | } 100 | 101 | /* MS supports */ 102 | @supports (-ms-overflow-style: none) { 103 | .ps { 104 | overflow: auto !important; 105 | } 106 | } 107 | 108 | @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { 109 | .ps { 110 | overflow: auto !important; 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /files/jenkins/4542-php/vendor/perfect-scrollbar/perfect-scrollbar.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Container style 3 | */ 4 | .ps { 5 | overflow: hidden !important; 6 | overflow-anchor: none; 7 | -ms-overflow-style: none; 8 | touch-action: auto; 9 | -ms-touch-action: auto; 10 | } 11 | 12 | /* 13 | * Scrollbar rail styles 14 | */ 15 | .ps__rail-x { 16 | display: none; 17 | opacity: 0; 18 | transition: background-color .2s linear, opacity .2s linear; 19 | -webkit-transition: background-color .2s linear, opacity .2s linear; 20 | height: 15px; 21 | /* there must be 'bottom' or 'top' for ps__rail-x */ 22 | bottom: 0px; 23 | /* please don't change 'position' */ 24 | position: absolute; 25 | } 26 | 27 | .ps__rail-y { 28 | display: none; 29 | opacity: 0; 30 | transition: background-color .2s linear, opacity .2s linear; 31 | -webkit-transition: background-color .2s linear, opacity .2s linear; 32 | width: 15px; 33 | /* there must be 'right' or 'left' for ps__rail-y */ 34 | right: 0; 35 | /* please don't change 'position' */ 36 | position: absolute; 37 | } 38 | 39 | .ps--active-x > .ps__rail-x, 40 | .ps--active-y > .ps__rail-y { 41 | display: block; 42 | background-color: transparent; 43 | } 44 | 45 | .ps:hover > .ps__rail-x, 46 | .ps:hover > .ps__rail-y, 47 | .ps--focus > .ps__rail-x, 48 | .ps--focus > .ps__rail-y, 49 | .ps--scrolling-x > .ps__rail-x, 50 | .ps--scrolling-y > .ps__rail-y { 51 | opacity: 0.6; 52 | } 53 | 54 | .ps__rail-x:hover, 55 | .ps__rail-y:hover, 56 | .ps__rail-x:focus, 57 | .ps__rail-y:focus { 58 | background-color: #eee; 59 | opacity: 0.9; 60 | } 61 | 62 | /* 63 | * Scrollbar thumb styles 64 | */ 65 | .ps__thumb-x { 66 | background-color: #aaa; 67 | border-radius: 6px; 68 | transition: background-color .2s linear, height .2s ease-in-out; 69 | -webkit-transition: background-color .2s linear, height .2s ease-in-out; 70 | height: 6px; 71 | /* there must be 'bottom' for ps__thumb-x */ 72 | bottom: 2px; 73 | /* please don't change 'position' */ 74 | position: absolute; 75 | } 76 | 77 | .ps__thumb-y { 78 | background-color: #aaa; 79 | border-radius: 6px; 80 | transition: background-color .2s linear, width .2s ease-in-out; 81 | -webkit-transition: background-color .2s linear, width .2s ease-in-out; 82 | width: 6px; 83 | /* there must be 'right' for ps__thumb-y */ 84 | right: 2px; 85 | /* please don't change 'position' */ 86 | position: absolute; 87 | } 88 | 89 | .ps__rail-x:hover > .ps__thumb-x, 90 | .ps__rail-x:focus > .ps__thumb-x { 91 | background-color: #999; 92 | height: 11px; 93 | } 94 | 95 | .ps__rail-y:hover > .ps__thumb-y, 96 | .ps__rail-y:focus > .ps__thumb-y { 97 | background-color: #999; 98 | width: 11px; 99 | } 100 | 101 | /* MS supports */ 102 | @supports (-ms-overflow-style: none) { 103 | .ps { 104 | overflow: auto !important; 105 | } 106 | } 107 | 108 | @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { 109 | .ps { 110 | overflow: auto !important; 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /files/jenkins/4542-php/jenkins/Jenkinsfile.groovy: -------------------------------------------------------------------------------- 1 | node { 2 | def servers = [100,200] 3 | def server = servers[new Random().nextInt(servers.size())] 4 | def img = 'viniciusfelix1/php-login' 5 | def parameters = [ 6 | '--restart always', 7 | "--name ${JOB_BASE_NAME}", 8 | "--network ${JOB_BASE_NAME}", 9 | '--ip 192.168.10.10', 10 | '--add-host=memcached:172.27.11.30', 11 | '-e DB_HOST=172.27.11.30', 12 | '-e DB_PORT=3306', 13 | '-e DB_NAME=infraagil', 14 | '-e DB_USER=devops', 15 | '-e DB_PASS=4linux' 16 | ] 17 | try { 18 | docker.withServer("172.27.11.${server}:2375") { 19 | println "Utilizando servidor 172.27.11.${server}" 20 | stage('Build') { 21 | git branch: 'dev', credentialsId: 'jenkins', url: 'git@172.27.11.10:devops/php-login.git' 22 | sh 'rm -rf .git*' 23 | sh "sed -i 's/8080/80/' docker/Dockerfile" 24 | docker.build(img, '-f docker/Dockerfile .') 25 | } 26 | stage('Test') { 27 | sh "docker-compose -p $JOB_BASE_NAME -f docker/docker-compose.yml up -d" 28 | sleep 10 29 | sh "docker exec -i ${JOB_BASE_NAME}_mysql_1 mysql -u root -p'Abc123!' php < db/dump.sql" 30 | ip = sh(returnStdout: true, script: "docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${JOB_BASE_NAME}_app_1").trim() 31 | docker.image('alpine').withRun("--tty --interactive --network ${JOB_BASE_NAME}_default") { alpine -> 32 | sh "docker exec ${alpine.id} apk add --no-cache curl" 33 | sh "docker exec ${alpine.id} curl -sL ${ip}:80 > /dev/null" 34 | output = sh(returnStdout: true, script: "docker exec ${alpine.id} curl -sL --cookie-jar cookie -d 'username=victor@frankenstein.co.uk&pass=123' ${ip}:80/login.php").trim() 35 | if(!output.contains('Bem Vindo!')) 36 | error("Login falhou!") 37 | } 38 | } 39 | stage('Save') { 40 | docker.withRegistry('https://index.docker.io/v1/', 'dockerregistry') { 41 | docker.image(img).push() 42 | } 43 | } 44 | } 45 | stage('Deploy') { 46 | servers.each { 47 | docker.withServer("172.27.11.${it}:2375") { 48 | docker.withRegistry('https://index.docker.io/v1/', 'dockerregistry') { 49 | docker.image(img).pull() 50 | } 51 | sh "docker network create --subnet 192.168.10.0/24 ${JOB_BASE_NAME} || /bin/true" 52 | sh "docker rm -f ${JOB_BASE_NAME} || /bin/true" 53 | docker.image(img).run(parameters.join(' ')) 54 | } 55 | } 56 | } 57 | } catch (ex) { 58 | throw ex 59 | } finally { 60 | docker.withServer("172.27.11.${server}:2375") { 61 | sh "docker-compose -p $JOB_BASE_NAME -f docker/docker-compose.yml down -v" 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /exercicios/07-docker/README.md: -------------------------------------------------------------------------------- 1 | # Docker 2 | 3 | ## Docker Básico 4 | 5 | Iniciar um contêiner do **postgres** capaz de persistir os dados salvos no banco mesmo que o contêiner seja destruído e recriado. 6 | 7 | - A imagem deve ser **postgres** 8 | - O usuário de acesso deve ser **devops** 9 | - O nome da base de dados deve ser **devops** 10 | - A senha de acesso deve ser **4linux** 11 | 12 | Será necessário validar na documentação da imagem qual é o diretório em que os dados do PostgreSQL ficam salvos. 13 | 14 | Ao terminar, valide o exercício executando o seguinte comando: 15 | 16 | ```bash 17 | sudo -i 18 | curl -sL https://raw.githubusercontent.com/4linux/4525/master/exercicios/07-docker/respostas/validador-01.sh | bash 19 | ``` 20 | 21 | ## Imagens 22 | 23 | Abaixo temos dois exercícios para criação de imagens, o primeiro é mais simples e o segundo ligeiramente mais complexo. Lembre-se que o código deve ser copiado para dentro do contêiner. 24 | 25 | ### 01 - Flask 26 | 27 | Flask é um microframework em Python para criar aplicações web bastante utilizado para APIs Rest. 28 | 29 | Utilizar o código da aplicação em https://github.com/4linux/4542-python para construir uma imagem chamada **flask-site**. 30 | 31 | - Basear a imagem em **alpine** 32 | - Instalar os pacotes `py3-pip` 33 | - Utilizar o **pip** para instalar as dependências da aplicação presentes em `requirements.txt` 34 | ``` 35 | pip install -r /diretorio/aplicacao/requirements.txt 36 | ``` 37 | - O comando do contêiner deverá ser `python3 /diretorio/aplicacao/app.py` 38 | - A aplicação, por padrão, escuta na interface local na porta 5000, estes parâmetros podem ser modificados pelas variáveis `APP_HOST` e `APP_PORT` respectivamente. 39 | 40 | > **Observação:** Substituir `/diretorio/aplicacao` pelo caminho que achar mais conveniente. 41 | 42 | ### 02 - Dancer 43 | 44 | Dancer é um framework em Perl para criar aplicações web bastante utilizado para APIs Rest. 45 | 46 | A construção desta imagem é relativamente demorada pois centenas de testes são executados durante a instalação, sendo assim, utilize as camadas que achar necessário e preste atenção para evitar builds desnecessárias. 47 | 48 | Esta aplicação se conecta a um servidor redis para gravar uma página HTML que pode ser modificada através de um POST em sua API conforme mostrado no final do `README.md` do repositório. 49 | 50 | Utilizar o código da aplicação em https://github.com/4linux/4542-perl para construir uma imagem chamada **/dancer**. 51 | 52 | - Basear a imagem em **debian:buster-slim** 53 | - Esta aplicação depende de um servidor **redis**, a comunicação é ditada pelas variáveis da aplicação, não é necessário usar senha. 54 | - Instalar os pacotes `perl cpanminus make gcc` 55 | - O comando para instalar as dependências do **perl** é `cpanm --installdeps /diretorio/aplicacao` 56 | - O comando do contêiner deverá ser `plackup /diretorio/aplicacao/bin/app.psgi` 57 | - Por padrão, a aplicação escuta na porta 5000 58 | 59 | > **Observação:** Substituir `/diretorio/aplicacao` pelo caminho que achar mais conveniente. 60 | 61 | Enviar a imagem para o Docker Hub. 62 | 63 | ## Docker Compose 64 | 65 | Criar um **docker-compose.yml** capaz de subir o contêiner **/dancer** criado anteriormente juntamente de um outro contêiner com **redis** e deixar a aplicação acessível na porta 8080 da sua máquina. 66 | -------------------------------------------------------------------------------- /files/jenkins/README.md: -------------------------------------------------------------------------------- 1 | # Jenkins 2 | 3 | Este diretório armazena os passos e arquivos para a criação da pipeline final do Curso 525 da 4Linux. 4 | 5 | ## Requerimentos 6 | Para essa última pipeline, é necessário que você possua uma conta no [Docker HUB](https://hub.docker.com/). 7 | 8 | ## Aplicação PHP 9 | A aplicação foi clonada do repositório `https://github.com/4linux/4542-php` 10 | 11 | ## Passo a passo 12 | 13 | Clonar repositório 14 | 15 | ```bash 16 | git clone https://github.com/4linux/4542-php.git 17 | cd 4525 18 | git remote rm origin 19 | ``` 20 | 21 | Após termos is arquivos da aplicação, é hora de criar um repositóŕio no [Gitea](http://172.27.11.10:3000) com o nome "php-login" e do tipo privado para simular o máximo um ambiente real. 22 | 23 | Após a criação do repositório, é necessário adicionar o repositório remoto no diretório onde fizemos o clone anteriormente. Então voltaremos no terminal. 24 | 25 | ```bash 26 | git remote add origin git@172.27.11.10:devops/php-login.git 27 | ``` 28 | 29 | Após termos adicionado o repositório remoto, podemos realizar a configuração para ele utilizar automaticamente a chave que incluimos no gitea nas aulas passadas. 30 | 31 | > Caso vocẽ não tenha a chave adicionada, crie um par de chaves (`ssh-keygen -m PEM -N '' -f /root/keys/infra-agil`) e adicione a chave privada dentro do gitea e então rode o comando abaixo. 32 | 33 | ```bash 34 | git config core.sshCommand "ssh -i /root/keys/infra-agil" 35 | ``` 36 | 37 | Depois da adição da chave, podemos commitar para nosso repositório remoto no gitea esses arquivos que serão utilizados pela esteira do Jenkins. 38 | 39 | Vamos criar uma nova pipeline, para isso vamos ao dashboard do Jenkins. 40 | - New Item; 41 | - Nome: php-login 42 | - Tipo: Pipeline 43 | - Ok. 44 | - Discard old build: 10 items 45 | - Em Pipeline, selecionar pipeline script from SCM 46 | - SCM: Git 47 | - Repository URL: git@172.27.11.10:devops/php-login.git 48 | 49 | Neste ponto, vamos precisar adicionar a chave pública do Jenkins dentro do Gitea. Após termos adicionado a chave, vamos voltar na criação a pipeline. 50 | 51 | - Credentials: jenkins 52 | - Script Path: jenkins/Jenkinsfile.groovy 53 | - Save 54 | 55 | Com isso temos o esqueleto para nossa pipeline. 56 | 57 | ### Ajustes no docker-compose.yml 58 | 59 | Será necessário relizar alguns ajustes no docker-compose.yml para subirmos nosso ambiente de teste. 60 | 61 | A primeira alteração é trocar a imagem do banco, de "mysql" para "mariadb". Como alteramos a imagem, podemos remover a linha "command". 62 | 63 | A próxima alteração é trocar a imagem do serviço "app" para o nome que daremos através do Jenkinsfile. Não será necessário termos as portas mapeadas para o container, então podemos remover esta configuração. 64 | 65 | O docker-compose.yml de testes, ficará da seguinte forma: 66 | 67 | ```yaml 68 | version: '3.3' 69 | services: 70 | mysql: 71 | image: mariadb 72 | environment: 73 | MYSQL_ROOT_PASSWORD: Abc123! 74 | MYSQL_DATABASE: php 75 | MYSQL_USER: php 76 | MYSQL_PASSWORD: 4linux 77 | memcached: 78 | image: memcached:alpine 79 | app: 80 | depends_on: 81 | - mysql 82 | image: IMAGEM 83 | environment: 84 | DB_HOST: mysql 85 | DB_PORT: 3306 86 | DB_USER: php 87 | DB_PASS: 4linux 88 | DB_NAME: php 89 | ``` 90 | 91 | E por fim, podemos criar uma nova branch onde teremos esta aplicação. 92 | 93 | ```bash 94 | git checkout -b dev 95 | git add . 96 | git commit -m "Modificado docker-compose.yml" 97 | git push origin dev 98 | ``` 99 | -------------------------------------------------------------------------------- /files/php/vendor/bootstrap/css/bootstrap-reboot.min.css: -------------------------------------------------------------------------------- 1 | html{box-sizing:border-box;font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}*,::after,::before{box-sizing:inherit}@-ms-viewport{width:device-width}article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:1rem;font-weight:400;line-height:1.5;color:#212529;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent;-webkit-text-decoration-skip:objects}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg:not(:root){overflow:hidden}[role=button],a,area,button,input,label,select,summary,textarea{-ms-touch-action:manipulation;touch-action:manipulation}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#868e96;text-align:left;caption-side:bottom}th{text-align:left}label{display:inline-block;margin-bottom:.5rem}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item}template{display:none}[hidden]{display:none!important} 2 | /*# sourceMappingURL=bootstrap-reboot.min.css.map */ -------------------------------------------------------------------------------- /files/jenkins/4542-php/vendor/bootstrap/css/bootstrap-reboot.min.css: -------------------------------------------------------------------------------- 1 | html{box-sizing:border-box;font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}*,::after,::before{box-sizing:inherit}@-ms-viewport{width:device-width}article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:1rem;font-weight:400;line-height:1.5;color:#212529;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent;-webkit-text-decoration-skip:objects}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg:not(:root){overflow:hidden}[role=button],a,area,button,input,label,select,summary,textarea{-ms-touch-action:manipulation;touch-action:manipulation}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#868e96;text-align:left;caption-side:bottom}th{text-align:left}label{display:inline-block;margin-bottom:.5rem}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item}template{display:none}[hidden]{display:none!important} 2 | /*# sourceMappingURL=bootstrap-reboot.min.css.map */ -------------------------------------------------------------------------------- /files/php/login.php: -------------------------------------------------------------------------------- 1 | ' . PHP_EOL . $ex->getMessage(); 18 | exit; 19 | } 20 | 21 | try { 22 | $username = $mysql->real_escape_string($_POST['username']); 23 | $pass = $_POST['pass']; 24 | $res = $mysql->query("SELECT * FROM usuarios WHERE email = '$username'"); 25 | if(!$res) 26 | throw new Exception($mysql->error); 27 | $rs = $res->fetch_assoc(); 28 | if($rs) { 29 | if(password_verify($pass, $rs['senha'])) { 30 | $_SESSION['auth'] = $rs['nome']; 31 | header('Location: index.php'); 32 | exit; 33 | } 34 | } 35 | } catch (Exception $ex) { 36 | echo 'Problemas ao consultar o banco:
    ' . PHP_EOL . $ex->getMessage(); 37 | exit; 38 | } 39 | $error = 'Usuário ou senha inválidos'; 40 | } 41 | 42 | $ip = exec("hostname -i"); 43 | 44 | ?> 45 | 46 | 47 | 48 | Login - Microserviço 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 |
    65 | 66 | 69 | 70 |
    71 |
    72 |
    73 | 76 | 77 | 78 | Log in 79 | 80 | 81 |
    82 | 83 | 84 |
    85 | 86 |
    87 | 88 | 89 |
    90 | 91 |
    92 | 95 |
    96 | 97 |
    98 | 99 | 100 | 101 |
    102 |
    103 |
    104 |
    105 |
    106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /files/jenkins/4542-php/login.php: -------------------------------------------------------------------------------- 1 | ' . PHP_EOL . $ex->getMessage(); 18 | exit; 19 | } 20 | 21 | try { 22 | $username = $mysql->real_escape_string($_POST['username']); 23 | $pass = $_POST['pass']; 24 | $res = $mysql->query("SELECT * FROM usuarios WHERE email = '$username'"); 25 | if(!$res) 26 | throw new Exception($mysql->error); 27 | $rs = $res->fetch_assoc(); 28 | if($rs) { 29 | if(password_verify($pass, $rs['senha'])) { 30 | $_SESSION['auth'] = $rs['nome']; 31 | header('Location: index.php'); 32 | exit; 33 | } 34 | } 35 | } catch (Exception $ex) { 36 | echo 'Problemas ao consultar o banco:
    ' . PHP_EOL . $ex->getMessage(); 37 | exit; 38 | } 39 | $error = 'Usuário ou senha inválidos'; 40 | } 41 | 42 | $ip = exec("hostname -i"); 43 | 44 | ?> 45 | 46 | 47 | 48 | Login - Microserviço 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 |
    65 | 66 | 69 | 70 |
    71 |
    72 |
    73 | 76 | 77 | 78 | Log in 79 | 80 | 81 |
    82 | 83 | 84 |
    85 | 86 |
    87 | 88 | 89 |
    90 | 91 |
    92 | 95 |
    96 | 97 |
    98 | 99 | 100 | 101 |
    102 |
    103 |
    104 |
    105 |
    106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /files/php/vendor/animsition/js/animsition.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * animsition v4.0.2 3 | * A simple and easy jQuery plugin for CSS animated page transitions. 4 | * http://blivesta.github.io/animsition 5 | * License : MIT 6 | * Author : blivesta (http://blivesta.com/) 7 | */ 8 | !function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?module.exports=t(require("jquery")):t(jQuery)}(function(t){"use strict";var n="animsition",i={init:function(a){a=t.extend({inClass:"fade-in",outClass:"fade-out",inDuration:1500,outDuration:800,linkElement:".animsition-link",loading:!0,loadingParentElement:"body",loadingClass:"animsition-loading",loadingInner:"",timeout:!1,timeoutCountdown:5e3,onLoadEvent:!0,browser:["animation-duration","-webkit-animation-duration"],overlay:!1,overlayClass:"animsition-overlay-slide",overlayParentElement:"body",transition:function(t){window.location.href=t}},a),i.settings={timer:!1,data:{inClass:"animsition-in-class",inDuration:"animsition-in-duration",outClass:"animsition-out-class",outDuration:"animsition-out-duration",overlay:"animsition-overlay"},events:{inStart:"animsition.inStart",inEnd:"animsition.inEnd",outStart:"animsition.outStart",outEnd:"animsition.outEnd"}};var o=i.supportCheck.call(this,a);if(!o&&a.browser.length>0&&(!o||!this.length))return"console"in window||(window.console={},window.console.log=function(t){return t}),this.length||console.log("Animsition: Element does not exist on page."),o||console.log("Animsition: Does not support this browser."),i.destroy.call(this);var e=i.optionCheck.call(this,a);return e&&t("."+a.overlayClass).length<=0&&i.addOverlay.call(this,a),a.loading&&t("."+a.loadingClass).length<=0&&i.addLoading.call(this,a),this.each(function(){var o=this,e=t(this),s=t(window),r=t(document),l=e.data(n);l||(a=t.extend({},a),e.data(n,{options:a}),a.timeout&&i.addTimer.call(o),a.onLoadEvent&&s.on("load."+n,function(){i.settings.timer&&clearTimeout(i.settings.timer),i["in"].call(o)}),s.on("pageshow."+n,function(t){t.originalEvent.persisted&&i["in"].call(o)}),s.on("unload."+n,function(){}),r.on("click."+n,a.linkElement,function(n){n.preventDefault();var a=t(this),e=a.attr("href");2===n.which||n.metaKey||n.shiftKey||-1!==navigator.platform.toUpperCase().indexOf("WIN")&&n.ctrlKey?window.open(e,"_blank"):i.out.call(o,a,e)}))})},addOverlay:function(n){t(n.overlayParentElement).prepend('
    ')},addLoading:function(n){t(n.loadingParentElement).append('
    '+n.loadingInner+"
    ")},removeLoading:function(){var i=t(this),a=i.data(n).options,o=t(a.loadingParentElement).children("."+a.loadingClass);o.fadeOut().remove()},addTimer:function(){var a=this,o=t(this),e=o.data(n).options;i.settings.timer=setTimeout(function(){i["in"].call(a),t(window).off("load."+n)},e.timeoutCountdown)},supportCheck:function(n){var i=t(this),a=n.browser,o=a.length,e=!1;0===o&&(e=!0);for(var s=0;o>s;s++)if("string"==typeof i.css(a[s])){e=!0;break}return e},optionCheck:function(n){var a,o=t(this);return a=n.overlay||o.data(i.settings.data.overlay)?!0:!1},animationCheck:function(i,a,o){var e=t(this),s=e.data(n).options,r=typeof i,l=!a&&"number"===r,d=a&&"string"===r&&i.length>0;return l||d?i=i:a&&o?i=s.inClass:!a&&o?i=s.inDuration:a&&!o?i=s.outClass:a||o||(i=s.outDuration),i},"in":function(){var a=this,o=t(this),e=o.data(n).options,s=o.data(i.settings.data.inDuration),r=o.data(i.settings.data.inClass),l=i.animationCheck.call(a,s,!1,!0),d=i.animationCheck.call(a,r,!0,!0),u=i.optionCheck.call(a,e),c=o.data(n).outClass;e.loading&&i.removeLoading.call(a),c&&o.removeClass(c),u?i.inOverlay.call(a,d,l):i.inDefault.call(a,d,l)},inDefault:function(n,a){var o=t(this);o.css({"animation-duration":a+"ms"}).addClass(n).trigger(i.settings.events.inStart).animateCallback(function(){o.removeClass(n).css({opacity:1}).trigger(i.settings.events.inEnd)})},inOverlay:function(a,o){var e=t(this),s=e.data(n).options;e.css({opacity:1}).trigger(i.settings.events.inStart),t(s.overlayParentElement).children("."+s.overlayClass).css({"animation-duration":o+"ms"}).addClass(a).animateCallback(function(){e.trigger(i.settings.events.inEnd)})},out:function(a,o){var e=this,s=t(this),r=s.data(n).options,l=a.data(i.settings.data.outClass),d=s.data(i.settings.data.outClass),u=a.data(i.settings.data.outDuration),c=s.data(i.settings.data.outDuration),m=l?l:d,g=u?u:c,f=i.animationCheck.call(e,m,!0,!1),v=i.animationCheck.call(e,g,!1,!1),h=i.optionCheck.call(e,r);s.data(n).outClass=f,h?i.outOverlay.call(e,f,v,o):i.outDefault.call(e,f,v,o)},outDefault:function(a,o,e){var s=t(this),r=s.data(n).options;s.css({"animation-duration":o+1+"ms"}).addClass(a).trigger(i.settings.events.outStart).animateCallback(function(){s.trigger(i.settings.events.outEnd),r.transition(e)})},outOverlay:function(a,o,e){var s=this,r=t(this),l=r.data(n).options,d=r.data(i.settings.data.inClass),u=i.animationCheck.call(s,d,!0,!0);t(l.overlayParentElement).children("."+l.overlayClass).css({"animation-duration":o+1+"ms"}).removeClass(u).addClass(a).trigger(i.settings.events.outStart).animateCallback(function(){r.trigger(i.settings.events.outEnd),l.transition(e)})},destroy:function(){return this.each(function(){var i=t(this);t(window).off("."+n),i.css({opacity:1}).removeData(n)})}};t.fn.animateCallback=function(n){var i="animationend webkitAnimationEnd";return this.each(function(){var a=t(this);a.on(i,function(){return a.off(i),n.call(this)})})},t.fn.animsition=function(a){return i[a]?i[a].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof a&&a?void t.error("Method "+a+" does not exist on jQuery."+n):i.init.apply(this,arguments)}}); -------------------------------------------------------------------------------- /files/jenkins/4542-php/vendor/animsition/js/animsition.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * animsition v4.0.2 3 | * A simple and easy jQuery plugin for CSS animated page transitions. 4 | * http://blivesta.github.io/animsition 5 | * License : MIT 6 | * Author : blivesta (http://blivesta.com/) 7 | */ 8 | !function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?module.exports=t(require("jquery")):t(jQuery)}(function(t){"use strict";var n="animsition",i={init:function(a){a=t.extend({inClass:"fade-in",outClass:"fade-out",inDuration:1500,outDuration:800,linkElement:".animsition-link",loading:!0,loadingParentElement:"body",loadingClass:"animsition-loading",loadingInner:"",timeout:!1,timeoutCountdown:5e3,onLoadEvent:!0,browser:["animation-duration","-webkit-animation-duration"],overlay:!1,overlayClass:"animsition-overlay-slide",overlayParentElement:"body",transition:function(t){window.location.href=t}},a),i.settings={timer:!1,data:{inClass:"animsition-in-class",inDuration:"animsition-in-duration",outClass:"animsition-out-class",outDuration:"animsition-out-duration",overlay:"animsition-overlay"},events:{inStart:"animsition.inStart",inEnd:"animsition.inEnd",outStart:"animsition.outStart",outEnd:"animsition.outEnd"}};var o=i.supportCheck.call(this,a);if(!o&&a.browser.length>0&&(!o||!this.length))return"console"in window||(window.console={},window.console.log=function(t){return t}),this.length||console.log("Animsition: Element does not exist on page."),o||console.log("Animsition: Does not support this browser."),i.destroy.call(this);var e=i.optionCheck.call(this,a);return e&&t("."+a.overlayClass).length<=0&&i.addOverlay.call(this,a),a.loading&&t("."+a.loadingClass).length<=0&&i.addLoading.call(this,a),this.each(function(){var o=this,e=t(this),s=t(window),r=t(document),l=e.data(n);l||(a=t.extend({},a),e.data(n,{options:a}),a.timeout&&i.addTimer.call(o),a.onLoadEvent&&s.on("load."+n,function(){i.settings.timer&&clearTimeout(i.settings.timer),i["in"].call(o)}),s.on("pageshow."+n,function(t){t.originalEvent.persisted&&i["in"].call(o)}),s.on("unload."+n,function(){}),r.on("click."+n,a.linkElement,function(n){n.preventDefault();var a=t(this),e=a.attr("href");2===n.which||n.metaKey||n.shiftKey||-1!==navigator.platform.toUpperCase().indexOf("WIN")&&n.ctrlKey?window.open(e,"_blank"):i.out.call(o,a,e)}))})},addOverlay:function(n){t(n.overlayParentElement).prepend('
    ')},addLoading:function(n){t(n.loadingParentElement).append('
    '+n.loadingInner+"
    ")},removeLoading:function(){var i=t(this),a=i.data(n).options,o=t(a.loadingParentElement).children("."+a.loadingClass);o.fadeOut().remove()},addTimer:function(){var a=this,o=t(this),e=o.data(n).options;i.settings.timer=setTimeout(function(){i["in"].call(a),t(window).off("load."+n)},e.timeoutCountdown)},supportCheck:function(n){var i=t(this),a=n.browser,o=a.length,e=!1;0===o&&(e=!0);for(var s=0;o>s;s++)if("string"==typeof i.css(a[s])){e=!0;break}return e},optionCheck:function(n){var a,o=t(this);return a=n.overlay||o.data(i.settings.data.overlay)?!0:!1},animationCheck:function(i,a,o){var e=t(this),s=e.data(n).options,r=typeof i,l=!a&&"number"===r,d=a&&"string"===r&&i.length>0;return l||d?i=i:a&&o?i=s.inClass:!a&&o?i=s.inDuration:a&&!o?i=s.outClass:a||o||(i=s.outDuration),i},"in":function(){var a=this,o=t(this),e=o.data(n).options,s=o.data(i.settings.data.inDuration),r=o.data(i.settings.data.inClass),l=i.animationCheck.call(a,s,!1,!0),d=i.animationCheck.call(a,r,!0,!0),u=i.optionCheck.call(a,e),c=o.data(n).outClass;e.loading&&i.removeLoading.call(a),c&&o.removeClass(c),u?i.inOverlay.call(a,d,l):i.inDefault.call(a,d,l)},inDefault:function(n,a){var o=t(this);o.css({"animation-duration":a+"ms"}).addClass(n).trigger(i.settings.events.inStart).animateCallback(function(){o.removeClass(n).css({opacity:1}).trigger(i.settings.events.inEnd)})},inOverlay:function(a,o){var e=t(this),s=e.data(n).options;e.css({opacity:1}).trigger(i.settings.events.inStart),t(s.overlayParentElement).children("."+s.overlayClass).css({"animation-duration":o+"ms"}).addClass(a).animateCallback(function(){e.trigger(i.settings.events.inEnd)})},out:function(a,o){var e=this,s=t(this),r=s.data(n).options,l=a.data(i.settings.data.outClass),d=s.data(i.settings.data.outClass),u=a.data(i.settings.data.outDuration),c=s.data(i.settings.data.outDuration),m=l?l:d,g=u?u:c,f=i.animationCheck.call(e,m,!0,!1),v=i.animationCheck.call(e,g,!1,!1),h=i.optionCheck.call(e,r);s.data(n).outClass=f,h?i.outOverlay.call(e,f,v,o):i.outDefault.call(e,f,v,o)},outDefault:function(a,o,e){var s=t(this),r=s.data(n).options;s.css({"animation-duration":o+1+"ms"}).addClass(a).trigger(i.settings.events.outStart).animateCallback(function(){s.trigger(i.settings.events.outEnd),r.transition(e)})},outOverlay:function(a,o,e){var s=this,r=t(this),l=r.data(n).options,d=r.data(i.settings.data.inClass),u=i.animationCheck.call(s,d,!0,!0);t(l.overlayParentElement).children("."+l.overlayClass).css({"animation-duration":o+1+"ms"}).removeClass(u).addClass(a).trigger(i.settings.events.outStart).animateCallback(function(){r.trigger(i.settings.events.outEnd),l.transition(e)})},destroy:function(){return this.each(function(){var i=t(this);t(window).off("."+n),i.css({opacity:1}).removeData(n)})}};t.fn.animateCallback=function(n){var i="animationend webkitAnimationEnd";return this.each(function(){var a=t(this);a.on(i,function(){return a.off(i),n.call(this)})})},t.fn.animsition=function(a){return i[a]?i[a].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof a&&a?void t.error("Method "+a+" does not exist on jQuery."+n):i.init.apply(this,arguments)}}); -------------------------------------------------------------------------------- /exercicios/06-rundeck/resposta/README.md: -------------------------------------------------------------------------------- 1 | # Resposta 2 | 3 | Este exercício possui três partes. 4 | 5 | ## 01 - Adicionando o Node 6 | 7 | Modifique o `Vagrantfile`, adicionando uma outra máquina: 8 | 9 | ```ruby 10 | vms = { 11 | 'automation' => {'memory' => '2048', 'cpus' => 2, 'ip' => '10', 'box' => 'debian/buster64', 'provision' => 'automation.sh'}, 12 | 'balancer' => {'memory' => '256', 'cpus' => 1, 'ip' => '20', 'box' => 'debian/buster64','provision' => 'balancer.sh'}, 13 | 'database' => {'memory' => '512', 'cpus' => 1, 'ip' => '30', 'box' => 'centos/8', 'provision' => 'database.sh'}, 14 | 'docker1' => {'memory' => '512', 'cpus' => 1, 'ip' => '100', 'box' => 'debian/buster64', 'provision' => 'docker.sh'}, 15 | 'docker2' => {'memory' => '512', 'cpus' => 1, 'ip' => '200', 'box' => 'centos/8', 'provision' => 'docker.sh'}, 16 | 'minion' => {'memory' => '256', 'cpus' => 1, 'ip' => '250', 'box' => 'debian/buster64', 'provision' => 'balancer.sh'} 17 | } 18 | ``` 19 | 20 | > **Observação:** Como `provision` escolhemos `balancer.sh` pois trata-se de um arquivo vazio, mas você pode criar um novo arquivo se assim desejar. 21 | 22 | Inicie a nova máquina: 23 | 24 | ```bash 25 | vagrant up minion 26 | ``` 27 | 28 | Adicione a parte pública do chave do Rundeck e o usuário rundeck na máquina minion: 29 | 30 | ```bash 31 | CMD='sudo useradd --system --shell /bin/bash --create-home --home-dir /var/lib/rundeck rundeck' 32 | vagrant ssh minion -c "$CMD" 33 | KEY="$(vagrant ssh automation -c 'sudo cat /root/keys/rundeck.pub' < /dev/null)" 34 | CMD="sudo -u rundeck -s /bin/bash -c \"mkdir -p ~/.ssh && echo '$KEY' > ~/.ssh/authorized_keys\"" 35 | vagrant ssh minion -c "$CMD" 36 | ``` 37 | 38 | Adicione o Rundeck ao sudoers: 39 | 40 | ```bash 41 | CMD="sudo sed 's/vagrant/rundeck/g' /etc/sudoers.d/vagrant | sudo tee /etc/sudoers.d/rundeck" 42 | vagrant ssh minion -c "$CMD" 43 | ``` 44 | 45 | Adicione a máquina no arquivos de nodes do Rundeck em `/var/lib/rundeck/projects/infra-agil/nodes.yml`: 46 | 47 | ```yml 48 | 172.27.11.250: 49 | nodename: minion 50 | hostname: 172.27.11.250 51 | osVersion: 4.19.0-9-amd64 52 | osFamily: unix 53 | osArch: amd64 54 | description: Minion node 55 | osName: Linux 56 | username: rundeck 57 | tags: ['minion'] 58 | ``` 59 | 60 | ## 02 - Garantindo Idempotência 61 | 62 | O script capaz de instalar o nginx e configurar o site é o seguinte: 63 | 64 | ```bash 65 | #!/bin/bash 66 | 67 | for P in git nginx-common nginx; do 68 | dpkg -l | awk '{print $2}' | grep -E "^$P$" > /dev/null 69 | if [ $? -ne 0 ]; then 70 | PACOTES="$PACOTES $P" 71 | fi 72 | done 73 | 74 | if [ -n "$PACOTES" ]; then 75 | apt-get update 76 | apt-get install -y $PACOTES 77 | fi 78 | 79 | if [ ! -d /var/www/html/.git ]; then 80 | rm -rf /var/www/html/* 81 | git clone https://github.com/4linux/4542-site /var/www/html 82 | fi 83 | 84 | systemctl start nginx 85 | systemctl enable nginx 86 | ``` 87 | 88 | > **Observação:** Este script não necessariamente garante que o site esteja presente já que é possível apagar o site e manter o diretório `.git`, mas outras verificações seriam capazes de fazer isso. 89 | 90 | ## 03 - Ignorando as Precauções 91 | 92 | Uma leve modificação precisa ser feita no script para aceitar os argumentos do Rundeck: 93 | 94 | ```bash 95 | #!/bin/bash 96 | 97 | for P in git nginx-common nginx; do 98 | dpkg -l | awk '{print $2}' | grep -E "^$P$" > /dev/null 99 | if [ $? -ne 0 ]; then 100 | PACOTES="$PACOTES $P" 101 | fi 102 | done 103 | 104 | if [ -n "$PACOTES" ] || [ "@option.force@" == "yes" ]; then 105 | apt-get update 106 | apt-get install -y $PACOTES 107 | fi 108 | 109 | if [ ! -d /var/www/html/.git ] || [ "@option.force@" == "yes" ]; then 110 | find /var/www/html/ -mindepth 1 -delete 111 | git clone https://github.com/4linux/4542-site /var/www/html 112 | fi 113 | 114 | systemctl start nginx 115 | systemctl enable nginx 116 | ``` 117 | 118 | Para facilitar, todo o arquivo YAML de definição do Job: 119 | 120 | ```yaml 121 | - defaultTab: nodes 122 | description: '' 123 | executionEnabled: true 124 | id: 750982da-5e61-4451-9437-5537bf8b9a89 125 | loglevel: INFO 126 | name: Site 127 | nodeFilterEditable: false 128 | nodefilters: 129 | dispatch: 130 | excludePrecedence: true 131 | keepgoing: false 132 | rankOrder: ascending 133 | successOnEmptyNodeFilter: false 134 | threadcount: '1' 135 | filter: 172.27.11.250 136 | nodesSelectedByDefault: true 137 | options: 138 | - label: Force 139 | name: force 140 | required: true 141 | value: 'no' 142 | values: 143 | - 'yes' 144 | - 'no' 145 | valuesListDelimiter: ',' 146 | plugins: 147 | ExecutionLifecycle: null 148 | scheduleEnabled: true 149 | sequence: 150 | commands: 151 | - fileExtension: .sh 152 | interpreterArgsQuoted: false 153 | script: |- 154 | #!/bin/bash 155 | 156 | for P in git nginx-common nginx; do 157 | dpkg -l | awk '{print $2}' | grep -E "^$P$" > /dev/null 158 | if [ $? -ne 0 ]; then 159 | PACOTES="$PACOTES $P" 160 | fi 161 | done 162 | 163 | if [ -n "$PACOTES" ] || [ "@option.force@" == "yes" ]; then 164 | apt-get update 165 | apt-get install -y $PACOTES 166 | fi 167 | 168 | if [ ! -d /var/www/html/.git ] || [ "@option.force@" == "yes" ]; then 169 | find /var/www/html/ -mindepth 1 -delete 170 | git clone https://github.com/4linux/4542-site /var/www/html 171 | fi 172 | 173 | systemctl start nginx 174 | systemctl enable nginx 175 | scriptInterpreter: sudo bash 176 | keepgoing: false 177 | strategy: node-first 178 | uuid: exercicio-06 179 | ``` 180 | -------------------------------------------------------------------------------- /files/jenkins/4542-php/README.md: -------------------------------------------------------------------------------- 1 | # PHP 2 | 3 | Esta pequena aplicação faz parte de um dos exercícios do curso de Openshift da 4Linux. 4 | 5 | ## Objetivo 6 | 7 | O objetivo é provisionar uma aplicação que suporte alta disponibilidade com os seguintes componentes: 8 | 9 | - PHP 10 | - DeploymentConfig 11 | - Service 12 | - Route 13 | - ConfigMap 14 | - Memcached 15 | - DeploymentConfig 16 | - Service 17 | - MySQL 18 | - DeploymentConfig 19 | - Service 20 | - Secret 21 | 22 | Lembre-se que um **DeploymentConfig** provisiona outros componentes e portanto estes não foram mencionados. 23 | 24 | ## Exigências 25 | 26 | 1. A aplicação **PHP** deve possuir **3** réplicas, e um **ConfigMap** deve ser montado em `/app/php-ini/php.ini`. 27 | 2. Dois **memcached** devem ser criados, porém cada qual com suas próprias configurações, serviços e pods - *não utilizar réplicas*. 28 | 3. O banco de dados deve utilizar um volume persistente, utilizando **NFS**. 29 | 30 | **Dicas:** 31 | 32 | - Não será possível utilizar a imagem **PHP** do catálogo do Openshift pois não há suporte para **memcached**. 33 | - Uma imagem com todas as dependências pode ser gerada utilizando o `Dockerfile` presente no diretório `docker` deste repositório. 34 | - O comando `oc new-app` pode ser utilizado, mas será preciso alterar o diretório em que o Openshift procura o `Dockerfile`. 35 | 36 | ## Aplicação - php 37 | 38 | Esta aplicação utiliza 6 variáveis de ambiente, uma para o `php.ini` e as outras para se conectar ao banco de dados: 39 | 40 | - PHP_INI 41 | - DB_HOST 42 | - DB_PORT 43 | - DB_USER 44 | - DB_NAME 45 | - DB_PASS 46 | 47 | O PHP utiliza o *php.ini* para configurar o servidor externo de cache, como por exemplo o **memcached**. Neste caso, dentro do *php.ini* adicionar: 48 | 49 | ```ini 50 | [Session] 51 | session.save_handler = memcached 52 | session.save_path = "m1:11211,m2:11211,m3:11211...m9:11211" 53 | ``` 54 | 55 | ## ConfigMap - php.ini 56 | 57 | ``` 58 | [PHP] 59 | engine = On 60 | short_open_tag = Off 61 | precision = 14 62 | output_buffering = 4096 63 | zlib.output_compression = Off 64 | implicit_flush = Off 65 | unserialize_callback_func = 66 | serialize_precision = -1 67 | disable_functions = 68 | disable_classes = 69 | zend.enable_gc = On 70 | expose_php = On 71 | max_execution_time = 30 72 | max_input_time = 60 73 | memory_limit = 128M 74 | error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT 75 | display_errors = Off 76 | display_startup_errors = Off 77 | log_errors = On 78 | log_errors_max_len = 1024 79 | ignore_repeated_errors = Off 80 | ignore_repeated_source = Off 81 | report_memleaks = On 82 | html_errors = On 83 | variables_order = "GPCS" 84 | request_order = "GP" 85 | register_argc_argv = Off 86 | auto_globals_jit = On 87 | post_max_size = 8M 88 | auto_prepend_file = 89 | auto_append_file = 90 | default_mimetype = "text/html" 91 | default_charset = "UTF-8" 92 | include_path = ".:/usr/share/php7" 93 | doc_root = 94 | user_dir = 95 | enable_dl = Off 96 | file_uploads = On 97 | upload_max_filesize = 2M 98 | max_file_uploads = 20 99 | allow_url_fopen = On 100 | allow_url_include = Off 101 | default_socket_timeout = 60 102 | 103 | [CLI Server] 104 | cli_server.color = On 105 | 106 | [MySQLi] 107 | mysqli.max_persistent = -1 108 | mysqli.allow_persistent = On 109 | mysqli.max_links = -1 110 | mysqli.cache_size = 2000 111 | mysqli.default_port = 3306 112 | mysqli.default_socket = 113 | mysqli.default_host = 114 | mysqli.default_user = 115 | mysqli.default_pw = 116 | mysqli.reconnect = Off 117 | 118 | [mysqlnd] 119 | mysqlnd.collect_statistics = On 120 | mysqlnd.collect_memory_statistics = Off 121 | 122 | [bcmath] 123 | bcmath.scale = 0 124 | 125 | [Session] 126 | session.save_handler = memcached 127 | session.save_path = ":,:" 128 | session.use_strict_mode = 0 129 | session.use_cookies = 1 130 | session.use_only_cookies = 1 131 | session.name = PHPSESSID 132 | session.auto_start = 0 133 | session.cookie_lifetime = 0 134 | session.cookie_path = / 135 | session.cookie_domain = 136 | session.cookie_httponly = 137 | session.serialize_handler = php 138 | session.gc_probability = 1 139 | session.gc_divisor = 1000 140 | session.gc_maxlifetime = 1440 141 | session.referer_check = 142 | session.cache_limiter = nocache 143 | session.cache_expire = 180 144 | session.use_trans_sid = 0 145 | session.sid_length = 26 146 | session.trans_sid_tags = "a=href,area=href,frame=src,form=" 147 | session.sid_bits_per_character = 5 148 | ``` 149 | 150 | ## Memcached 151 | 152 | O memcached não decide para qual das réplicas disponíveis a gravação e/ou leitura será feita. Essa decisão é de responsabilidade do cliente, sendo assim é preciso haver dois memcacheds, cada qual com seu respectivo serviço. 153 | 154 | O endereço e a porta do memcached - por padrão **11211** - devem ser adicionadas no `php.ini`. 155 | 156 | ## MySQL 157 | 158 | O banco de dados deve utilizar um volume persistente com **NFS** - não é a melhor opção, mas é o que temos no cluster, e o seguinte **dump** deve ser recuperado: 159 | 160 | ```sql 161 | -- version 0.1 162 | -- mysql -h 127.0.0.1 -u 'user' -p'password' database < db.sql 163 | -- docker exec -i conteineres_mysql_1 mysql -u php -p'4linux' php < db/dump.sql 164 | 165 | DROP TABLE IF EXISTS usuarios; 166 | 167 | CREATE TABLE usuarios ( 168 | id INT AUTO_INCREMENT PRIMARY KEY, 169 | nome VARCHAR(50), 170 | email VARCHAR(100), 171 | senha CHAR(60), 172 | cadastro TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP 173 | ); 174 | 175 | INSERT INTO usuarios (nome, email, senha) VALUES ('Paramahansa Yogananda', 'paramahansa@yogananda.in', '$2y$10$qTdhcJ8CkKztrvRhBN7EG.UB/YqfwjXpV2iKrZjvTIp2HTzqcflvi'); 176 | INSERT INTO usuarios (nome, email, senha) VALUES ('Mary Shelley', 'victor@frankenstein.co.uk', '$2y$10$mKvUbxiLFx9V4WPcNT3dWehd9xJ5xyZi2wkmadK8UlJBnYrLpwAqi'); 177 | -- Ambas as senhas são um hash de 123 178 | ``` 179 | 180 | Existem várias formas de restaurar o dump, utilize a sua criatividade! 181 | 182 | ## Testando a Aplicação 183 | 184 | Existem dois usuários para testar o login da aplicação: 185 | 186 | - paramahansa@yogananda.in com senha **123** 187 | - victor@frankenstein.co.uk com senha **123** 188 | -------------------------------------------------------------------------------- /files/php/vendor/bootstrap/css/bootstrap-reboot.css: -------------------------------------------------------------------------------- 1 | html { 2 | box-sizing: border-box; 3 | font-family: sans-serif; 4 | line-height: 1.15; 5 | -webkit-text-size-adjust: 100%; 6 | -ms-text-size-adjust: 100%; 7 | -ms-overflow-style: scrollbar; 8 | -webkit-tap-highlight-color: transparent; 9 | } 10 | 11 | *, 12 | *::before, 13 | *::after { 14 | box-sizing: inherit; 15 | } 16 | 17 | @-ms-viewport { 18 | width: device-width; 19 | } 20 | 21 | article, aside, dialog, figcaption, figure, footer, header, hgroup, main, nav, section { 22 | display: block; 23 | } 24 | 25 | body { 26 | margin: 0; 27 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; 28 | font-size: 1rem; 29 | font-weight: normal; 30 | line-height: 1.5; 31 | color: #212529; 32 | background-color: #fff; 33 | } 34 | 35 | [tabindex="-1"]:focus { 36 | outline: none !important; 37 | } 38 | 39 | hr { 40 | box-sizing: content-box; 41 | height: 0; 42 | overflow: visible; 43 | } 44 | 45 | h1, h2, h3, h4, h5, h6 { 46 | margin-top: 0; 47 | margin-bottom: .5rem; 48 | } 49 | 50 | p { 51 | margin-top: 0; 52 | margin-bottom: 1rem; 53 | } 54 | 55 | abbr[title], 56 | abbr[data-original-title] { 57 | text-decoration: underline; 58 | -webkit-text-decoration: underline dotted; 59 | text-decoration: underline dotted; 60 | cursor: help; 61 | border-bottom: 0; 62 | } 63 | 64 | address { 65 | margin-bottom: 1rem; 66 | font-style: normal; 67 | line-height: inherit; 68 | } 69 | 70 | ol, 71 | ul, 72 | dl { 73 | margin-top: 0; 74 | margin-bottom: 1rem; 75 | } 76 | 77 | ol ol, 78 | ul ul, 79 | ol ul, 80 | ul ol { 81 | margin-bottom: 0; 82 | } 83 | 84 | dt { 85 | font-weight: bold; 86 | } 87 | 88 | dd { 89 | margin-bottom: .5rem; 90 | margin-left: 0; 91 | } 92 | 93 | blockquote { 94 | margin: 0 0 1rem; 95 | } 96 | 97 | dfn { 98 | font-style: italic; 99 | } 100 | 101 | b, 102 | strong { 103 | font-weight: bolder; 104 | } 105 | 106 | small { 107 | font-size: 80%; 108 | } 109 | 110 | sub, 111 | sup { 112 | position: relative; 113 | font-size: 75%; 114 | line-height: 0; 115 | vertical-align: baseline; 116 | } 117 | 118 | sub { 119 | bottom: -.25em; 120 | } 121 | 122 | sup { 123 | top: -.5em; 124 | } 125 | 126 | a { 127 | color: #007bff; 128 | text-decoration: none; 129 | background-color: transparent; 130 | -webkit-text-decoration-skip: objects; 131 | } 132 | 133 | a:hover { 134 | color: #0056b3; 135 | text-decoration: underline; 136 | } 137 | 138 | a:not([href]):not([tabindex]) { 139 | color: inherit; 140 | text-decoration: none; 141 | } 142 | 143 | a:not([href]):not([tabindex]):focus, a:not([href]):not([tabindex]):hover { 144 | color: inherit; 145 | text-decoration: none; 146 | } 147 | 148 | a:not([href]):not([tabindex]):focus { 149 | outline: 0; 150 | } 151 | 152 | pre, 153 | code, 154 | kbd, 155 | samp { 156 | font-family: monospace, monospace; 157 | font-size: 1em; 158 | } 159 | 160 | pre { 161 | margin-top: 0; 162 | margin-bottom: 1rem; 163 | overflow: auto; 164 | } 165 | 166 | figure { 167 | margin: 0 0 1rem; 168 | } 169 | 170 | img { 171 | vertical-align: middle; 172 | border-style: none; 173 | } 174 | 175 | svg:not(:root) { 176 | overflow: hidden; 177 | } 178 | 179 | a, 180 | area, 181 | button, 182 | [role="button"], 183 | input, 184 | label, 185 | select, 186 | summary, 187 | textarea { 188 | -ms-touch-action: manipulation; 189 | touch-action: manipulation; 190 | } 191 | 192 | table { 193 | border-collapse: collapse; 194 | } 195 | 196 | caption { 197 | padding-top: 0.75rem; 198 | padding-bottom: 0.75rem; 199 | color: #868e96; 200 | text-align: left; 201 | caption-side: bottom; 202 | } 203 | 204 | th { 205 | text-align: left; 206 | } 207 | 208 | label { 209 | display: inline-block; 210 | margin-bottom: .5rem; 211 | } 212 | 213 | button:focus { 214 | outline: 1px dotted; 215 | outline: 5px auto -webkit-focus-ring-color; 216 | } 217 | 218 | input, 219 | button, 220 | select, 221 | optgroup, 222 | textarea { 223 | margin: 0; 224 | font-family: inherit; 225 | font-size: inherit; 226 | line-height: inherit; 227 | } 228 | 229 | button, 230 | input { 231 | overflow: visible; 232 | } 233 | 234 | button, 235 | select { 236 | text-transform: none; 237 | } 238 | 239 | button, 240 | html [type="button"], 241 | [type="reset"], 242 | [type="submit"] { 243 | -webkit-appearance: button; 244 | } 245 | 246 | button::-moz-focus-inner, 247 | [type="button"]::-moz-focus-inner, 248 | [type="reset"]::-moz-focus-inner, 249 | [type="submit"]::-moz-focus-inner { 250 | padding: 0; 251 | border-style: none; 252 | } 253 | 254 | input[type="radio"], 255 | input[type="checkbox"] { 256 | box-sizing: border-box; 257 | padding: 0; 258 | } 259 | 260 | input[type="date"], 261 | input[type="time"], 262 | input[type="datetime-local"], 263 | input[type="month"] { 264 | -webkit-appearance: listbox; 265 | } 266 | 267 | textarea { 268 | overflow: auto; 269 | resize: vertical; 270 | } 271 | 272 | fieldset { 273 | min-width: 0; 274 | padding: 0; 275 | margin: 0; 276 | border: 0; 277 | } 278 | 279 | legend { 280 | display: block; 281 | width: 100%; 282 | max-width: 100%; 283 | padding: 0; 284 | margin-bottom: .5rem; 285 | font-size: 1.5rem; 286 | line-height: inherit; 287 | color: inherit; 288 | white-space: normal; 289 | } 290 | 291 | progress { 292 | vertical-align: baseline; 293 | } 294 | 295 | [type="number"]::-webkit-inner-spin-button, 296 | [type="number"]::-webkit-outer-spin-button { 297 | height: auto; 298 | } 299 | 300 | [type="search"] { 301 | outline-offset: -2px; 302 | -webkit-appearance: none; 303 | } 304 | 305 | [type="search"]::-webkit-search-cancel-button, 306 | [type="search"]::-webkit-search-decoration { 307 | -webkit-appearance: none; 308 | } 309 | 310 | ::-webkit-file-upload-button { 311 | font: inherit; 312 | -webkit-appearance: button; 313 | } 314 | 315 | output { 316 | display: inline-block; 317 | } 318 | 319 | summary { 320 | display: list-item; 321 | } 322 | 323 | template { 324 | display: none; 325 | } 326 | 327 | [hidden] { 328 | display: none !important; 329 | } 330 | /*# sourceMappingURL=bootstrap-reboot.css.map */ -------------------------------------------------------------------------------- /files/jenkins/4542-php/vendor/bootstrap/css/bootstrap-reboot.css: -------------------------------------------------------------------------------- 1 | html { 2 | box-sizing: border-box; 3 | font-family: sans-serif; 4 | line-height: 1.15; 5 | -webkit-text-size-adjust: 100%; 6 | -ms-text-size-adjust: 100%; 7 | -ms-overflow-style: scrollbar; 8 | -webkit-tap-highlight-color: transparent; 9 | } 10 | 11 | *, 12 | *::before, 13 | *::after { 14 | box-sizing: inherit; 15 | } 16 | 17 | @-ms-viewport { 18 | width: device-width; 19 | } 20 | 21 | article, aside, dialog, figcaption, figure, footer, header, hgroup, main, nav, section { 22 | display: block; 23 | } 24 | 25 | body { 26 | margin: 0; 27 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; 28 | font-size: 1rem; 29 | font-weight: normal; 30 | line-height: 1.5; 31 | color: #212529; 32 | background-color: #fff; 33 | } 34 | 35 | [tabindex="-1"]:focus { 36 | outline: none !important; 37 | } 38 | 39 | hr { 40 | box-sizing: content-box; 41 | height: 0; 42 | overflow: visible; 43 | } 44 | 45 | h1, h2, h3, h4, h5, h6 { 46 | margin-top: 0; 47 | margin-bottom: .5rem; 48 | } 49 | 50 | p { 51 | margin-top: 0; 52 | margin-bottom: 1rem; 53 | } 54 | 55 | abbr[title], 56 | abbr[data-original-title] { 57 | text-decoration: underline; 58 | -webkit-text-decoration: underline dotted; 59 | text-decoration: underline dotted; 60 | cursor: help; 61 | border-bottom: 0; 62 | } 63 | 64 | address { 65 | margin-bottom: 1rem; 66 | font-style: normal; 67 | line-height: inherit; 68 | } 69 | 70 | ol, 71 | ul, 72 | dl { 73 | margin-top: 0; 74 | margin-bottom: 1rem; 75 | } 76 | 77 | ol ol, 78 | ul ul, 79 | ol ul, 80 | ul ol { 81 | margin-bottom: 0; 82 | } 83 | 84 | dt { 85 | font-weight: bold; 86 | } 87 | 88 | dd { 89 | margin-bottom: .5rem; 90 | margin-left: 0; 91 | } 92 | 93 | blockquote { 94 | margin: 0 0 1rem; 95 | } 96 | 97 | dfn { 98 | font-style: italic; 99 | } 100 | 101 | b, 102 | strong { 103 | font-weight: bolder; 104 | } 105 | 106 | small { 107 | font-size: 80%; 108 | } 109 | 110 | sub, 111 | sup { 112 | position: relative; 113 | font-size: 75%; 114 | line-height: 0; 115 | vertical-align: baseline; 116 | } 117 | 118 | sub { 119 | bottom: -.25em; 120 | } 121 | 122 | sup { 123 | top: -.5em; 124 | } 125 | 126 | a { 127 | color: #007bff; 128 | text-decoration: none; 129 | background-color: transparent; 130 | -webkit-text-decoration-skip: objects; 131 | } 132 | 133 | a:hover { 134 | color: #0056b3; 135 | text-decoration: underline; 136 | } 137 | 138 | a:not([href]):not([tabindex]) { 139 | color: inherit; 140 | text-decoration: none; 141 | } 142 | 143 | a:not([href]):not([tabindex]):focus, a:not([href]):not([tabindex]):hover { 144 | color: inherit; 145 | text-decoration: none; 146 | } 147 | 148 | a:not([href]):not([tabindex]):focus { 149 | outline: 0; 150 | } 151 | 152 | pre, 153 | code, 154 | kbd, 155 | samp { 156 | font-family: monospace, monospace; 157 | font-size: 1em; 158 | } 159 | 160 | pre { 161 | margin-top: 0; 162 | margin-bottom: 1rem; 163 | overflow: auto; 164 | } 165 | 166 | figure { 167 | margin: 0 0 1rem; 168 | } 169 | 170 | img { 171 | vertical-align: middle; 172 | border-style: none; 173 | } 174 | 175 | svg:not(:root) { 176 | overflow: hidden; 177 | } 178 | 179 | a, 180 | area, 181 | button, 182 | [role="button"], 183 | input, 184 | label, 185 | select, 186 | summary, 187 | textarea { 188 | -ms-touch-action: manipulation; 189 | touch-action: manipulation; 190 | } 191 | 192 | table { 193 | border-collapse: collapse; 194 | } 195 | 196 | caption { 197 | padding-top: 0.75rem; 198 | padding-bottom: 0.75rem; 199 | color: #868e96; 200 | text-align: left; 201 | caption-side: bottom; 202 | } 203 | 204 | th { 205 | text-align: left; 206 | } 207 | 208 | label { 209 | display: inline-block; 210 | margin-bottom: .5rem; 211 | } 212 | 213 | button:focus { 214 | outline: 1px dotted; 215 | outline: 5px auto -webkit-focus-ring-color; 216 | } 217 | 218 | input, 219 | button, 220 | select, 221 | optgroup, 222 | textarea { 223 | margin: 0; 224 | font-family: inherit; 225 | font-size: inherit; 226 | line-height: inherit; 227 | } 228 | 229 | button, 230 | input { 231 | overflow: visible; 232 | } 233 | 234 | button, 235 | select { 236 | text-transform: none; 237 | } 238 | 239 | button, 240 | html [type="button"], 241 | [type="reset"], 242 | [type="submit"] { 243 | -webkit-appearance: button; 244 | } 245 | 246 | button::-moz-focus-inner, 247 | [type="button"]::-moz-focus-inner, 248 | [type="reset"]::-moz-focus-inner, 249 | [type="submit"]::-moz-focus-inner { 250 | padding: 0; 251 | border-style: none; 252 | } 253 | 254 | input[type="radio"], 255 | input[type="checkbox"] { 256 | box-sizing: border-box; 257 | padding: 0; 258 | } 259 | 260 | input[type="date"], 261 | input[type="time"], 262 | input[type="datetime-local"], 263 | input[type="month"] { 264 | -webkit-appearance: listbox; 265 | } 266 | 267 | textarea { 268 | overflow: auto; 269 | resize: vertical; 270 | } 271 | 272 | fieldset { 273 | min-width: 0; 274 | padding: 0; 275 | margin: 0; 276 | border: 0; 277 | } 278 | 279 | legend { 280 | display: block; 281 | width: 100%; 282 | max-width: 100%; 283 | padding: 0; 284 | margin-bottom: .5rem; 285 | font-size: 1.5rem; 286 | line-height: inherit; 287 | color: inherit; 288 | white-space: normal; 289 | } 290 | 291 | progress { 292 | vertical-align: baseline; 293 | } 294 | 295 | [type="number"]::-webkit-inner-spin-button, 296 | [type="number"]::-webkit-outer-spin-button { 297 | height: auto; 298 | } 299 | 300 | [type="search"] { 301 | outline-offset: -2px; 302 | -webkit-appearance: none; 303 | } 304 | 305 | [type="search"]::-webkit-search-cancel-button, 306 | [type="search"]::-webkit-search-decoration { 307 | -webkit-appearance: none; 308 | } 309 | 310 | ::-webkit-file-upload-button { 311 | font: inherit; 312 | -webkit-appearance: button; 313 | } 314 | 315 | output { 316 | display: inline-block; 317 | } 318 | 319 | summary { 320 | display: list-item; 321 | } 322 | 323 | template { 324 | display: none; 325 | } 326 | 327 | [hidden] { 328 | display: none !important; 329 | } 330 | /*# sourceMappingURL=bootstrap-reboot.css.map */ -------------------------------------------------------------------------------- /exercicios/08-ansible/README.md: -------------------------------------------------------------------------------- 1 | # Ansible 2 | 3 | Existem três exercícios para o Ansible. 4 | 5 | ## 01 - Ad Hoc 6 | 7 | Utilize um comando ad-hoc para baixar o seguinte arquivo https://github.com/4linux/4542-site/archive/master.zip no diretório `/tmp` da máquina **minion** criada nos exercícios de Rundeck. 8 | 9 | ## 02 - Playbook 10 | 11 | O objetivo desta playbook é provisionar um webserver que fornece um jogo 2D de plataforma em HTML5 chamado **elemental one**. 12 | 13 | Criar uma playbook que atenda as seguintes exigências: 14 | 15 | - A máquina a ser configurada pelo Ansible é a **minion** 16 | - Instale e configure um servidor de **Apache** 17 | - Clone ou baixe e descompacte o repositório https://github.com/4linux/elemental-one.git em /var/www/elemental-one 18 | - Garanta que o serviço do webserver esteja iniciado e seja carregado durante a inicialização da máquina 19 | - Modifique o arquivo `/etc/apache2/sites-enabled/` 20 | 21 | Ao final, teste o acesso em http://172.27.11.250. 22 | 23 | ## 03 - Roles 24 | 25 | Os arquivos desta tarefa estão no final das exigências. 26 | 27 | Continuar com a playbook acima mas transformá-la em uma role chamada **https-site** que além de já fazer o que fazia anteriormente consiga atender as novas exigências e de uma forma mais genérica para aceitar outras execuções com outros valores: 28 | 29 | - O endereço de download do conteúdo do site deverá ser uma variável (no diretório `defaults`) 30 | - O nome dos certificados, diretórios e arquivos de configuração que se chamam **elemental-one** deverão puxar este nome de uma variável chamada `prefix` (no diretório `defaults`) 31 | - Configure um certificado autoassinado x509 (HTTPS) para o webserver (com o arquivo abaixo) 32 | - Tenha um arquivo de configuração para o site que: 33 | - Deverá estar em `templates` e se chamar `site.conf` 34 | - Deverá possuir variáveis que indiquem os caminhos dos certificados 35 | - Deverá ser enviado para /etc/apache2/sites-enabled 36 | - O certificado e a chave deverão estar no diretório `files` da role 37 | - O certificado deverá estar em `/etc/ssl/certs/` 38 | - A chave deverá estar em `/etc/ssl/private/` 39 | - Habilite o módulo **ssl** do apache criando um link simbólico de `/etc/apache2/mods-available/ssl.conf` e `/etc/apache2/mods-available/ssl.load` para `/etc/apache2/mods-enabled/` 40 | - Recarregue o serviço do apache caso exista alterações no arquivo de configuração 41 | 42 | Ao final, teste o acesso em https://elemental-one.172-27-11-250.nip.io, lembre-se de aceitar o certificado auto-assinado. 43 | 44 | O arquivo de configuração do site é o seguinte: 45 | 46 | **elemental-one.conf** 47 | 48 | ``` 49 | 50 | 51 | ServerAdmin webmaster@example.com 52 | 53 | DocumentRoot /var/www/html 54 | 55 | ErrorLog ${APACHE_LOG_DIR}/error.log 56 | CustomLog ${APACHE_LOG_DIR}/access.log combined 57 | 58 | SSLEngine on 59 | 60 | 61 | SSLCertificateFile /etc/ssl/certs/elemental-one.pem 62 | SSLCertificateKeyFile /etc/ssl/private/elemental-one.key 63 | 64 | 65 | 66 | # vim: syntax=apache ts=4 sw=4 sts=4 sr noet 67 | ``` 68 | 69 | Os certificados são os seguintes: 70 | 71 | **elemental-one.pem** 72 | 73 | ``` 74 | -----BEGIN CERTIFICATE----- 75 | MIIFazCCA1OgAwIBAgIUFLcVMeCdF5QGfutC7bCOtg8/51gwDQYJKoZIhvcNAQEL 76 | BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM 77 | GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yMDExMTkyMzA4MTZaFw0zMDEx 78 | MTcyMzA4MTZaMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEw 79 | HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwggIiMA0GCSqGSIb3DQEB 80 | AQUAA4ICDwAwggIKAoICAQC88cpXtaocK1QWGjyPz9/Rr3tGyz9bzRjo/H8Z84si 81 | cbaLio2vSIQlW13Qref2mW+FwKtApVoS9oP8YhzbkCmWOSCY1IFbSNLmFsd4VoBu 82 | 30xfgP4Yes8f9pY2yEJd6qkjhOD90PI/U/CAv61Z1vym0Yq0T3cEjyytjUer577a 83 | WImvKp3wx1qnFfKgSbNouuubc3uP2i0seotpBKuO5YPapRRMY00mztnHDBh0HJuR 84 | yWBY0xqZs1IcgK09+cqD5o640LrEpUn2/R7XY3L3rMzPZ5yGNotyFc0HFfz/UrTp 85 | Lvrl+LmPBEkxJ/0azT5Y2ujPNsRP5EKT/z7UlNhYslSCGx7xCsOcJhcpPdhJcIV1 86 | T6f4PSuc5u49q5y8Aa11C2mAd0JE3luUnAd/qL7Vt7RBIZGemgz7pDw94pLsL14u 87 | W37DlZo0A9NoKiV8yNGE6+uH2zYb6mlQFZ34R7lHq0eFDWrVUfWjbHbH0f6PvlCy 88 | 00rEqm1dBeaFhVWnqpAIbf4cqM3vlojny6LjcTMxJa3LylBOIaQ+uZVWgvv0jXwK 89 | yP+5OnA7GWUdCtgLuXVAOJt+MSMUsSzzvytiOU2XNfNZyJSOkoY8yjk9FdSLi23g 90 | ve34HcXLjO6FktiW3xG9Ec4VkbAHhWPvxrHmtB/gq/MtN1Ne3GGkp5nbNTSMTK3k 91 | IwIDAQABo1MwUTAdBgNVHQ4EFgQUJ2mvkjUIEM80u3mZRRFAnoG0+oQwHwYDVR0j 92 | BBgwFoAUJ2mvkjUIEM80u3mZRRFAnoG0+oQwDwYDVR0TAQH/BAUwAwEB/zANBgkq 93 | hkiG9w0BAQsFAAOCAgEAAO+6OZyuhkwDjxdqluWsMuQBao4ubuNOfRboegoWjOLz 94 | yCGaiiOngQMR9/JG6ic7XsfvML4cLDdJBPhpybSQEGVBaZaGZklHDW8aacxuP+Om 95 | 4ZxWpzjaJddr2t0w72+pAQYKvcP/ORDKmlTfAEqdWgO8pwYJtbWre57e1UnzNibh 96 | z/UAZdaSEl4S8UpjGX7M0KNpLNg9cZpxTAj7yYW4pFHH8wSba57OF3gPQCMqUWjd 97 | L3B8Z84atWB7/RHqf7f6IMBdMc0LRfuRKag35pkxpXY3gjvpqh0gOiIeG8GsRpVj 98 | ZSSm8LIWw2Dbjtijx4zuLq3v4PMGlR29eglDiNcKIjBk5VTBiYxbIaRX1IHOPigx 99 | SEDAdVednqO/q1UqHYhT1Ds8AbsA29tif9OfWWn/bfJZaXfgGvFxq//FBX6Rgpgv 100 | n6CUm+dDwGMOcFM43FHPKSBxOHE1CV2kJiB+r0Nj0I8yAJ9f7ZcweWzSMWq4zzNd 101 | lsxKX1Zks6g3EhXpULHuqZbHrvCxxOnJcdIUQnnm9H+ykSctec4D1bz8Ng4LiuwE 102 | UDBGlD4OUJYKMpsG9PtP+a6Ku2zhdvxasN3ZW9ykQRm/2983TxBPAIzn/jVcKMej 103 | +86aZdBTsBLrHtzt1/dOdUCetacFQHs/agXxD40LbN/qtH0SIFDTwGnqXY3WA7M= 104 | -----END CERTIFICATE----- 105 | ``` 106 | 107 | **elemental-one.key** 108 | 109 | ``` 110 | -----BEGIN PRIVATE KEY----- 111 | MIIJQwIBADANBgkqhkiG9w0BAQEFAASCCS0wggkpAgEAAoICAQC88cpXtaocK1QW 112 | GjyPz9/Rr3tGyz9bzRjo/H8Z84sicbaLio2vSIQlW13Qref2mW+FwKtApVoS9oP8 113 | YhzbkCmWOSCY1IFbSNLmFsd4VoBu30xfgP4Yes8f9pY2yEJd6qkjhOD90PI/U/CA 114 | v61Z1vym0Yq0T3cEjyytjUer577aWImvKp3wx1qnFfKgSbNouuubc3uP2i0seotp 115 | BKuO5YPapRRMY00mztnHDBh0HJuRyWBY0xqZs1IcgK09+cqD5o640LrEpUn2/R7X 116 | Y3L3rMzPZ5yGNotyFc0HFfz/UrTpLvrl+LmPBEkxJ/0azT5Y2ujPNsRP5EKT/z7U 117 | lNhYslSCGx7xCsOcJhcpPdhJcIV1T6f4PSuc5u49q5y8Aa11C2mAd0JE3luUnAd/ 118 | qL7Vt7RBIZGemgz7pDw94pLsL14uW37DlZo0A9NoKiV8yNGE6+uH2zYb6mlQFZ34 119 | R7lHq0eFDWrVUfWjbHbH0f6PvlCy00rEqm1dBeaFhVWnqpAIbf4cqM3vlojny6Lj 120 | cTMxJa3LylBOIaQ+uZVWgvv0jXwKyP+5OnA7GWUdCtgLuXVAOJt+MSMUsSzzvyti 121 | OU2XNfNZyJSOkoY8yjk9FdSLi23gve34HcXLjO6FktiW3xG9Ec4VkbAHhWPvxrHm 122 | tB/gq/MtN1Ne3GGkp5nbNTSMTK3kIwIDAQABAoICABAEn5bX+9fvhG1rQ/8dLGhm 123 | bBkQWgq6VIZMAap9jyoYYdVqpaBakXlpSYbLd4LcdyvrrZkJa5138LCQ0Ml8a0ol 124 | BbJvMZg/kEGZZMe67aB4pczi7qe8oZqgGRQD3jyADF7KgRiDgkYEI7uGhHe9ViX+ 125 | Vbf7lKd6S9tawty8BN4V63ZCMqma/QB1R+B23xLd5eOD4tHLOVEwAmmgz7qJkqgS 126 | nqnrMTs9BhFt4RTW6Alv/Q8KtpKZNTjdX9KFPrn37dmVOIA7Uw3xX4/7CmAc8jAT 127 | JJ3sOd4uIvea0ZwDsvqh1PtyHqkVP+8+6KJBDCwUQvBuQC5Vt588YGM9SyoZ1Dge 128 | LclVA0w+Gm+tiGY3+lA0TY9OS6Mzmh5V2gHjBdeRTF2sYH8ZRafk5/WPoT5ZpMp3 129 | yYmLeX1CD+ZdiQmHo0PuwThLVEyY/KnYxIbZsj0rr3tWeehrOrS0NrioM/x12p3Z 130 | iqersUHe4q2Se9CXUxmGB5DkNTQxKwZE9DN/f/r2n7NZQoqT9HgnGq9EwdFuBaQ8 131 | j2MxH2ARFWkSGml6hbJeqqKODBkexPzSMbzqfGbJGrY5k49CfmD6bar9VMwr7nnz 132 | +tVl6BvwbumgcAntG/cB1vD9f/gBgKT9TP/ZOhj7ixGr0xA28v5BDvspQ0ISH3PR 133 | yDagg7u9lEr1CNudSJPBAoIBAQDio6Vi1jbDI1pE9qBajQKaiH9yy0nyhvclU2Sf 134 | TNtCh/JPqGQlZke2u5geU12dDQaofoGri6aCD2pJGIVODvsw6K2S4lG8JdBv5xPM 135 | lzI1yyRw5LrbSef8uyIrbZyKN0LmYkClDDCRuJjJgk9qO8KdCF19FMcvci9h5yz4 136 | kibugaWOQcMZTePj6ubTcJP0DKx4CZ5H1HyMJpr+RouSPg75kFnq0fR4uO3Cw5/u 137 | 2zSZdrbbkbm8eoLqU7H3GgLEVmwucMSMR9TAp4GnzKBuPW8oKKnnn8LHV7vG3rN5 138 | f0s56vP0ACAod7Lt5pg3HLLeSeIDoYD7AlSGB15qXvgCvqc5AoIBAQDVbAVOgqAd 139 | h7k5wN2YbyHce6R6QI33qPuysDIbbqxBPEfmcPx4mdTLgCIrMGZ2SuLmvG2cWX0l 140 | /f5Kzqwl1ZQEkPggu5LJAJVzLUmNCqPmwMdnIJbS5StThYmsZITkp2cBmKbQQXl7 141 | nbmTwZe6kduzuJeo6xbtKPtG434Gy9IUppSMXHI50ZZyjdsZMdVqEdAnKn/ocAyd 142 | mzwvlVw4p115r9KnmAxBSic1tzQe8+2CsRDb2BcJcrIJzO7376+v+HDmCY3oIfA2 143 | xubFf8rOxbm/4whW6STnGkR0VujSxoBT7Bs3XSYeS6cBGaBPAknBDvDV4cRppkI/ 144 | bZoJI1N/vio7AoIBAQCtaStleaSDIOyz8cT2JAjG9wQVcKiPEmfOPoWyQdtOh7iG 145 | 7MBbwWvDzLvzEDSDs3DRwaI0APGReHwJm+J7vIjEfnQ4/EQv4vsedD+4/kMj1+B1 146 | JP44Rc9kmEbn1cG+G9RrdOgjoTUUepslLDjZfwpEnx7xUtGpYwQQNBM7ypBRVA+5 147 | zmWaWfex741YYT5DsOLSIgHi0hnOHsffIVkvt547pBC41JbrPAxoRsh7uWwAtE3r 148 | qQ/lwBOleg6klFljowC5c/1fnKKUGlbhbneeghEoOBzwplQhtOZvnvzSTOzhTv4E 149 | R4hTjmrxDsyO9r2ByiROROfsp3bG6qJ6X1oCt6A5AoIBAFQHGrPFlFrsFA5cFCMv 150 | JirT93c2sW6f9rFs092fHmz02e4t8Alfr7uLsGhGvyC17U4hRBq51R8/OH6ljnu6 151 | 8nM1zKu+jlVbSHw3iWzhkpSItDmzSA6ysfNJcWIRlY0dJ94mBw+Zp8X23JkDMMUB 152 | JnpFJFkabkVjzEMl0HnGh+kfiP8Wata+4TgrB+eMilUfvE+fWQrgCueGthSZ/txD 153 | cPc3NX5MzA5srrFkdz30lj/NjTCxjKhooxZevHubwBVNgM3hVyDdM+GtQDDkVqpA 154 | iRi2v5LQanofCnKvwS0zgFUKcdDDeP2WlaNGPqq84OMFCed740QhdJXahjow0XBL 155 | I/8CggEBAIfbIOwNENxa8pVkcXRtYGUapL0M0xMvRnqh1xzXCxg6oYLuFZKo7Y4R 156 | wNQ2Q1D38mMDW4uIdarqWLemHVU/WedpR5CjA6vSjZbanb5CPbGSGpQcepkOOOyN 157 | 9F4g9vsbTGqAM1fMvssJpvv5Lzs6kYnhBPcCKtpo8Pcj7iRwMgguapmUEZr4cHuz 158 | EVd7Y632gqvotvnfg7eg2PIzqomdOGz3Ps3ZdfJeCM/SHIFNyN0SvfzsVwulHGWB 159 | FjCV/ymllohWCd/V2+Uo+H4gRtNmZVNKury/WWYsKldVIJaFlWHKq6OtUPDfAxV1 160 | Wtnjzj4YhcGdpTNFd2DmURosxESZUVg= 161 | -----END PRIVATE KEY----- 162 | ``` 163 | --------------------------------------------------------------------------------