Skip to content

Commit a40944d

Browse files
authored
Merge pull request #2435 from apify/actorize
Apify will sponsor your project: Sherlock Actor on Apify infrastructure
2 parents 4428b15 + b7ce20b commit a40944d

File tree

7 files changed

+220
-0
lines changed

7 files changed

+220
-0
lines changed

.actor/Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM sherlock/sherlock as sherlock
2+
3+
# Install Node.js
4+
RUN apt-get update; apt-get install curl gpg -y
5+
RUN mkdir -p /etc/apt/keyrings
6+
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
7+
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
8+
RUN apt-get update && apt-get install -y curl bash git jq jo xz-utils nodejs
9+
10+
# Install Apify CLI (node.js) for the Actor Runtime
11+
RUN npm -g install apify-cli
12+
13+
# Install Dependencies for the Actor Shell Script
14+
RUN apt-get update && apt-get install -y bash jq jo xz-utils nodejs
15+
16+
# Copy Actor dir with the actorization shell script
17+
COPY .actor/ .actor
18+
19+
ENTRYPOINT [".actor/actor.sh"]

.actor/README.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Sherlock Actor on Apify
2+
3+
[![Sherlock Actor](https://apify.com/actor-badge?actor=netmilk/sherlock)](https://apify.com/netmilk/sherlock?fpr=sherlock)
4+
5+
This Actor wraps the [Sherlock Project](https://sherlockproject.xyz/) to provide serverless username reconnaissance across social networks in the cloud. It helps you find usernames across multiple social media platforms without installing and running the tool locally.
6+
7+
## What are Actors?
8+
[Actors](https://docs.apify.com/platform/actors?fpr=sherlock) are serverless microservices running on the [Apify Platform](https://apify.com/?fpr=sherlock). They are based on the [Actor SDK](https://docs.apify.com/sdk/js?fpr=sherlock) and can be found in the [Apify Store](https://apify.com/store?fpr=sherlock). Learn more about Actors in the [Apify Whitepaper](https://whitepaper.actor?fpr=sherlock).
9+
10+
## Usage
11+
12+
### Apify Console
13+
14+
1. Go to the Apify Actor page
15+
2. Click "Run"
16+
3. In the input form, fill in **Username(s)** to search for
17+
4. The Actor will run and produce its outputs in the default datastore
18+
19+
20+
### Apify CLI
21+
22+
```bash
23+
apify call YOUR_USERNAME/sherlock --input='{
24+
"usernames": ["johndoe", "janedoe"]
25+
}'
26+
```
27+
28+
### Using Apify API
29+
30+
```bash
31+
curl --request POST \
32+
--url "https://api.apify.com/v2/acts/YOUR_USERNAME~sherlock/run" \
33+
--header 'Content-Type: application/json' \
34+
--header 'Authorization: Bearer YOUR_API_TOKEN' \
35+
--data '{
36+
"usernames": ["johndoe", "janedoe"],
37+
}
38+
}'
39+
```
40+
41+
## Input Parameters
42+
43+
The Actor accepts a JSON schema with the following structure:
44+
45+
| Field | Type | Required | Default | Description |
46+
|-------|------|----------|---------|-------------|
47+
| `usernames` | array | Yes | - | List of usernames to search for |
48+
| `usernames[]` | string | Yes | "json" | Username to search for |
49+
50+
51+
### Example Input
52+
53+
```json
54+
{
55+
"usernames": ["techuser", "designuser"],
56+
}
57+
```
58+
59+
## Output
60+
61+
The Actor provides three types of outputs:
62+
63+
### Dataset Record*
64+
65+
| Field | Type | Required | Description |
66+
|-------|------|----------|-------------|
67+
| `username` | string | Yes | Username the search was conducted for |
68+
| `links` | arrray | Yes | Array with found links to the social media |
69+
| `links[]`| string | No | URL to the account
70+
71+
### Example Dataset Item (JSON)
72+
73+
```json
74+
{
75+
"username": "johndoe",
76+
"links": [
77+
"https://github.com/johndoe"
78+
]
79+
}
80+
```
81+
82+
## Performance & Resources
83+
84+
- **Memory Requirements**:
85+
- Minimum: 512 MB RAM
86+
- Recommended: 1 GB RAM for multiple usernames
87+
- **Processing Time**:
88+
- Single username: ~1-2 minutes
89+
- Multiple usernames: 2-5 minutes
90+
- Varies based on number of sites checked and response times
91+
92+
93+
For more help, check the [Sherlock Project documentation](https://github.com/sherlock-project/sherlock) or raise an issue in the Actor's repository.

.actor/actor.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"actorSpecification": 1,
3+
"name": "sherlock",
4+
"version": "0.0",
5+
"buildTag": "latest",
6+
"environmentVariables": {},
7+
"dockerFile": "./Dockerfile",
8+
"dockerContext": "../",
9+
"input": "./input_schema.json",
10+
"storages": {
11+
"dataset": "./dataset_schema.json"
12+
}
13+
}

.actor/actor.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
INPUT=`apify actor:get-input | jq -r .usernames[] | xargs echo`
3+
echo "INPUT: $INPUT"
4+
5+
sherlock $INPUT
6+
7+
for username in $INPUT; do
8+
# escape the special meaning leading characters
9+
# https://github.com/jpmens/jo/blob/master/jo.md#description
10+
safe_username=$(echo $username | sed 's/^@/\\@/' | sed 's/^:/\\:/' | sed 's/%/\\%/')
11+
echo "pushing results for username: $username, content:"
12+
cat $username.txt
13+
sed '$d' $username.txt | jo -a | jo username=$safe_username links:=- | apify actor:push-data
14+
done

.actor/dataset_schema.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"actorSpecification": 1,
3+
"fields":{
4+
"title": "Sherlock actor input",
5+
"description": "This is actor input schema",
6+
"type": "object",
7+
"schemaVersion": 1,
8+
"properties": {
9+
"links": {
10+
"title": "Links to accounts",
11+
"type": "array",
12+
"description": "A list of social media accounts found for the uername"
13+
},
14+
"username": {
15+
"title": "Lookup username",
16+
"type": "string",
17+
"description": "Username the lookup was performed for"
18+
}
19+
},
20+
"required": [
21+
"username",
22+
"links"
23+
]
24+
},
25+
"views": {
26+
"overview": {
27+
"title": "Overview",
28+
"transformation": {
29+
"fields": [
30+
"username",
31+
"links"
32+
],
33+
},
34+
"display": {
35+
"component": "table",
36+
"links": {
37+
"label": "Links"
38+
},
39+
"username":{
40+
"label": "Username"
41+
}
42+
}
43+
}
44+
}
45+
}

.actor/input_schema.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"title": "Sherlock actor input",
3+
"description": "This is actor input schema",
4+
"type": "object",
5+
"schemaVersion": 1,
6+
"properties": {
7+
"usernames": {
8+
"title": "Usernames to hunt down",
9+
"type": "array",
10+
"description": "A list of usernames to be checked for existence across social media",
11+
"editor": "stringList",
12+
"prefill": ["johndoe"]
13+
}
14+
},
15+
"required": [
16+
"usernames"
17+
]
18+
}

docs/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,24 @@ optional arguments:
9898
--local, -l Force the use of the local data.json file.
9999
--nsfw Include checking of NSFW sites from default list.
100100
```
101+
## Apify Actor Usage [![Sherlock Actor](https://apify.com/actor-badge?actor=netmilk/sherlock)](https://apify.com/netmilk/sherlock?fpr=sherlock)
102+
103+
<a href="https://apify.com/netmilk/sherlock?fpr=sherlock"><img src="https://apify.com/ext/run-on-apify.png" alt="Run Sherlock Actor on Apify" width="176" height="39" /></a>
104+
105+
You can run Sherlock in the cloud without installation using the [Sherlock Actor](https://apify.com/netmilk/sherlock?fpr=sherlock) on [Apify](https://apify.com?fpr=sherlock) free of charge.
106+
107+
``` bash
108+
$ echo '{"usernames":["user123"]}' | apify call -so netmilk/sherlock
109+
[{
110+
"username": "user123",
111+
"links": [
112+
"https://www.1337x.to/user/user123/",
113+
...
114+
]
115+
}]s
116+
```
117+
118+
Read more about the [Sherlock Actor](../.actor/README.md), including how to use it programmaticaly via the Apify [API](https://apify.com/netmilk/sherlock/api?fpr=sherlock), [CLI](https://docs.apify.com/cli/?fpr=sherlock) and [JS/TS and Python SDKs](https://docs.apify.com/sdk?fpr=sherlock).
101119

102120
## Credits
103121

0 commit comments

Comments
 (0)