Skip to content
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

Update README.md #22

Open
wants to merge 18 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
1c77ff8
Update README.md
smint86 May 2, 2017
0bf0f05
Add email activation
drallieiv Aug 23, 2020
ad515e5
Email changer with password management
drallieiv Sep 5, 2020
47e4f0e
Add Documentation
drallieiv Sep 19, 2020
dcb29cc
build(deps): bump commons-io from 2.5 to 2.7 in /ptc-api
dependabot[bot] Apr 26, 2021
17f84d0
build(deps): bump commons-io from 2.5 to 2.7 in /KinanCity-core
dependabot[bot] Apr 26, 2021
157a12b
build(deps-dev): bump junit from 4.12 to 4.13.1 in /KinanCity-utils
dependabot[bot] Oct 13, 2020
5b5c911
build(deps): bump commons-io from 2.5 to 2.7 in /KinanCity-mail
dependabot[bot] Apr 26, 2021
3611479
build(deps-dev): bump junit from 4.12 to 4.13.1 in /ptc-api
dependabot[bot] Oct 13, 2020
587b7a9
build(deps-dev): bump junit from 4.12 to 4.13.1 in /KinanCity-core
dependabot[bot] Oct 13, 2020
481f691
build(deps-dev): bump junit in /KinanCity-captcha-ImageTypers
dependabot[bot] Oct 13, 2020
826e03c
build(deps-dev): bump junit in /KinanCity-captcha-api
dependabot[bot] Oct 13, 2020
dd48b42
build(deps-dev): bump junit in /KinanCity-captcha-client
dependabot[bot] Oct 13, 2020
c67d46b
build(deps-dev): bump junit in /KinanCity-captcha-server
dependabot[bot] Oct 13, 2020
6a6ff87
build(deps-dev): bump junit in /KinanCity-captcha-2captcha
dependabot[bot] Oct 13, 2020
3d6f1a1
build(deps-dev): bump junit from 4.12 to 4.13.1 in /KinanCity-mail
dependabot[bot] Oct 13, 2020
da8d9f5
build(deps-dev): bump junit in /KinanCity-captcha-AntiCaptcha
dependabot[bot] Oct 13, 2020
3e0301c
Merge branch 'develop' into patch-1
drallieiv Apr 28, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion KinanCity-captcha-2captcha/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<version>4.13.1</version>
<scope>test</scope>
</dependency>

Expand Down
2 changes: 1 addition & 1 deletion KinanCity-captcha-AntiCaptcha/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<version>4.13.1</version>
<scope>test</scope>
</dependency>

Expand Down
2 changes: 1 addition & 1 deletion KinanCity-captcha-ImageTypers/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<version>4.13.1</version>
<scope>test</scope>
</dependency>

Expand Down
2 changes: 1 addition & 1 deletion KinanCity-captcha-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<version>4.13.1</version>
<scope>test</scope>
</dependency>

Expand Down
2 changes: 1 addition & 1 deletion KinanCity-captcha-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<version>4.13.1</version>
<scope>test</scope>
</dependency>

Expand Down
2 changes: 1 addition & 1 deletion KinanCity-captcha-server/dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<configuration>
<transformers>
<transformer>
<mainClass>com.kinancity.captcha.server.Application</mainClass>
<mainClass>com.kinancity.captcha.server.CaptchaServer</mainClass>
</transformer>
<transformer>
<resource>META-INF/spring.handlers</resource>
Expand Down
4 changes: 2 additions & 2 deletions KinanCity-captcha-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
<mainClass>com.kinancity.captcha.server.Application</mainClass>
<mainClass>com.kinancity.captcha.server.CaptchaServer</mainClass>
</configuration>
<executions>
<execution>
Expand Down Expand Up @@ -78,7 +78,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<version>4.13.1</version>
<scope>test</scope>
</dependency>

Expand Down
19 changes: 19 additions & 0 deletions KinanCity-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,32 @@

**TABLE OF CONTENTS**

