migrate to new server

This commit is contained in:
Joerg Lehmann 2021-04-10 21:05:50 +02:00
parent 7c7dcb3815
commit cdb81295af
8 changed files with 20499 additions and 6 deletions

View File

@ -19,7 +19,7 @@ https://github.com/hetznercloud/cli
Temporaer einen API Key erstellen (nachher wieder loeschen) Temporaer einen API Key erstellen (nachher wieder loeschen)
``` ```
$ hcloud context create mini-beieli-server $ hcloud context create mini-beieli-server # evtl. zuerst: hcloud context delete mini-beieli-server
$ hcloud image list # zeigt moegliche Images $ hcloud image list # zeigt moegliche Images
$ hcloud server-type list # zeigt moegliche Typen $ hcloud server-type list # zeigt moegliche Typen
@ -59,8 +59,7 @@ Root-Passwort setzen (das machen wir von Hand)
``` ```
# curl https://get.acme.sh | sh -s email=info@nbit.ch # curl https://get.acme.sh | sh -s email=info@nbit.ch
# systemctl stop nginx # systemctl stop nginx
# acme.sh --issue -d mini-beieli.ch -d www.mini-beieli.ch -w /home/beieli/mini-beieli-web --standalone # acme.sh --issue --standalone -d mini-beieli.ch -d www.mini-beieli.ch -w /home/beieli/mini-beieli-web # --staging zum Testen
# restorecon -irv /etc/letsencrypt
[Sa Feb 27 17:27:34 CET 2021] Your cert is in /root/.acme.sh/mini-beieli.ch/mini-beieli.ch.cer [Sa Feb 27 17:27:34 CET 2021] Your cert is in /root/.acme.sh/mini-beieli.ch/mini-beieli.ch.cer
@ -70,6 +69,7 @@ Root-Passwort setzen (das machen wir von Hand)
Install Certificate: Install Certificate:
# acme.sh --install-cert -d mini-beieli.ch --key-file /etc/letsencrypt/mini-beieli.ch/mini-beieli.ch.key --fullchain-file /etc/letsencrypt/mini-beieli.ch/fullchain.cer --reloadcmd "service nginx force-reload" # acme.sh --install-cert -d mini-beieli.ch --key-file /etc/letsencrypt/mini-beieli.ch/mini-beieli.ch.key --fullchain-file /etc/letsencrypt/mini-beieli.ch/fullchain.cer --reloadcmd "service nginx force-reload"
# restorecon -irv /etc/letsencrypt
``` ```
### Influxdb Users ### Influxdb Users

View File

@ -9,5 +9,5 @@
- nginx - nginx
- redis - redis
- influxsw - influxsw
- lorahandler - mini-beieli-lorahandler
- mini-beieli-web - mini-beieli-web

View File

@ -7,6 +7,6 @@ mail_forward_address=joerg.lehmann@nbit.ch
document_root=/home/beieli/mini-beieli-web document_root=/home/beieli/mini-beieli-web
[mini_beieli_servers] [mini_beieli_servers]
mb1.mini-beieli.ch letsEncryptDomain=dev.mini-beieli.ch influx_token=XXX mb1.mini-beieli.ch letsEncryptDomain=mini-beieli.ch influx_token=3xt2X2djaSgIOD4mK4fHEoL6MvbdxLBiznaZTDjYF0-v-8x_0PQNSOkpzMPBoWWvas_Y3H7yMMhn6OMsU2Pk-A==
mb2.mini-beieli.ch letsEncryptDomain=mini-beieli.ch influx_token=YYY mb2.mini-beieli.ch letsEncryptDomain=mb-dev.mini-beieli.ch influx_token=YYY

View File

@ -18,6 +18,7 @@
- wget - wget
- git - git
- bzip2 - bzip2
- golang
- name: Enable SELinux - name: Enable SELinux
selinux: selinux:
@ -58,6 +59,14 @@
group: beieli group: beieli
mode: '0755' mode: '0755'
- name: Create /home/beieli/mini-beieli-lorahandler
file:
path: /home/beieli/mini-beieli-lorahandler
state: directory
owner: beieli
group: beieli
mode: '0755'
- name: Allow apache to read files in /home/beieli/mini-beieli-web - name: Allow apache to read files in /home/beieli/mini-beieli-web
sefcontext: sefcontext:
target: '/home/beieli/mini-beieli-web(/.*)?' target: '/home/beieli/mini-beieli-web(/.*)?'

View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>mini-beieli.ch - die besondere Bienenstockwaage</title>
<link rel="stylesheet" href="/mini-beieli-web.css">
<link rel="stylesheet" href="/mini-beieli-web-custom.css">
</head>
<body>
<div class="section px-4 py-4">
<div class="notification is-danger">
<strong>Oops, da ist was schiefgegangen!</strong>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,84 @@
.image.is-10by1 img, .image.is-20by3 img {
bottom: 0;
left: 0;
position: absolute;
right: 0;
top: 0;
height: 100%;
width: 100%;
}
.image.is-10by1 {
padding-top: 10%;
}
.image.is-20by3 {
padding-top: 15%;
}
hr {
margin: 0 0 15px 0;
}
.signup-box {
margin: auto;
width: 300px;
background: rgba(255,255,255,0.05);
border: 1px solid rgba(255,255,255,0.3);
border-radius: 10px;
}
.block-link {
text-decoration: none !important;
}
.apexcharts-title-text {
font-weight: 700 !important;
font-size: 24px !important;
font-family: "Rubik", sans-serif !important;
}
.apexcharts-legend {
font-family: "Rubik", sans-serif;
}
/**
* * The CSS shown here will not be introduced in the Quickstart guide, but
* * shows how you can use CSS to style your Element's container.
* */
input,
.StripeElement {
height: 40px;
padding: 10px 12px;
color: #32325d;
background-color: white;
border: 1px solid transparent;
border-radius: 4px;
box-shadow: 0 1px 3px 0 #e6ebf1;
-webkit-transition: box-shadow 150ms ease;
transition: box-shadow 150ms ease;
}
input:focus,
.StripeElement--focus {
box-shadow: 0 1px 3px 0 #cfd7df;
}
.StripeElement--invalid {
border-color: #fa755a;
}
.StripeElement--webkit-autofill {
background-color: #fefde5 !important;
}
.checkboxes input {
vertical-align: middle;
}
.checkboxes label span {
vertical-align: middle;
margin-left: 5px;
}

File diff suppressed because it is too large Load Diff

View File

@ -4,11 +4,18 @@
name: nginx name: nginx
- name: enable nginx - name: enable nginx
ignore_errors: yes
systemd: systemd:
name: nginx name: nginx
enabled: yes enabled: yes
state: started state: started
- name: Set httpd_can_network_connect flag on and keep it persistent across reboots
seboolean:
name: httpd_can_network_connect
state: yes
persistent: yes
- name: create /etc/nginx/nginx.conf from template - name: create /etc/nginx/nginx.conf from template
template: template:
src: nginx.conf.j2 src: nginx.conf.j2
@ -25,3 +32,26 @@
state: present state: present
notify: notify:
- Restore selinux context - Restore selinux context
- name: create certificate directory
file:
path: /etc/letsencrypt/{{ letsEncryptDomain }}
state: directory
- name: create static dir
file:
path: /home/beieli/mini-beieli-web/static
state: directory
- name: 502 error page
copy:
src: 502.html
dest: /home/beieli/mini-beieli-web/static/502.html
- name: copy css files
copy:
src: "{{ item }}"
dest: "/home/beieli/mini-beieli-web/static/{{ item }}"
loop:
- mini-beieli-web.css
- mini-beieli-web-custom.css