Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
YOURLS MultiSite #2306
Hi, I'm a retired computer programmer (new to GitHub, maybe too old to be writing programs, a couple dozen grandkids, one of whom is an airplane pilot!).
A couple months ago I started a project and wanted to use YOURLS in a MultiSite mode (like WordPress). But YOURLS doesn't do MultiSite, Yet! So I hacked the code and built my own. My YOURLS MultiSite Roadmap is at ** YOURLS MultiSite **
On that page, you can see a Proof-Of-Concept - some URLs that forward through this YOURLS MultiSite. I am now building this into a production site.
On that page, I have addressed these topics...
YOURLS MultiSite Roadmap
YOURLS MultiSite is a Drop-In Replacement for YOURLS.
These are all working now, either on my development server, or live in the Proof-Of-Concept.
YOURLS MultiSite uses about 99% of the original YOURLS code so I think it should be compatible with things like plugins.
I'm sorry if I am a little bit slow, or old, (50+ years of writing computer programs!), or don't pick up things as quickly as I did before. But if anyone would like to see/use/modify this code, or merge it into the YOURLS project (it should be a drop in fit.)
Caution: I have not done the last few YOURLS modifications for the last couple months. But I plan to!
The Proof-Of-Concept is running on shared hosting (Ubuntu) at Pair Network. You can check their site for the environment.
It looks like an interesting project. Ideally though, you would package everything as a plugin instead of a standalone replacement that uses "99% of the original code", this would allow for future compatibility and ease of use
Also, did you check this plugin https://github.com/adigitalife/yourls-allow-aliases, it may be inspirational
Greetings from the Philippines!
I started out to build a multisite plugin. Although most of the code stays the same, the strategic changes would mean copying most of the core functions into the plugin. Just like when WP added MultiSite. The only truly viable way was to actually replace part of the WP core. Originally WPMU was a drop in replacement for a large part of the WP core. Time proved the wisdom in this as WPMU was then merged into the WP core as MultiSite with only simple configuration from one to the other.
The same applies here, YOURLS MultiSite changes minor, but critical and strategic things, throughout the program. By design, it will work as a single site with NO configuration changes. Easy configuration changes would let the site admin add the features available for MultiSite.
Yes! I had looked at the Allow aliases for YOURLS plugin, even before I got started, as well as many other plugins.
"Aliases" simply allows you to address the same YOURLS keywords to different domains. Effectively making two URLs with different domain names that go to the same place. They both use the same MySQL Table, Making one domain's keywords to be aliases of another YOURLS domain.
Personally, I wouldn't do such a thing. Not that the sky would fall or anything like that. I am assuming each would do a 301. I just personally don't like the idea of doing the same thing with different domains, it seems wasteful. Just a preference, not saying it is wrong.
YOURLS MultiSite is not that way at all. It largely follows the WordPress MultiSite ideas (ok, I confess, I stole a lot of the idea from WP). Each Domain name is a complete YOURLS site. Like WP they use different sets of tables for completely separate sites. If you notice on ** YOURLS MultiSite ** there are six domain names configured in the Proof-Of-Concept demo. Look closely and you will see that the six examples all use the keyword "54". The same keyword in different domains, going to 6 different URLs. This produces the exact same result as loading six copies of YOURLS! Each can be totally configured separately, yet reside in one physical location on the server.
YOURLS and WordPress together!
Down the page a bit you will find a section called:
Because I moved the YOURLS files to its own directory and split the site URLs from the location URLs, The location URL become self-aware for document root sites. I was able to determine the different requirements of each program and merge them to work together.
This server is actually running about 50 small WordPress sites that are spread across a half-dozen WordPress MultiSite installs. AND ONE YOURLS MultiSite running three sites now and will increase to six. You and I both know that 6 YOURLS cannot be loaded as is into one document root. Likewise, adding even one WP site or WP MultiSite would break it. However, moving YOURLS completely off the document root allows me to demonstrate multiple YOURLS and multiple WP sites doing just that.
Finally, I would be the first to say this should be considered no more than beta software. I am more than capable of maintaining my production sites and "going it alone." Although it is working perfectly in my tests, I still need to work on the documentation and upgrade the XHTML to HTML5 (minor cleanup stuff). However, YOURLS MultiSite needs more and more varied testing.
I would like more people to test with me. For example, all plugins and API need testing. After the code proves itself you then may consider merging it into the YOURLS core. Do you have a suggestion how I might proceed with this? I am just learning about GitHub so forgive my ignorance. Would it be better to branch or fork this project? I do believe YOURLS MultiSite can be merged into the YOURLS Master once it has proven itself.
I will be looking for your advice on how to proceed,
PS: A big THANK YOU for such a wonderful program. It is very useful as is and also has great future potential.
@grzchr15 - Sorry about the delay and the confusion, I will try to explain.
The project, including the MultiSite feature, we are referring to it as YOURLS-PV.
You Said, "You stopped your first try ... 5 years ago."
The TuKod Team made "the first attempt." Likewise, I should not have borrowed their account to make my earlier YOURLS comments. TuKod is back, exclusively, for their use. PopVeKind is now my new retirement account. I'm sorry about the confusion.
You Asked,_ "any chance to get read access to your repository?"_