- [What does Kinan Core do ?](#what-does-kinan-core-do)
- [Main usage and tips](#main-usage-and-tips)
- Configuration examples
- [Create a sequence of accounts](#create-a-sequence-of-accounts)
- [Create a batch from a csv](#create-a-batch-from-a-csv)
- [Create a single account](#create-a-single-account)
- [Additional parameters](#additional-parameters)

# What does Kinan Core do ?

Instead of manually going to the PTC website, Kinan Core automates all the requests needed to create the account itself.

The captcha challenge still needs to be done, but you can use a third party provider (see below) or implement your own (see kinanCity-captcha-server).

![](../docs/1_KinanCore.png)

In the end you will still need to take care of the activation link that will be sent by email.

Instead of doing these steps one by one, Kinan core does multi-thread the process (see -thread option below).

However PTC has some restrictions that only allows to create 5 accounts per 15 minutes from the same IP.

![](../docs/2_IPrestrictions.png)

To overcome that limit, Kinan Core includes an embedded cooldown system, and allows using multiple proxies to call PTC from several different IP addresses.

# Main usage and tips

KinanCity-core main class accepts configuration from :
Expand Down
4 changes: 2 additions & 2 deletions KinanCity-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.5</version>
<version>2.7</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
Expand All @@ -102,7 +102,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<version>4.13.1</version>
<scope>test</scope>
</dependency>

Expand Down
22 changes: 22 additions & 0 deletions KinanCity-mail/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,35 @@
# KinanCity-mail : Email Activator

## About activation emails

Here is how activations emails work in a standard way :

There are 2 part in an email address : after the @ symbol, is the internet domain where the email should be sent. And before the @ symbol is the username who this email should be delivered to.

![](../docs/3_email.png)

PTC sends and email to the address you gave it.
It arrives to the DNS server of that domain, that defines to which server the the emails should be sent.

On that email server, there is a program setup with mailboxes for each user and the emails are stored.

Then the user connects to that mailbox and retreives his emails. He will then find the email with the activation link and open it in his browser.

## What this module does

If you have your own domain, you can run your own email server.
Instead of running a standard email server, you can run Kinan Mail instead.

This module can be run as a standalone service and will :

- Start a **Mail server** listening to default port 25
- For each mail received from nintendo, the **activation link** is grabbed
- A web request is made to the **activation** link

![](../docs/4_kinanMail.png)

Using Kinan Mail, you don't need to create a mailbox for each account before hand. And the activation links are taken care automatically.

## How to setup

The machine running the email server must be accessible from **the internet**.
Expand Down
3 changes: 3 additions & 0 deletions KinanCity-mail/accounts.example.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#username;email;password
username1;username1@myMxDomain.com;testAA123+
username2;username2@myMxDomain.com;testAA456+
17 changes: 16 additions & 1 deletion KinanCity-mail/config.example.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,19 @@
#proxy=http://login:pass@127.0.0.1:3128|http://login:pass@127.0.0.1:3128

# Uncomment the line below if you want to accept emails that does not come from pokemon.com
#disableDomainFilter=true
#disableDomainFilter=true

# Add your domain and uncomment the line below to only accept emails sent to a specific email address
#allowedDomains=myDomain.xyz
#hostname=myDomain.xyz


# Activate the email changer
# emailChanger.active=true

# Loading from a csv file
# emailChanger.password.csv=accounts.example.csv
# Mapping between email account and password with wildcard
# emailChanger.password.mapping=aaaaa.*@domain.com:pass1||bbbbb.*@.*:pass2
# Always the same password
# emailChanger.password.static=sameForAll
16 changes: 11 additions & 5 deletions KinanCity-mail/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<version>1.4.2-SNAPSHOT</version>
</parent>
<artifactId>KinanCity-mail</artifactId>
<version>1.5.4</version>
<version>2.0.2</version>

<description>Email validation for KinanCity</description>

Expand All @@ -22,7 +22,7 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.5</version>
<version>2.7</version>
</dependency>

<dependency>
Expand All @@ -48,7 +48,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<version>4.13.1</version>
<scope>test</scope>
</dependency>

Expand All @@ -58,8 +58,14 @@
<version>3.6.2</version>
<scope>test</scope>
</dependency>

</dependencies>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.13.1</version>
<scope>compile</scope>
</dependency>

</dependencies>

<build>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class Activation {

private String link;
private String email;
private String status;
private String status = "UNDEF";

public Activation(String link, String email) {
this.link = link;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.kinancity.mail;

public class EmailChangeRequest extends Activation {

public EmailChangeRequest(String link, String email) {
super(link, email);
}

public EmailChangeRequest(String link, String email, String status) {
super(link, email, status);
}
}
22 changes: 18 additions & 4 deletions KinanCity-mail/src/main/java/com/kinancity/mail/FileLogger.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.kinancity.mail;

import com.kinancity.mail.mailchanger.ToFileEmailChanger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -10,21 +11,34 @@ public class FileLogger {
public static final String BAD = "BAD";
public static final String THROTTLED = "THROTTLED";
public static final String ERROR = "ERROR";
public static final String EXPIRED = "EXPIRED";

public static final String SKIPPED = "SKIPPED";

public static final String TYPE_MAILCHANGE = "MAILCHANGE";
public static final String TYPE_ACTIVATION = "ACTIVATION";

private static Logger LOGGER = LoggerFactory.getLogger("LINKS");

public static void logStatus(Activation link, String status) {
LOGGER.info("{};{};{}", link.getLink(), link.getEmail(), status);
String type = (link instanceof EmailChangeRequest) ? TYPE_MAILCHANGE : TYPE_ACTIVATION;
LOGGER.info("{};{};{};{}", type, link.getLink(), link.getEmail(), status);
}

public static Activation fromLog(String line) {
String[] parts = line.split(";");
if (parts.length > 2) {
return new Activation(parts[0], parts[1], parts[2]);
if(parts[0].equals(TYPE_ACTIVATION)) {
if (parts.length > 3) {
return new Activation(parts[1], parts[2], parts[3]);
} else {
return new Activation(parts[1], null, parts[2]);
}
} else {
return new Activation(parts[0], null, parts[1]);
if (parts.length > 3) {
return new EmailChangeRequest(parts[1], parts[2], parts[3]);
} else {
return new EmailChangeRequest(parts[1], parts[2]);
}
}
}
}
Loading