forked from pub-solar/infra
Compare commits
11 commits
d280b29394
...
1b7f808804
Author | SHA1 | Date | |
---|---|---|---|
Pablo Ovelleiro Corral | 1b7f808804 | ||
teutat3s | f18fee25e4 | ||
Hendrik Sokolowski | fee6ce74c7 | ||
Hendrik Sokolowski | a278c178b0 | ||
Hendrik Sokolowski | 75c7e2dcf5 | ||
teutat3s | 41798a1cd6 | ||
Hendrik Sokolowski | 10c86c6b20 | ||
Hendrik Sokolowski | 1d6c5003e8 | ||
Hendrik Sokolowski | fef1874938 | ||
Hendrik Sokolowski | c74394449d | ||
Benjamin Yule Bädorf | c49e47dc30 |
75
.editorconfig
Normal file
75
.editorconfig
Normal file
|
@ -0,0 +1,75 @@
|
|||
# Editor configuration, see http://editorconfig.org
|
||||
root = true
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
charset = utf-8
|
||||
indent_style = tab
|
||||
|
||||
# Ignore diffs/patches
|
||||
[*.{diff,patch}]
|
||||
end_of_line = unset
|
||||
insert_final_newline = unset
|
||||
trim_trailing_whitespace = unset
|
||||
indent_size = unset
|
||||
charset = unset
|
||||
indent_style = unset
|
||||
indent_size = unset
|
||||
|
||||
[{.*,secrets}/**]
|
||||
end_of_line = unset
|
||||
insert_final_newline = unset
|
||||
trim_trailing_whitespace = unset
|
||||
charset = unset
|
||||
indent_style = unset
|
||||
indent_size = unset
|
||||
|
||||
[*.rom]
|
||||
end_of_line = unset
|
||||
insert_final_newline = unset
|
||||
trim_trailing_whitespace = unset
|
||||
charset = unset
|
||||
indent_style = unset
|
||||
indent_size = unset
|
||||
|
||||
[*.py]
|
||||
indent_size = 4
|
||||
|
||||
[*.md]
|
||||
max_line_length = off
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
# Ignore diffs/patches
|
||||
[*.{diff,patch}]
|
||||
end_of_line = unset
|
||||
insert_final_newline = unset
|
||||
trim_trailing_whitespace = unset
|
||||
indent_size = unset
|
||||
charset = unset
|
||||
indent_style = unset
|
||||
indent_size = unset
|
||||
|
||||
[{.*,secrets}/**]
|
||||
end_of_line = unset
|
||||
insert_final_newline = unset
|
||||
trim_trailing_whitespace = unset
|
||||
charset = unset
|
||||
indent_style = unset
|
||||
indent_size = unset
|
||||
|
||||
[*.rom]
|
||||
end_of_line = unset
|
||||
insert_final_newline = unset
|
||||
trim_trailing_whitespace = unset
|
||||
charset = unset
|
||||
indent_style = unset
|
||||
indent_size = unset
|
||||
|
||||
[*.py]
|
||||
indent_size = 4
|
||||
|
||||
[*.md]
|
||||
max_line_length = off
|
||||
trim_trailing_whitespace = false
|
32
docs/obs-portal.md
Normal file
32
docs/obs-portal.md
Normal file
|
@ -0,0 +1,32 @@
|
|||
# OpenBikeSensor Portal
|
||||
|
||||
## Docker Containers
|
||||
* portal
|
||||
* worker
|
||||
* db
|
||||
|
||||
|
||||
## Run database migrations
|
||||
|
||||
After an upgrade it is sometimes necessary to run database migrations or regenerate tiles.
|
||||
|
||||
```
|
||||
docker exec -ti obs-portal tools/upgrade.py
|
||||
```
|
||||
|
||||
## Dump database
|
||||
|
||||
Save database dump to `dump.sql` in the current working directory.
|
||||
|
||||
```
|
||||
docker exec -ti --user postgres obs-portal-db pg_dump obs > dump.sql
|
||||
```
|
||||
|
||||
## Restore database
|
||||
|
||||
Load database dump from `dump.sql` file.
|
||||
`obs` database needs to exist before importing the dump.
|
||||
|
||||
```
|
||||
cat dump.sql | docker exec -ti --user postgres obs-portal-db psql obs
|
||||
```
|
|
@ -86,6 +86,7 @@
|
|||
inherit username;
|
||||
|
||||
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) inputs.deploy-rs.lib;
|
||||
formatter.x86_64-linux = inputs.nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style;
|
||||
|
||||
deploy.nodes = self.lib.deploy.mkDeployNodes self.nixosConfigurations {
|
||||
nachtigall = {
|
||||
|
|
|
@ -59,7 +59,8 @@ in {
|
|||
in
|
||||
{
|
||||
serviceConfig.Type = "oneshot";
|
||||
before = [ "docker-obs-portal.service" ];
|
||||
before = [ "docker-obs-portal.service" "docker-obs-portal-db.service" "docker-obs-portal-worker.service" ];
|
||||
requiredBy = [ "docker-obs-portal.service" "docker-obs-portal-db.service" "docker-obs-portal-worker.service" ];
|
||||
script = ''
|
||||
${dockerBin} network inspect obs-portal-net >/dev/null 2>&1 || ${dockerBin} network create obs-portal-net --subnet 172.20.0.0/24
|
||||
'';
|
||||
|
@ -85,7 +86,11 @@ in {
|
|||
containers."obs-portal" = {
|
||||
image = "git.pub.solar/pub-solar/obs-portal:latest";
|
||||
autoStart = true;
|
||||
ports = [ "localhost:3001:${env.OBS_PORT}" ];
|
||||
ports = [ "127.0.0.1:3001:${env.OBS_PORT}" ];
|
||||
dependsOn = [
|
||||
"obs-portal-db"
|
||||
"obs-portal-worker"
|
||||
];
|
||||
|
||||
environment = env;
|
||||
environmentFiles = [ config.age.secrets.obs-portal-env.path ];
|
||||
|
@ -93,7 +98,6 @@ in {
|
|||
volumes = [
|
||||
"${configPy}:/opt/obs/api/config.py"
|
||||
"/var/lib/obs-portal${env.OBS_DATA_DIR}:${env.OBS_DATA_DIR}"
|
||||
"/var/lib/obs-portal/tiles/:/tiles"
|
||||
"/var/lib/obs-portal/pbf/:/pbf"
|
||||
];
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
let
|
||||
<<<<<<< HEAD
|
||||
admins = import ../logins/admins.nix;
|
||||
|
||||
nachtigall-host = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIP7G0ufi+MNvaAZLDgpieHrABPGN7e/kD5kMFwSk4ABj root@nachtigall";
|
||||
|
|
|
@ -36,8 +36,8 @@ resource "namecheap_domain_records" "pub-solar" {
|
|||
}
|
||||
record {
|
||||
hostname = "obs-portal"
|
||||
type = "A"
|
||||
address = "80.71.153.210"
|
||||
type = "CNAME"
|
||||
address = "nachtigall.pub.solar."
|
||||
}
|
||||
record {
|
||||
hostname = "vpn"
|
||||
|
|
Loading…
Reference in a new issue