New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testers Needed - YOURLS-PV Patch #2320

Closed
PopVeKind opened this Issue Nov 18, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@PopVeKind
Contributor

PopVeKind commented Nov 18, 2017

Testers Needed!

We need testers for the small YOURLS-PV Patch.

Announcement

The Small YOURLS-PV Patch has been Merged with the latest YOURLS Code, including the Config Class (Config.php)

Possible Benefits

This small patch may benefit the YOURLS community in the following ways:

  1. Fixes the trailing edge slash configuration error.
  2. Allows YOURLS to work in MultiSite Mode.
  3. Gives YOURLS its own directory.
  4. Allows the admin directory to be easily renamed.
  5. YOURLS_SITE is automatically calculated in most cased.

YOURLS-PV Patch

GitHub - this is Branch PV
YOURLS-PV Patch Website

Patch Compatibility Issues

100% Compatible with all YOURLS Installs tested to date.
No Compatibility Issue reported with any standard YOURLS installed to date.
Please Test This Small Patch and report all results! (Good or Bad.)
The limited amount of plugins tested to date have been 100% Compatible!

Proof Of Concept Demo

The following links go to a Single Installation of YOURLS with the YOURLS-PV Patch. It is loaded into the /s/ directory and configured for MultiSite Mode. The admin directory was easily changed (renamed) to the hide directory.

Note: The default of any domain is any unused YOURLS keyword (examples /none, /fail, /empty, or /default). The autoloaded keywords are also active (/yourls and /ozh).

http://a.fil.net/s/54 => http://vekind.org/
http://a.fil.net/s/none => http://a.fil.net/s/ (the default page index.php)
http://a.fil.net/s/hide/index.php - The YOURLS admin page.
http://a.fil.net/s/ozh => http://ozh.org/
http://a.fil.net/s/yourls => http://yourls.org/
http://b.ph2.biz/54 => http://tukod.com/yourls-multisite/
http://b.ph2.biz/s/hide/index.php - YOURLS admin page.
http://b.ph2.biz/ozh => http://ozh.org/
http://b.ph2.biz/fail => http://b.ph2.biz/
http://c.c143.net/54 => http://tait.asia/2017/02/09/resources/
http://c.c143.net/yourls => http://yourls.org/
http://x.fil.net/54 => http://fyuel.org/
http://y.ph2.biz/s/54 => http://abolitionistapproach.info/
http://z.z143.net/54 => http://plant-only.org/plant-only-basics/
http://z.z143.net/A-A => http://abolitionistapproach.info/our-declaration-of-independence/
http://z.z143.net/a-a => http://abolitionistapproach.info/star-wars-rights-sentience/

Note: z.z143.net has the following activated:

  • Allow hyphens in short URLs
  • define( ‘YOURLS_URL_CONVERT’, 62 );

Program Changes Made

(Commented "YOURLS-PV")
admin/tools.php (4 changes)
includes/YOURLS/Config/Config.php (8 changes)
includes/functions.php (3 changes)
includes/load-yourls.php (1 change)
yourls-infos.php (1 change)

Total Program Changes Made (17 changes)

Sample/Example Pages Changed

(Commented "YOURLS-PV")
pages/examplepage.php (1)
sample-public-front-page.txt (1)

Sample Page Added

user/sample-multisite-config.php (Added)

Read More...

@ozh

This comment has been minimized.

Show comment
Hide comment
@ozh

ozh Nov 19, 2017

Member

@PopVeKind respectful side note: I really think you should try to make things more readable, waaaaaaay shorter, and easier to understand.

First, this issue doesn't even explain what this is about to people who have no idea what your "PV" stuff is for.

Second, this is full of info with various degrees of interest (example: it's interesting to know what this is about (the "benefits" section) but there is absolutely no point in listing files that have been edited for instance. That's what Git is for.

If you want to catch interest among users, sell your stuff straight to the point: why would they be interested? what is the problem addressed here?

My 2 cents 💵

Member

ozh commented Nov 19, 2017

@PopVeKind respectful side note: I really think you should try to make things more readable, waaaaaaay shorter, and easier to understand.

First, this issue doesn't even explain what this is about to people who have no idea what your "PV" stuff is for.

Second, this is full of info with various degrees of interest (example: it's interesting to know what this is about (the "benefits" section) but there is absolutely no point in listing files that have been edited for instance. That's what Git is for.

If you want to catch interest among users, sell your stuff straight to the point: why would they be interested? what is the problem addressed here?

My 2 cents 💵

@PopVeKind

This comment has been minimized.

Show comment
Hide comment
@PopVeKind

PopVeKind Nov 24, 2017

Contributor

@ozh - Thank You Ozh for your advice!

Be sure to read below... The New Roadmap!

As I previously stated I have decades of programming experience, however, I am a complete "noob" when it comes to Git and GitHub. As a Linux user, it seems there is not much in the way of free GUIs for GitHub either. This leaves me with a rather steep learning curve on the command line interface. Likewise, most of my work has been in rather closed shops (top secret and above) where all the developers were physically in one building or complex. It seems this has left me with a huge handicap in this GitHub environment. I really apologize for this and I thank you for taking the time to give me your helpful advice.

Using your thoughtful suggestions, I tried rewriting the issue, which after a number of days work, I found extremely difficult to do. The patch, code-named "YOURLS-PV", works great! But is not a single patch or feature. That was my first error.

I started out with the purpose of making an easy to use YOURLS Multisite as stated in the Roadmap.
Multisite feature (one install to manage several domains)
It quickly became obvious that for Multisite to work, it is imperative to split the YOURLS_SITE constant into a constant for each of its dual purposes. Consider this paragraph from my attempt to rewrite the issue...

  1. Splitting YOURLS_SITE into two constants YOURLS_SITE (for making shortened URLs) and YOURLS_ABSURL (for defining the Absolute URL where the program files are loaded). Since 2012 this has been frequently requested in issues and PRs (E.g. Giving YOURLS its own directory). We believe this is absolutely necessary for Multisite Operation. (Consider the file location [directory] for a Multisite install containing these two sites [YOURLS_SITE], http://cu.te and http://ti.ny/s It cannot be both the root directory and the /s/ subdirectory!). The rejection of these PRs has always been that it adds complexity to the config file on basic installs. On the other hand, instead of adding a config option, this patch removes the requirement for YOURLS_SITE - for a basic install. This makes it easier, less complicated for a newbie to install a basic YOURLS site. The program calculates YOURLS_SITE and YOURLS_ABSURL automatically for basic sites. However, they remain available for advanced admins to define.

And...

  1. Not a feature per se. This patch is not a Feature, like "MultiSite Mode" or "Renaming the admin directory". Neither is it a fix for "the noob trailing edge error" or " simplifying noob basic install" (by automatically calculating the YOURLS_SITE). Likewise, it is not a plugin for "WordPress and YOURLS Together" (peacefully sharing the document root directory). Nor is it a Plugin for "Using YOURLS in HTTPS behind load-balancers and reverse proxies." Nor is it a Plugin for "Giving YOURLS its own directory" The patch turns on nothing new by itself. If this was dropped into a working site, with no configuration changes to either YOURLS or the server, there would be no change noticed at all! This patch simply makes the necessary tiny changes required to allow all these things to happen.

That's when it hit me, the YOURLS-PV patch actually does all that and more! Likewise, I realized the YOURLS-PV patch would never be approved! Even though it works perfectly! So, I need to focus on the component parts of the patch as follows.

The New Roadmap!

Necessary Patch:
From the YOURLS Core Roadmap

  1. Add Multisite Operation - Split YOURLS_SITE.
  2. Newbie Support - Make the basic install easier, less complex, by removing the requirement for YOURLS_SITE to be defined in the config file for basic installs.

Improvement Patches:
These are patches for things Ozh has expressly stated in issues should be added or fixed in YOURLS.core files.

  1. Simplify Basic Installation - In addition to number two above, the .htaccess files for the root domain and sub-domain installs may be reduced to a single file (copy/paste or installer built) for all site types, including multisite (less confusion).
  2. Rename the admin directory - Allow the admin directory to be easily renamed in 2 easy steps any noob can do.
  3. Fix the noob trailing edge error - YOURLS_SITE may still be defined for some advanced configurations or in misconfigured legacy sites.

Aditional Plugins
The original patch contained additional proven features. These features may be ported to additional Plugins with ease after YOURLS_SITE is split in the core (see number one above). The additional functionality (Plugins) include the following.

  1. WordPress and YOURLS Together Plugin - The original patch proved YOURLS and WordPress can easily share the domain document root, without any complex setup, nor any special restrictions for either program. I have a production site with YOURLS Multisite running side by side with a WordPress Multisite.
  2. HTTPS Behind Load-Balancers and Reverse Proxies Plugin - WordPress suffers from the same problem and failure, which was copied into YOURLS. The solution is the same, a plugin!
  3. Give YOURLS Its Own Directory Plugin - Does exactly what it says!

Removed Coding
The original patch had coded things that should be revisited, but have been removed from this Roadmap.

  1. Migrate all HTTP to Valid HTTP5.
  2. Migrate all CSS to Valid CSS3.
  3. Make Readme dynamic. - This helps noobs by using their exact information and building valid links to their appropriate admin pages.
  4. The Admin Issues Tab - This Admin Tab helps noobs with information that should be added to issues when reporting problems or asking for help. While writing an issue, an easy copy/paste from this page would provide the OS and version, YOURLS version, PHP version, DB name and version, and any installed plugin names and versions.

The above patches and plugins depend on YOURLS_ABSURL being defined by the Split YOURLS_SITE patch. At the risk of repeating myself, I do not believe Multisite, nor anything else listed here can be effectively implemented without first implementing a Split YOURLS_SITE patch.

For the time being, I will cut down the patch to focus on creating an acceptable patch for only numbers one and two above (multisite and newbie support). After that, when YOURLS_ABSURL is available, I will gladly work on reintroducing each of the enhanced features and plugins listed above, if approved by ozh.

Thank You Ozh! This is a great program.

Contributor

PopVeKind commented Nov 24, 2017

@ozh - Thank You Ozh for your advice!

Be sure to read below... The New Roadmap!

As I previously stated I have decades of programming experience, however, I am a complete "noob" when it comes to Git and GitHub. As a Linux user, it seems there is not much in the way of free GUIs for GitHub either. This leaves me with a rather steep learning curve on the command line interface. Likewise, most of my work has been in rather closed shops (top secret and above) where all the developers were physically in one building or complex. It seems this has left me with a huge handicap in this GitHub environment. I really apologize for this and I thank you for taking the time to give me your helpful advice.

Using your thoughtful suggestions, I tried rewriting the issue, which after a number of days work, I found extremely difficult to do. The patch, code-named "YOURLS-PV", works great! But is not a single patch or feature. That was my first error.

I started out with the purpose of making an easy to use YOURLS Multisite as stated in the Roadmap.
Multisite feature (one install to manage several domains)
It quickly became obvious that for Multisite to work, it is imperative to split the YOURLS_SITE constant into a constant for each of its dual purposes. Consider this paragraph from my attempt to rewrite the issue...

  1. Splitting YOURLS_SITE into two constants YOURLS_SITE (for making shortened URLs) and YOURLS_ABSURL (for defining the Absolute URL where the program files are loaded). Since 2012 this has been frequently requested in issues and PRs (E.g. Giving YOURLS its own directory). We believe this is absolutely necessary for Multisite Operation. (Consider the file location [directory] for a Multisite install containing these two sites [YOURLS_SITE], http://cu.te and http://ti.ny/s It cannot be both the root directory and the /s/ subdirectory!). The rejection of these PRs has always been that it adds complexity to the config file on basic installs. On the other hand, instead of adding a config option, this patch removes the requirement for YOURLS_SITE - for a basic install. This makes it easier, less complicated for a newbie to install a basic YOURLS site. The program calculates YOURLS_SITE and YOURLS_ABSURL automatically for basic sites. However, they remain available for advanced admins to define.

And...

  1. Not a feature per se. This patch is not a Feature, like "MultiSite Mode" or "Renaming the admin directory". Neither is it a fix for "the noob trailing edge error" or " simplifying noob basic install" (by automatically calculating the YOURLS_SITE). Likewise, it is not a plugin for "WordPress and YOURLS Together" (peacefully sharing the document root directory). Nor is it a Plugin for "Using YOURLS in HTTPS behind load-balancers and reverse proxies." Nor is it a Plugin for "Giving YOURLS its own directory" The patch turns on nothing new by itself. If this was dropped into a working site, with no configuration changes to either YOURLS or the server, there would be no change noticed at all! This patch simply makes the necessary tiny changes required to allow all these things to happen.

That's when it hit me, the YOURLS-PV patch actually does all that and more! Likewise, I realized the YOURLS-PV patch would never be approved! Even though it works perfectly! So, I need to focus on the component parts of the patch as follows.

The New Roadmap!

Necessary Patch:
From the YOURLS Core Roadmap

  1. Add Multisite Operation - Split YOURLS_SITE.
  2. Newbie Support - Make the basic install easier, less complex, by removing the requirement for YOURLS_SITE to be defined in the config file for basic installs.

Improvement Patches:
These are patches for things Ozh has expressly stated in issues should be added or fixed in YOURLS.core files.

  1. Simplify Basic Installation - In addition to number two above, the .htaccess files for the root domain and sub-domain installs may be reduced to a single file (copy/paste or installer built) for all site types, including multisite (less confusion).
  2. Rename the admin directory - Allow the admin directory to be easily renamed in 2 easy steps any noob can do.
  3. Fix the noob trailing edge error - YOURLS_SITE may still be defined for some advanced configurations or in misconfigured legacy sites.

Aditional Plugins
The original patch contained additional proven features. These features may be ported to additional Plugins with ease after YOURLS_SITE is split in the core (see number one above). The additional functionality (Plugins) include the following.

  1. WordPress and YOURLS Together Plugin - The original patch proved YOURLS and WordPress can easily share the domain document root, without any complex setup, nor any special restrictions for either program. I have a production site with YOURLS Multisite running side by side with a WordPress Multisite.
  2. HTTPS Behind Load-Balancers and Reverse Proxies Plugin - WordPress suffers from the same problem and failure, which was copied into YOURLS. The solution is the same, a plugin!
  3. Give YOURLS Its Own Directory Plugin - Does exactly what it says!

Removed Coding
The original patch had coded things that should be revisited, but have been removed from this Roadmap.

  1. Migrate all HTTP to Valid HTTP5.
  2. Migrate all CSS to Valid CSS3.
  3. Make Readme dynamic. - This helps noobs by using their exact information and building valid links to their appropriate admin pages.
  4. The Admin Issues Tab - This Admin Tab helps noobs with information that should be added to issues when reporting problems or asking for help. While writing an issue, an easy copy/paste from this page would provide the OS and version, YOURLS version, PHP version, DB name and version, and any installed plugin names and versions.

The above patches and plugins depend on YOURLS_ABSURL being defined by the Split YOURLS_SITE patch. At the risk of repeating myself, I do not believe Multisite, nor anything else listed here can be effectively implemented without first implementing a Split YOURLS_SITE patch.

For the time being, I will cut down the patch to focus on creating an acceptable patch for only numbers one and two above (multisite and newbie support). After that, when YOURLS_ABSURL is available, I will gladly work on reintroducing each of the enhanced features and plugins listed above, if approved by ozh.

Thank You Ozh! This is a great program.

@PopVeKind

This comment has been minimized.

Show comment
Hide comment
@PopVeKind

PopVeKind Dec 8, 2017

Contributor

I am closing this in order to work on the required code needed to put this all in a plugin.

POP

Contributor

PopVeKind commented Dec 8, 2017

I am closing this in order to work on the required code needed to put this all in a plugin.

POP

@PopVeKind PopVeKind closed this Dec 8, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment