• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

flora-pm/flora-server: A package index for the Haskell ecosystem

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

flora-pm/flora-server

开源软件地址(OpenSource Url):

https://github.com/flora-pm/flora-server

开源编程语言(OpenSource Language):

Haskell 91.0%

开源软件介绍(OpenSource Introduction):

Flora
A package index for the Haskell ecosystem

Logo

CI badge made with Haskell Matrix chatroom badge

Flora.pm
A read-only mirror of hackage.haskell.org with an improved and lightweight interface.

Flora Server
An alternative package index server for the Haskell ecosystem with mirroring capabilities.

Read More

Installation and Configuration

For ease of development, a shell.nix file is provided. It brings with it system dependency and tooling.

To jump into the development environment, use make nix-shell. It is impure by default, so your editor and development tools will still be accessible.

System dependencies

Flora server

The configuration is handled through environment variables. They are all prefixed by FLORA_ to avoid conflict, and the server will tell you which ones are missing.

To start in the best of conditions, create a file called environment.local.sh with the following content:

source environment.sh

# export FLORA_SENTRY_DSN="" # Don't forget to add your Sentry DSN if you use it!
# export FLORA_PROMETHEUS_ENABLED="true"

This will get all the variables from environment.sh and allow you to override them.

You can then build the server with

# To build the binaries
$ make build
# To load the main library in a REPL
$ make repl

Database

The Flora server uses PostgreSQL 14.

To create the database and apply the migrations, type:

$ make db-setup # Implies db-create

you can also use db-create and db-drop to create and delete the database in the PostgreSQL instance.

Docker Workflow

A docker-based workflow is provided. The idea is to develop from within a container that brings with it all dependencies, and communicates with another container for the PostgreSQL database.

# You need to build the container first. It's gonna take around 13 minutes the first time you build
$ make docker-build
# Start the container.
$ make docker-start
# Once the containers are running, you can enter the development environment and start hacking
$ make docker-enter
# You'll be in the docker container. Environment variables are automatically set 
# so you should be able to start Flora
(docker)$ make nix-tmux
# You'll be in a tmux session, everything should be launched
# Visit localhost:8084 from your web browser to see if it all works.

# To provision the development database, type:
$ make docker-enter
(docker)$ source environment.docker.sh
(docker)$ make db-drop  # password is 'postgres' by default
(docker)$ make db-setup # password is 'postgres' by default
(docker)$ make nix-provision
# And you should be good!

Importing everything from Hackage

  1. Download the archive containing all packages here
  2. Extract it in Flora's root directory. You should now have a 01-index folder
  3. Run make import-from-hackage

You can explore the Makefile rules by typing make in your shell.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
chrisdone/jl: Functional sed for JSON发布时间:2022-06-24
下一篇:
csabahruska/jhc-components: JHC Haskell compiler split into reusable components发布时间:2022-06-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap