Giter Club home page Giter Club logo

elf's Introduction

Elf

Docker for API Man hours

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.

e.g.:

Raw URL:

https://www.somewebsite.com/a-very-long-and-complicated-link-that-can-also-change?with=parameters

will be translate to https://yourdomain/fw/token or https://yourdomain/aka/name

Features

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

list

report

Forward Logic

image

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 API

Tools Alternative
.NET 8 SDK N/A
Visual Studio 2022 Visual Studio Code
Azure SQL Database SQL Server 2022 / 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

Create an Azure SQL Database or a SQL Server 2019+ database. e.g. elf

Update the connection string "ElfDatabase" in appsettings.[env].json

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

Build Source

Build and run ./src/API/Elf.sln

Authentication

Register an App in Microsoft Entra ID (Azure Active Directory)

  • Set an Application ID URI as unique for this app
  • Expose an API with name access_as_user and with Admins and users type
  • Change accessTokenAcceptedVersion to 2 in Manifest blade
  • Copy "appId" to set as EntraID:ClientId in appsettings.json file
"EntraID": {
  "Domain": "{YOUR-VALUE}",
  "TenantId": "{YOUR-VALUE}",
  "ClientId": "{YOUR-VALUE}",
}

Azure Cache for Redis (Optional)

To use Redis, follow these steps:

  1. Create an Azure Cache for Redis instance
  2. Copy the connection string in "Access keys"
  3. Set the connection string in ConnectionStrings:RedisConnection in appsettings.json or environment variable
  4. Restart the application

Build and Run Admin Portal

Pre-requests

  • Visual Studio / VSCode / .NET CLI or any editor you like

Configure Microsoft Entra ID

  1. Navigate to the Azure portal and select the Microsoft Entra ID service.
  2. Select New registration.
  3. In the Register an application page, enter your application's information:
    • In the Name section, for example elf-admin.
    • Under Supported account types, select Accounts in this organizational directory only.
    • In the Redirect URI (optional) section, select Single-page application and enter redirect URI: https://localhost:7160/authentication/login-callback for local debug and whatever URL you use in production.
  4. Select Register to create the application.
  5. In the app's registration screen, find and note the Application (client) ID.
  6. In the app's registration screen, click on the API permissions blade.
    • Click the Add a permission button and then,
    • Ensure that the My APIs tab is selected.
    • In the list of APIs, select the API you created.
    • In the Delegated permissions section, select the access_as_user in the list.
    • Click on the Add permissions.

Configure API endpoint

  1. Open ./src/Admin/Constants.cs, replace APIAddress, APIAppUrlGuid with your own values.
  2. Open ./src/Admin/wwwroot/appsettings.json, replace Authority, ClientId with your own values.

Run

cd ./src/Admin/
dotnet run

免责申明

对于**访客,我们有一份特定的免责申明。请确保你已经阅读并理解其内容:

elf's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

elf's Issues

Multi-database support

Currently only sql server is supported, and other databases, such as postgresql, are expected to be supported

Add Privacy Policy

This application collects user IP and User Agent. Perhaps a privacy policy is necessary.

Build Failed: libman restore failed

[LIB002]: "[email protected]" 库无法由 "cdnjs" 提供程序解析
[LIB002]: "[email protected]" 库无法由 "cdnjs" 提供程序解析
[LIB002]: "[email protected]" 库无法由 "cdnjs" 提供程序解析
[LIB002]: "[email protected]" 库无法由 "cdnjs" 提供程序解析
[LIB002]: "[email protected]" 库无法由 "cdnjs" 提供程序解析
[LIB002]: "[email protected]" 库无法由 "cdnjs" 提供程序解析
[LIB002]: "[email protected]" 库无法由 "cdnjs" 提供程序解析
[LIB002]: "[email protected]" 库无法由 "cdnjs" 提供程序解析
[LIB002]: "[email protected]" 库无法由 "cdnjs" 提供程序解析
[LIB002]: "[email protected]" 库无法由 "cdnjs" 提供程序解析

Where is the Response type coming from?

Hey there, nice project. I'm trying to implement something similar in my app, and was wondering where the Response<T> was coming from?

I think I figured out it was coming from Edi.Practice.RequestResponse, but this is not listed in the .sln file as a dependency of any kind...

Use URLRewrite

Do things like:

  • Remove trailing slash
  • Redirect Misc Homepage URLs to canonical homepage URL

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.