Skip to content
This repository has been archived by the owner on Nov 6, 2023. It is now read-only.

Create showapi.com.xml #7957

Merged
merged 4 commits into from
Jun 17, 2017
Merged

Conversation

gloomy-ghost
Copy link
Collaborator

No description provided.

@jeremyn
Copy link
Contributor

jeremyn commented Feb 10, 2017

Here's what I would do:

<!--
	200 with plain HTTP, 404 with HTTPS:
	- docs.showapi.com
	  example: http://docs.showapi.com/jdk7/index.html

	503 with plain HTTP, refused with HTTPS:
	- wap.showapi.com

	No working URL known:
	- static.showapi.com

-->
<ruleset name="ShowAPI.com">
	<target host="showapi.com" />
	<target host="www.showapi.com" />
	<target host="bbs.showapi.com" />
	<target host="route.showapi.com" />

	<rule from="^http://bbs\.showapi\.com/(archiver|data|source|static)/" to="https://bbs.showapi.com/$1/" />
		<test url="http://bbs.showapi.com/archiver/" />
		<test url="http://bbs.showapi.com/data/" />
		<test url="http://bbs.showapi.com/source/" />
		<test url="http://bbs.showapi.com/static/" />
		<!-- This exception disables the implicit test created by the target. -->
		<exclusion pattern="^http://bbs\.showapi\.com/$" />
	<rule from="^http://(www\.|route\.)?showapi.com/" to="https://$1showapi.com/" />
</ruleset>

Also the filename would be ShowAPI.com.xml.

Do you want to add dn-showapi.qbox.me to Qbox.me.xml?

@jeremyn jeremyn self-assigned this Feb 10, 2017
@gloomy-ghost
Copy link
Collaborator Author

I was using exceptions to keep the plain rewriting rule, otherwise the rules are basically just repeating subdomains that are already included in targets. Maybe complicated rules that don't do anything else than http>https redirecting would be a good method if there were only wildcard targets.

@Hainish Would it be possible to add something likes a no_plain_rewriting attribute in targets so that a target which is only partially redirected by rule won't be redirected by http:>https: rule in the end of the ruleset?

@jeremyn jeremyn mentioned this pull request Feb 10, 2017
@jeremyn
Copy link
Contributor

jeremyn commented Feb 10, 2017

The ruleset I wrote in #7957 (comment) is simple: for these domains, do these rewrites. This is a lot easier to understand in my opinion than saying rewrite everything except these other certain things.

I'm opposed to something like no_plain_rewriting because that means that to figure out what the rewrite logic is, I can't just look at the rule, I have to also possibly look at attributes of the targets.

@Hainish
Copy link
Member

Hainish commented Feb 10, 2017

I agree with @jeremyn on this - adding an attribute which changes how rewrites are performed also complicates things for our downstream dependencies, like Brave browser or libhttpseverywhere.

@jeremyn
Copy link
Contributor

jeremyn commented Mar 8, 2017

@gloomy-ghost Can we finish this?

@gloomy-ghost
Copy link
Collaborator Author

Is there a url for actual resource under http://bbs.showapi.com/source/? I can't find any.

BTW, I still think that listing all subdomains in a plain rewriting rule is repeating the targets' jobs. If everything is in rules, I can replace all targets with a wildcard and it won't change anything. Then why there are target tags?

@jeremyn
Copy link
Contributor

jeremyn commented Mar 9, 2017

I can't find anything under http://bbs.showapi.com/source/ either, but it returns a 200 even though it's empty so that's good enough for me.

I don't know how to answer the question in your second paragraph. Maybe a better system would merge the concept of target and rule.

@jeremyn
Copy link
Contributor

jeremyn commented Apr 25, 2017

  • https://docs.showapi.com is Different HTTP/HTTPS content, not 404
  • The general case *.showapi.com works for me (they all redirect to www), so you can remove it from the top comment
  • Also u5335.showapi.com redirects to https://www.showapi.com like the general * case, so you can delete that from the top comment too
  • The u(\d+)\.showapi\.com rule here doesn't have a target, so please either delete the rule or add a target
  • I would move the rule for ^ here into the larger rule here, using (www\.|admin\.|api\.| ...)? but if you prefer the style you have now, that's fine with me.

@jeremyn
Copy link
Contributor

jeremyn commented May 8, 2017

I made the changes I described in #7957 (comment).

@J0WI Can you review this please?

@jeremyn jeremyn removed their assignment May 8, 2017
@J0WI J0WI closed this Jun 17, 2017
@J0WI J0WI reopened this Jun 17, 2017
@J0WI J0WI closed this Jun 17, 2017
@J0WI J0WI reopened this Jun 17, 2017
@jeremyn jeremyn assigned jeremyn and unassigned jeremyn Jun 17, 2017
@J0WI J0WI merged commit edef891 into EFForg:master Jun 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants