Skip to content
/ Elf Public
forked from EdiWang/Elf

The .NET Core link forward service runs on Microsoft Azure

License

Notifications You must be signed in to change notification settings

gungorugur/Elf

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Elf

Build Status

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

Features

Forward Link, Create/Manage/Share Link, View Report

image

Forward Logic

image

Docker Deployment

See https://hub.docker.com/r/ediwang/linkforwarder

If you don't like docker, you can follow the next section to build and run the project yourself.

Build and Run

Tools Alternative
.NET Core 3.1 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. linkforwarder-dev

For Production

Create an Azure SQL Database or a SQL Server 2019+ database. e.g. linkforwarder-dev

2. Set Connection String

Update the connection string "LinkForwarderDatabase" in appsettings.[env].json according to your database configuration.

Example:

"ConnectionStrings": {
  "ElfDatabase": "Server=(localdb)\\MSSQLLocalDB;Database=linkforwarder-dev;Trusted_Connection=True;"
}

Build Source

  1. Create an "appsettings.Development.json" under "src\LinkForwarder", 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.

  2. Build and run LinkForwarder.sln

Configuration

Below section discuss system settings in appsettings.[env].json.

Authentication

Configure how to sign in to admin portal.

Preferred: Azure Active Directory

Register an App in Azure Active Directory

"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}",
  }
}

About

The .NET Core link forward service runs on Microsoft Azure

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 69.7%
  • HTML 21.8%
  • PowerShell 4.6%
  • JavaScript 1.9%
  • TSQL 0.8%
  • CSS 0.7%
  • Dockerfile 0.5%