Repository files navigation

drift

CI:
E2E TestsUpdate DNS snapshot

Image builds:
confluenceldap-toolboxopenldapotel-collectorsimplesamlphpslack-invite-automationweb-1webdavcgi

Deploys:
Deploy Ansible common tagDeploy all Ansible servicesDeploy confluenceDeploy deployerDeploy dugnadenDeploy energi-extractorDeploy gatusDeploy internDeploy ldap-masterDeploy ldap-slaveDeploy ldap-toolboxDeploy mysql-1Deploy nginx-front-1Deploy okoreportsDeploy otel-collector-agentDeploy pgadminDeploy phpldapadminDeploy phpmyadminDeploy postgresql-1Deploy signozDeploy simplesamlphpDeploy slack-invite-automationDeploy smaabruket-availability-apiDeploy snipeitDeploy uka-billettDeploy uka-webserverDeploy users-apiDeploy web-1Deploy webdavcgi

Service status: https://status.foreningenbs.no

This Git-repo describes the setup of some our services. For more details, see https://foreningenbs.no/confluence/display/FBS/IT-gruppa

Design principles of our setup

The intention of these principles is to keep a simple and easily maintained setup with few components. We might consider moving to something more complex later (such as Kubernetes) if we need more HA capabilities or a platform to control services deployment.

  • Terraform is used to provision VMs in NREC. Only the minimal instance setup is done in Terraform / cloud-init, as any change to this will recreate the instances.
    • All data is stored on a separate volume mounted at /var/mnt/data, allowing us to more easily recreate instances if needed, and to have a single location to backup.
    • As host OS we use Fedora CoreOS which is self-updating.
  • Ansible is used to configure the hosts, including the mapping of which services run on the various hosts. When recreating a VM instance, Ansible should perform all required tasks for the host to be running properly in short time. Some manual tasks for moving data might be needed.
  • All hosts use ZeroTier to be in the same L2 network. A bridge named fbs0 and a docker network is set up to allow Docker containers to use IPs in this network. Each host has its own internal IP-range so ad-hoc containers can get IPs in this network.
  • All services run as Docker containers. The containers gets a static internal IPs and all containers can reach any other service on any host.
  • Services should be reached only by using its hostname, such as users-api.zt.foreningenbs.no. Published services are only published on the host they are running.

Network details

Note: ZeroTier DNS entries (*.zt) can be managed via dns/manage-record.sh. See https://foreningenbs.no/confluence/display/FBS/Kundedetaljer+Domeneshop for API credentials.

  • ZeroTier is set up to use:
    • 172.25.0.0/16
  • Auto-assign range for normal ZeroTier clients:
    • 172.25.0.0/23 (172.25.0.1 - 172.25.1.254)
  • Hosts:
    • 172.25.10.1 athene.zt.foreningenbs.no
    • 172.25.10.2 p.zt.foreningenbs.no
    • 172.25.10.3 uka-1.zt.foreningenbs.no (decommissioned)
    • 172.25.11.1 coreos-1.zt.foreningenbs.no (decommissioned)
    • 172.25.11.2 coreos-2.zt.foreningenbs.no (decommissioned)
    • 172.25.11.3 coreos-3.zt.foreningenbs.no (decommissioned)
    • 172.25.11.4 coreos-4.zt.foreningenbs.no (decommissioned)
    • 172.25.12.1 fcos-1.zt.foreningenbs.no
    • 172.25.12.2 fcos-2.zt.foreningenbs.no
    • 172.25.12.3 fcos-3.zt.foreningenbs.no
    • 172.25.12.4 fbshs1.zt.foreningenbs.no
  • IP-ranges for ad-hoc containers with Docker:
    • 172.25.21.0/24 coreos-1 (decommissioned)
    • 172.25.22.0/24 coreos-2 (decommissioned)
    • 172.25.23.0/24 coreos-3 (decommissioned)
    • 172.25.24.0/24 coreos-4 (decommissioned)
    • 172.25.25.0/24 uka-1 (decommissioned)
    • 172.25.26.0/24 fcos-1
    • 172.25.27.0/24 fcos-2
    • 172.25.28.0/24 fcos-3
    • 172.25.29.0/24 fbshs1
  • IP-range used for allocation of services:
    • 172.25.16.0/22 (172.25.16.0-172.25.19.255)
  • Allocated services:
    • 172.25.16.1 web-1.zt.foreningenbs.no
    • 172.25.16.2 users-api.zt.foreningenbs.no
    • 172.25.16.3 intern-backend.zt.foreningenbs.no
    • 172.25.16.4 intern-frontend.zt.foreningenbs.no (decommissioned)
    • 172.25.16.5 okoreports-backend.zt.foreningenbs.no
    • 172.25.16.6 okoreports-frontend.zt.foreningenbs.no
    • 172.25.16.7 smaabruket-availability-api.zt.foreningenbs.no
    • 172.25.16.8 confluence.zt.foreningenbs.no
    • 172.25.16.9 slack-invite-automation.zt.foreningenbs.no
    • 172.25.16.10 dugnaden.zt.foreningenbs.no
    • 172.25.16.11 phpldapadmin.zt.foreningenbs.no
    • 172.25.16.12 phpmyadmin.zt.foreningenbs.no
    • 172.25.16.13 simplesamlphp.zt.foreningenbs.no
    • 172.25.16.14 nginx-front-1.zt.foreningenbs.no
    • 172.25.16.15 storage-1-samba.zt.foreningenbs.no (not set up yet)
    • 172.25.16.16 webdavcgi.zt.foreningenbs.no
    • 172.25.16.17 intern-calendar-api.zt.foreningenbs.no
    • 172.25.16.18 gatus.zt.foreningenbs.no
    • 172.25.16.30 ldap-master.zt.foreningenbs.no
    • 172.25.16.31 ldap-slave.zt.foreningenbs.no
    • 172.25.16.40 mysql-1.zt.foreningenbs.no
    • 172.25.16.41 mongodb-1.zt.foreningenbs.no (decommissioned)
    • 172.25.16.42 postgresql-1.zt.foreningenbs.no
    • 172.25.16.43 mysql-2.zt.foreningenbs.no (decommissioned)
    • 172.25.16.44 snipeit.zt.foreningenbs.no
    • 172.25.16.45 snipe-mysql.zt.foreningenbs.no (decommissioned)
    • 172.25.16.46 uka-mysql.zt.foreningenbs.no (decommissioned)
    • 172.25.16.47 uka-webserver.zt.foreningenbs.no
    • 172.25.16.48 uka-billett-proxy.zt.foreningenbs.no
    • 172.25.16.49 uka-billett-fpm.zt.foreningenbs.no
    • 172.25.16.50 uka-billett-frontend.zt.foreningenbs.no
    • 172.25.16.51 deployer.zt.foreningenbs.no
    • 172.25.16.52 deployer-secondary.zt.foreningenbs.no
    • 172.25.16.53 mongodb-2.zt.foreningenbs.no (decommissioned)
    • 172.25.16.54 energi-extractor (no DNS record created, only outband traffic)
    • 172.25.16.55 dugnaden-mysql.zt.foreningenbs.no (decommissioned)
    • 172.25.16.56 ldap-toolbox.zt.foreningenbs.no
    • 172.25.16.57 pgadmin.zt.foreningenbs.no
    • 172.25.16.60 signoz-zookeeper.zt.foreningenbs.no
    • 172.25.16.61 signoz-clickhouse.zt.foreningenbs.no
    • 172.25.16.62 signoz-otel-collector.zt.foreningenbs.no (OTLP: 4317/4318)
    • 172.25.16.63 signoz.zt.foreningenbs.no (UI: port 8080)

Public web

The service nginx-front-1 is published at port 80 and 443 and acts as the reverse proxy for public traffic. DNS-entries must be set up for this for the physical host this is running at:

  • foreningenbs.no: 158.39.48.49 (fcos-3)
  • www.foreningenbs.no: 158.39.48.49 (fcos-3)
  • deployer.foreningenbs.no: 158.39.48.49 (fcos-3)
  • deployer-secondary.foreningenbs.no: 158.39.48.49 (fcos-3)
  • signoz.foreningenbs.no: 158.39.48.49 (fcos-3)
  • status.foreningenbs.no: 158.39.48.49 (fcos-3)
  • blindernuka.no: 158.39.48.49 (fcos-3)
  • www.blindernuka.no: 158.39.48.49 (fcos-3)
  • billett.blindernuka.no: 158.39.48.49 (fcos-3)

This service also keeps our Let's Encrypt certificates up-to-date.

ZeroTier details

To manage the network, log in to https://my.zerotier.com/network/a84ac5c10a9c7522 using the credentials stored at https://foreningenbs.no/confluence/display/FBS/Kundeforhold+ZeroTier

To add a new ad-hoc client to the network:

  • Install ZeroTier from https://www.zerotier.com/ or use https://github.com/henrist/zerotier-one-docker.
  • Request to join network a84ac5c10a9c7522 (leave only "allow managed" checked).
  • Authorize the client in the ZeroTier dashboard linked above.
  • Give the client a description so we keep track of what is connected.
  • You should now be able to ping e.g. fcos-1.zt.foreningenbs.no.

SigNoz (Observability)

SigNoz provides observability (traces, metrics, logs) for our services.

  • UI: https://signoz.foreningenbs.no (or http://signoz.zt.foreningenbs.no:8080 via ZeroTier)
  • Auth: Google OAuth SSO (OAuth client signoz in GCP project foreningenbs) — any @blindernuka.no account can login (viewer access by default)
  • OTLP gRPC: signoz-otel-collector.zt.foreningenbs.no:4317
  • OTLP HTTP: signoz-otel-collector.zt.foreningenbs.no:4318

To send data from a service, configure it to export OTLP to the collector endpoint.

Deployment kill switch

To temporarily disable all automated deployments, set the repository variable DEPLOY_DISABLED to true in Settings → Variables → Actions. Remove or set to any other value to re-enable.

Outgoing email

We use Google Workspace SMTP relay service to send email.

For this to work, all the IPs of our instances must be registered in our Google Workspace account. See https://admin.google.com/u/0/ac/apps/gmail/routing

More details: https://support.google.com/a/answer/176600

Google Cloud credentials

Each host has its own GCP service account to pull images from Artifact Registry. Managed via Terraform in gcp/. The gcp-credentials Ansible role places relevant symlinks.

Encryption in this repo

This repo uses git-crypt to encrypt sensitive files.

In addition, some files are encrypted using Ansible Vault. The encryption key used for this is stored in this repo. The intention of using Ansible Vault is to avoid having plain text files in local working directories, which is the default behaviour with git-crypt.

Debugging

The instances comes with https://containertoolbx.org/install/ preinstalled.

To access an environment where you can install tools etc use:

toolbox enter

About

IT-services for Foreningen Blindern Studenterhjem

Resources

Stars

2 stars

Watchers

5 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Repository files navigation

drift

CI:
E2E TestsUpdate DNS snapshot

Image builds:
confluenceldap-toolboxopenldapotel-collectorsimplesamlphpslack-invite-automationweb-1webdavcgi

Deploys:
Deploy Ansible common tagDeploy all Ansible servicesDeploy confluenceDeploy deployerDeploy dugnadenDeploy energi-extractorDeploy gatusDeploy internDeploy ldap-masterDeploy ldap-slaveDeploy ldap-toolboxDeploy mysql-1Deploy nginx-front-1Deploy okoreportsDeploy otel-collector-agentDeploy pgadminDeploy phpldapadminDeploy phpmyadminDeploy postgresql-1Deploy signozDeploy simplesamlphpDeploy slack-invite-automationDeploy smaabruket-availability-apiDeploy snipeitDeploy uka-billettDeploy uka-webserverDeploy users-apiDeploy web-1Deploy webdavcgi

Service status: https://status.foreningenbs.no

This Git-repo describes the setup of some our services. For more details, see https://foreningenbs.no/confluence/display/FBS/IT-gruppa

Design principles of our setup

The intention of these principles is to keep a simple and easily maintained setup with few components. We might consider moving to something more complex later (such as Kubernetes) if we need more HA capabilities or a platform to control services deployment.

  • Terraform is used to provision VMs in NREC. Only the minimal instance setup is done in Terraform / cloud-init, as any change to this will recreate the instances.
    • All data is stored on a separate volume mounted at /var/mnt/data, allowing us to more easily recreate instances if needed, and to have a single location to backup.
    • As host OS we use Fedora CoreOS which is self-updating.
  • Ansible is used to configure the hosts, including the mapping of which services run on the various hosts. When recreating a VM instance, Ansible should perform all required tasks for the host to be running properly in short time. Some manual tasks for moving data might be needed.
  • All hosts use ZeroTier to be in the same L2 network. A bridge named fbs0 and a docker network is set up to allow Docker containers to use IPs in this network. Each host has its own internal IP-range so ad-hoc containers can get IPs in this network.
  • All services run as Docker containers. The containers gets a static internal IPs and all containers can reach any other service on any host.
  • Services should be reached only by using its hostname, such as users-api.zt.foreningenbs.no. Published services are only published on the host they are running.

Network details

Note: ZeroTier DNS entries (*.zt) can be managed via dns/manage-record.sh. See https://foreningenbs.no/confluence/display/FBS/Kundedetaljer+Domeneshop for API credentials.

  • ZeroTier is set up to use:
    • 172.25.0.0/16
  • Auto-assign range for normal ZeroTier clients:
    • 172.25.0.0/23 (172.25.0.1 - 172.25.1.254)
  • Hosts:
    • 172.25.10.1 athene.zt.foreningenbs.no
    • 172.25.10.2 p.zt.foreningenbs.no
    • 172.25.10.3 uka-1.zt.foreningenbs.no (decommissioned)
    • 172.25.11.1 coreos-1.zt.foreningenbs.no (decommissioned)
    • 172.25.11.2 coreos-2.zt.foreningenbs.no (decommissioned)
    • 172.25.11.3 coreos-3.zt.foreningenbs.no (decommissioned)
    • 172.25.11.4 coreos-4.zt.foreningenbs.no (decommissioned)
    • 172.25.12.1 fcos-1.zt.foreningenbs.no
    • 172.25.12.2 fcos-2.zt.foreningenbs.no
    • 172.25.12.3 fcos-3.zt.foreningenbs.no
    • 172.25.12.4 fbshs1.zt.foreningenbs.no
  • IP-ranges for ad-hoc containers with Docker:
    • 172.25.21.0/24 coreos-1 (decommissioned)
    • 172.25.22.0/24 coreos-2 (decommissioned)
    • 172.25.23.0/24 coreos-3 (decommissioned)
    • 172.25.24.0/24 coreos-4 (decommissioned)
    • 172.25.25.0/24 uka-1 (decommissioned)
    • 172.25.26.0/24 fcos-1
    • 172.25.27.0/24 fcos-2
    • 172.25.28.0/24 fcos-3
    • 172.25.29.0/24 fbshs1
  • IP-range used for allocation of services:
    • 172.25.16.0/22 (172.25.16.0-172.25.19.255)
  • Allocated services:
    • 172.25.16.1 web-1.zt.foreningenbs.no
    • 172.25.16.2 users-api.zt.foreningenbs.no
    • 172.25.16.3 intern-backend.zt.foreningenbs.no
    • 172.25.16.4 intern-frontend.zt.foreningenbs.no (decommissioned)
    • 172.25.16.5 okoreports-backend.zt.foreningenbs.no
    • 172.25.16.6 okoreports-frontend.zt.foreningenbs.no
    • 172.25.16.7 smaabruket-availability-api.zt.foreningenbs.no
    • 172.25.16.8 confluence.zt.foreningenbs.no
    • 172.25.16.9 slack-invite-automation.zt.foreningenbs.no
    • 172.25.16.10 dugnaden.zt.foreningenbs.no
    • 172.25.16.11 phpldapadmin.zt.foreningenbs.no
    • 172.25.16.12 phpmyadmin.zt.foreningenbs.no
    • 172.25.16.13 simplesamlphp.zt.foreningenbs.no
    • 172.25.16.14 nginx-front-1.zt.foreningenbs.no
    • 172.25.16.15 storage-1-samba.zt.foreningenbs.no (not set up yet)
    • 172.25.16.16 webdavcgi.zt.foreningenbs.no
    • 172.25.16.17 intern-calendar-api.zt.foreningenbs.no
    • 172.25.16.18 gatus.zt.foreningenbs.no
    • 172.25.16.30 ldap-master.zt.foreningenbs.no
    • 172.25.16.31 ldap-slave.zt.foreningenbs.no
    • 172.25.16.40 mysql-1.zt.foreningenbs.no
    • 172.25.16.41 mongodb-1.zt.foreningenbs.no (decommissioned)
    • 172.25.16.42 postgresql-1.zt.foreningenbs.no
    • 172.25.16.43 mysql-2.zt.foreningenbs.no (decommissioned)
    • 172.25.16.44 snipeit.zt.foreningenbs.no
    • 172.25.16.45 snipe-mysql.zt.foreningenbs.no (decommissioned)
    • 172.25.16.46 uka-mysql.zt.foreningenbs.no (decommissioned)
    • 172.25.16.47 uka-webserver.zt.foreningenbs.no
    • 172.25.16.48 uka-billett-proxy.zt.foreningenbs.no
    • 172.25.16.49 uka-billett-fpm.zt.foreningenbs.no
    • 172.25.16.50 uka-billett-frontend.zt.foreningenbs.no
    • 172.25.16.51 deployer.zt.foreningenbs.no
    • 172.25.16.52 deployer-secondary.zt.foreningenbs.no
    • 172.25.16.53 mongodb-2.zt.foreningenbs.no (decommissioned)
    • 172.25.16.54 energi-extractor (no DNS record created, only outband traffic)
    • 172.25.16.55 dugnaden-mysql.zt.foreningenbs.no (decommissioned)
    • 172.25.16.56 ldap-toolbox.zt.foreningenbs.no
    • 172.25.16.57 pgadmin.zt.foreningenbs.no
    • 172.25.16.60 signoz-zookeeper.zt.foreningenbs.no
    • 172.25.16.61 signoz-clickhouse.zt.foreningenbs.no
    • 172.25.16.62 signoz-otel-collector.zt.foreningenbs.no (OTLP: 4317/4318)
    • 172.25.16.63 signoz.zt.foreningenbs.no (UI: port 8080)

Public web

The service nginx-front-1 is published at port 80 and 443 and acts as the reverse proxy for public traffic. DNS-entries must be set up for this for the physical host this is running at:

  • foreningenbs.no: 158.39.48.49 (fcos-3)
  • www.foreningenbs.no: 158.39.48.49 (fcos-3)
  • deployer.foreningenbs.no: 158.39.48.49 (fcos-3)
  • deployer-secondary.foreningenbs.no: 158.39.48.49 (fcos-3)
  • signoz.foreningenbs.no: 158.39.48.49 (fcos-3)
  • status.foreningenbs.no: 158.39.48.49 (fcos-3)
  • blindernuka.no: 158.39.48.49 (fcos-3)
  • www.blindernuka.no: 158.39.48.49 (fcos-3)
  • billett.blindernuka.no: 158.39.48.49 (fcos-3)

This service also keeps our Let's Encrypt certificates up-to-date.

ZeroTier details

To manage the network, log in to https://my.zerotier.com/network/a84ac5c10a9c7522 using the credentials stored at https://foreningenbs.no/confluence/display/FBS/Kundeforhold+ZeroTier

To add a new ad-hoc client to the network:

  • Install ZeroTier from https://www.zerotier.com/ or use https://github.com/henrist/zerotier-one-docker.
  • Request to join network a84ac5c10a9c7522 (leave only "allow managed" checked).
  • Authorize the client in the ZeroTier dashboard linked above.
  • Give the client a description so we keep track of what is connected.
  • You should now be able to ping e.g. fcos-1.zt.foreningenbs.no.

SigNoz (Observability)

SigNoz provides observability (traces, metrics, logs) for our services.

  • UI: https://signoz.foreningenbs.no (or http://signoz.zt.foreningenbs.no:8080 via ZeroTier)
  • Auth: Google OAuth SSO (OAuth client signoz in GCP project foreningenbs) — any @blindernuka.no account can login (viewer access by default)
  • OTLP gRPC: signoz-otel-collector.zt.foreningenbs.no:4317
  • OTLP HTTP: signoz-otel-collector.zt.foreningenbs.no:4318

To send data from a service, configure it to export OTLP to the collector endpoint.

Deployment kill switch

To temporarily disable all automated deployments, set the repository variable DEPLOY_DISABLED to true in Settings → Variables → Actions. Remove or set to any other value to re-enable.

Outgoing email

We use Google Workspace SMTP relay service to send email.

For this to work, all the IPs of our instances must be registered in our Google Workspace account. See https://admin.google.com/u/0/ac/apps/gmail/routing

More details: https://support.google.com/a/answer/176600

Google Cloud credentials

Each host has its own GCP service account to pull images from Artifact Registry. Managed via Terraform in gcp/. The gcp-credentials Ansible role places relevant symlinks.

Encryption in this repo

This repo uses git-crypt to encrypt sensitive files.

In addition, some files are encrypted using Ansible Vault. The encryption key used for this is stored in this repo. The intention of using Ansible Vault is to avoid having plain text files in local working directories, which is the default behaviour with git-crypt.

Debugging

The instances comes with https://containertoolbx.org/install/ preinstalled.

To access an environment where you can install tools etc use:

toolbox enter

About

IT-services for Foreningen Blindern Studenterhjem

Resources

Stars

2 stars

Watchers

5 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

drift

CI:
E2E TestsUpdate DNS snapshot

Image builds:
confluenceldap-toolboxopenldapotel-collectorsimplesamlphpslack-invite-automationweb-1webdavcgi

Deploys:
Deploy Ansible common tagDeploy all Ansible servicesDeploy confluenceDeploy deployerDeploy dugnadenDeploy energi-extractorDeploy gatusDeploy internDeploy ldap-masterDeploy ldap-slaveDeploy ldap-toolboxDeploy mysql-1Deploy nginx-front-1Deploy okoreportsDeploy otel-collector-agentDeploy pgadminDeploy phpldapadminDeploy phpmyadminDeploy postgresql-1Deploy signozDeploy simplesamlphpDeploy slack-invite-automationDeploy smaabruket-availability-apiDeploy snipeitDeploy uka-billettDeploy uka-webserverDeploy users-apiDeploy web-1Deploy webdavcgi

Service status: https://status.foreningenbs.no

This Git-repo describes the setup of some our services. For more details, see https://foreningenbs.no/confluence/display/FBS/IT-gruppa

Design principles of our setup

The intention of these principles is to keep a simple and easily maintained setup with few components. We might consider moving to something more complex later (such as Kubernetes) if we need more HA capabilities or a platform to control services deployment.

  • Terraform is used to provision VMs in NREC. Only the minimal instance setup is done in Terraform / cloud-init, as any change to this will recreate the instances.
    • All data is stored on a separate volume mounted at /var/mnt/data, allowing us to more easily recreate instances if needed, and to have a single location to backup.
    • As host OS we use Fedora CoreOS which is self-updating.
  • Ansible is used to configure the hosts, including the mapping of which services run on the various hosts. When recreating a VM instance, Ansible should perform all required tasks for the host to be running properly in short time. Some manual tasks for moving data might be needed.
  • All hosts use ZeroTier to be in the same L2 network. A bridge named fbs0 and a docker network is set up to allow Docker containers to use IPs in this network. Each host has its own internal IP-range so ad-hoc containers can get IPs in this network.
  • All services run as Docker containers. The containers gets a static internal IPs and all containers can reach any other service on any host.
  • Services should be reached only by using its hostname, such as users-api.zt.foreningenbs.no. Published services are only published on the host they are running.

Network details

Note: ZeroTier DNS entries (*.zt) can be managed via dns/manage-record.sh. See https://foreningenbs.no/confluence/display/FBS/Kundedetaljer+Domeneshop for API credentials.

  • ZeroTier is set up to use:
    • 172.25.0.0/16
  • Auto-assign range for normal ZeroTier clients:
    • 172.25.0.0/23 (172.25.0.1 - 172.25.1.254)
  • Hosts:
    • 172.25.10.1 athene.zt.foreningenbs.no
    • 172.25.10.2 p.zt.foreningenbs.no
    • 172.25.10.3 uka-1.zt.foreningenbs.no (decommissioned)
    • 172.25.11.1 coreos-1.zt.foreningenbs.no (decommissioned)
    • 172.25.11.2 coreos-2.zt.foreningenbs.no (decommissioned)
    • 172.25.11.3 coreos-3.zt.foreningenbs.no (decommissioned)
    • 172.25.11.4 coreos-4.zt.foreningenbs.no (decommissioned)
    • 172.25.12.1 fcos-1.zt.foreningenbs.no
    • 172.25.12.2 fcos-2.zt.foreningenbs.no
    • 172.25.12.3 fcos-3.zt.foreningenbs.no
    • 172.25.12.4 fbshs1.zt.foreningenbs.no
  • IP-ranges for ad-hoc containers with Docker:
    • 172.25.21.0/24 coreos-1 (decommissioned)
    • 172.25.22.0/24 coreos-2 (decommissioned)
    • 172.25.23.0/24 coreos-3 (decommissioned)
    • 172.25.24.0/24 coreos-4 (decommissioned)
    • 172.25.25.0/24 uka-1 (decommissioned)
    • 172.25.26.0/24 fcos-1
    • 172.25.27.0/24 fcos-2
    • 172.25.28.0/24 fcos-3
    • 172.25.29.0/24 fbshs1
  • IP-range used for allocation of services:
    • 172.25.16.0/22 (172.25.16.0-172.25.19.255)
  • Allocated services:
    • 172.25.16.1 web-1.zt.foreningenbs.no
    • 172.25.16.2 users-api.zt.foreningenbs.no
    • 172.25.16.3 intern-backend.zt.foreningenbs.no
    • 172.25.16.4 intern-frontend.zt.foreningenbs.no (decommissioned)
    • 172.25.16.5 okoreports-backend.zt.foreningenbs.no
    • 172.25.16.6 okoreports-frontend.zt.foreningenbs.no
    • 172.25.16.7 smaabruket-availability-api.zt.foreningenbs.no
    • 172.25.16.8 confluence.zt.foreningenbs.no
    • 172.25.16.9 slack-invite-automation.zt.foreningenbs.no
    • 172.25.16.10 dugnaden.zt.foreningenbs.no
    • 172.25.16.11 phpldapadmin.zt.foreningenbs.no
    • 172.25.16.12 phpmyadmin.zt.foreningenbs.no
    • 172.25.16.13 simplesamlphp.zt.foreningenbs.no
    • 172.25.16.14 nginx-front-1.zt.foreningenbs.no
    • 172.25.16.15 storage-1-samba.zt.foreningenbs.no (not set up yet)
    • 172.25.16.16 webdavcgi.zt.foreningenbs.no
    • 172.25.16.17 intern-calendar-api.zt.foreningenbs.no
    • 172.25.16.18 gatus.zt.foreningenbs.no
    • 172.25.16.30 ldap-master.zt.foreningenbs.no
    • 172.25.16.31 ldap-slave.zt.foreningenbs.no
    • 172.25.16.40 mysql-1.zt.foreningenbs.no
    • 172.25.16.41 mongodb-1.zt.foreningenbs.no (decommissioned)
    • 172.25.16.42 postgresql-1.zt.foreningenbs.no
    • 172.25.16.43 mysql-2.zt.foreningenbs.no (decommissioned)
    • 172.25.16.44 snipeit.zt.foreningenbs.no
    • 172.25.16.45 snipe-mysql.zt.foreningenbs.no (decommissioned)
    • 172.25.16.46 uka-mysql.zt.foreningenbs.no (decommissioned)
    • 172.25.16.47 uka-webserver.zt.foreningenbs.no
    • 172.25.16.48 uka-billett-proxy.zt.foreningenbs.no
    • 172.25.16.49 uka-billett-fpm.zt.foreningenbs.no
    • 172.25.16.50 uka-billett-frontend.zt.foreningenbs.no
    • 172.25.16.51 deployer.zt.foreningenbs.no
    • 172.25.16.52 deployer-secondary.zt.foreningenbs.no
    • 172.25.16.53 mongodb-2.zt.foreningenbs.no (decommissioned)
    • 172.25.16.54 energi-extractor (no DNS record created, only outband traffic)
    • 172.25.16.55 dugnaden-mysql.zt.foreningenbs.no (decommissioned)
    • 172.25.16.56 ldap-toolbox.zt.foreningenbs.no
    • 172.25.16.57 pgadmin.zt.foreningenbs.no
    • 172.25.16.60 signoz-zookeeper.zt.foreningenbs.no
    • 172.25.16.61 signoz-clickhouse.zt.foreningenbs.no
    • 172.25.16.62 signoz-otel-collector.zt.foreningenbs.no (OTLP: 4317/4318)
    • 172.25.16.63 signoz.zt.foreningenbs.no (UI: port 8080)

Public web

The service nginx-front-1 is published at port 80 and 443 and acts as the reverse proxy for public traffic. DNS-entries must be set up for this for the physical host this is running at:

  • foreningenbs.no: 158.39.48.49 (fcos-3)
  • www.foreningenbs.no: 158.39.48.49 (fcos-3)
  • deployer.foreningenbs.no: 158.39.48.49 (fcos-3)
  • deployer-secondary.foreningenbs.no: 158.39.48.49 (fcos-3)
  • signoz.foreningenbs.no: 158.39.48.49 (fcos-3)
  • status.foreningenbs.no: 158.39.48.49 (fcos-3)
  • blindernuka.no: 158.39.48.49 (fcos-3)
  • www.blindernuka.no: 158.39.48.49 (fcos-3)
  • billett.blindernuka.no: 158.39.48.49 (fcos-3)

This service also keeps our Let's Encrypt certificates up-to-date.

ZeroTier details

To manage the network, log in to https://my.zerotier.com/network/a84ac5c10a9c7522 using the credentials stored at https://foreningenbs.no/confluence/display/FBS/Kundeforhold+ZeroTier

To add a new ad-hoc client to the network:

  • Install ZeroTier from https://www.zerotier.com/ or use https://github.com/henrist/zerotier-one-docker.
  • Request to join network a84ac5c10a9c7522 (leave only "allow managed" checked).
  • Authorize the client in the ZeroTier dashboard linked above.
  • Give the client a description so we keep track of what is connected.
  • You should now be able to ping e.g. fcos-1.zt.foreningenbs.no.

SigNoz (Observability)

SigNoz provides observability (traces, metrics, logs) for our services.

  • UI: https://signoz.foreningenbs.no (or http://signoz.zt.foreningenbs.no:8080 via ZeroTier)
  • Auth: Google OAuth SSO (OAuth client signoz in GCP project foreningenbs) — any @blindernuka.no account can login (viewer access by default)
  • OTLP gRPC: signoz-otel-collector.zt.foreningenbs.no:4317
  • OTLP HTTP: signoz-otel-collector.zt.foreningenbs.no:4318

To send data from a service, configure it to export OTLP to the collector endpoint.

Deployment kill switch

To temporarily disable all automated deployments, set the repository variable DEPLOY_DISABLED to true in Settings → Variables → Actions. Remove or set to any other value to re-enable.

Outgoing email

We use Google Workspace SMTP relay service to send email.

For this to work, all the IPs of our instances must be registered in our Google Workspace account. See https://admin.google.com/u/0/ac/apps/gmail/routing

More details: https://support.google.com/a/answer/176600

Google Cloud credentials

Each host has its own GCP service account to pull images from Artifact Registry. Managed via Terraform in gcp/. The gcp-credentials Ansible role places relevant symlinks.

Encryption in this repo

This repo uses git-crypt to encrypt sensitive files.

In addition, some files are encrypted using Ansible Vault. The encryption key used for this is stored in this repo. The intention of using Ansible Vault is to avoid having plain text files in local working directories, which is the default behaviour with git-crypt.

Debugging

The instances comes with https://containertoolbx.org/install/ preinstalled.

To access an environment where you can install tools etc use:

toolbox enter

About

IT-services for Foreningen Blindern Studenterhjem

Resources

Stars

2 stars

Watchers

5 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

drift

CI:
E2E TestsUpdate DNS snapshot

Image builds:
confluenceldap-toolboxopenldapotel-collectorsimplesamlphpslack-invite-automationweb-1webdavcgi

Deploys:
Deploy Ansible common tagDeploy all Ansible servicesDeploy confluenceDeploy deployerDeploy dugnadenDeploy energi-extractorDeploy gatusDeploy internDeploy ldap-masterDeploy ldap-slaveDeploy ldap-toolboxDeploy mysql-1Deploy nginx-front-1Deploy okoreportsDeploy otel-collector-agentDeploy pgadminDeploy phpldapadminDeploy phpmyadminDeploy postgresql-1Deploy signozDeploy simplesamlphpDeploy slack-invite-automationDeploy smaabruket-availability-apiDeploy snipeitDeploy uka-billettDeploy uka-webserverDeploy users-apiDeploy web-1Deploy webdavcgi

Service status: https://status.foreningenbs.no

This Git-repo describes the setup of some our services. For more details, see https://foreningenbs.no/confluence/display/FBS/IT-gruppa

Design principles of our setup

The intention of these principles is to keep a simple and easily maintained setup with few components. We might consider moving to something more complex later (such as Kubernetes) if we need more HA capabilities or a platform to control services deployment.

  • Terraform is used to provision VMs in NREC. Only the minimal instance setup is done in Terraform / cloud-init, as any change to this will recreate the instances.
    • All data is stored on a separate volume mounted at /var/mnt/data, allowing us to more easily recreate instances if needed, and to have a single location to backup.
    • As host OS we use Fedora CoreOS which is self-updating.
  • Ansible is used to configure the hosts, including the mapping of which services run on the various hosts. When recreating a VM instance, Ansible should perform all required tasks for the host to be running properly in short time. Some manual tasks for moving data might be needed.
  • All hosts use ZeroTier to be in the same L2 network. A bridge named fbs0 and a docker network is set up to allow Docker containers to use IPs in this network. Each host has its own internal IP-range so ad-hoc containers can get IPs in this network.
  • All services run as Docker containers. The containers gets a static internal IPs and all containers can reach any other service on any host.
  • Services should be reached only by using its hostname, such as users-api.zt.foreningenbs.no. Published services are only published on the host they are running.

Network details

Note: ZeroTier DNS entries (*.zt) can be managed via dns/manage-record.sh. See https://foreningenbs.no/confluence/display/FBS/Kundedetaljer+Domeneshop for API credentials.

  • ZeroTier is set up to use:
    • 172.25.0.0/16
  • Auto-assign range for normal ZeroTier clients:
    • 172.25.0.0/23 (172.25.0.1 - 172.25.1.254)
  • Hosts:
    • 172.25.10.1 athene.zt.foreningenbs.no
    • 172.25.10.2 p.zt.foreningenbs.no
    • 172.25.10.3 uka-1.zt.foreningenbs.no (decommissioned)
    • 172.25.11.1 coreos-1.zt.foreningenbs.no (decommissioned)
    • 172.25.11.2 coreos-2.zt.foreningenbs.no (decommissioned)
    • 172.25.11.3 coreos-3.zt.foreningenbs.no (decommissioned)
    • 172.25.11.4 coreos-4.zt.foreningenbs.no (decommissioned)
    • 172.25.12.1 fcos-1.zt.foreningenbs.no
    • 172.25.12.2 fcos-2.zt.foreningenbs.no
    • 172.25.12.3 fcos-3.zt.foreningenbs.no
    • 172.25.12.4 fbshs1.zt.foreningenbs.no
  • IP-ranges for ad-hoc containers with Docker:
    • 172.25.21.0/24 coreos-1 (decommissioned)
    • 172.25.22.0/24 coreos-2 (decommissioned)
    • 172.25.23.0/24 coreos-3 (decommissioned)
    • 172.25.24.0/24 coreos-4 (decommissioned)
    • 172.25.25.0/24 uka-1 (decommissioned)
    • 172.25.26.0/24 fcos-1
    • 172.25.27.0/24 fcos-2
    • 172.25.28.0/24 fcos-3
    • 172.25.29.0/24 fbshs1
  • IP-range used for allocation of services:
    • 172.25.16.0/22 (172.25.16.0-172.25.19.255)
  • Allocated services:
    • 172.25.16.1 web-1.zt.foreningenbs.no
    • 172.25.16.2 users-api.zt.foreningenbs.no
    • 172.25.16.3 intern-backend.zt.foreningenbs.no
    • 172.25.16.4 intern-frontend.zt.foreningenbs.no (decommissioned)
    • 172.25.16.5 okoreports-backend.zt.foreningenbs.no
    • 172.25.16.6 okoreports-frontend.zt.foreningenbs.no
    • 172.25.16.7 smaabruket-availability-api.zt.foreningenbs.no
    • 172.25.16.8 confluence.zt.foreningenbs.no
    • 172.25.16.9 slack-invite-automation.zt.foreningenbs.no
    • 172.25.16.10 dugnaden.zt.foreningenbs.no
    • 172.25.16.11 phpldapadmin.zt.foreningenbs.no
    • 172.25.16.12 phpmyadmin.zt.foreningenbs.no
    • 172.25.16.13 simplesamlphp.zt.foreningenbs.no
    • 172.25.16.14 nginx-front-1.zt.foreningenbs.no
    • 172.25.16.15 storage-1-samba.zt.foreningenbs.no (not set up yet)
    • 172.25.16.16 webdavcgi.zt.foreningenbs.no
    • 172.25.16.17 intern-calendar-api.zt.foreningenbs.no
    • 172.25.16.18 gatus.zt.foreningenbs.no
    • 172.25.16.30 ldap-master.zt.foreningenbs.no
    • 172.25.16.31 ldap-slave.zt.foreningenbs.no
    • 172.25.16.40 mysql-1.zt.foreningenbs.no
    • 172.25.16.41 mongodb-1.zt.foreningenbs.no (decommissioned)
    • 172.25.16.42 postgresql-1.zt.foreningenbs.no
    • 172.25.16.43 mysql-2.zt.foreningenbs.no (decommissioned)
    • 172.25.16.44 snipeit.zt.foreningenbs.no
    • 172.25.16.45 snipe-mysql.zt.foreningenbs.no (decommissioned)
    • 172.25.16.46 uka-mysql.zt.foreningenbs.no (decommissioned)
    • 172.25.16.47 uka-webserver.zt.foreningenbs.no
    • 172.25.16.48 uka-billett-proxy.zt.foreningenbs.no
    • 172.25.16.49 uka-billett-fpm.zt.foreningenbs.no
    • 172.25.16.50 uka-billett-frontend.zt.foreningenbs.no
    • 172.25.16.51 deployer.zt.foreningenbs.no
    • 172.25.16.52 deployer-secondary.zt.foreningenbs.no
    • 172.25.16.53 mongodb-2.zt.foreningenbs.no (decommissioned)
    • 172.25.16.54 energi-extractor (no DNS record created, only outband traffic)
    • 172.25.16.55 dugnaden-mysql.zt.foreningenbs.no (decommissioned)
    • 172.25.16.56 ldap-toolbox.zt.foreningenbs.no
    • 172.25.16.57 pgadmin.zt.foreningenbs.no
    • 172.25.16.60 signoz-zookeeper.zt.foreningenbs.no
    • 172.25.16.61 signoz-clickhouse.zt.foreningenbs.no
    • 172.25.16.62 signoz-otel-collector.zt.foreningenbs.no (OTLP: 4317/4318)
    • 172.25.16.63 signoz.zt.foreningenbs.no (UI: port 8080)

Public web

The service nginx-front-1 is published at port 80 and 443 and acts as the reverse proxy for public traffic. DNS-entries must be set up for this for the physical host this is running at:

  • foreningenbs.no: 158.39.48.49 (fcos-3)
  • www.foreningenbs.no: 158.39.48.49 (fcos-3)
  • deployer.foreningenbs.no: 158.39.48.49 (fcos-3)
  • deployer-secondary.foreningenbs.no: 158.39.48.49 (fcos-3)
  • signoz.foreningenbs.no: 158.39.48.49 (fcos-3)
  • status.foreningenbs.no: 158.39.48.49 (fcos-3)
  • blindernuka.no: 158.39.48.49 (fcos-3)
  • www.blindernuka.no: 158.39.48.49 (fcos-3)
  • billett.blindernuka.no: 158.39.48.49 (fcos-3)

This service also keeps our Let's Encrypt certificates up-to-date.

ZeroTier details

To manage the network, log in to https://my.zerotier.com/network/a84ac5c10a9c7522 using the credentials stored at https://foreningenbs.no/confluence/display/FBS/Kundeforhold+ZeroTier

To add a new ad-hoc client to the network:

  • Install ZeroTier from https://www.zerotier.com/ or use https://github.com/henrist/zerotier-one-docker.
  • Request to join network a84ac5c10a9c7522 (leave only "allow managed" checked).
  • Authorize the client in the ZeroTier dashboard linked above.
  • Give the client a description so we keep track of what is connected.
  • You should now be able to ping e.g. fcos-1.zt.foreningenbs.no.

SigNoz (Observability)

SigNoz provides observability (traces, metrics, logs) for our services.

  • UI: https://signoz.foreningenbs.no (or http://signoz.zt.foreningenbs.no:8080 via ZeroTier)
  • Auth: Google OAuth SSO (OAuth client signoz in GCP project foreningenbs) — any @blindernuka.no account can login (viewer access by default)
  • OTLP gRPC: signoz-otel-collector.zt.foreningenbs.no:4317
  • OTLP HTTP: signoz-otel-collector.zt.foreningenbs.no:4318

To send data from a service, configure it to export OTLP to the collector endpoint.

Deployment kill switch

To temporarily disable all automated deployments, set the repository variable DEPLOY_DISABLED to true in Settings → Variables → Actions. Remove or set to any other value to re-enable.

Outgoing email

We use Google Workspace SMTP relay service to send email.

For this to work, all the IPs of our instances must be registered in our Google Workspace account. See https://admin.google.com/u/0/ac/apps/gmail/routing

More details: https://support.google.com/a/answer/176600

Google Cloud credentials

Each host has its own GCP service account to pull images from Artifact Registry. Managed via Terraform in gcp/. The gcp-credentials Ansible role places relevant symlinks.

Encryption in this repo

This repo uses git-crypt to encrypt sensitive files.

In addition, some files are encrypted using Ansible Vault. The encryption key used for this is stored in this repo. The intention of using Ansible Vault is to avoid having plain text files in local working directories, which is the default behaviour with git-crypt.

Debugging

The instances comes with https://containertoolbx.org/install/ preinstalled.

To access an environment where you can install tools etc use:

toolbox enter

About

IT-services for Foreningen Blindern Studenterhjem

Resources

Stars

2 stars

Watchers

5 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Repository files navigation

drift

