-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates #7
- Loading branch information
Showing
5 changed files
with
114 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Redir APIs | ||
|
||
All possible routers: `/s`, `/r`, and `/x`. The `/s` is the most | ||
complicated router because we are limited to use these prefixes | ||
(for many reasons, e.g. deploy to an existing domain that served a lot | ||
different routers. The prefix is configurable). | ||
|
||
Thus, all kinds of data, pages, static files are served under this router. | ||
|
||
## GET /s | ||
|
||
The GET request query parameters of `/s` and `/r` are listed as follows: | ||
|
||
- `mode`, possible options: `stats`, `index`, `index-pro` | ||
+ `admin`, access admin dashboard | ||
+ `index-pro` mode, admin only | ||
- `ps`, page size | ||
- `pn`, page number | ||
+ `index` mode | ||
- `ps`, page size | ||
- `pn`, page number | ||
+ `stats` mode | ||
- `a`, alias for stat data | ||
- `stat`, possible options: `referer`, `ua`, `time` | ||
- `t0`, start time | ||
- `t1`, end time | ||
|
||
## POST /s | ||
|
||
The POST request body of `/s` and `/r` is in the following format: | ||
|
||
```json | ||
{ | ||
"op": "create", | ||
"alias": "awesome-link", | ||
"data": { | ||
"alias": "awesome-link", | ||
"url": "https://github.com/changkun", | ||
"private": true, | ||
"valid_from": "2022-01-01T00:00:00+00:00" | ||
} | ||
} | ||
``` | ||
|
||
## License | ||
|
||
MIT © 2020-2021 [Changkun Ou](https://changkun.de) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Why redir is GDPR compliant? | ||
|
||
TODO | ||
|
||
## License | ||
|
||
MIT © 2020-2021 [Changkun Ou](https://changkun.de) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
# Troubleshooting | ||
|
||
## Private Vanity URL Imports | ||
|
||
1. Use `git` instead of `https` protocol | ||
2. Configure `GOPRIVATE` environment variable of the import location, e.g. `changkun.de/x` | ||
|
||
``` | ||
$ git config --global url."[email protected]:".insteadOf "https://github.com/" | ||
$ echo "export GOPRIVATE=changkun.de/x" >> ~/.zshrc | ||
``` | ||
|
||
## License | ||
|
||
MIT © 2020-2021 [Changkun Ou](https://changkun.de) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Who is using this service? | ||
|
||
Existing famous link shortener services, such as `bitly`, `tinyurl`, etc., | ||
offer similar features but requires an unreasonably overpriced subscription fee. | ||
Therefore, the initial purpose of building this service is to support link | ||
shortener under domain [changkun.de](https://changkun.de), and | ||
it is one of the active user of this service currently. | ||
|
||
I wrote `redir` under [golang.design/s/redir](https://golang.design/s/redir) | ||
initially. Due to the different requirements, this project has branched out | ||
from it and has a different architecture and feature set now. | ||
|
||
The current known users: | ||
|
||
- changkun.de | ||
- golang.design | ||
- qcrao.com | ||
- gonewspaper.org | ||
|
||
|
||
## License | ||
|
||
MIT © 2020-2021 [Changkun Ou](https://changkun.de) |