Skip to content

Commit 7546cbc

Browse files
author
Weiwu
committed
make ssh work again
1 parent 09c6104 commit 7546cbc

File tree

3 files changed

+47
-29
lines changed

3 files changed

+47
-29
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ prepare:
3636

3737

3838
upload:
39-
scp -r ./ s01cd.syd6.hostingplatform.net.au:repo.tokenscript.org/
39+
scp -P 2683 -r ./ net@s01cd.syd6.hostingplatform.net.au:repo.tokenscript.org/

README.md

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,41 +12,27 @@ Then, run this to upload the files. This will only work if you already configure
1212

1313
$ make upload
1414

15-
## How it works
15+
## Configure SSH access
1616

17-
The Makfile generates a list of rewrite rules for accessing TokenScript files based on their token contract addresses. See more in [how_it_works.md](how_it_works.md)
18-
19-
## When will it be used
20-
21-
A user obtains a TokenScript in two ways.
22-
23-
1. If the user accesses a token use-case through a website, the TokenScript for that use-case is offered through that web page[^1].
24-
25-
2. If the user needs a TokenScriptn without going through a dapp website, (e.g. he receives a token from an exchange withdraw or restoring a wallet backup), the user-agent (wallet) tries to find the TokenScript for that token by accessing the `scriptURI()` repo server. Using this repo as a backup source if that function doesn't exist on the token contract.
17+
This is tricky. You need 2 things:
2618

27-
## Submit a TokenScript to this repo
19+
1. Adding your IP address to the whitelist. [Official document](https://ventraip.com.au/faq/article/enabling-ssh-and-sftp-access-on-a-hosting-service/)
20+
2. Adding your key to [the cPanel](https://web23.hosting-cloud.net:2083/cpsess0722241000/frontend/paper_lantern/index.html?login=1&post_login=29808973384901).
2821

29-
When you deploy your Tokenscript, please also send a copy to this repo in the form of a new Pull Request. By doing so:
22+
Note that the whitelist is not in the cPanel.
3023

31-
1. If a user gets a token without going through any of the dapp websites with your TokenScript deployed, they can still get a copy from here.
24+
In reality, both are ticky.
3225

33-
2. When we upgrade the schema, we know who to talk to for updating existing TokenScript.
26+
1. Adding your IP address to the whitelist - the whitelist only allows 3 entries, **you need to delete an old one to add a new one**.
27+
2. Adding SSH public key: It's better to add your SSH public key by asking a colleague to do the following, **avoid using cPanel at all**, since cPanel requires you to share your private key, which should not be shared in any case.
3428

35-
When you submit the TokenScript, create a new directory following the convention [as specified](hier.md).
29+
$ ssh -p 2683 net@s01cd.syd6.hostingplatform.net.au
30+
$ cat >> .ssh/authorized_keys
3631

37-
## When a user-agent (client) obtains a TokenScript from this repo
32+
## How the .htaccess file works
3833

39-
- A user receives a token directly.
40-
- A user scans a QR code or opens a link that represents a token-holding smart-contract.
41-
- A user gets a "MagicLink" which allows him to redeem a token.
42-
- A user recovers a key backup, and the user-agent discovers that he/she owns a few Token.
43-
44-
45-
Check [user-agent behaviour](user-agent.md) for how a user-agent is supposed to communicate with a repo server.
46-
47-
## Will namespace and schema always be updated at the same time?
48-
49-
Likely so in 2019 and perhaps 2020 as well. In the first two years, TokenScript schema and namespace are versioned in the same way. A user-agent only works with TokenScripts whose schema and namespace are _both_ supported by the user-agent.
34+
The Makfile generates a list of rewrite rules for accessing TokenScript files based on their token contract addresses. See more in [how_it_works.md](how_it_works.md)
5035

51-
Beyond 2020, a user-agent would work with any TokenScript whose namespace it supports, even if its schema is not supported. By such an arrangement, TokenScript schema can evolve at a faster pace than its namespace, by adding new elements and not removing old elements; but it leaves room for mistakes, resulting existing Tokenscript becomes invalidated. We think it's a fair trade-off.
36+
## Background: how user agents get tokenscripts
5237

38+
See [how user agents get tokenscripts](how_user_agents_get_tokenscripts.md).
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
A user obtains a TokenScript in two ways.
2+
3+
1. If the user accesses a token use-case through a website, the TokenScript for that use-case is offered through that web page[^1].
4+
5+
2. If the user needs a TokenScriptn without going through a dapp website, (e.g. he receives a token from an exchange withdraw or restoring a wallet backup), the user-agent (wallet) tries to find the TokenScript for that token by accessing the `scriptURI()` repo server. Using this repo as a backup source if that function doesn't exist on the token contract.
6+
7+
## Submit a TokenScript to this repo
8+
9+
When you deploy your Tokenscript, please also send a copy to this repo in the form of a new Pull Request. By doing so:
10+
11+
1. If a user gets a token without going through any of the dapp websites with your TokenScript deployed, they can still get a copy from here.
12+
13+
2. When we upgrade the schema, we know who to talk to for updating existing TokenScript.
14+
15+
When you submit the TokenScript, create a new directory following the convention [as specified](hier.md).
16+
17+
## When a user-agent (client) obtains a TokenScript from this repo
18+
19+
- A user receives a token directly.
20+
- A user scans a QR code or opens a link that represents a token-holding smart-contract.
21+
- A user gets a "MagicLink" which allows him to redeem a token.
22+
- A user recovers a key backup, and the user-agent discovers that he/she owns a few Token.
23+
24+
25+
Check [user-agent behaviour](user-agent.md) for how a user-agent is supposed to communicate with a repo server.
26+
27+
## Will namespace and schema always be updated at the same time?
28+
29+
Likely so in 2019 and perhaps 2020 as well. In the first two years, TokenScript schema and namespace are versioned in the same way. A user-agent only works with TokenScripts whose schema and namespace are _both_ supported by the user-agent.
30+
31+
Beyond 2020, a user-agent would work with any TokenScript whose namespace it supports, even if its schema is not supported. By such an arrangement, TokenScript schema can evolve at a faster pace than its namespace, by adding new elements and not removing old elements; but it leaves room for mistakes, resulting existing Tokenscript becomes invalidated. We think it's a fair trade-off.
32+

0 commit comments

Comments
 (0)