Anope IRC Services

Anope Development => Feature Requests => Topic started by: n0kS Phr33d0m on November 03, 2008, 02:35:06 AM

Title: Migrate channels
Post by: n0kS Phr33d0m on November 03, 2008, 02:35:06 AM
Hello. To migrate all channel data to another (not registered channel/or registered....)
/msg cs migrate <#chan1> <#chan2> <pass chan1> (<pass chan2> if channel registered)

This is... to make cut and paste (not copy & paste...). Like only to change channel's name...

Thanks.
Title: Re: Migrate channels
Post by: Trystan Scott Lee on November 03, 2008, 05:50:04 AM
heard this asked for many times, would be nice to see it either as a mod or core feature
Title: Re: Migrate channels
Post by: Andrew B. on November 03, 2008, 06:53:50 AM
So like two channels merging? -- Seems like it would be simple to do.
Title: Re: Migrate channels
Post by: Jobe on November 03, 2008, 08:54:53 AM
Would be easy enough for a module to do, but I'd be happy to see it as a core feature too.
Title: Re: Migrate channels
Post by: n0kS Phr33d0m on November 03, 2008, 12:21:59 PM
So like two channels merging? -- Seems like it would be simple to do.

No. That wasn't my first idea...
In simple words, this command changes only the channel's name... (#chan1 to #chan12313 or something)

I'll try to explain (sorry for my bad english...):

I'm user in the network and I own a channel #infernum (with password: r123) and I have a lot of people in my lists (sop aop vop...), I've changed mlock settings, mail, etc.... and I don't want to drop this channel and to do all this again when I register the new one, so I use the migrate command.
*** Here are two options:
** Non registered channel:
/msg cs migrate <#chan1> <#chan2> <pass chan1>
1. I enter channel #boooooom (I have @ and I'm able to register...) so I type the command "/msg cs migrate #infernum #boooooom r123" and every option, access list, etc. copies to my new channel #boooooom and the old one (#infernum) gets dropped.
(if there is any way to redirect users to the channel.... like CS to kick them and with mode "+lL 1 #<newchannel>" (in Unreal) users will autojoin the new channel (the problem is if the user doesn't have autojoin on kick... but this is not a big problem))

** Registered channel:
/msg cs migrate <#chan1> <#chan2> <pass chan1> <pass chan2>
2. I join channel #boooooom (that is registered to me, or I know the founder's password (for example ppp555)) so I type "/msg cs migrate #infernum #boooooom r123 ppp555" and then the same in 1.

Thanks.
Title: Re: Migrate channels
Post by: Charles Kingsley on November 04, 2008, 07:12:19 AM
Definitely interesting.
Title: Re: Migrate channels
Post by: deiks on November 04, 2008, 12:51:10 PM
** Non registered channel:1. I enter channel #boooooom (I have @ and I'm able to register...) so I type the command "/msg cs migrate #infernum #boooooom r123" and every option, access list, etc. copies to my new channel #boooooom and the old one (#infernum) gets dropped.
(if there is any way to redirect users to the channel.... like CS to kick them and with mode "+lL 1 #<newchannel>" (in Unreal) users will autojoin the new channel (the problem is if the user doesn't have autojoin on kick... but this is not a big problem))
[/quote]

Option: If channel isn't registered, check if user is op on unregistered chan
Title: Re: Migrate channels
Post by: zEkE on November 04, 2008, 02:54:58 PM
naturally it should apply any security to the command that would otherwise apply to CS REGISTER (including oper-only/no registering modules, is the user op, etc).
Title: Re: Migrate channels
Post by: Jobe on November 04, 2008, 04:13:56 PM
Well, for the "oper only/no registering" modules, they would have to be updated themselves, because they only restrict access to commands by re-binding them.
Title: Re: Migrate channels
Post by: n0kS Phr33d0m on November 04, 2008, 07:10:56 PM
Module Complete! (in 1 day eh! :D )

URL: http://modules.anope.org/viewmod.php?id=175
Author: mark
Title: Re: Migrate channels
Post by: techgeek on November 08, 2008, 02:33:50 AM
I really think the idea of cs_migrate is pretty cool.  Mark, if you could please make it for Windows, I would great appreciate it.  Thanks.
Title: Re: Migrate channels
Post by: TwinShadow on November 08, 2008, 03:44:43 AM
I think this should be moved to the modules forum, but I'll put in my two cents in.

There are some people who have BotServ settings as well, so I'm curious, does it also transfer BotServ stuff as well or do those have to be reset?
Title: Re: Migrate channels
Post by: deiks on November 09, 2008, 01:02:27 PM
For that could be /bs migrate
Title: Re: Migrate channels
Post by: Master on November 14, 2008, 08:32:32 PM
Wouldn't this have some security concerns? It'd make the channel extremely easy to take over ><...
Perhaps make it so only the founder can merge the old channel, and verification is sent via memo to the founder of the new channel (then he has to type a code to complete the merge)? Of course, this would likely apply only if the second channel is registered...
Title: Re: Migrate channels
Post by: Jobe on November 14, 2008, 11:43:23 PM
The only security this really needs is A) make sure the destination channel is NOT already registered, B) make sure the user doing the merge has +o on the destination channel and C) the user MUST be the REAL found of the source channel, and NOT just identified to the channel using the channels password.
Title: Re: Migrate channels
Post by: fisben on November 20, 2008, 07:14:02 AM
how to restrict access to this command only service administrators? (sorry for my bad english)
Title: Re: Migrate channels
Post by: deiks on November 20, 2008, 02:32:51 PM
Why would you to that couse it is made for regulars users

But if you really want:

Find:

if (!is_services_admin(u) && ((source->flags & CI_SECUREFOUNDER ? !is_real_founder(u, source) : !is_founder(u, source)) && (dest->flags & CI_SECUREFOUNDER ? !is_real_founder(u, dest) : !is_founder(u, dest))))

Replace with:

if (!is_services_admin(u))

Chears

Title: Re: Migrate channels
Post by: fisben on November 20, 2008, 03:48:13 PM
Why would you to that couse it is made for regulars users

But if you really want:

Find:

if (!is_services_admin(u) && ((source->flags & CI_SECUREFOUNDER ? !is_real_founder(u, source) : !is_founder(u, source)) && (dest->flags & CI_SECUREFOUNDER ? !is_real_founder(u, dest) : !is_founder(u, dest))))

Replace with:

if (!is_services_admin(u))

Chears


thanks for answer!

Somebody can make the version for 1.6.*? I think its very useful module. I can't use this version for some reasons :(
Title: Re: Migrate channels
Post by: deiks on November 20, 2008, 07:02:48 PM
Some reason == Your Anope version. :]

Upgrade to 1.8 Branch :)
Title: Re: Migrate channels
Post by: Jan Milants on November 20, 2008, 11:19:50 PM
A module author would have to be insane to, at this point, write new modules for a branch that is soon to become deprecated.. not even mentioning that writing for 1.6 is torture..
Title: Re: Migrate channels
Post by: fisben on November 24, 2008, 03:37:02 AM
Some reason == Your Anope version. :]

Upgrade to 1.8 Branch :)
Some reason == Inaccessibility of a patch bynets.org for anope 1.7. There is a version only for 1.6

ok, and how it is possible to rename manually channels if I have an access on a shell?
Title: Re: Migrate channels
Post by: zEkE on November 24, 2008, 03:42:33 AM
Could be done via SQL.

Would take a while, but the process would be something like this:

Configure Anope to write to SQL database, and force an update of the database.
Check, make sure database was written successfully.
Shutdown Anope.
Rename channel as desired in SQL database.
Configure Anope to "UseDB", in order to read from the SQL database.
Start Anope.
Remove SQL configuration if desired (probably will be).
Title: Re: Migrate channels
Post by: Jan Milants on November 24, 2008, 09:29:31 PM
since anope 1.6 does not support starting from SQL (phase 2 - implemented in 1.7) this would be impossible in anope 1.6
Title: Re: Migrate channels
Post by: Jobe on November 24, 2008, 10:14:58 PM
Some reason == Inaccessibility of a patch bynets.org for anope 1.7. There is a version only for 1.6

Apologies if I have misunderstood you on this, but are you saying you are using a modified version of Anope 1.6.5?
Title: Re: Migrate channels
Post by: fisben on November 25, 2008, 03:12:51 AM
Apologies if I have misunderstood you on this, but are you saying you are using a modified version of Anope 1.6.5?
Yes it so. The patch removes vulnerability (takeover) in names of channels in Russian locale.
Title: Re: Migrate channels
Post by: Jobe on November 25, 2008, 05:56:23 PM
Yes it so. The patch removes vulnerability (takeover) in names of channels in Russian locale.
If you feel this is a bug then can I please advise you to report it on the bug tracker so it can be fixed officially?
Title: Re: Migrate channels
Post by: fisben on November 26, 2008, 03:04:21 AM
If you feel this is a bug then can I please advise you to report it on the bug tracker so it can be fixed officially?
http://bugs.anope.org/show_bug.cgi?id=971