Skip to content

Commit 8e18ed8

Browse files
committed
fix: errors fixed
1 parent 1bdf7ff commit 8e18ed8

File tree

3 files changed

+246
-85
lines changed

3 files changed

+246
-85
lines changed

configuration.nix

+126-45
Original file line numberDiff line numberDiff line change
@@ -87,54 +87,135 @@
8787

8888
# Docker und Docker Compose aktivieren
8989
services.dockerRegistry.enable = true;
90-
virtualisation.docker.registries = [ "docker.io" ];
9190
virtualisation.docker.enable = true;
9291

9392
# Docker-Services konfigurieren
94-
virtualisation.docker.services = [
95-
{
96-
name = "sentry";
97-
image = "getsentry/sentry:latest";
98-
ports = [ "9000:9000" ];
99-
environment = {
100-
SENTRY_SECRET_KEY = "your_secret_key";
101-
SENTRY_DATABASE_URL = "postgres://sentry_user:password@localhost/sentry_db";
102-
SENTRY_REDIS_URL = "redis://localhost:6379";
103-
};
104-
volumes = [
105-
{
106-
hostPath = "/var/lib/sentry";
107-
containerPath = "/data";
108-
}
109-
];
110-
}
111-
{
112-
name = "clickhouse";
113-
image = "clickhouse/clickhouse-server:latest";
114-
ports = [
115-
{
116-
containerPort = 8123;
117-
hostPort = 8123;
118-
}
119-
{
120-
containerPort = 9000;
121-
hostPort = 9000;
122-
}
123-
];
124-
volumes = [
125-
{
126-
hostPath = "/var/lib/clickhouse";
127-
containerPath = "/var/lib/clickhouse";
128-
}
129-
{
130-
hostPath = "/var/log/clickhouse-server";
131-
containerPath = "/var/log/clickhouse-server";
132-
}
133-
];
134-
}
135-
];
136-
137-
93+
#virtualisation.docker = [
94+
# {
95+
# name = "sentry";
96+
# image = "getsentry/sentry:latest";
97+
# ports = [ "9000:9000" ];
98+
# environment = {
99+
# SENTRY_SECRET_KEY = "your_secret_key";
100+
# SENTRY_DATABASE_URL = "postgres://sentry_user:password@localhost/sentry_db";
101+
# SENTRY_REDIS_URL = "redis://localhost:6379";
102+
# };
103+
# volumes = [
104+
# {
105+
# hostPath = "/var/lib/sentry";
106+
# containerPath = "/data";
107+
# }
108+
# ];
109+
# }
110+
# {
111+
# name = "clickhouse";
112+
# image = "clickhouse/clickhouse-server:latest";
113+
# ports = [
114+
# {
115+
# containerPort = 8123;
116+
# hostPort = 8123;
117+
# }
118+
# {
119+
# containerPort = 9000;
120+
# hostPort = 9000;
121+
# }
122+
# ];
123+
# volumes = [
124+
# {
125+
# hostPath = "/var/lib/clickhouse";
126+
# containerPath = "/var/lib/clickhouse";
127+
# }
128+
# {
129+
# hostPath = "/var/log/clickhouse-server";
130+
# containerPath = "/var/log/clickhouse-server";
131+
# }
132+
# ];
133+
# }
134+
# {
135+
# name = "snuba-api";
136+
# image = "getsentry/snuba:latest";
137+
# ports = [ "1218:1218" ];
138+
# environment = {
139+
# SNUBA_SETTINGS = "docker";
140+
# SNUBA_BROKER = "kafka://localhost:9092";
141+
# SNUBA_CLICKHOUSE_HOST = "clickhouse";
142+
# SNUBA_CLICKHOUSE_PORT = "8123";
143+
# SNUBA_REDIS_HOST = "localhost";
144+
# SNUBA_ZOOKEEPER_HOST = "localhost";
145+
# };
146+
# }
147+
# {
148+
# name = "snuba-consumer";
149+
# image = "getsentry/snuba:latest";
150+
# environment = {
151+
# SNUBA_SETTINGS = "docker";
152+
# SNUBA_BROKER = "kafka://localhost:9092";
153+
# SNUBA_CLICKHOUSE_HOST = "clickhouse";
154+
# SNUBA_CLICKHOUSE_PORT = "8123";
155+
# SNUBA_REDIS_HOST = "localhost";
156+
# SNUBA_ZOOKEEPER_HOST = "localhost";
157+
# };
158+
# command = "consumer --storage events --auto-offset-reset=latest --log-level=INFO";
159+
# }
160+
# {
161+
# name = "snuba-replacer";
162+
# image = "getsentry/snuba:latest";
163+
# environment = {
164+
# SNUBA_SETTINGS = "docker";
165+
# SNUBA_BROKER = "kafka://localhost:9092";
166+
# SNUBA_CLICKHOUSE_HOST = "clickhouse";
167+
# SNUBA_CLICKHOUSE_PORT = "8123";
168+
# SNUBA_REDIS_HOST = "localhost";
169+
# SNUBA_ZOOKEEPER_HOST = "localhost";
170+
# };
171+
# command = "replacer --storage events --auto-offset-reset=latest --log-level=INFO";
172+
# }
173+
# {
174+
# name = "symbolicator";
175+
# image = "getsentry/symbolicator:latest";
176+
# ports = [ "3021:3021" ];
177+
# environment = {
178+
# SYM_STORE_PATH = "/data";
179+
# BIND = "0.0.0.0:3021";
180+
# };
181+
# volumes = [
182+
# {
183+
# hostPath = "/var/lib/symbolicator";
184+
# containerPath = "/data";
185+
# }
186+
# ];
187+
# }
188+
# {
189+
# name = "zookeeper";
190+
# image = "zookeeper:latest"; # Offizielles ZooKeeper Docker-Image
191+
# ports = [ "2181:2181" ]; # Standardport für ZooKeeper
192+
# environment = {
193+
# ZOO_MY_ID = "1"; # Beispielkonfiguration für eine ZooKeeper-Instanz
194+
# ZOO_SERVERS = "server.1=0.0.0.0:2888:3888";
195+
# };
196+
# volumes = [
197+
# {
198+
# hostPath = "/var/lib/zookeeper";
199+
# containerPath = "/data";
200+
# }
201+
# ];
202+
# }
203+
#];
204+
205+
206+
# Systemd-Dienst für Docker-Compose
207+
systemd.services.sentry-compose = {
208+
description = "Sentry Docker-Compose service";
209+
after = [ "docker.service" ];
210+
wants = [ "docker.service" ];
211+
serviceConfig = {
212+
ExecStart = "${pkgs.docker-compose}/bin/docker-compose -f /etc/docker-compose/docker-compose.yml up";
213+
ExecStop = "${pkgs.docker-compose}/bin/docker-compose -f /etc/docker-compose/docker-compose.yml down";
214+
Restart = "always";
215+
WorkingDirectory = "/etc/docker-compose";
216+
};
217+
};
218+
138219
environment.systemPackages = with pkgs; [
139220
git
140221
makeWrapper

docker-compose.yml

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# /etc/docker-compose/docker-compose.yml
2+
3+
version: '3.4'
4+
5+
services:
6+
sentry:
7+
image: getsentry/sentry:latest
8+
ports:
9+
- "9000:9000"
10+
environment:
11+
SENTRY_SECRET_KEY: "your_secret_key"
12+
SENTRY_DATABASE_URL: "postgres://sentry_user:password@localhost/sentry_db"
13+
SENTRY_REDIS_URL: "redis://localhost:6379"
14+
volumes:
15+
- /var/lib/sentry:/data
16+
17+
clickhouse:
18+
image: clickhouse/clickhouse-server:latest
19+
ports:
20+
- "8123:8123"
21+
- "9000:9000"
22+
volumes:
23+
- /var/lib/clickhouse:/var/lib/clickhouse
24+
- /var/log/clickhouse-server:/var/log/clickhouse-server
25+
26+
snuba-api:
27+
image: getsentry/snuba:latest
28+
ports:
29+
- "1218:1218"
30+
environment:
31+
SNUBA_SETTINGS: "docker"
32+
SNUBA_BROKER: "kafka://localhost:9092"
33+
SNUBA_CLICKHOUSE_HOST: "clickhouse"
34+
SNUBA_CLICKHOUSE_PORT: "8123"
35+
SNUBA_REDIS_HOST: "localhost"
36+
SNUBA_ZOOKEEPER_HOST: "localhost"
37+
38+
snuba-consumer:
39+
image: getsentry/snuba:latest
40+
environment:
41+
SNUBA_SETTINGS: "docker"
42+
SNUBA_BROKER: "kafka://localhost:9092"
43+
SNUBA_CLICKHOUSE_HOST: "clickhouse"
44+
SNUBA_CLICKHOUSE_PORT: "8123"
45+
SNUBA_REDIS_HOST: "localhost"
46+
SNUBA_ZOOKEEPER_HOST: "localhost"
47+
command: "consumer --storage events --auto-offset-reset=latest --log-level=INFO"
48+
49+
snuba-replacer:
50+
image: getsentry/snuba:latest
51+
environment:
52+
SNUBA_SETTINGS: "docker"
53+
SNUBA_BROKER: "kafka://localhost:9092"
54+
SNUBA_CLICKHOUSE_HOST: "clickhouse"
55+
SNUBA_CLICKHOUSE_PORT: "8123"
56+
SNUBA_REDIS_HOST: "localhost"
57+
SNUBA_ZOOKEEPER_HOST: "localhost"
58+
command: "replacer --storage events --auto-offset-reset=latest --log-level=INFO"
59+
60+
symbolicator:
61+
image: getsentry/symbolicator:latest
62+
ports:
63+
- "3021:3021"
64+
environment:
65+
SYM_STORE_PATH: "/data"
66+
BIND: "0.0.0.0:3021"
67+
volumes:
68+
- /var/lib/symbolicator:/data
69+
70+
zookeeper:
71+
image: zookeeper:latest
72+
ports:
73+
- "2181:2181"
74+
environment:
75+
ZOO_MY_ID: "1"
76+
ZOO_SERVERS: "server.1=0.0.0.0:2888:3888"
77+
volumes:
78+
- /var/lib/zookeeper:/data

sentry.nix

+42-40
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
};
2424

