Server cannot download from repository

For all the help you need with Armagetron!
Post Reply
User avatar
sinewav
Graphic Artist
Posts: 6413
Joined: Wed Jan 23, 2008 3:37 am
Contact:

Server cannot download from repository

Post by sinewav »

Arma dedicated 0.4 no longer downloads maps from my repository adventuresoftron.com/aa/resource. I suspect it may be because I recently forced https on my repository. Can anyone confirm this is the problem and is there a solution?

Code: Select all

[1] New user: 1
[0] sine.wav entered the game.
[0] Ping charity changed from 500 to 398.
[0] Resource turtle/adventure/chasm_f-0.0.5.aamap.xml not found in cache. Downloading it, please be patient...
[0] Downloading http://adventuresoftron.com/aa/resource/turtle/adventure/chasm_f-0.0.5.aamap.xml ...
error : Unknown IO error
[0] ERROR: ctxt is NULL
[0] Downloading http://resource.armagetronad.net/resource/turtle/adventure/chasm_f-0.0.5.aamap.xml ...
error : Unknown IO error
[0] ERROR: ctxt is NULL
[0] Resource turtle/adventure/chasm_f-0.0.5.aamap.xml not found in cache. Downloading it, please be patient...
[0] Downloading http://adventuresoftron.com/aa/resource/turtle/adventure/chasm_f-0.0.5.aamap.xml ...
error : Unknown IO error
[0] ERROR: ctxt is NULL
[0] Downloading http://resource.armagetronad.net/resource/turtle/adventure/chasm_f-0.0.5.aamap.xml ...
error : Unknown IO error
[0] ERROR: ctxt is NULL
[0] Loading XML file 'turtle/adventure/chasm_f-0.0.5.aamap.xml' failed!
[0] Map load failure:
[0] The map turtle/adventure/chasm_f-0.0.5.aamap.xml could not be loaded or parsed; please check your configuration and the log.
[0] 
[0] Reverting to last known working map Anonymous/polygon/regular/square-1.0.1.aamap.xml.
Thanks to nelg for bringing this to my attention.
User avatar
aP|Nelg
Match Winner
Posts: 621
Joined: Wed Oct 22, 2014 10:22 pm
Contact:

Re: Server cannot download from repository

Post by aP|Nelg »

You didn't really say anything, probably because I had to leave, but https isnt supported by armagetronad. That's why I don't force https for http://www.armanelgtron.tk/armagetronad/resource/, but force it for the rest of the site. (Well, I force it for the repository directory views but not for the individual map, but you get the idea)
User avatar
Light
Reverse Outside Corner Grinder
Posts: 1667
Joined: Thu Oct 20, 2011 2:11 pm

Re: Server cannot download from repository

Post by Light »

Not quite the same, but I can confirm that without a certificate, getting files from the repo fails. It was done on mine on accident back when I switched my site to use SSL. I'm pretty sure that authentication failed with SSL as well.
User avatar
sinewav
Graphic Artist
Posts: 6413
Joined: Wed Jan 23, 2008 3:37 am
Contact:

Re: Server cannot download from repository

Post by sinewav »

Ok cool. So, anyone got a quick solution? The repository server is running Apache on Ubuntu 16 and I used Let's Encrypt (/usr/bin/letsencrypt from the Ubuntu repo) for https. Do I need to set some sort of exception in Apache?
User avatar
Light
Reverse Outside Corner Grinder
Posts: 1667
Joined: Thu Oct 20, 2011 2:11 pm

Re: Server cannot download from repository

Post by Light »

sinewav wrote:Ok cool. So, anyone got a quick solution? The repository server is running Apache on Ubuntu 16 and I used Let's Encrypt (/usr/bin/letsencrypt from the Ubuntu repo) for https. Do I need to set some sort of exception in Apache?
If it's set up for a specific virtualhost, maybe just create a "resource.yoursite.ext" then use "http://resource.yoursite.ext/resource/" for the resource setting.
User avatar
sinewav
Graphic Artist
Posts: 6413
Joined: Wed Jan 23, 2008 3:37 am
Contact:

Re: Server cannot download from repository

Post by sinewav »

I've never had good luck with Apache. Too many similarly named directives and the documentation is no help. Anyone got a working config I can see?
User avatar
Light
Reverse Outside Corner Grinder
Posts: 1667
Joined: Thu Oct 20, 2011 2:11 pm

Re: Server cannot download from repository

Post by Light »

sinewav wrote:I've never had good luck with Apache. Too many similarly named directives and the documentation is no help. Anyone got a working config I can see?
What config do you need exactly? The default Apache config with minor tweaks in the virtual host file seems like it would give you what you want.
User avatar
sinewav
Graphic Artist
Posts: 6413
Joined: Wed Jan 23, 2008 3:37 am
Contact:

Re: Server cannot download from repository

Post by sinewav »

Light wrote:The default Apache config with minor tweaks in the virtual host file seems like it would give you what you want.
Yeah, that's what I was hoping, but nothing has worked so far. These is my virtual host config for AoT:

Server version: Apache/2.4.18 (Ubuntu)

Code: Select all

