[Look for a tester] ansible role added #662

Open
mhkarimi1383 wants to merge 18 commits from mhkarimi1383/master into master
mhkarimi1383 commented 4 years ago (Migrated from github.com)
Owner

using ansible you can automate installation process and make it cleaner and faster
this playbook will install docker
then install uptime kuma using docker
and install and configure nginx with ssl

using ansible you can automate installation process and make it cleaner and faster this playbook will install docker then install uptime kuma using docker and install and configure nginx with ssl
gaby (Migrated from github.com) requested changes 4 years ago
gaby (Migrated from github.com) commented 4 years ago
Owner

Shouldn't this use the official Docker installation method instead of docker.io ? The official package is docker-ce

Shouldn't this use the official Docker installation method instead of `docker.io` ? The official package is `docker-ce`
gaby (Migrated from github.com) commented 4 years ago
Owner

What is this used for?

What is this used for?
gaby (Migrated from github.com) commented 4 years ago
Owner

This should check first if docker-compose is pre-installed.

This should check first if `docker-compose` is pre-installed.
gaby (Migrated from github.com) commented 4 years ago
Owner

Replace this with port binding for

80:80
443:443

Replace this with port binding for 80:80 443:443
gaby (Migrated from github.com) commented 4 years ago
Owner

Replace with nginx:stable-alpine

Replace with `nginx:stable-alpine`
gaby (Migrated from github.com) commented 4 years ago
Owner

You can generate initial self-signed certs using Ansible Openssl module:

Ex:

- openssl_privatekey:
    path: /etc/uptime-kuma/server.key
    size: 2048 

- openssl_csr:
    path: /etc/stunnel/redis-server.csr
    privatekey_path: /etc/stunnel/server.key

- openssl_certificate:
    provider: selfsigned
    path: /etc/uptime-kuma/server.crt
    privatekey_path: /etc/uptime-kuma/server.key
    csr_path:/etc/uptime-kuma/server.csr
You can generate initial self-signed certs using Ansible Openssl module: Ex: ``` - openssl_privatekey: path: /etc/uptime-kuma/server.key size: 2048 - openssl_csr: path: /etc/stunnel/redis-server.csr privatekey_path: /etc/stunnel/server.key - openssl_certificate: provider: selfsigned path: /etc/uptime-kuma/server.crt privatekey_path: /etc/uptime-kuma/server.key csr_path:/etc/uptime-kuma/server.csr ```
gaby (Migrated from github.com) commented 4 years ago
Owner

Replace with :1-debian

Replace with `:1-debian`
Saibamen (Migrated from github.com) requested changes 4 years ago
Saibamen (Migrated from github.com) commented 4 years ago
Owner
        image: nginx:stable-alpine
```suggestion image: nginx:stable-alpine ```
Saibamen (Migrated from github.com) commented 4 years ago
Owner
    ### SSL Settings for all servers (https://ssl-config.mozilla.org/#server=nginx&server-version=1.17.2&config=intermediate)
```suggestion ### SSL Settings for all servers (https://ssl-config.mozilla.org/#server=nginx&server-version=1.17.2&config=intermediate) ```
Saibamen (Migrated from github.com) commented 4 years ago
Owner
    # Remove Headers that gonna be sent to client
```suggestion # Remove Headers that gonna be sent to client ```
Saibamen (Migrated from github.com) commented 4 years ago
Owner
        image: 'louislam/uptime-kuma:1-debian'
```suggestion image: 'louislam/uptime-kuma:1-debian' ```
louislam commented 4 years ago (Migrated from github.com)
Owner

I would suggest that it should be kept as an unofficial way.

Reasons:

  • The main reason is that I probably will not maintain it in the future.
  • Against my project styles. I believe that users have to go through 7 yml files in order to spin up Uptime Kuma.

https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md#project-styles

I would suggest that it should be kept as an unofficial way. Reasons: - The main reason is that I probably will not maintain it in the future. - Against my project styles. I believe that users have to go through 7 yml files in order to spin up Uptime Kuma. https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md#project-styles
mhkarimi1383 commented 4 years ago (Migrated from github.com)
Poster
Owner

