Skip to content

Commit eedccab

Browse files
committed
moved database and added config.yml
1 parent 4ca2d40 commit eedccab

File tree

2 files changed

+38
-11
lines changed

2 files changed

+38
-11
lines changed

config.example.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
authentication: true # Set to false to disable authentication
3+
influxdb:
4+
enabled: true
5+
host_tag: 'speedtest'
6+
retention: '30d'
7+
notifications:
8+
channels:
9+
discord:
10+
webhook_url: null # Set as null to disable
11+
slack:
12+
webhook_url: null # Set as null to disable
13+
speedtest:
14+
schedule: '*/60 * * * *' # every hour
15+
ookla_server_id: null # specify a server ID to use a sepecific server
16+
tz: 'America/New_York'

docker/deploy/etc/cont-init.d/50-speedtest-automations

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,35 +9,46 @@
99

1010
echo "🐇 Starting Speedtest Tracker..."
1111

12-
# Check for appdata directory
13-
if [ ! -d /appdata ]; then
12+
# Check for app data directory
13+
if [ ! -d /app ]; then
1414
# make the directory
1515
echo "🙄 App data directory not found, creating..."
1616

17-
su - webuser -c "mkdir /appdata"
18-
chown -R webuser:webgroup /appdata
19-
chmod -R 750 /appdata
17+
su - webuser -c "mkdir /app"
18+
chown -R webuser:webgroup /app
19+
chmod -R 750 /app
2020
else
2121
# just update the permissions
2222
echo "✅ App data directiory exists"
2323

24-
chown -R webuser:webgroup /appdata
25-
chmod -R 750 /appdata
24+
chown -R webuser:webgroup /app
25+
chmod -R 750 /app
2626
fi
2727

2828
if [ ${DB_CONNECTIONS:="sqlite"} == "sqlite" ]; then
2929
# Check for database
30-
if [ ! -f /appdata/database.sqlite ]; then
30+
if [ ! -f /app/database.sqlite ]; then
3131
echo "🙄 Database file not found, creating..."
3232

33-
su - webuser -c "touch /appdata/database.sqlite"
34-
chmod 750 /appdata/database.sqlite
33+
su - webuser -c "touch /app/database.sqlite"
34+
chmod 750 /app/database.sqlite
3535
else
3636
echo "✅ Database exists"
37-
chmod 750 /appdata/database.sqlite
37+
chmod 750 /app/database.sqlite
3838
fi
3939
fi
4040

41+
# Check for config yaml file
42+
if [ ! -f /app/config.yml ]; then
43+
echo "🙄 Config file not found, creating..."
44+
45+
su - webuser -c "cp /var/www/html/config.example.yml /app/config.yml"
46+
chmod 750 /app/config.yml
47+
else
48+
echo "✅ Config file exists"
49+
chmod 750 /app/config.yml
50+
fi
51+
4152
# Check for app key
4253
if grep -E "APP_KEY=[0-9A-Za-z:+\/=]{1,}" /var/www/html/.env > /dev/null; then
4354
echo "✅ App key exists"

0 commit comments

Comments
 (0)