Loomio
Mon 26 Oct 2015 1:38PM

Help porting Loomio to Sandstorm

ND Nolan Darilek Public Seen by 886

Hello. For the past several days, I've been working on a port of Loomio to the Sandstorm app platform. I think it's going well, and my hope is to have v0.15.0 on the Sandstorm app market sometime this week or next. I'd also like to push the Sandstorm-specific changes upstream for inclusion into Loomio if possible. I built a function that determines whether Loomio is running as a Sandstorm grain, and am selectively disabling/tweaking functionality when that variable is set.

But I'm encountering an odd issue, and I can't seem to find anything in the tech manual. When I delete the initial discussion from new groups, the discussion vanishes but the "plan a trip to the moon" proposal sticks around. When I click on it, I get a "not found" page.

Digging through the code, I see that @discussion.delayed.destroy is called. This leads me to believe that I need to start scripts/delayed_job, but I see nothing about this in the manual. Also, starting it doesn't seem to make the proposal vanish either, so I'm wondering if perhaps it's crashing and not logging its failure on stdout. That's something I'll be investigating next.

But do I in fact need to start scripts/delayed_job, and if so, is there any setup work I need to do first? (I.e. initializing the delayed_job database tables)

I haven't done Rails in quite a while. Can delayed_job periodically run tasks like the automatic closing of proposals? Since the app isn't constantly running, cron isn't an option. Having the tasks run immediately on startup and every 15 minutes or so would be acceptable.

Thanks.

Z

zack Mon 26 Oct 2015 5:10PM

cannot help with your issue but just want to say that if you manage to port Loomio and allow people to create on-demand a Loomio instance so easily it's really cool

RDB

Richard D. Bartlett Mon 26 Oct 2015 7:46PM

Hey @nolandarilek - sounds like a cool project! I've just moved this thread to the "Installing Loomio" subgroup.

@robertguthrie or @jameskiesel can advise about the best way to handle delayed job.

RG

Robert Guthrie Mon 26 Oct 2015 10:31PM

Hi.

You need to run rake jobs:work to process background jobs. Best to keep this process running. Additionally you'll need to run:

rake loomio:send_missed_yesterday_email
rake loomio:send_proposal_closing_soon

each hour

and rake loomio:close_lapsed_motions every ten minutes or so.

Sorry this was not in the tech manual.. I'll get it updated this week

ND

Nolan Darilek Wed 28 Oct 2015 2:42AM

Perfect, that appears to have resolved the phantom proposal issue.

One additional question. Perhaps this is in the activeadmin docs, or maybe it isn't activeadmin at all. I modified Loomio to provide a link to the /admin interface for users running in Sandstorm since it's fairly difficult to hit a URL directly at Sandstorm's random subdomains. Unfortunately, the admin interface includes a logout link which I need to disable for Sandstorm users, since authentication/authorization is handled within Sandstorm and it doesn't make sense for users to log out of individual apps.

Is there an easy way to disable the logout link in the admin interface? I can't seem to find a template for it, and I don't know if there's an activeadmin configuration anywhere that would let me tweak it.

Thanks.

RG

Robert Guthrie Wed 28 Oct 2015 3:30AM

Nolan this is very exciting news. Well done and thank you for your work. I am so please you are doing this!

I have not had a good look but I think it's possible there isn't a formal way/config setting to turn off the logout link. However you could remove the link via CSS with a display: none.

config/initalizers/active_admin.rb line 135 talks about adding a stylesheet.

The logout link has an id of logout so you could write

#logout {
display: none
}

and pop it in as a stylesheet.

RG

Robert Guthrie Wed 28 Oct 2015 3:31AM

@nolandarilek would you like to share what you are excited about with Loomio on SandStorm? I'd love to hear more about it.

ND

Nolan Darilek Wed 28 Oct 2015 4:22AM

Sandstorm strikes me as perhaps the most ideal platform for many types of cooperative, loosely organized or non-hierarchical organizations. Want to create a website to promote something? No need for buy-in from IT, just install a WordPress or Ghost instance and create your content, publishing it statically to any domain you own. Need to develop code? Spin up GitLab, Gogs, GitWeb or whatever other Git hosts are currently packaged. Need an app to support some odd corner case or business practice? Specifically target Sandstorm and you don't have to worry about authentication/authorization, sharing or a whole host of other issues. The whole platform is highly secured and sandboxed. You can work with whatever stack you're comfortable, as long as it runs on Linux X64.

It's hard to explain, though. I recommend trying the demo.

In the case of Loomio, someone might be interested in trying it in an organization running a Sandstorm server, and a few clicks will eventually install a highly-secure, auto-updating instance they can then share with their entire organization. That person doesn't need to be a sys admin with Rails knowledge, just an ordinary member looking for a way to encourage greater collaboration.

RDB

Richard D. Bartlett Wed 28 Oct 2015 4:30AM

OMG that is so cool you are awesome Nolan :)

JK

James Kiesel Fri 6 Nov 2015 5:46AM

Hey @nolandarilek is this project open source? I'd love to have a peek at it at some point.

ND

Nolan Darilek Sat 7 Nov 2015 4:27PM

The modifications I've made are here:

https://dev.thewordnerd.info/nolan/loomio-sandstorm

At the moment it's a single, rebased commit against the 0.15.0 tag that I keep force-pushing as I find new things that need tweaking, but at this point I think I've caught about everything. Wanted to keep it as a single, simple patch that can be merged upstream. Sorry for the irresponsible Git use, but I've been making a ton of small snapshot commits that really aren't of historical interest.

Unfortunately, when I've rebased this patch against master, I get some strange asset errors wherein none of the static assets are found. I don't know enough about Rails to troubleshoot.

Think I'm going to push 0.15.0 into the Sandstorm App Market, then ask for help porting this patch to the latest release.

BTW, the tag list on the repository is a bit confusing. Haven't looked in a while but I recall seeing a 2.x tag which is what I did the initial port against. I then had the bright idea to check out the Github releases which led me to the confusing v0.15.x. When I started this was the newest release, and unfortunately I've had to step back for a week or two so that may have changed.

Load More