EdiWang / Elf
Projects that are alternatives of or similar to Elf
Elf
The link forward service used by https://go.edi.wang. It generates static URLs for redirecting third party URLs. It's similar to, but NOT a URL shorter.
- Use a static token to adapt changes to origin url.
- Track user click to generate report. (Only if DNT isn't enabled)
e.g.:
Raw URL:
https://www.somewebsite.com/a-very-long-and-complicated-link-that-can-also-change?with=parameters
will translate to
https://yourdomain/fw/token
or
https://yourdomain/aka/name
Features
Forward Link, Create/Manage/Share Link, View Report
Forward Logic
Docker Deployment
https://hub.docker.com/r/ediwang/elf
You can also follow the next section to build and run the project yourself.
Build and Run
Tools | Alternative |
---|---|
.NET 5 SDK | N/A |
Visual Studio 2019 | Visual Studio Code |
Azure SQL Database | SQL Server 2019 / LocalDB (Dev Only) |
For a quick Azure deployment, you can use the automation script Azure-Deployment\Deploy.ps1
to setup a ready-to-run Elf in a couple of minutes. (Azure CLI is required to run the script)
Setup Database
1. Create Database
For Development (Light Weight, Recommended for Windows)
Create an SQL Server 2019 LocalDB database. e.g. elf
For Production
Create an Azure SQL Database or a SQL Server 2019+ database. e.g. elf
2. Set Connection String
Update the connection string "ElfDatabase" in appsettings.[env].json according to your database configuration.
Example:
"ConnectionStrings": {
"ElfDatabase": "Server=(localdb)\\MSSQLLocalDB;Database=elf;Trusted_Connection=True;"
}
Build Source
-
Create an "appsettings.Development.json" under "src\Elf.Web", this file defines development time settings like db connections. It is by default ignored by git, so you will need to manange it on your own.
-
Build and run Elf.sln
Configuration
Below section discuss system settings in appsettings.[env].json.
Authentication
Configure how to sign in to admin portal.
Azure Active Directory
Preferred:Register an App in Azure Active Directory
- Set Redirection URI to "https://yourdomain/signin-oidc"
- For local debugging, set URL to https://localhost:5001/signin-oidc
- Copy "appId" to set as AzureAd:ClientId in appsettings.[env].json file
"Authentication": {
"Provider": "AzureAD",
"AzureAd": {
"Domain": "{YOUR-VALUE}",
"TenantId": "{YOUR-VALUE}",
"ClientId": "{YOUR-VALUE}",
}
}
Alternative: Local Account
Set Authentication:Provider to "Local" and assign a pair of username and password.
Currently password is not encrypted, use it at your own risk.
"Authentication": {
"Provider": "Local",
"Local": {
"Username": "{YOUR-VALUE}",
"Password": "{YOUR-VALUE}",
}
}