mirror of
https://github.com/chirpstack/chirpstack.git
synced 2025-02-21 01:21:21 +00:00
Replace env. variables in config by localhost for .deb and .rpm
The env. variables are used such that the same configuration can be used for Docker images, .deb and .rpm packages. However, if installing .deb or .rpm packages, this can be confusing as executing 'chirpstack -c /etc/chirpstack' will fail because these environment variables are only available when using systemctl to start the ChirpStack process (configured in the .service configuration file).
This commit is contained in:
parent
e917f8ea49
commit
3b297ef221
@ -1,4 +0,0 @@
|
||||
[Service]
|
||||
Environment="MQTT_BROKER_HOST=localhost"
|
||||
Environment="POSTGRESQL_HOST=localhost"
|
||||
Environment="REDIS_HOST=localhost"
|
@ -23,6 +23,9 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
||||
rm -rf %{buildroot}
|
||||
mkdir -p %{buildroot}
|
||||
cp -a * %{buildroot}
|
||||
sed -i "s/\$MQTT_BROKER_HOST/localhost/" %{buildroot}/etc/chirpstack/*.toml
|
||||
sed -i "s/\$POSTGRESQL_HOST/localhost/" %{buildroot}/etc/chirpstack/*.toml
|
||||
sed -i "s/\$REDIS_HOST/localhost/" %{buildroot}/etc/chirpstack/*.toml
|
||||
|
||||
%clean
|
||||
rm -rf %{buildroot}
|
||||
@ -32,4 +35,3 @@ rm -rf %{buildroot}
|
||||
%{_bindir}/*
|
||||
/lib/systemd/system/chirpstack.service
|
||||
%config /etc/chirpstack/*
|
||||
%config /etc/systemd/system/chirpstack.service.d/*
|
||||
|
@ -120,7 +120,6 @@ bytes = "1.1"
|
||||
assets = [
|
||||
["target/release/chirpstack", "usr/bin/", "755"],
|
||||
["configuration/*.toml", "etc/chirpstack/", "640"],
|
||||
["debian/environment.conf", "etc/systemd/system/chirpstack.service.d/environment.conf", "640"],
|
||||
]
|
||||
conf-files = [
|
||||
"/etc/chirpstack/chirpstack.toml",
|
||||
@ -162,7 +161,6 @@ package = "chirpstack"
|
||||
[package.metadata.rpm.files]
|
||||
"configuration/" = { path = "/etc/chirpstack/" }
|
||||
"chirpstack.service" = { path = "/lib/systemd/system/chirpstack.service" }
|
||||
"chirpstack.env" = { path = "/etc/systemd/system/chirpstack.service.d/environment" }
|
||||
|
||||
[package.metadata.rpm.cargo]
|
||||
buildflags = ["--release"]
|
||||
|
@ -1,4 +0,0 @@
|
||||
[Service]
|
||||
Environment="MQTT_BROKER_HOST=localhost"
|
||||
Environment="POSTGRESQL_HOST=localhost"
|
||||
Environment="REDIS_HOST=localhost"
|
@ -5,4 +5,9 @@ chown -R chirpstack:chirpstack /etc/chirpstack
|
||||
chmod 750 /etc/chirpstack
|
||||
chmod 640 /etc/chirpstack/*.toml
|
||||
|
||||
# Set environment variables to localhost
|
||||
sed -i "s/\$MQTT_BROKER_HOST/localhost/" /etc/chirpstack/*.toml
|
||||
sed -i "s/\$POSTGRESQL_HOST/localhost/" /etc/chirpstack/*.toml
|
||||
sed -i "s/\$REDIS_HOST/localhost/" /etc/chirpstack/*.toml
|
||||
|
||||
#DEBHELPER#
|
||||
|
Loading…
x
Reference in New Issue
Block a user