CI:
E2E TestsUpdate DNS snapshot

Image builds:
confluenceldap-toolboxopenldapotel-collectorsimplesamlphpslack-invite-automationweb-1webdavcgi

Deploys:
Deploy Ansible common tagDeploy all Ansible servicesDeploy confluenceDeploy deployerDeploy dugnadenDeploy energi-extractorDeploy gatusDeploy internDeploy ldap-masterDeploy ldap-slaveDeploy ldap-toolboxDeploy mysql-1Deploy nginx-front-1Deploy okoreportsDeploy otel-collector-agentDeploy pgadminDeploy phpldapadminDeploy phpmyadminDeploy postgresql-1Deploy signozDeploy simplesamlphpDeploy slack-invite-automationDeploy smaabruket-availability-apiDeploy snipeitDeploy uka-billettDeploy uka-webserverDeploy users-apiDeploy web-1Deploy webdavcgi

Service status: https://status.foreningenbs.no

This Git-repo describes the setup of some our services. For more details, see https://foreningenbs.no/confluence/display/FBS/IT-gruppa

Design principles of our setup

The intention of these principles is to keep a simple and easily maintained setup with few components. We might consider moving to something more complex later (such as Kubernetes) if we need more HA capabilities or a platform to control services deployment.

  • Terraform is used to provision VMs in NREC. Only the minimal instance setup is done in Terraform / cloud-init, as any change to this will recreate the instances.
    • All data is stored on a separate volume mounted at /var/mnt/data, allowing us to more easily recreate instances if needed, and to have a single location to backup.
    • As host OS we use Fedora CoreOS which is self-updating.
  • Ansible is used to configure the hosts, including the mapping of which services run on the various hosts. When recreating a VM instance, Ansible should perform all required tasks for the host to be running properly in short time. Some manual tasks for moving data might be needed.
  • All hosts use ZeroTier to be in the same L2 network. A bridge named fbs0 and a docker network is set up to allow Docker containers to use IPs in this network. Each host has its own internal IP-range so ad-hoc containers can get IPs in this network.
  • All services run as Docker containers. The containers gets a static internal IPs and all containers can reach any other service on any host.
  • Services should be reached only by using its hostname, such as users-api.zt.foreningenbs.no. Published services are only published on the host they are running.

Network details

Note: ZeroTier DNS entries (*.zt) can be managed via dns/manage-record.sh. See https://foreningenbs.no/confluence/display/FBS/Kundedetaljer+Domeneshop for API credentials.

  • ZeroTier is set up to use:
    • 172.25.0.0/16
  • Auto-assign range for normal ZeroTier clients:
    • 172.25.0.0/23 (172.25.0.1 - 172.25.1.254)
  • Hosts:
    • 172.25.10.1 athene.zt.foreningenbs.no
    • 172.25.10.2 p.zt.foreningenbs.no
    • 172.25.10.3 uka-1.zt.foreningenbs.no (decommissioned)
    • 172.25.11.1 coreos-1.zt.foreningenbs.no (decommissioned)
    • 172.25.11.2 coreos-2.zt.foreningenbs.no (decommissioned)
    • 172.25.11.3 coreos-3.zt.foreningenbs.no (decommissioned)
    • 172.25.11.4 coreos-4.zt.foreningenbs.no (decommissioned)
    • 172.25.12.1 fcos-1.zt.foreningenbs.no
    • 172.25.12.2 fcos-2.zt.foreningenbs.no
    • 172.25.12.3 fcos-3.zt.foreningenbs.no
    • 172.25.12.4 fbshs1.zt.foreningenbs.no
  • IP-ranges for ad-hoc containers with Docker:
    • 172.25.21.0/24 coreos-1 (decommissioned)
    • 172.25.22.0/24 coreos-2 (decommissioned)
    • 172.25.23.0/24 coreos-3 (decommissioned)
    • 172.25.24.0/24 coreos-4 (decommissioned)
    • 172.25.25.0/24 uka-1 (decommissioned)
    • 172.25.26.0/24 fcos-1
    • 172.25.27.0/24 fcos-2
    • 172.25.28.0/24 fcos-3
    • 172.25.29.0/24 fbshs1
  • IP-range used for allocation of services:
    • 172.25.16.0/22 (172.25.16.0-172.25.19.255)
  • Allocated services:
    • 172.25.16.1 web-1.zt.foreningenbs.no
    • 172.25.16.2 users-api.zt.foreningenbs.no
    • 172.25.16.3 intern-backend.zt.foreningenbs.no
    • 172.25.16.4 intern-frontend.zt.foreningenbs.no (decommissioned)
    • 172.25.16.5 okoreports-backend.zt.foreningenbs.no
    • 172.25.16.6 okoreports-frontend.zt.foreningenbs.no
    • 172.25.16.7 smaabruket-availability-api.zt.foreningenbs.no
    • 172.25.16.8 confluence.zt.foreningenbs.no
    • 172.25.16.9 slack-invite-automation.zt.foreningenbs.no
    • 172.25.16.10 dugnaden.zt.foreningenbs.no
    • 172.25.16.11 phpldapadmin.zt.foreningenbs.no
    • 172.25.16.12 phpmyadmin.zt.foreningenbs.no
    • 172.25.16.13 simplesamlphp.zt.foreningenbs.no
    • 172.25.16.14 nginx-front-1.zt.foreningenbs.no
    • 172.25.16.15 storage-1-samba.zt.foreningenbs.no (not set up yet)
    • 172.25.16.16 webdavcgi.zt.foreningenbs.no
    • 172.25.16.17 intern-calendar-api.zt.foreningenbs.no
    • 172.25.16.18 gatus.zt.foreningenbs.no
    • 172.25.16.30 ldap-master.zt.foreningenbs.no
    • 172.25.16.31 ldap-slave.zt.foreningenbs.no
    • 172.25.16.40 mysql-1.zt.foreningenbs.no
    • 172.25.16.41 mongodb-1.zt.foreningenbs.no (decommissioned)
    • 172.25.16.42 postgresql-1.zt.foreningenbs.no
    • 172.25.16.43 mysql-2.zt.foreningenbs.no (decommissioned)
    • 172.25.16.44 snipeit.zt.foreningenbs.no
    • 172.25.16.45 snipe-mysql.zt.foreningenbs.no (decommissioned)
    • 172.25.16.46 uka-mysql.zt.foreningenbs.no (decommissioned)
    • 172.25.16.47 uka-webserver.zt.foreningenbs.no
    • 172.25.16.48 uka-billett-proxy.zt.foreningenbs.no
    • 172.25.16.49 uka-billett-fpm.zt.foreningenbs.no
    • 172.25.16.50 uka-billett-frontend.zt.foreningenbs.no
    • 172.25.16.51 deployer.zt.foreningenbs.no
    • 172.25.16.52 deployer-secondary.zt.foreningenbs.no
    • 172.25.16.53 mongodb-2.zt.foreningenbs.no (decommissioned)
    • 172.25.16.54 energi-extractor (no DNS record created, only outband traffic)
    • 172.25.16.55 dugnaden-mysql.zt.foreningenbs.no (decommissioned)
    • 172.25.16.56 ldap-toolbox.zt.foreningenbs.no
    • 172.25.16.57 pgadmin.zt.foreningenbs.no
    • 172.25.16.60 signoz-zookeeper.zt.foreningenbs.no
    • 172.25.16.61 signoz-clickhouse.zt.foreningenbs.no
    • 172.25.16.62 signoz-otel-collector.zt.foreningenbs.no (OTLP: 4317/4318)
    • 172.25.16.63 signoz.zt.foreningenbs.no (UI: port 8080)

Public web

The service nginx-front-1 is published at port 80 and 443 and acts as the reverse proxy for public traffic. DNS-entries must be set up for this for the physical host this is running at:

  • foreningenbs.no: 158.39.48.49 (fcos-3)
  • www.foreningenbs.no: 158.39.48.49 (fcos-3)
  • deployer.foreningenbs.no: 158.39.48.49 (fcos-3)
  • deployer-secondary.foreningenbs.no: 158.39.48.49 (fcos-3)
  • signoz.foreningenbs.no: 158.39.48.49 (fcos-3)
  • status.foreningenbs.no: 158.39.48.49 (fcos-3)
  • blindernuka.no: 158.39.48.49 (fcos-3)
  • www.blindernuka.no: 158.39.48.49 (fcos-3)
  • billett.blindernuka.no: 158.39.48.49 (fcos-3)

This service also keeps our Let's Encrypt certificates up-to-date.

ZeroTier details

To manage the network, log in to https://my.zerotier.com/network/a84ac5c10a9c7522 using the credentials stored at https://foreningenbs.no/confluence/display/FBS/Kundeforhold+ZeroTier

To add a new ad-hoc client to the network:

  • Install ZeroTier from https://www.zerotier.com/ or use https://github.com/henrist/zerotier-one-docker.
  • Request to join network a84ac5c10a9c7522 (leave only "allow managed" checked).
  • Authorize the client in the ZeroTier dashboard linked above.
  • Give the client a description so we keep track of what is connected.
  • You should now be able to ping e.g. fcos-1.zt.foreningenbs.no.

SigNoz (Observability)

SigNoz provides observability (traces, metrics, logs) for our services.

  • UI: https://signoz.foreningenbs.no (or http://signoz.zt.foreningenbs.no:8080 via ZeroTier)
  • Auth: Google OAuth SSO (OAuth client signoz in GCP project foreningenbs) — any @blindernuka.no account can login (viewer access by default)
  • OTLP gRPC: signoz-otel-collector.zt.foreningenbs.no:4317
  • OTLP HTTP: signoz-otel-collector.zt.foreningenbs.no:4318

To send data from a service, configure it to export OTLP to the collector endpoint.

Deployment kill switch

To temporarily disable all automated deployments, set the repository variable DEPLOY_DISABLED to true in Settings → Variables → Actions. Remove or set to any other value to re-enable.

Outgoing email

We use Google Workspace SMTP relay service to send email.

For this to work, all the IPs of our instances must be registered in our Google Workspace account. See https://admin.google.com/u/0/ac/apps/gmail/routing

More details: https://support.google.com/a/answer/176600

Google Cloud credentials

Each host has its own GCP service account to pull images from Artifact Registry. Managed via Terraform in gcp/. The gcp-credentials Ansible role places relevant symlinks.

Encryption in this repo

This repo uses git-crypt to encrypt sensitive files.

In addition, some files are encrypted using Ansible Vault. The encryption key used for this is stored in this repo. The intention of using Ansible Vault is to avoid having plain text files in local working directories, which is the default behaviour with git-crypt.

Debugging

The instances comes with https://containertoolbx.org/install/ preinstalled.

To access an environment where you can install tools etc use:

toolbox enter

About

IT-services for Foreningen Blindern Studenterhjem

Resources

Stars

2 stars

Watchers

5 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

drift

CI:
E2E TestsUpdate DNS snapshot

Image builds:
confluenceldap-toolboxopenldapotel-collectorsimplesamlphpslack-invite-automationweb-1webdavcgi

Deploys:
Deploy Ansible common tagDeploy all Ansible servicesDeploy confluenceDeploy deployerDeploy dugnadenDeploy energi-extractorDeploy gatusDeploy internDeploy ldap-masterDeploy ldap-slaveDeploy ldap-toolboxDeploy mysql-1Deploy nginx-front-1Deploy okoreportsDeploy otel-collector-agentDeploy pgadminDeploy phpldapadminDeploy phpmyadminDeploy postgresql-1Deploy signozDeploy simplesamlphpDeploy slack-invite-automationDeploy smaabruket-availability-apiDeploy snipeitDeploy uka-billettDeploy uka-webserverDeploy users-apiDeploy web-1Deploy webdavcgi

Service status: https://status.foreningenbs.no

This Git-repo describes the setup of some our services. For more details, see https://foreningenbs.no/confluence/display/FBS/IT-gruppa

Design principles of our setup

The intention of these principles is to keep a simple and easily maintained setup with few components. We might consider moving to something more complex later (such as Kubernetes) if we need more HA capabilities or a platform to control services deployment.

  • Terraform is used to provision VMs in NREC. Only the minimal instance setup is done in Terraform / cloud-init, as any change to this will recreate the instances.
    • All data is stored on a separate volume mounted at /var/mnt/data, allowing us to more easily recreate instances if needed, and to have a single location to backup.
    • As host OS we use Fedora CoreOS which is self-updating.
  • Ansible is used to configure the hosts, including the mapping of which services run on the various hosts. When recreating a VM instance, Ansible should perform all required tasks for the host to be running properly in short time. Some manual tasks for moving data might be needed.
  • All hosts use ZeroTier to be in the same L2 network. A bridge named fbs0 and a docker network is set up to allow Docker containers to use IPs in this network. Each host has its own internal IP-range so ad-hoc containers can get IPs in this network.
  • All services run as Docker containers. The containers gets a static internal IPs and all containers can reach any other service on any host.
  • Services should be reached only by using its hostname, such as users-api.zt.foreningenbs.no. Published services are only published on the host they are running.

Network details

Note: ZeroTier DNS entries (*.zt) can be managed via dns/manage-record.sh. See https://foreningenbs.no/confluence/display/FBS/Kundedetaljer+Domeneshop for API credentials.

  • ZeroTier is set up to use:
    • 172.25.0.0/16
  • Auto-assign range for normal ZeroTier clients:
    • 172.25.0.0/23 (172.25.0.1 - 172.25.1.254)
  • Hosts:
    • 172.25.10.1 athene.zt.foreningenbs.no
    • 172.25.10.2 p.zt.foreningenbs.no
    • 172.25.10.3 uka-1.zt.foreningenbs.no (decommissioned)
    • 172.25.11.1 coreos-1.zt.foreningenbs.no (decommissioned)
    • 172.25.11.2 coreos-2.zt.foreningenbs.no (decommissioned)
    • 172.25.11.3 coreos-3.zt.foreningenbs.no (decommissioned)
    • 172.25.11.4 coreos-4.zt.foreningenbs.no (decommissioned)
    • 172.25.12.1 fcos-1.zt.foreningenbs.no
    • 172.25.12.2 fcos-2.zt.foreningenbs.no
    • 172.25.12.3 fcos-3.zt.foreningenbs.no
    • 172.25.12.4 fbshs1.zt.foreningenbs.no
  • IP-ranges for ad-hoc containers with Docker:
    • 172.25.21.0/24 coreos-1 (decommissioned)
    • 172.25.22.0/24 coreos-2 (decommissioned)
    • 172.25.23.0/24 coreos-3 (decommissioned)
    • 172.25.24.0/24 coreos-4 (decommissioned)
    • 172.25.25.0/24 uka-1 (decommissioned)
    • 172.25.26.0/24 fcos-1
    • 172.25.27.0/24 fcos-2
    • 172.25.28.0/24 fcos-3
    • 172.25.29.0/24 fbshs1
  • IP-range used for allocation of services:
    • 172.25.16.0/22 (172.25.16.0-172.25.19.255)
  • Allocated services:
    • 172.25.16.1 web-1.zt.foreningenbs.no
    • 172.25.16.2 users-api.zt.foreningenbs.no
    • 172.25.16.3 intern-backend.zt.foreningenbs.no
    • 172.25.16.4 intern-frontend.zt.foreningenbs.no (decommissioned)
    • 172.25.16.5 okoreports-backend.zt.foreningenbs.no
    • 172.25.16.6 okoreports-frontend.zt.foreningenbs.no
    • 172.25.16.7 smaabruket-availability-api.zt.foreningenbs.no
    • 172.25.16.8 confluence.zt.foreningenbs.no
    • 172.25.16.9 slack-invite-automation.zt.foreningenbs.no
    • 172.25.16.10 dugnaden.zt.foreningenbs.no
    • 172.25.16.11 phpldapadmin.zt.foreningenbs.no
    • 172.25.16.12 phpmyadmin.zt.foreningenbs.no
    • 172.25.16.13 simplesamlphp.zt.foreningenbs.no
    • 172.25.16.14 nginx-front-1.zt.foreningenbs.no
    • 172.25.16.15 storage-1-samba.zt.foreningenbs.no (not set up yet)
    • 172.25.16.16 webdavcgi.zt.foreningenbs.no
    • 172.25.16.17 intern-calendar-api.zt.foreningenbs.no
    • 172.25.16.18 gatus.zt.foreningenbs.no
    • 172.25.16.30 ldap-master.zt.foreningenbs.no
    • 172.25.16.31 ldap-slave.zt.foreningenbs.no
    • 172.25.16.40 mysql-1.zt.foreningenbs.no
    • 172.25.16.41 mongodb-1.zt.foreningenbs.no (decommissioned)
    • 172.25.16.42 postgresql-1.zt.foreningenbs.no
    • 172.25.16.43 mysql-2.zt.foreningenbs.no (decommissioned)
    • 172.25.16.44 snipeit.zt.foreningenbs.no
    • 172.25.16.45 snipe-mysql.zt.foreningenbs.no (decommissioned)
    • 172.25.16.46 uka-mysql.zt.foreningenbs.no (decommissioned)
    • 172.25.16.47 uka-webserver.zt.foreningenbs.no
    • 172.25.16.48 uka-billett-proxy.zt.foreningenbs.no
    • 172.25.16.49 uka-billett-fpm.zt.foreningenbs.no
    • 172.25.16.50 uka-billett-frontend.zt.foreningenbs.no
    • 172.25.16.51 deployer.zt.foreningenbs.no
    • 172.25.16.52 deployer-secondary.zt.foreningenbs.no
    • 172.25.16.53 mongodb-2.zt.foreningenbs.no (decommissioned)
    • 172.25.16.54 energi-extractor (no DNS record created, only outband traffic)
    • 172.25.16.55 dugnaden-mysql.zt.foreningenbs.no (decommissioned)
    • 172.25.16.56 ldap-toolbox.zt.foreningenbs.no
    • 172.25.16.57 pgadmin.zt.foreningenbs.no
    • 172.25.16.60 signoz-zookeeper.zt.foreningenbs.no
    • 172.25.16.61 signoz-clickhouse.zt.foreningenbs.no
    • 172.25.16.62 signoz-otel-collector.zt.foreningenbs.no (OTLP: 4317/4318)
    • 172.25.16.63 signoz.zt.foreningenbs.no (UI: port 8080)

Public web

The service nginx-front-1 is published at port 80 and 443 and acts as the reverse proxy for public traffic. DNS-entries must be set up for this for the physical host this is running at:

  • foreningenbs.no: 158.39.48.49 (fcos-3)
  • www.foreningenbs.no: 158.39.48.49 (fcos-3)
  • deployer.foreningenbs.no: 158.39.48.49 (fcos-3)
  • deployer-secondary.foreningenbs.no: 158.39.48.49 (fcos-3)
  • signoz.foreningenbs.no: 158.39.48.49 (fcos-3)
  • status.foreningenbs.no: 158.39.48.49 (fcos-3)
  • blindernuka.no: 158.39.48.49 (fcos-3)
  • www.blindernuka.no: 158.39.48.49 (fcos-3)
  • billett.blindernuka.no: 158.39.48.49 (fcos-3)

This service also keeps our Let's Encrypt certificates up-to-date.

ZeroTier details

To manage the network, log in to https://my.zerotier.com/network/a84ac5c10a9c7522 using the credentials stored at https://foreningenbs.no/confluence/display/FBS/Kundeforhold+ZeroTier

To add a new ad-hoc client to the network:

  • Install ZeroTier from https://www.zerotier.com/ or use https://github.com/henrist/zerotier-one-docker.
  • Request to join network a84ac5c10a9c7522 (leave only "allow managed" checked).
  • Authorize the client in the ZeroTier dashboard linked above.
  • Give the client a description so we keep track of what is connected.
  • You should now be able to ping e.g. fcos-1.zt.foreningenbs.no.

SigNoz (Observability)

SigNoz provides observability (traces, metrics, logs) for our services.

  • UI: https://signoz.foreningenbs.no (or http://signoz.zt.foreningenbs.no:8080 via ZeroTier)
  • Auth: Google OAuth SSO (OAuth client signoz in GCP project foreningenbs) — any @blindernuka.no account can login (viewer access by default)
  • OTLP gRPC: signoz-otel-collector.zt.foreningenbs.no:4317
  • OTLP HTTP: signoz-otel-collector.zt.foreningenbs.no:4318

To send data from a service, configure it to export OTLP to the collector endpoint.

Deployment kill switch

To temporarily disable all automated deployments, set the repository variable DEPLOY_DISABLED to true in Settings → Variables → Actions. Remove or set to any other value to re-enable.

Outgoing email

We use Google Workspace SMTP relay service to send email.

For this to work, all the IPs of our instances must be registered in our Google Workspace account. See https://admin.google.com/u/0/ac/apps/gmail/routing

More details: https://support.google.com/a/answer/176600

Google Cloud credentials

Each host has its own GCP service account to pull images from Artifact Registry. Managed via Terraform in gcp/. The gcp-credentials Ansible role places relevant symlinks.

Encryption in this repo

This repo uses git-crypt to encrypt sensitive files.

In addition, some files are encrypted using Ansible Vault. The encryption key used for this is stored in this repo. The intention of using Ansible Vault is to avoid having plain text files in local working directories, which is the default behaviour with git-crypt.

Debugging

The instances comes with https://containertoolbx.org/install/ preinstalled.

To access an environment where you can install tools etc use:

toolbox enter

About

IT-services for Foreningen Blindern Studenterhjem

Resources

Stars

2 stars

Watchers

5 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

drift

CI:
E2E TestsUpdate DNS snapshot

