amahi / amahi-anywhere-fs

Amahi Anywhere file server
GNU General Public License v3.0
12 stars 10 forks source link

cannot compile on ubuntu(Docker) #16

Closed phoon closed 5 years ago

phoon commented 5 years ago

I first compiled it on my Archlinux, it didn't work. So I turn to Ubuntu (Docker on my Arch), it still couldn't work, the errors are following:

root@Ubuntu:~/work/amahi-anywhere-fs# make
head: cannot open '/etc/system-release' for reading: No such file or directory
go get -tags " linux" fs
# fs
src/fs/fs.go:60:18: undefined: PFE_HOST
src/fs/fs.go:61:18: undefined: PFE_PORT
src/fs/fs.go:71:37: undefined: PFE_HOST
src/fs/fs.go:72:42: undefined: PFE_PORT
src/fs/fs.go:85:39: undefined: MYSQL_CREDENTIALS
src/fs/fs.go:109:41: undefined: METADATA_FILE
src/fs/fs.go:109:56: undefined: TMDB_API_KEY
src/fs/fs.go:109:70: undefined: TVRAGE_API_KEY
src/fs/fs.go:109:86: undefined: TVDB_API_KEY
src/fs/fs.go:112:13: undefined: PID_FILE
src/fs/fs.go:112:13: too many errors
Makefile:17: recipe for target 'build-production' failed
make: *** [build-production] Error 2
cpg commented 5 years ago

@csoni111 Can you see of a way we could come up with some way to make some basic (or in some cases fake) credentials so that people could at least build, if not run the app?

@iPeven IIRC, there was some way to run with some command line option to run from a local directory/folder so that one did not need mysql, etc., though you may still need a file with these constants (even if fake) just to run the program.

I kind of wish we'd be able to run the server in a local machine and still be able to be seen by the mobile app. That would be a cool functionality, come to think of it.

phoon commented 5 years ago

You mean the secrets.go file? I already added it. My Golang version is go version go1.12 linux/amd64

phoon commented 5 years ago

I finally compiled it, I think the problem is the Makefile, the system release information on ubuntu is at /etc/os-release now, and even I copy it to /etc/system-release, I should change the content of it. And the new problem is FATAL: Amahi API key was not found

cpg commented 5 years ago

Try using a random key just to get the program running. I think you can also provide it by hand via a command line argument like I mentioned before.

csoni111 commented 5 years ago

@iPeven Use go get -tags "development ubuntu linux" fs to build the binary. Then as @cpg mentioned, while running you can supply extra arguments to the program to provide things like API key, debug level, root directory etc. Use ./bin/fs -h to print all possible arguments you can pass. For example: ./bin/fs -k "sample-key" -r "/path/to/sample/directory"

csoni111 commented 5 years ago

@cpg we have that option with our current setup to run the fs in our local machine and see it in our Android app. We added this functionality Amahi Android (using-a-custom-server) for the very same purpose but one needs to build the android app to use this functionality.

phoon commented 5 years ago

@iPeven Use go get -tags "development ubuntu linux" fs to build the binary. Then as @cpg mentioned, while running you can supply extra arguments to the program to provide things like API key, debug level, root directory etc. Use ./bin/fs -h to print all possible arguments you can pass. For example: ./bin/fs -k "sample-key" -r "/path/to/sample/directory"

Thanks, it works now