I would suggest that it should be kept as an unofficial way.

Reasons:

  • The main reason is that I probably will not maintain it in the future.
  • Against my project styles. I believe that users have to go through 7 yml files in order to spin up Uptime Kuma.

https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md#project-styles

I tried to make it feature prof it's like kubernetes files
And I will try to keep this thing up to date

> I would suggest that it should be kept as an unofficial way. > > Reasons: > > * The main reason is that I probably will not maintain it in the future. > * Against my project styles. I believe that users have to go through 7 yml files in order to spin up Uptime Kuma. > > https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md#project-styles I tried to make it feature prof it's like kubernetes files And I will try to keep this thing up to date
mhkarimi1383 commented 4 years ago (Migrated from github.com)
Poster
Owner

Any progress You will accept it or not?

Any progress You will accept it or not?
louislam commented 4 years ago (Migrated from github.com)
Owner

Any progress You will accept it or not?

It could be accept with following constraints:

> Any progress You will accept it or not? It could be accept with following constraints: - It will be added in a secondary branch as a unofficial installation method. It will also be added to the wiki too. Similar to Kubernetes: https://github.com/louislam/uptime-kuma/tree/k8s-unofficial/kubernetes - It needs one more reviewer to test and to confirm the ansible script.
mhkarimi1383 commented 4 years ago (Migrated from github.com)
Poster
Owner

Any progress You will accept it or not?

It could be accept with following constraints:

Thanks
I think should wait for another user to approve it.

> > Any progress You will accept it or not? > > It could be accept with following constraints: > > * It will be added in a secondary branch as a unofficial installation method. It will also be added to the wiki too. > Similar to Kubernetes: https://github.com/louislam/uptime-kuma/tree/k8s-unofficial/kubernetes > * It needs one more reviewer to test and to confirm the ansible script. Thanks I think should wait for another user to approve it.
gaby (Migrated from github.com) reviewed 4 years ago
gaby (Migrated from github.com) commented 4 years ago
Owner

This should point to louislam/uptime-kuma:1, which is the debian release.

This should point to `louislam/uptime-kuma:1`, which is the debian release.
gaby (Migrated from github.com) reviewed 4 years ago
gaby (Migrated from github.com) commented 4 years ago
Owner

Starting with docker-compose v2, it's no installable via PIP anymore. Compose v2 was completely rewritten in Go, and it's now distributed as a binary file: https://github.com/docker/compose/releases

Starting with docker-compose v2, it's no installable via PIP anymore. Compose v2 was completely rewritten in Go, and it's now distributed as a binary file: https://github.com/docker/compose/releases
mhkarimi1383 commented 4 years ago (Migrated from github.com)
Poster
Owner

I have made some changes to make things cleaner and better you can see commits

I have made some changes to make things cleaner and better you can see commits
mhkarimi1383 commented 4 years ago (Migrated from github.com)
Poster
Owner

when this pull request accepted I will add another playbook that installs uptime kuma inside Kubernetes using files from Kubernetes directory in repo

when this pull request accepted I will add another playbook that installs uptime kuma inside Kubernetes using files from Kubernetes directory in repo
mhkarimi1383 commented 4 years ago (Migrated from github.com)
Poster
Owner

I should still wait?

I should still wait?
louislam commented 3 years ago (Migrated from github.com)
Owner

I should still wait?

An extra tester is still needed.

> I should still wait? An extra tester is still needed.
gaby (Migrated from github.com) requested changes 3 years ago
gaby (Migrated from github.com) commented 3 years ago
Owner

docker-compose 2.0.1 is not installable via PIP. They migrated from Python to Golang for v2.x.x

docker-compose 2.0.1 is not installable via PIP. They migrated from Python to Golang for v2.x.x
gaby (Migrated from github.com) commented 3 years ago
Owner

This shouldn't be using HOST network. Use port-binding to port 80 and 443

This shouldn't be using HOST network. Use port-binding to port 80 and 443
gaby (Migrated from github.com) commented 3 years ago
Owner

Why is NGINX by itself on a separate Docker-Compose file?