Image builds:
confluenceldap-toolboxopenldapotel-collectorsimplesamlphpslack-invite-automationweb-1webdavcgi

Deploys:
Deploy Ansible common tagDeploy all Ansible servicesDeploy confluenceDeploy deployerDeploy dugnadenDeploy energi-extractorDeploy gatusDeploy internDeploy ldap-masterDeploy ldap-slaveDeploy ldap-toolboxDeploy mysql-1Deploy nginx-front-1Deploy okoreportsDeploy otel-collector-agentDeploy pgadminDeploy phpldapadminDeploy phpmyadminDeploy postgresql-1Deploy signozDeploy simplesamlphpDeploy slack-invite-automationDeploy smaabruket-availability-apiDeploy snipeitDeploy uka-billettDeploy uka-webserverDeploy users-apiDeploy web-1Deploy webdavcgi

Service status: https://status.foreningenbs.no

This Git-repo describes the setup of some our services. For more details, see https://foreningenbs.no/confluence/display/FBS/IT-gruppa

Design principles of our setup

The intention of these principles is to keep a simple and easily maintained setup with few components. We might consider moving to something more complex later (such as Kubernetes) if we need more HA capabilities or a platform to control services deployment.

  • Terraform is used to provision VMs in NREC. Only the minimal instance setup is done in Terraform / cloud-init, as any change to this will recreate the instances.
    • All data is stored on a separate volume mounted at /var/mnt/data, allowing us to more easily recreate instances if needed, and to have a single location to backup.
    • As host OS we use Fedora CoreOS which is self-updating.
  • Ansible is used to configure the hosts, including the mapping of which services run on the various hosts. When recreating a VM instance, Ansible should perform all required tasks for the host to be running properly in short time. Some manual tasks for moving data might be needed.
  • All hosts use ZeroTier to be in the same L2 network. A bridge named fbs0 and a docker network is set up to allow Docker containers to use IPs in this network. Each host has its own internal IP-range so ad-hoc containers can get IPs in this network.
  • All services run as Docker containers. The containers gets a static internal IPs and all containers can reach any other service on any host.
  • Services should be reached only by using its hostname, such as users-api.zt.foreningenbs.no. Published services are only published on the host they are running.

Network details

Note: ZeroTier DNS entries (*.zt) can be managed via dns/manage-record.sh. See https://foreningenbs.no/confluence/display/FBS/Kundedetaljer+Domeneshop for API credentials.

  • ZeroTier is set up to use:
    • 172.25.0.0/16
  • Auto-assign range for normal ZeroTier clients:
    • 172.25.0.0/23 (172.25.0.1 - 172.25.1.254)
  • Hosts:
    • 172.25.10.1 athene.zt.foreningenbs.no
    • 172.25.10.2 p.zt.foreningenbs.no
    • 172.25.10.3 uka-1.zt.foreningenbs.no (decommissioned)
    • 172.25.11.1 coreos-1.zt.foreningenbs.no (decommissioned)
    • 172.25.11.2 coreos-2.zt.foreningenbs.no (decommissioned)
    • 172.25.11.3 coreos-3.zt.foreningenbs.no (decommissioned)
    • 172.25.11.4 coreos-4.zt.foreningenbs.no (decommissioned)
    • 172.25.12.1 fcos-1.zt.foreningenbs.no
    • 172.25.12.2 fcos-2.zt.foreningenbs.no
    • 172.25.12.3 fcos-3.zt.foreningenbs.no
    • 172.25.12.4 fbshs1.zt.foreningenbs.no
  • IP-ranges for ad-hoc containers with Docker:
    • 172.25.21.0/24 coreos-1 (decommissioned)
    • 172.25.22.0/24 coreos-2 (decommissioned)
    • 172.25.23.0/24 coreos-3 (decommissioned)
    • 172.25.24.0/24 coreos-4 (decommissioned)
    • 172.25.25.0/24 uka-1 (decommissioned)
    • 172.25.26.0/24 fcos-1
    • 172.25.27.0/24 fcos-2
    • 172.25.28.0/24 fcos-3
    • 172.25.29.0/24 fbshs1
  • IP-range used for allocation of services:
    • 172.25.16.0/22 (172.25.16.0-172.25.19.255)
  • Allocated services:
    • 172.25.16.1 web-1.zt.foreningenbs.no
    • 172.25.16.2 users-api.zt.foreningenbs.no
    • 172.25.16.3 intern-backend.zt.foreningenbs.no
    • 172.25.16.4 intern-frontend.zt.foreningenbs.no (decommissioned)
    • 172.25.16.5 okoreports-backend.zt.foreningenbs.no
    • 172.25.16.6 okoreports-frontend.zt.foreningenbs.no
    • 172.25.16.7 smaabruket-availability-api.zt.foreningenbs.no
    • 172.25.16.8 confluence.zt.foreningenbs.no
    • 172.25.16.9 slack-invite-automation.zt.foreningenbs.no
    • 172.25.16.10 dugnaden.zt.foreningenbs.no
    • 172.25.16.11 phpldapadmin.zt.foreningenbs.no
    • 172.25.16.12 phpmyadmin.zt.foreningenbs.no
    • 172.25.16.13 simplesamlphp.zt.foreningenbs.no
    • 172.25.16.14 nginx-front-1.zt.foreningenbs.no
    • 172.25.16.15 storage-1-samba.zt.foreningenbs.no (not set up yet)
    • 172.25.16.16 webdavcgi.zt.foreningenbs.no
    • 172.25.16.17 intern-calendar-api.zt.foreningenbs.no
    • 172.25.16.18 gatus.zt.foreningenbs.no
    • 172.25.16.30 ldap-master.zt.foreningenbs.no
    • 172.25.16.31 ldap-slave.zt.foreningenbs.no
    • 172.25.16.40 mysql-1.zt.foreningenbs.no
    • 172.25.16.41 mongodb-1.zt.foreningenbs.no (decommissioned)
    • 172.25.16.42 postgresql-1.zt.foreningenbs.no
    • 172.25.16.43 mysql-2.zt.foreningenbs.no (decommissioned)
    • 172.25.16.44 snipeit.zt.foreningenbs.no
    • 172.25.16.45 snipe-mysql.zt.foreningenbs.no (decommissioned)
    • 172.25.16.46 uka-mysql.zt.foreningenbs.no (decommissioned)
    • 172.25.16.47 uka-webserver.zt.foreningenbs.no
    • 172.25.16.48 uka-billett-proxy.zt.foreningenbs.no
    • 172.25.16.49 uka-billett-fpm.zt.foreningenbs.no
    • 172.25.16.50 uka-billett-frontend.zt.foreningenbs.no
    • 172.25.16.51 deployer.zt.foreningenbs.no
    • 172.25.16.52 deployer-secondary.zt.foreningenbs.no
    • 172.25.16.53 mongodb-2.zt.foreningenbs.no (decommissioned)
    • 172.25.16.54 energi-extractor (no DNS record created, only outband traffic)
    • 172.25.16.55 dugnaden-mysql.zt.foreningenbs.no (decommissioned)
    • 172.25.16.56 ldap-toolbox.zt.foreningenbs.no
    • 172.25.16.57 pgadmin.zt.foreningenbs.no
    • 172.25.16.60 signoz-zookeeper.zt.foreningenbs.no
    • 172.25.16.61 signoz-clickhouse.zt.foreningenbs.no
    • 172.25.16.62 signoz-otel-collector.zt.foreningenbs.no (OTLP: 4317/4318)
    • 172.25.16.63 signoz.zt.foreningenbs.no (UI: port 8080)

Public web

The service nginx-front-1 is published at port 80 and 443 and acts as the reverse proxy for public traffic. DNS-entries must be set up for this for the physical host this is running at:

  • foreningenbs.no: 158.39.48.49 (fcos-3)
  • www.foreningenbs.no: 158.39.48.49 (fcos-3)
  • deployer.foreningenbs.no: 158.39.48.49 (fcos-3)
  • deployer-secondary.foreningenbs.no: 158.39.48.49 (fcos-3)
  • signoz.foreningenbs.no: 158.39.48.49 (fcos-3)
  • status.foreningenbs.no: 158.39.48.49 (fcos-3)
  • blindernuka.no: 158.39.48.49 (fcos-3)
  • www.blindernuka.no: 158.39.48.49 (fcos-3)
  • billett.blindernuka.no: 158.39.48.49 (fcos-3)

This service also keeps our Let's Encrypt certificates up-to-date.

ZeroTier details

To manage the network, log in to https://my.zerotier.com/network/a84ac5c10a9c7522 using the credentials stored at https://foreningenbs.no/confluence/display/FBS/Kundeforhold+ZeroTier

To add a new ad-hoc client to the network:

  • Install ZeroTier from https://www.zerotier.com/ or use https://github.com/henrist/zerotier-one-docker.
  • Request to join network a84ac5c10a9c7522 (leave only "allow managed" checked).
  • Authorize the client in the ZeroTier dashboard linked above.
  • Give the client a description so we keep track of what is connected.
  • You should now be able to ping e.g. fcos-1.zt.foreningenbs.no.

SigNoz (Observability)

SigNoz provides observability (traces, metrics, logs) for our services.

  • UI: https://signoz.foreningenbs.no (or http://signoz.zt.foreningenbs.no:8080 via ZeroTier)
  • Auth: Google OAuth SSO (OAuth client signoz in GCP project foreningenbs) — any @blindernuka.no account can login (viewer access by default)
  • OTLP gRPC: signoz-otel-collector.zt.foreningenbs.no:4317
  • OTLP HTTP: signoz-otel-collector.zt.foreningenbs.no:4318

To send data from a service, configure it to export OTLP to the collector endpoint.

Deployment kill switch

To temporarily disable all automated deployments, set the repository variable DEPLOY_DISABLED to true in Settings → Variables → Actions. Remove or set to any other value to re-enable.

Outgoing email

We use Google Workspace SMTP relay service to send email.

For this to work, all the IPs of our instances must be registered in our Google Workspace account. See https://admin.google.com/u/0/ac/apps/gmail/routing

More details: https://support.google.com/a/answer/176600

Google Cloud credentials

Each host has its own GCP service account to pull images from Artifact Registry. Managed via Terraform in gcp/. The gcp-credentials Ansible role places relevant symlinks.

Encryption in this repo

This repo uses git-crypt to encrypt sensitive files.

In addition, some files are encrypted using Ansible Vault. The encryption key used for this is stored in this repo. The intention of using Ansible Vault is to avoid having plain text files in local working directories, which is the default behaviour with git-crypt.

Debugging

The instances comes with https://containertoolbx.org/install/ preinstalled.

To access an environment where you can install tools etc use:

toolbox enter

About

IT-services for Foreningen Blindern Studenterhjem

Resources

Stars

2 stars

Watchers

5 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Repository files navigation

drift

CI:
E2E TestsUpdate DNS snapshot

Image builds:
confluenceldap-toolboxopenldapotel-collectorsimplesamlphpslack-invite-automationweb-1webdavcgi

Deploys:
Deploy Ansible common tagDeploy all Ansible servicesDeploy confluenceDeploy deployerDeploy dugnadenDeploy energi-extractorDeploy gatusDeploy internDeploy ldap-masterDeploy ldap-slaveDeploy ldap-toolboxDeploy mysql-1Deploy nginx-front-1Deploy okoreportsDeploy otel-collector-agentDeploy pgadminDeploy phpldapadminDeploy phpmyadminDeploy postgresql-1Deploy signozDeploy simplesamlphpDeploy slack-invite-automationDeploy smaabruket-availability-apiDeploy snipeitDeploy uka-billettDeploy uka-webserverDeploy users-apiDeploy web-1Deploy webdavcgi

Service status: https://status.foreningenbs.no

This Git-repo describes the setup of some our services. For more details, see https://foreningenbs.no/confluence/display/FBS/IT-gruppa

Design principles of our setup

The intention of these principles is to keep a simple and easily maintained setup with few components. We might consider moving to something more complex later (such as Kubernetes) if we need more HA capabilities or a platform to control services deployment.

  • Terraform is used to provision VMs in NREC. Only the minimal instance setup is done in Terraform / cloud-init, as any change to this will recreate the instances.
    • All data is stored on a separate volume mounted at /var/mnt/data, allowing us to more easily recreate instances if needed, and to have a single location to backup.
    • As host OS we use Fedora CoreOS which is self-updating.
  • Ansible is used to configure the hosts, including the mapping of which services run on the various hosts. When recreating a VM instance, Ansible should perform all required tasks for the host to be running properly in short time. Some manual tasks for moving data might be needed.
  • All hosts use ZeroTier to be in the same L2 network. A bridge named fbs0 and a docker network is set up to allow Docker containers to use IPs in this network. Each host has its own internal IP-range so ad-hoc containers can get IPs in this network.
  • All services run as Docker containers. The containers gets a static internal IPs and all containers can reach any other service on any host.
  • Services should be reached only by using its hostname, such as users-api.zt.foreningenbs.no. Published services are only published on the host they are running.

Network details

Note: ZeroTier DNS entries (*.zt) can be managed via dns/manage-record.sh. See https://foreningenbs.no/confluence/display/FBS/Kundedetaljer+Domeneshop for API credentials.

  • ZeroTier is set up to use:
    • 172.25.0.0/16
  • Auto-assign range for normal ZeroTier clients:
    • 172.25.0.0/23 (172.25.0.1 - 172.25.1.254)
  • Hosts:
    • 172.25.10.1 athene.zt.foreningenbs.no
    • 172.25.10.2 p.zt.foreningenbs.no
    • 172.25.10.3 uka-1.zt.foreningenbs.no (decommissioned)
    • 172.25.11.1 coreos-1.zt.foreningenbs.no (decommissioned)
    • 172.25.11.2 coreos-2.zt.foreningenbs.no (decommissioned)
    • 172.25.11.3 coreos-3.zt.foreningenbs.no (decommissioned)
    • 172.25.11.4 coreos-4.zt.foreningenbs.no (decommissioned)
    • 172.25.12.1 fcos-1.zt.foreningenbs.no
    • 172.25.12.2 fcos-2.zt.foreningenbs.no
    • 172.25.12.3 fcos-3.zt.foreningenbs.no
    • 172.25.12.4 fbshs1.zt.foreningenbs.no
  • IP-ranges for ad-hoc containers with Docker:
    • 172.25.21.0/24 coreos-1 (decommissioned)
    • 172.25.22.0/24 coreos-2 (decommissioned)
    • 172.25.23.0/24 coreos-3 (decommissioned)
    • 172.25.24.0/24 coreos-4 (decommissioned)
    • 172.25.25.0/24 uka-1 (decommissioned)
    • 172.25.26.0/24 fcos-1
    • 172.25.27.0/24 fcos-2
    • 172.25.28.0/24 fcos-3
    • 172.25.29.0/24 fbshs1
  • IP-range used for allocation of services:
    • 172.25.16.0/22 (172.25.16.0-172.25.19.255)
  • Allocated services:
    • 172.25.16.1 web-1.zt.foreningenbs.no
    • 172.25.16.2 users-api.zt.foreningenbs.no
    • 172.25.16.3 intern-backend.zt.foreningenbs.no
    • 172.25.16.4 intern-frontend.zt.foreningenbs.no (decommissioned)
    • 172.25.16.5 okoreports-backend.zt.foreningenbs.no
    • 172.25.16.6 okoreports-frontend.zt.foreningenbs.no
    • 172.25.16.7 smaabruket-availability-api.zt.foreningenbs.no
    • 172.25.16.8 confluence.zt.foreningenbs.no
    • 172.25.16.9 slack-invite-automation.zt.foreningenbs.no
    • 172.25.16.10 dugnaden.zt.foreningenbs.no
    • 172.25.16.11 phpldapadmin.zt.foreningenbs.no
    • 172.25.16.12 phpmyadmin.zt.foreningenbs.no
    • 172.25.16.13 simplesamlphp.zt.foreningenbs.no
    • 172.25.16.14 nginx-front-1.zt.foreningenbs.no
    • 172.25.16.15 storage-1-samba.zt.foreningenbs.no (not set up yet)
    • 172.25.16.16 webdavcgi.zt.foreningenbs.no
    • 172.25.16.17 intern-calendar-api.zt.foreningenbs.no
    • 172.25.16.18 gatus.zt.foreningenbs.no
    • 172.25.16.30 ldap-master.zt.foreningenbs.no
    • 172.25.16.31 ldap-slave.zt.foreningenbs.no
    • 172.25.16.40 mysql-1.zt.foreningenbs.no
    • 172.25.16.41 mongodb-1.zt.foreningenbs.no (decommissioned)
    • 172.25.16.42 postgresql-1.zt.foreningenbs.no
    • 172.25.16.43 mysql-2.zt.foreningenbs.no (decommissioned)
    • 172.25.16.44 snipeit.zt.foreningenbs.no
    • 172.25.16.45 snipe-mysql.zt.foreningenbs.no (decommissioned)
    • 172.25.16.46 uka-mysql.zt.foreningenbs.no (decommissioned)
    • 172.25.16.47 uka-webserver.zt.foreningenbs.no
    • 172.25.16.48 uka-billett-proxy.zt.foreningenbs.no
    • 172.25.16.49 uka-billett-fpm.zt.foreningenbs.no
    • 172.25.16.50 uka-billett-frontend.zt.foreningenbs.no
    • 172.25.16.51 deployer.zt.foreningenbs.no
    • 172.25.16.52 deployer-secondary.zt.foreningenbs.no
    • 172.25.16.53 mongodb-2.zt.foreningenbs.no (decommissioned)
    • 172.25.16.54 energi-extractor (no DNS record created, only outband traffic)
    • 172.25.16.55 dugnaden-mysql.zt.foreningenbs.no (decommissioned)
    • 172.25.16.56 ldap-toolbox.zt.foreningenbs.no
    • 172.25.16.57 pgadmin.zt.foreningenbs.no
    • 172.25.16.60 signoz-zookeeper.zt.foreningenbs.no
    • 172.25.16.61 signoz-clickhouse.zt.foreningenbs.no
    • 172.25.16.62 signoz-otel-collector.zt.foreningenbs.no (OTLP: 4317/4318)
    • 172.25.16.63 signoz.zt.foreningenbs.no (UI: port 8080)

Public web

The service nginx-front-1 is published at port 80 and 443 and acts as the reverse proxy for public traffic. DNS-entries must be set up for this for the physical host this is running at:

  • foreningenbs.no: 158.39.48.49 (fcos-3)
  • www.foreningenbs.no: 158.39.48.49 (fcos-3)
  • deployer.foreningenbs.no: 158.39.48.49 (fcos-3)
  • deployer-secondary.foreningenbs.no: 158.39.48.49 (fcos-3)
  • signoz.foreningenbs.no: 158.39.48.49 (fcos-3)
  • status.foreningenbs.no: 158.39.48.49 (fcos-3)
  • blindernuka.no: 158.39.48.49 (fcos-3)
  • www.blindernuka.no: 158.39.48.49 (fcos-3)
  • billett.blindernuka.no: 158.39.48.49 (fcos-3)

This service also keeps our Let's Encrypt certificates up-to-date.

ZeroTier details

To manage the network, log in to https://my.zerotier.com/network/a84ac5c10a9c7522 using the credentials stored at https://foreningenbs.no/confluence/display/FBS/Kundeforhold+ZeroTier

To add a new ad-hoc client to the network:

  • Install ZeroTier from https://www.zerotier.com/ or use https://github.com/henrist/zerotier-one-docker.
  • Request to join network a84ac5c10a9c7522 (leave only "allow managed" checked).
  • Authorize the client in the ZeroTier dashboard linked above.
  • Give the client a description so we keep track of what is connected.
  • You should now be able to ping e.g. fcos-1.zt.foreningenbs.no.

SigNoz (Observability)

SigNoz provides observability (traces, metrics, logs) for our services.

  • UI: https://signoz.foreningenbs.no (or http://signoz.zt.foreningenbs.no:8080 via ZeroTier)
  • Auth: Google OAuth SSO (OAuth client signoz in GCP project foreningenbs) — any @blindernuka.no account can login (viewer access by default)
  • OTLP gRPC: signoz-otel-collector.zt.foreningenbs.no:4317
  • OTLP HTTP: signoz-otel-collector.zt.foreningenbs.no:4318

To send data from a service, configure it to export OTLP to the collector endpoint.

Deployment kill switch

To temporarily disable all automated deployments, set the repository variable DEPLOY_DISABLED to true in Settings → Variables → Actions. Remove or set to any other value to re-enable.

Outgoing email

We use Google Workspace SMTP relay service to send email.

For this to work, all the IPs of our instances must be registered in our Google Workspace account. See https://admin.google.com/u/0/ac/apps/gmail/routing

More details: https://support.google.com/a/answer/176600

Google Cloud credentials

Each host has its own GCP service account to pull images from Artifact Registry. Managed via Terraform in gcp/. The gcp-credentials Ansible role places relevant symlinks.

Encryption in this repo

This repo uses git-crypt to encrypt sensitive files.

In addition, some files are encrypted using Ansible Vault. The encryption key used for this is stored in this repo. The intention of using Ansible Vault is to avoid having plain text files in local working directories, which is the default behaviour with git-crypt.

Debugging

The instances comes with https://containertoolbx.org/install/ preinstalled.

To access an environment where you can install tools etc use:

toolbox enter

About

IT-services for Foreningen Blindern Studenterhjem

Resources

Stars

2 stars

Watchers

5 watching

Forks

Releases

Packages

Used by

Contributors

Languages