<VirtualHost *:80>
	ServerName adventuresoftron.com
	ServerAlias www.adventuresoftron.com
	Redirect / https://adventuresoftron.com
	RewriteEngine on
	RewriteCond %{SERVER_NAME} =adventuresoftron.com [OR]
	RewriteCond %{SERVER_NAME} =www.adventuresoftron.com
	RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
</VirtualHost>

<IfModule mod_ssl.c>
<VirtualHost *:443>
	ServerName adventuresoftron.com
	ServerAlias www.adventuresoftron.com
	DocumentRoot /var/www/html/aot
	SSLCertificateFile /etc/letsencrypt/live/adventuresoftron.com/fullchain.pem
	SSLCertificateKeyFile /etc/letsencrypt/live/adventuresoftron.com/privkey.pem
	Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>
Am I correct in thinking that a RewriteCond and RewriteRule should go somewhere in the SSL section, turning HTTPS "off" for requests to http://adventuresoftron/aa/resource ? Note: options-ssl-apache.conf only has basic stuff in it like SSLEngine "on" and Log formatting, etc...

Also, thanks Kyle for doing your best to help me.
User avatar
Light
Reverse Outside Corner Grinder
Posts: 1667
Joined: Thu Oct 20, 2011 2:11 pm

Re: Server cannot download from repository

Post by Light »

I would just make the resource an exception to redirecting to https. Something like "RewriteCond %{REQUEST_URI} !^/aa/resource" should work. I guess you could kick them back to http if someone manages to attempt going in with https, but if you don't direct them to it, people probably will never get there using https. If you feel the need, you could use the same rewrite condition (without the not "!") and push them back to http.
User avatar
sinewav
Graphic Artist
Posts: 6413
Joined: Wed Jan 23, 2008 3:37 am
Contact:

Re: Server cannot download from repository

Post by sinewav »

Light wrote:Something like "RewriteCond %{REQUEST_URI} !^/aa/resource" should work.
I've tried this, but it didn't work. Perhaps I placed it on the wrong line? Where would you suggest putting it? That single line should solve the problem?
User avatar
Light
Reverse Outside Corner Grinder
Posts: 1667
Joined: Thu Oct 20, 2011 2:11 pm

Re: Server cannot download from repository

Post by Light »

sinewav wrote:
Light wrote:Something like "RewriteCond %{REQUEST_URI} !^/aa/resource" should work.
I've tried this, but it didn't work. Perhaps I placed it on the wrong line? Where would you suggest putting it? That single line should solve the problem?
Well, it should stop the server from redirecting you, but then you probably ran into caching issues that can cause a world of annoyances.

Code: Select all

RewriteCond %{REQUEST_URI} !^/aa/resource [NC]
RewriteCond %{SERVER_NAME} ^(www\.)?adventuresoftron\.com [NC]
I didn't test it, so you should probably double check me, but that should replace your two lines for the condition on port 80.
User avatar
sinewav
Graphic Artist
Posts: 6413
Joined: Wed Jan 23, 2008 3:37 am
Contact:

Re: Server cannot download from repository

Post by sinewav »

Bummer. Didn't work. Oh well, thanks for trying! I started a help thread over at Let's Encrypt, maybe someone there knows how to fix it. I feel like this should be easier and more common than it is.
User avatar
kyle
Reverse Outside Corner Grinder
Posts: 1876
Joined: Thu Jun 08, 2006 3:33 pm
Location: Indiana, USA, Earth, Milky Way Galaxy, Universe, Multiverse
Contact:

Re: Server cannot download from repository

Post by kyle »

I think the browsers now may do some cacheing on the "[END,QSA,R=permanent]"

Have you tried adding that condition and trying from tron or another browser / incognito mode?
Image
User avatar
Light
Reverse Outside Corner Grinder
Posts: 1667
Joined: Thu Oct 20, 2011 2:11 pm

Re: Server cannot download from repository

Post by Light »

kyle wrote:I think the browsers now may do some cacheing on the "[END,QSA,R=permanent]"

Have you tried adding that condition and trying from tron or another browser / incognito mode?
Yeah, it's annoying as hell when they cache. I tend to use proxies to test it out when I mess things up. lol A good lesson is to make it a temporary redirect until things are ready to be moved for good, that way your browser continues to make sure you should still be being redirected.
User avatar
sinewav
Graphic Artist
Posts: 6413
Joined: Wed Jan 23, 2008 3:37 am
Contact:

Re: Server cannot download from repository

Post by sinewav »

After many frustrating replies on the Let's Encrypt site I was given a solution to this problem. My *:80 should look like this:

Code: Select all

<VirtualHost *:80>
  ServerName adventuresoftron.com
  ServerAlias www.adventuresoftron.com
  DocumentRoot /var/www/html/aot
  RedirectMatch 301 ^/((?!aa/resource).*)$ https://adventuresoftron.com/$1
</VirtualHost>
Explanation: My previous config was using both mod_rewrite (Rewrite) and mod_alias (Redirect), only one is needed. I also needed to declare DocumentRoot in this case. Apache is confusing! There are several ways to do the same thing! (I still don't understand the regex for RedirectMatch, but I'll worry about that later...)
Post Reply