Closed HebaruSan closed 6 years ago
Weird. Did you run build/fetch_plugins.sh and the other script in the folder?
On Fri, Feb 16, 2018, 12:42 AM HebaruSan notifications@github.com wrote:
Following the instructions in README.md up to this point:
... I have no build_sdb.go file. This causes the above command to fail.
Should this perhaps be sdb.go instead? It's the only .go file in the project's root folder.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/KSP-SpaceDock/SpaceDock-Backend/issues/30, or mute the thread https://github.com/notifications/unsubscribe-auth/ABMW-9OeIq8vAo9WbQ7-4tIvaQ2oaIouks5tVOsigaJpZM4SH0K0 .
No I did not run build/fetch_plugins.sh
, because it was contraindicated by the instructions:
I have no reason to "want" to use plugins at this point (I'd prefer a simple, stable build the first time around), and I know of no goland dependency URLs to enter into that file, since I don't know of any plugins. So I moved on to the next section.
I did run build/install_glide.sh
, though. It seemed to work fine, and $GOPATH/bin/glide
now exists.
Does it work if you compile sdb.go instead? It should work since build_sdb.go is just sdb.go with plugins added to its imports.
On Fri, Feb 16, 2018, 12:50 AM HebaruSan notifications@github.com wrote:
No I did not run build/fetch_plugins.sh, because it was contraindicated by the instructions:
I have no reason to "want" to use plugins at this point (I'd prefer a simple, stable build the first time around), and I know of no goland dependency URLs to enter into that file, since I don't know of any plugins. So I moved on to the next section.
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/KSP-SpaceDock/SpaceDock-Backend/issues/30#issuecomment-366130888, or mute the thread https://github.com/notifications/unsubscribe-auth/ABMW-wtFhj9fAv1OTJn_j90bFwR0feUNks5tVO0AgaJpZM4SH0K0 .
Yes, this command seemed to work as expected:
go build -v -o ./sdb ./sdb.go
This gave me a ~20 MB sdb
file in the current directory, as well as an exact copy of that file called SpaceDock-Backend
.
I get this when I run ./sdb
:
2018/02/15 21:06:27 SpaceDock-Backend -- Version: {$VERSION}
2018/02/15 21:06:27 * Loading configuration file: config/config.yml
2018/02/15 21:06:27 * Establishing Database connection
2018/02/15 21:06:27 * Failed to connect to the database: Error 1045: Access denied for user ''@'localhost' (using password: NO)
I assume this is because my SQL environment isn't set up to host a SpaceDock data set. I'll try to figure out how to do that, but a "Database setup" section in README.md would be nice to have.
It's pretty easy, just setup the correct connection string in config.yml and then run sdb setup
On Fri, Feb 16, 2018, 1:09 AM HebaruSan notifications@github.com wrote:
I get this when I run ./sdb:
2018/02/15 21:06:27 SpaceDock-Backend -- Version: {$VERSION} 2018/02/15 21:06:27 Loading configuration file: config/config.yml 2018/02/15 21:06:27 Establishing Database connection 2018/02/15 21:06:27 * Failed to connect to the database: Error 1045: Access denied for user ''@'localhost' (using password: NO)
I assume this is because my SQL environment isn't set up to host a SpaceDock data set. I'll try to figure out how to do that, but a "Database setup" section in README.md would be nice to have.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/KSP-SpaceDock/SpaceDock-Backend/issues/30#issuecomment-366133104, or mute the thread https://github.com/notifications/unsubscribe-auth/ABMW-17-Zp5Tq2w8dksX6ZFfFziBhzPNks5tVPFtgaJpZM4SH0K0 .
I tried guessing a string to see what errors came up:
dialect: "mysql"
connection-data: "server=127.0.0.1;uid=root;pwd=test;database=spacedockbackend"
I don't think that password is valid, but the error was about something else:
2018/02/15 21:20:29 * Failed to connect to the database: invalid DSN: missing the slash separating the database name
What is the format of this string supposed to be? None of the examples of connection strings I can find online include slashes.
postgresql://username:password@hostname:port/database
The dialect
setting defaulted to "mysql"
. I assume it should be "postgresql"
to use those values?
Here's the one I use
dialect: "postgres"
connection-data: "postgresql://spacedock:spacedock@127.0.0.1/spacedock?sslmode=disable"
EDIT: after you setup your DB correctly, just run sdb setup
and it should update the DB's structure with the required tables and fields.
Thanks! Finally I got the expected failed authentication message. Now to figure out how to administer postgresql on Ubuntu...
Check the SpaceDock readme for more instructions on setting up PostgreSQL.
... and a short SQL crash course later, ./sdb setup
has finished running, and ./sdb
says:
Serving HTTP on 0.0.0.0 port 5000 using httprouter
On to OpenDock!...
Should this work for configuring Apache? It's been a few years and apparently some of the syntax has changed...
Alias "/OpenDock/" "/home/paul/Documents/src/gopath/src/github.com/KSP-SpaceDock/OpenDock/"
<Directory "/home/paul/Documents/src/gopath/src/github.com/KSP-SpaceDock/OpenDock/">
AllowOverride All
Require all granted
</Directory>
I get this in error.log:
[Thu Feb 15 22:53:29.198876 2018] [:error] [pid 25569] [client 127.0.0.1:60926] PHP Fatal error: Uncaught BadMethodCallException: Method notFound is not a valid method in /home/paul/Documents/src/gopath/src/github.com/KSP-SpaceDock/OpenDock/vendor/slim/slim/Slim/App.php:126\nStack trace:\n#0 /home/paul/Documents/src/gopath/src/github.com/KSP-SpaceDock/OpenDock/src/anonymus.php(41): Slim\App->__call('notFound', Array)\n#1 /home/paul/Documents/src/gopath/src/github.com/KSP-SpaceDock/OpenDock/index.php(47): require('/home/paul/Docu...')\n#2 {main}\n thrown in /home/paul/Documents/src/gopath/src/github.com/KSP-SpaceDock/OpenDock/vendor/slim/slim/Slim/App.php on line 126
I'm not sure whether notFound
is supposed to be defined in OpenDock itself or a library.
Thanks! Finally I got the expected failed authentication message. Now to figure out how to administer postgresql on Ubuntu...
I recommend pgAdmin for that, it's a really nice tool
The README should be changed to specify that running the fetch_plugins script without having plugins defined just generates build_sdb.go
without any changes.
However, OpenDock currently needs some of the plugins in SpaceDock-Extras, so here is my plugins.txt for reference: https://gist.github.com/StollD/686a2476b1c48eb899d1f5b3d9557434
Following the instructions in README.md up to this point:
https://github.com/KSP-SpaceDock/SpaceDock-Backend/blob/43a0c94fc550ac565dc38629b204818eb09caca0/README.md#L55-L59
... I have no
build_sdb.go
file. This causes the above command to fail.Should this perhaps be
sdb.go
instead? It's the only.go
file in the project's root folder.