2525
# ZooKeeper
26-
services.zookeeper = {
27-
enable = true;
28-
package = pkgs.zookeeper;
29-
dataDir = "/var/lib/zookeeper";
30-
clientPort = 2181;
31-
};
26+
#services.zookeeper = {
27+
# enable = true;
28+
# package = pkgs.zookeeper;
29+
# dataDir = "/var/lib/zookeeper";
30+
# clientPort = 2181;
31+
#};
3232

3333
# Apache Kafka
3434
services.apache-kafka = {
@@ -52,42 +52,42 @@
5252
#};
5353

5454
# Symbolicator
55-
services.symbolicator = {
56-
enable = true;
57-
package = pkgs.symbolicator;
58-
settings = {
59-
"bind" = "0.0.0.0:3021";
60-
};
61-
};
55+
#services.symbolicator = {
56+
# enable = true;
57+
# package = pkgs.symbolicator;
58+
# settings = {
59+
# "bind" = "0.0.0.0:3021";
60+
# };
61+
#};
6262

6363
# Sentry Web und Worker
64-
services.sentry = {
65-
enable = true;
66-
package = pkgs.sentry;
67-
web = {
68-
enable = true;
69-
host = "0.0.0.0";
70-
port = 9000;
71-
};
72-
worker = {
73-
enable = true;
74-
};
75-
cron = {
76-
enable = true;
77-
};
78-
};
64+
#services.sentry = {
65+
# enable = true;
66+
# package = pkgs.sentry;
67+
# web = {
68+
# enable = true;
69+
# host = "0.0.0.0";
70+
# port = 9000;
71+
# };
72+
# worker = {
73+
# enable = true;
74+
# };
75+
# cron = {
76+
# enable = true;
77+
# };
78+
#};
7979

8080
# Snuba
81-
services.snuba = {
82-
enable = true;
83-
package = pkgs.snuba;
84-
settings = {
85-
"broker" = "kafka://localhost:9092";
86-
"clickhouse" = "http://localhost:8123";
87-
"redis" = "redis://localhost:6379";
88-
"zookeeper" = "localhost:2181";
89-
};
90-
};
81+
#services.snuba = {
82+
# enable = true;
83+
# package = pkgs.snuba;
84+
# settings = {
85+
# "broker" = "kafka://localhost:9092";
86+
# "clickhouse" = "http://localhost:8123";
87+
# "redis" = "redis://localhost:6379";
88+
# "zookeeper" = "localhost:2181";
89+
# };
90+
#};
9191

9292
# Sentry Relay
9393
#services.relay = {
@@ -113,8 +113,10 @@
113113
listen = [ { addr = "0.0.0.0"; port = 3000; } ];
114114
root = "/var/www/sentry";
115115
locations."/" = {
116-
proxyPass = "http://localhost:9000";
117-
proxySetHeader = "X-Relay-Host" "relay.example.com"; # Optional
116+
proxyPass = "http://localhost:9000";
117+
proxySetHeader = [
118+
{ name = "X-Relay-Host"; value = "relay.example.com"; }
119+
]; # Optional
118120
};
119121
};
120122
};

0 commit comments

Comments
 (0)