librespeed / speedtest-go

Go backend for LibreSpeed
GNU Lesser General Public License v3.0
733 stars 157 forks source link

Make assets directory location configurable #2

Closed driesmp closed 4 years ago

driesmp commented 4 years ago

Description

Make the asset directory configurable in the source code or the configuration file.

Why it should be implemented

Me in porting this stuff to FreeBSD. When I'm trying to start speedtest-go from the install directory itself, with the assert directory located in it everything works. When trying to start it from an rc script, it doesn't find the asset dir. Probably because of the env?

Optional: implementation suggestions

If we could specify asset dir in the source, like the config path location viper.AddConfigPath("."), If we could have a asset.addpath or something, you know what I mean :-).

maddie commented 4 years ago

Yeah, you’d have to have your script chdir to the directory which assets resides to make it work. I agree that the current implementation isn’t good, and your suggestion sounds good to me. I’ll take a look when I have time, or better yet submit a PR :)

On Thu, Jun 11, 2020 at 18:27 Dries Michiels notifications@github.com wrote:

Description

Make the asset directory configurable in the source code or the configuration file. Why it should be implemented

Me in porting this stuff to FreeBSD. When I'm trying to start speedtest-go from the install directory itself, with the assert directory located in it everything works. When trying to start it from an rc script, it doesn't find the asset dir. Probably because of the env? Optional: implementation suggestions

If we could specify asset dir in the source, like the config path location viper.AddConfigPath("."), If we could have a asset.addpath or something, you know what I mean :-).

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/librespeed/speedtest-go/issues/2, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABWFMG6TAT4PV3JBE7BUSTRWCWP5ANCNFSM4N3I6B7A .

-- Yours, Maddie

driesmp commented 4 years ago

Ok I dug a little deeper and as you stated I can use our RC framework to chdir to the DIR in question. I might leave this open, but its fine for now :-).

maddie commented 4 years ago

Good to know it’s working for you. Please leave this issue open, I think it’s a good suggestion to let user define the assets path.

On Fri, Jun 12, 2020 at 21:14 Dries Michiels notifications@github.com wrote:

Ok I dug a little deeper and as you stated I can use our RC framework to chdir to the DIR in question. I might leave this open, but its fine for now :-).

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/librespeed/speedtest-go/issues/2#issuecomment-643263817, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABWFMB54NVY2DCMGMEI3BDRWISZZANCNFSM4N3I6B7A .

-- Yours, Maddie