60 lines
2.0 KiB
Markdown
60 lines
2.0 KiB
Markdown
# wo-bisch-server - Server fuer den Dienst wo-bisch.ch
|
|
|
|
Code zum Erstellen des Servers
|
|
|
|
Spezifikaktion:
|
|
- CentOS 8
|
|
- Hetzner Cloud Server
|
|
- nginx Webserver/Proxy
|
|
- wo-bisch-web (Webapplikation/Golang)
|
|
- lorahandler (Webapplikation/Golang)
|
|
- Redis
|
|
|
|
## Erstellen des Servers
|
|
|
|
Mit dem Binary hcloud von:
|
|
https://github.com/hetznercloud/cli
|
|
|
|
Temporaer einen API Key erstellen (nachher wieder loeschen)
|
|
|
|
$ hcloud context create wo-bisch-server
|
|
$ hcloud image list # zeigt moegliche Images
|
|
$ hcloud server-type list # zeigt moegliche Typen
|
|
|
|
$ hcloud server create --name wobisch1 --image centos-8 --type cx11 --ssh-key joerg@cinnamon.nbit.ch
|
|
$ hcloud server set-rdns wobisch1 --hostname wobisch1.nbit.ch
|
|
$ IPV6="$(hcloud server ip wobisch1 -6)"
|
|
$ hcloud server set-rdns wobisch1 --ip $IPV6 --hostname wobisch1.nbit.ch
|
|
|
|
DNS Eintraege erstellen:
|
|
$ hcloud server ip wobisch1
|
|
$ hcloud server ip wobisch1 -6
|
|
|
|
Root-Passwort setzen (das machen wir von Hand)
|
|
|
|
## Ansible Playbook laufen lassen
|
|
|
|
$ cd ansible
|
|
$ ansible-playbook -i production wo-bisch-server.yml
|
|
|
|
Mailzugang muss auf mail.nbit.ch noch gegeben werden (main.cf)!
|
|
|
|
### Let's Encrypt Zertifikat einrichten
|
|
|
|
# curl https://get.acme.sh | sh -s email=info@nbit.ch
|
|
# acme.sh --issue -d wo-bisch.ch -d www.wo-bisch.ch -w /home/appuser/wo-bisch-web
|
|
|
|
[Sa Feb 27 17:27:34 CET 2021] Your cert is in /root/.acme.sh/wo-bisch.ch/wo-bisch.ch.cer
|
|
[Sa Feb 27 17:27:34 CET 2021] Your cert key is in /root/.acme.sh/wo-bisch.ch/wo-bisch.ch.key
|
|
[Sa Feb 27 17:27:34 CET 2021] The intermediate CA cert is in /root/.acme.sh/wo-bisch.ch/ca.cer
|
|
[Sa Feb 27 17:27:34 CET 2021] And the full chain certs is there: /root/.acme.sh/wo-bisch.ch/fullchain.cer
|
|
|
|
|
|
|
|
### Influxdb Users
|
|
admin: admin7355
|
|
Org: wobischorg
|
|
Bucket: wobischbucket
|
|
RW-Token: PWuleFEPB2YSduUkzkcW94V_-KFDK5Fi3MAeaA999Qe51OsGlJJSrcZ41pUAppCwF-z3rUNnyFQQJs8fCSTFzg==
|
|
RO-Token: TQvQxxLLAj1kTKWuEqcx7BA-KfE6WtJUeDlPa_Dnvms6Zqf6uh6lMbpXtzcsCjKO_x3PrpxxGDR5E6YnDB5PFg==
|