The current NGINX is only reverse-proxying Uptime-Kuma, so they should be both on the same file that way you don't have to manage multiple Docker Networks.

Why is NGINX by itself on a separate Docker-Compose file? The current NGINX is only reverse-proxying Uptime-Kuma, so they should be both on the same file that way you don't have to manage multiple Docker Networks.
gaby (Migrated from github.com) commented 3 years ago
Owner

This should be:

proxy_pass	http://uptime-kuma:3001;

Since the service gets a hostname assigned by Docker Network.

This should be: ``` proxy_pass http://uptime-kuma:3001; ``` Since the service gets a hostname assigned by Docker Network.
gaby (Migrated from github.com) commented 3 years ago
Owner

Suggest creating a folder:

/var/log/nginx/uptime-kuma

Which will contain:

access.log
error.log

That way you have less custom stuff in the nginx.conf

Suggest creating a folder: `/var/log/nginx/uptime-kuma` Which will contain: ``` access.log error.log ``` That way you have less custom stuff in the nginx.conf
gaby (Migrated from github.com) commented 3 years ago
Owner

Still valid comment

Still valid comment
gaby (Migrated from github.com) commented 3 years ago
Owner

There's not need to use ports here, only NGINX should be binding ports to the host. Instead use expose, which only exposes the port to the Docker network.

expose:
  - 3001
There's not need to use `ports` here, only NGINX should be binding ports to the host. Instead use `expose`, which only exposes the port to the Docker network. ``` expose: - 3001 ```
gaby (Migrated from github.com) commented 3 years ago
Owner

This whole compose file should be merge with the NGINX one. No need to run 2 compose instances if NGINX is only managing traffic for uptime-kuma

This whole compose file should be merge with the NGINX one. No need to run 2 compose instances if NGINX is only managing traffic for `uptime-kuma`
gaby commented 3 years ago (Migrated from github.com)
Owner

@louislam @mhkarimi1383 Added comment.

@louislam @mhkarimi1383 Added comment.
gaby commented 3 years ago (Migrated from github.com)
Owner

@mhkarimi1383

Example docker-compose.yml

version: '3'

services:
    nginx:
        image: nginx:stable
        container_name: nginx
        restart: always
        networks:
            - uptime-kuma
        ports:
            - 443:443
            - 80:80
        volumes:
            - /compose/volumes/nginx/:/etc/nginx/
            
    uptime-kuma:
        image: louislam/uptime-kuma:1-debian
        container_name: uptime-kuma
        restart: always
        networks:
            - uptime-kuma
        expose:
            - 3001
        volumes:
            - /compose/volumes/uptime-kuma:/app/data

networks:
  uptime-kuma: 
@mhkarimi1383 Example docker-compose.yml ``` version: '3' services: nginx: image: nginx:stable container_name: nginx restart: always networks: - uptime-kuma ports: - 443:443 - 80:80 volumes: - /compose/volumes/nginx/:/etc/nginx/ uptime-kuma: image: louislam/uptime-kuma:1-debian container_name: uptime-kuma restart: always networks: - uptime-kuma expose: - 3001 volumes: - /compose/volumes/uptime-kuma:/app/data networks: uptime-kuma: ```
mhkarimi1383 commented 3 years ago (Migrated from github.com)
Poster
Owner

I will add your suggestions...
thanks

I will add your suggestions... thanks
mhkarimi1383 commented 3 years ago (Migrated from github.com)
Poster
Owner

@gaby @louislam You suggestions Are applied with some improvements

@gaby @louislam You suggestions Are applied with some improvements
mhkarimi1383 commented 3 years ago (Migrated from github.com)
Poster
Owner

@gaby To see details about what I done for docker installation checkout here https://github.com/geerlingguy/ansible-role-docker#use-with-ansible-and-docker-python-library

@gaby To see details about what I done for docker installation checkout here https://github.com/geerlingguy/ansible-role-docker#use-with-ansible-and-docker-python-library

Reviewers

This pull request can be merged automatically.
You are not authorized to merge this pull request.
Sign in to join this conversation.
Loading…
There is no content yet.