Open frshbeetz opened 7 years ago
Quick update: I've run bin/rails and I see a server listening on 127.0.0.1:3000. So I set up nginx really quick to proxy there, but when I load the site, it's just a white screen.
Log output from rails:
~/OnceUponATable/bin$ ./rails server
=> Booting WEBrick
=> Rails 4.2.7.1 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2016-11-25 07:41:00] INFO WEBrick 1.3.1
[2016-11-25 07:41:00] INFO ruby 2.3.1 (2016-04-26) [x86_64-linux]
[2016-11-25 07:41:00] INFO WEBrick::HTTPServer#start: pid=4870 port=3000
Started GET "/" for 127.0.0.1 at 2016-11-25 07:41:14 +0000
ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
Processing by StaticPagesController#root as HTML
User Load (0.7ms) SELECT "users".* FROM "users" WHERE "users"."session_token" IS NULL LIMIT 1
Rendered static_pages/root.html.erb within layouts/application (20.8ms)
Completed 200 OK in 298ms (Views: 296.9ms | ActiveRecord: 1.4ms)
I use webpack to bundle all my front-end code. If the final bundle.js isn't available, then React never gets around to building the app on the client side.
Try running npm -install
from the top directory and running webpack
to generatate bundle.js.
Also as a quick heads up, you'll need to set up your own API keys with figaro. As is right now, neither pusher nor cloudinary will work.
Awesome, thanks! I can confirm that after running:
sudo npm install webpack -g
webpack
./bin/setup
./bin/rails server
That the interface does indeed load when I hit the site, hooray progress!
What kind of headaches am I looking at if I want to use some arbitrary webserver of mine for housing token and map files, instead of cloudinary?
You'll just need to swap out the logic building URLs and image elements from Cloudinary public_ids with source URLs pointing to your own image assets. If you want to do away with the Pusher API, I imagine you'll need to build your own publish/subscribe model with websockets.
Understood! In the interest of testing further, I've signed up for free Pusher and Cloudinary accounts.
I've been looking over the code a bit, and I can't nail down where should I be inserting these keys.
I read one of your comments about how keys shouldn't be included in the source. Figaro somehow sets them as environment variables then I take it, what should I be looking to do order to configure/run that? Update: Looking over https://github.com/laserlemon/figaro
Presumably, I can also write a bash script to set the variables for testing. If so what are the names of the variables I'll be setting?
My apologies for the onslaught of noob questions, finding a self-hostable grid that my friends and I can drop maps/tokens on has been tricky, since most of the similar projects on here seem thoroughly dead. I'm really stoked to have found one that's being actively developed.
In the meantime, I'll continue to wander around your source code and attempt to answer these questions for myself, will post an update in the event that I figure it out beforehand. Once I can get a version that runs, I might be able to work on some theming and CSS with you in return for the support!
I think i have this working for the most part. I noticed that If I go to add users from my instance of the game I can see them from yours though, which is interesting. I'll let you know if I get stuck anywhere or notice anything else.
Before you sign on full-throttle, I'd like to point out that this is largely a project undertaken to learn a few technologies and demonstrate them as part of my skillset. While I will be getting around to various enhancements when I've time, it's unlikely to ever be a solid replacement for a site like roll20.
As for the pre-seeded users, that's expected. There is a seeds.rb file that will preseed a project's database. If you wish to have a clean slate, remove or empty the file.
In the meantime, I'm going to keep this issue open until such time as I've updated the readme with setup instructions. I will take note of a need to allow alternate schemes for image hosting and push notifications. It should be noted that the choice to go for pusher was made more out of time pressure and simplicity than any other criterion.
heh understood! Definitely aware of the pitfalls and appreciate your work, as well as your advice. I'll definitely be hacking on it a bit (with my limited abilities) just to mess around, and I'll try to run a game or two to see how it goes.
I've been able to deploy it to a state where a friend of mine can join a game and we can both add tokens, move them etc... so whatever I managed to cobble together does appear to work at least. It sits nicely in an iframe next to another div with my mattermost (rich chat) deployment after some nginx tweaking, so my group has something we'd certainly be able to play around with for now.
Thank you for your time!
I'll look over my notes and add them here as far as what I had to do to deploy on a Debian 8 box with Nginx.
I've been hacking up your seeds.rb and stylesheets for our Shadowrun game. Definitely enjoying myself! Just figured I'd show you what it's looking like. :)
Hopefully I didn't miss anything!
sudo apt-get update ; sudo apt-get upgrade
sudo apt-get install nginx screen postgresql-9.4 postgresql-client-9.4 build-essential git
git clone https://github.com/jamesdconklin/OnceUponATable.git
cd OnceUponATable
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
curl -sSL https://get.rvm.io | bash -s stable --ruby=jruby --gems=rails,puma
rvm install ruby-2.3.1
rvm use ruby-2.3.1
gem install bundler
sudo apt-get install libpq-dev
gem install pg -v '0.19.0'
bundler
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo npm install webpack -g
npm install
webpack
sudo su -
su - postgres
creatdb onceupon
createuser --interactive
psql
alter user "tableadmin" with password 'yoursecurepassword';
grant all on database onceupon to tableadmin;
\q
default: &default
adapter: postgresql
encoding: unicode
pool: 5
development:
<<: *default
database: onceupon
username: tableadmin
password: yoursecurepassword
host: localhost
port: 5432
template: template0
test:
<<: *default
database: onceupon_test
https://cloudinary.com/users/register/free https://pusher.com/signup
https://cloudinary.com/console/settings/security https://dashboard.pusher.com/apps/(yourappid)/keys
PUSHER_APP_ID: ""
PUSHER_API_KEY:
PUSHER_SECRET:
#CLOUDINARY_CLOUD_NAME: jdc-asset-server
CLOUDINARY_CLOUD_NAME:
CLOUDUNARY_API_KEY:
(I recommed reviewing the CertBot Github repo and Nginx docs for HTTPS)
server {
listen 80;
server_name YOUR_FQDN_OR_IP;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_read_timeout 90;
}
}
sudo service nginx restart
cd ~/OnceUponATable/bin/
./setup
./rails server
I cloned your repo, then installed rvm, nodejs, postgresql. When I go to run bin/setup, it says it completes successfully, and the spring server is running, but I don't see anything listening on a public port. Feel free to let me know what information I can provide you with.
Some sample output is below: