Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Knifegrab
Jul 30, 2014

Gadzooks! I'm terrified of this little child who is going to stab me with a knife. I must wrest the knife away from his control and therefore gain the upperhand.

karms posted:

POST the url of the current page, log in, redirect to the url?

I feel so stupid asking this, consdiering how far along I am in webdev. I know how to effectively do a get using links and what not, and i know how to fire xmlhttp requests using ajax but I have no idea how to hand craft a post.

code:
window.location.href = `/auth/steam?returnTo=${encodeURIComponent(window.location.pathname)}`;
That did the trick but I would prefer to post it.

Adbot
ADBOT LOVES YOU

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/send if you're using nekked XHRs

Knifegrab
Jul 30, 2014

Gadzooks! I'm terrified of this little child who is going to stab me with a knife. I must wrest the knife away from his control and therefore gain the upperhand.

But I thought XHR's deny cross site redirects? As per the CORS spec

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Knifegrab posted:

But I thought XHR's deny cross site redirects? As per the CORS spec

Ah, sorry - I lost track of what you were talking about doing during the day.

You can do the auth in a child window and have an auth success page that just postMessages the cookies and whatnot back to the parent that can update itself as needed.

E: unless I'm continuing to misunderstand :v:

Munkeymon fucked around with this message at 22:32 on Jan 11, 2017

Knifegrab
Jul 30, 2014

Gadzooks! I'm terrified of this little child who is going to stab me with a knife. I must wrest the knife away from his control and therefore gain the upperhand.

Munkeymon posted:

Ah, sorry - I lost track of what you were talking about doing during the day.

You can do the auth in a child window and have an auth success page that just postMessages the cookies and whatnot back to the parent that can update itself as needed.

E: unless I'm continuing to misunderstand :v:

This might work but I would need to see an example to really wrap my head around it.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Knifegrab posted:

This might work but I would need to see an example to really wrap my head around it.

Of https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage and https://developer.mozilla.org/en-US/docs/Web/API/Window/open ?

The parent page would open() the auth URL with returnTo set to, for example, /auth/post-success which would contain a script that would postMessage with whatever the parent page needs to XHR-get the user information you just stored on the back-end (or it could postMessage all of that - it'd be faster that way) so the parent can update itself as needed to reflect the logged in user and pass along credentials. That probably means setting user ID and auth token cookies - you know your system better than I do.

I don't have an example to hand because I've never tried this myself, but you can probably find an existing OAuth library that works that way.

Yes, the cookie 'API' is terrible. Such is webdev.

Warbird
May 23, 2012

America's Favorite Dumbass

Warbird posted:

Bitching about apache

I redid the VHost config for the blog and it appears to have worked. I had read in a few places that it could be something on my server provider's level, but let's home not. Now onward to SFTP setup and great amounts of crying!

putin is a cunt
Apr 5, 2007

BOY DO I SURE ENJOY TRASH. THERE'S NOTHING MORE I LOVE THAN TO SIT DOWN IN FRONT OF THE BIG SCREEN AND EAT A BIIIIG STEAMY BOWL OF SHIT. WARNER BROS CAN COME OVER TO MY HOUSE AND ASSFUCK MY MOM WHILE I WATCH AND I WOULD CERTIFY IT FRESH, NO QUESTION

FateFree posted:

Yessir, these aren't external services though they are all separate applications within their intranet that I guess they purchased or something. Anyway it seems to work if I just post a form to a hidden iframe on the page soo, good enough!

I'm still confused - how do you know that they are all the same username/password? Do users not have the ability to change their credentials in these systems?

By the way your approach will only work so long as the other systems never implement a nonce or an anti-forgery token or whatever. If this scenario isn't of any concern then you should be okay. Make sure you also log them out automatically as well though.

putin is a cunt fucked around with this message at 06:55 on Jan 12, 2017

FateFree
Nov 14, 2003

The Wizard of Poz posted:

I'm still confused - how do you know that they are all the same username/password?

Honestly the only way I know is because that's what the client told me. I realize this whole thing is terrible and I actively fought against it, but he would not be dissuaded. Anyway good point about the logout, although I guess the sessions would just time out anyway if they didn't click it.

Knifegrab
Jul 30, 2014

Gadzooks! I'm terrified of this little child who is going to stab me with a knife. I must wrest the knife away from his control and therefore gain the upperhand.
So I have a node server and I would like to force users to only use domain.com and not https://www.domain.com. There are lots of packages out there and odd solutions, I was wondering if anyone dealt with this recently.

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
Is something fronting your node server? It probably should be fronted by nginx or apache or something, which then proxies to node. If that's the case, you should handle your redirect rules at the nginx/apache level.

Knifegrab
Jul 30, 2014

Gadzooks! I'm terrified of this little child who is going to stab me with a knife. I must wrest the knife away from his control and therefore gain the upperhand.
So I will be doing advertising soon and I am not going through google adsense because my site has been rejected by google. Instead I have found a number of people willing to do more custom ad tailoring (there is a contract and what not). Its based on CPM and whatnot and CTR etc etc. My question is, how do I best enforce the approrpiate payment. I have the site google analytics'ed out, and I have I have a google event set to fire on clicks on the ads but I have no guarantee they will fire completely before the redirect.

Furthermore is just page views thorugh GA enough to use for recompensation. I am terribly new to this, not even really trying to turn a profit, just want to get to net zero on server costs.

Knifegrab fucked around with this message at 11:32 on Jan 13, 2017

awesomeolion
Nov 5, 2007

"Hi, I'm awesomeolion."

Having some weird issues here. Would much appreciate any ideas of what to check on.

Hosting a Wordpress multisite on GoDaddy. Occasionally when visiting the page it will fail to load and give an "internal server error". Also, there is a game portion of the site that uses Pusher and sometimes it falls apart because a mobile user gets this error "[Error] Failed to load resource: The request timed out. (presence_auth.php, line 0)" which is a file also hosted on GoDaddy. To me that looks like the same issue: getting no response when trying to request a file. The site is http://multi.lovelinesonline.com/sample/. I'm starting to think it's something in the .htaccess or server configuration that needs to be tweaked.

awesomeolion fucked around with this message at 18:55 on Jan 13, 2017

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

awesomeolion posted:

Having some weird issues here. Would much appreciate any ideas of what to check on.

Hosting a Wordpress multisite on GoDaddy. Occasionally when visiting the page it will fail to load and give an "internal server error". Also, there is a game portion of the site that uses Pusher and sometimes it falls apart because a mobile user gets this error "[Error] Failed to load resource: The request timed out. (presence_auth.php, line 0)" which is a file also hosted on GoDaddy. To me that looks like the same issue: getting no response when trying to request a file. The site is http://multi.lovelinesonline.com/sample/. I'm starting to think it's something in the .htaccess or server configuration that needs to be tweaked.

Or it could be your GoDaddy hosting is over-resourced and is making GBS threads the bed on some requests.

LargeHadron
May 19, 2009

They say, "you mean it's just sounds?" thinking that for something to just be a sound is to be useless, whereas I love sounds just as they are, and I have no need for them to be anything more than what they are.
Is there existing software for an embeddable (and customizable) web form builder? I'm looking to write a web app that allows non-technical users to go in and design their own web forms. My instincts tell me that this is something I should build from scratch with Angular or whatever, and I'm ok with that. I just wanted to make sure there's not an existing solution I can leverage first.

kedo
Nov 27, 2007

Lumpy posted:

Or it could be your GoDaddy hosting is over-resourced and is making GBS threads the bed on some requests.

Agreed, this is likely the issue. Godaddy hosting is horrific.

awesomeolion
Nov 5, 2007

"Hi, I'm awesomeolion."

Alright good to know, thanks y'all!

dexter6
Sep 22, 2003
Not sure if this is exactly the right thread or not but I figured it's close enough so...

I volunteer with a non-profit. We recently learned that Google offers free stuff to non-profits, so we're checking that out. It would be very cool to issue our members email addresses through Gmail, be able to use Google Drive to collaborate and Google Sites to host our site.

However, we currently have a domain, hosting and email addresses through network solutions.

If I go through the process of setting up the GSuite apps, will I be able to keep our old site and emails up and running while I set up the new stuff? Anyone have any experience with migrating to GSuite from Network Solutions?

The Fool
Oct 16, 2003


dexter6 posted:

Not sure if this is exactly the right thread or not but I figured it's close enough so...

I volunteer with a non-profit. We recently learned that Google offers free stuff to non-profits, so we're checking that out. It would be very cool to issue our members email addresses through Gmail, be able to use Google Drive to collaborate and Google Sites to host our site.

However, we currently have a domain, hosting and email addresses through network solutions.

If I go through the process of setting up the GSuite apps, will I be able to keep our old site and emails up and running while I set up the new stuff? Anyone have any experience with migrating to GSuite from Network Solutions?

Short answer is yes.

You'll be able to continue using your network solutions stuff until you change your DNS setting to use gsuite. And you can mess around setting up whatever you want in gsuite without having your domain pointing at it.

Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!

Lumpy posted:

I cannot fathom working in anything else (unless it has a really, really, good VIM-mode / plugin) You just say "Okay me, for the next three weeks, I'm going to be slow as poo poo and swearing constantly" and Just Use It™. Then after that, it's wired into your muscle memory and you can fly. It's insanely powerful and customizable, but that comes at the price of it having a steeeeeep learning curve (cliff) and having to constantly delete VIM commands you type in the middle of text done in non-VIM places. If I had a dollar for every post on the forums I've had to delete the jkwq at the end....

Same but I always have to delete :w in the most random places.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



LargeHadron posted:

Is there existing software for an embeddable (and customizable) web form builder? I'm looking to write a web app that allows non-technical users to go in and design their own web forms. My instincts tell me that this is something I should build from scratch with Angular or whatever, and I'm ok with that. I just wanted to make sure there's not an existing solution I can leverage first.

https://www.google.com/forms/about/ and googling for that showed me four ads for other services lol

LargeHadron
May 19, 2009

They say, "you mean it's just sounds?" thinking that for something to just be a sound is to be useless, whereas I love sounds just as they are, and I have no need for them to be anything more than what they are.

Munkeymon posted:

https://www.google.com/forms/about/ and googling for that showed me four ads for other services lol

I'm not looking to use a form builder, so much as I'm looking to *write* a form builder for a targeted purpose. The project manager is hoping we can take existing form builder software (open source, or maybe something we can buy a license for) and build on it. I'm not at all hopeful that this exists, and I believe we will need to build one from scratch, but I am doing my due diligence by looking into the possibility.

ROFLburger
Jan 12, 2006

Restful design question:

Which seems more appropriate (Or do you have another suggestion?)
GET /users/avatars/?userIds={list-of-user-ids}
or
GET /users/{list-of-user-ids}/avatars

All I have available to me are the users' IDs

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

ROFLburger posted:

Restful design question:

Which seems more appropriate (Or do you have another suggestion?)
GET /users/avatars/?userIds={list-of-user-ids}
or
GET /users/{list-of-user-ids}/avatars

All I have available to me are the users' IDs

Ehh, people will say different things. There's discussion of a lot of pros and cons here at snack overflow.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



LargeHadron posted:

I'm not looking to use a form builder, so much as I'm looking to *write* a form builder for a targeted purpose. The project manager is hoping we can take existing form builder software (open source, or maybe something we can buy a license for) and build on it. I'm not at all hopeful that this exists, and I believe we will need to build one from scratch, but I am doing my due diligence by looking into the possibility.

Ah, you didn't specify open source, but I probably should have known. You should be able to find an open source CMS using the same stack you're using - they usually have a way to slap forms togehter.

LargeHadron
May 19, 2009

They say, "you mean it's just sounds?" thinking that for something to just be a sound is to be useless, whereas I love sounds just as they are, and I have no need for them to be anything more than what they are.

ROFLburger posted:

Restful design question:

Which seems more appropriate (Or do you have another suggestion?)
GET /users/avatars/?userIds={list-of-user-ids}
or
GET /users/{list-of-user-ids}/avatars

All I have available to me are the users' IDs

You can implement both!

LargeHadron
May 19, 2009

They say, "you mean it's just sounds?" thinking that for something to just be a sound is to be useless, whereas I love sounds just as they are, and I have no need for them to be anything more than what they are.

Munkeymon posted:

Ah, you didn't specify open source, but I probably should have known. You should be able to find an open source CMS using the same stack you're using - they usually have a way to slap forms togehter.

Cool, I'll look into it. Thanks!

Warbird
May 23, 2012

America's Favorite Dumbass

I've hosed up more than usual. Which is both impressive and terrifying.

I tried to get SFTP set up on my box to see if I could nail down getting VSCode's remote editing plugins to work (WinSCP works great, just checking to see if I could make it work). It didn't really occur to me that I was already using SFTP with WinSCP at the time and I assumed that FTP just wasn't on the box; because, you see, I'm stupid as hell. So I followed a guide that assumed it wasn't already on the box and now I can't get in the damned thing at all. Putty's being flat out refused and WinSCP refuses connection on port 22 and can't find anything if I try regular FTP on 21.

I still have shell access via DigitalOcean's access console, but that's anything but ideal. Any suggestions as to how to ungoober this thing?

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

In the past I've had similar snafus because two (or more!) services are trying to grab the port, which applies to both FTP and SFTP. I assume if Putty can't get in you can't ssh or otherwise stop/start one of the suspect services?

Warbird
May 23, 2012

America's Favorite Dumbass

I'll give it a shot. I had noticed that I wasn't able to start FTP as a local user on the box last night and didn't see anything using 21 or 22.

Boosh!
Apr 12, 2002
Oven Wrangler
Outlook 2013 :allears:

What are you guys doing for Office 2013 stripping margins from paragraph tags? Our email templates are fed through a CMS so I'd be hands off. Any suggestions other than having the editors create 2 single-line breaks?

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Can anyone figure out what causes the restaurant thumbnails to load on this page when you scroll?

I'm not interested in lazy-loading in general, I'm just trying to figure out what this hunk of garbage page in particular is doing.

edit: nevermind, I finally figured it out. Traced javascript forever, then posted here about it, then figured it out a few minutes later... The answer is a stupid jquery thing involving scrollTop.

Thermopyle fucked around with this message at 02:16 on Jan 18, 2017

Warbird
May 23, 2012

America's Favorite Dumbass

Warbird posted:

I've hosed up more than usual. Which is both impressive and terrifying.

I tried to get SFTP set up on my box to see if I could nail down getting VSCode's remote editing plugins to work (WinSCP works great, just checking to see if I could make it work). It didn't really occur to me that I was already using SFTP with WinSCP at the time and I assumed that FTP just wasn't on the box; because, you see, I'm stupid as hell. So I followed a guide that assumed it wasn't already on the box and now I can't get in the damned thing at all. Putty's being flat out refused and WinSCP refuses connection on port 22 and can't find anything if I try regular FTP on 21.

I still have shell access via DigitalOcean's access console, but that's anything but ideal. Any suggestions as to how to ungoober this thing?

Update: The guide thankfully included a step where you backed up your sshd_config file. Always back up your config files.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Warbird posted:

Update: The guide thankfully included a step where you backed up your sshd_config file. Always back up your config files.

Wise, wise words.

Warbird
May 23, 2012

America's Favorite Dumbass

In an ongoing run of unusual good luck I was able to get the sftp editing plugins for VSCode working as well. No idea why or how they work now, but, hey, progress.

New question, is anyone here familiar with glances? A coworker introduced it to me and I've been running it on my webserver if for not other reason than it looks neat. Their website mentions it running on Windows systems and includes some installation instructions, but I've been utterly unable to get the thing to cooperate so far. If anyone has some insight I'd love to hear it.

Bonus question:
How would one have a virtual host handle access requests such as "site.com" as opposed to "www.site.com"? I've got it handling http and https access requests, but I'm not sure how to approach this. Would adding a serveralias on the port 80 config suffice?

I'm currently using
code:
<VirtualHost *:80>
    ServerName [url]www.site.com[/url]
    Redirect / [url]https://www.site.com/[/url]
</VirtualHost>


to some level of success.

Warbird fucked around with this message at 17:12 on Jan 18, 2017

ToxicSlurpee
Nov 5, 2003

-=SEND HELP=-


Pillbug

Warbird posted:

Always back up your config files pretty much everything .

Fixed.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell


Having a backup agent that backs up everything continuously to the cloud (for example, Crashplan) is like the best thing to happen to computing in the past decade. Maybe second to SSD's.

Warbird
May 23, 2012

America's Favorite Dumbass

I was under Comcast's tyranny until about this time last year (whoo municipal ISPs!), so I never really considered the service. I wasn't aware they had a free tier either; I'll for sure use it on my desktop. Can you vouch for the paid version? I don't need unlimited cloud storage right now(dropbox, Amazon Prime Cloud, Drive, ect), but it's reasonably priced.

Edit - I can't read. I'll likely go for the $60 for as long as I don't have data caps.

Can you recommend anything that would be decent for the >20Gig webserver?

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Warbird posted:

I was under Comcast's tyranny until about this time last year (whoo municipal ISPs!), so I never really considered the service. I wasn't aware they had a free tier either; I'll for sure use it on my desktop. Can you vouch for the paid version? I don't need unlimited cloud storage right now(dropbox, Amazon Prime Cloud, Drive, ect), but it's reasonably priced.

Edit - I can't read. I'll likely go for the $60 for as long as I don't have data caps.

Can you recommend anything that would be decent for the >20Gig webserver?

Crashplan is pretty much the exclusive recommendation in the NAS thread in SHSC. It's pretty good! The client can be kind of a hog and if you have too many files you have to adjust its memory usage via some shenanigans, but it works for its purpose.

I haven't really thought about backing up a webserver. If it's a PRO-GRADE BIG METAL SERVER, there's probably purpose-built solutions that I'm not aware of. Crashplan does run on linux with some shenanigans and works fine. I'd probably consider it for a personal or small business server. 20GB is nothing for crashplan. There many people in the NAS thread who have many terabytes backed up there.

Adbot
ADBOT LOVES YOU

Warbird
May 23, 2012

America's Favorite Dumbass

I've got it installed, but haven't had a chance to poke at it yet. If nothing else I can do a backup to my desktop in case of future ssh fuckery.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply