magnetissimo
1.0.0
Magnetissimo是一個自託管的Web應用程序,它索引了所有流行的洪流站點,並將磁鐵鍊接保存到您本地數據庫。


我們想解釋如何運行Magnetissimo:
Docker組成
# Generate a secret_key with either
openssl rand -base64 64
mix phx.gen.secret
# Enter that key as SECRET_KEY_BASE in the docker-compse.yml file
SECRET_KEY_BASE=YourKeyGoesHere
# Start the application
docker compose up -d
如果您要在localhost以外的地址訪問Magnetissimo,請在環境變量中添加PHX_HOST 。例如,在http://192.168.0.54:4000上訪問它:
- PHX_HOST=192.168.0.54
或在https://magnetissimo.domain.tld上訪問它:
- PHX_HOST=magnetissimo.domain.tld
Kubernetes
# Generate a secret_key with either
openssl rand -base64 64
mix phx.gen.secret
Edit the k8s/deployment.yaml file, and replace the ENV SECRET_KEY_BASE with your generated key.
Edit k8s/ingress.yaml & the PHX_HOST in k8s/deployment.yaml and replace the host with your domain name.
The Postgres database is configured to use the DNS name assuming it is being deployed to the default namespace, update this in the enviroment variables if you are deploying to a different namespace.
Finaly, deploy the application to your cluster.
kubectl apply -f k8s/pvc.yaml
kubectl apply -f k8s/deployment.yaml
kubectl apply -f k8s/svc.yaml
kubectl apply -f k8s/ingress.yaml
地方發展
asdf install
mix deps.get
iex -S mix phx.server
然後訪問:http:// localhost:4000
所有端點均返回JSON格式化信息。
/search端點:http:// localhost:4000/api/search/:search_term
搜索返回與search_term param匹配的洪流。
/latest端點:http:// localhost:4000/api/最新
最新返回最新的50個已發布的洪流。
我們有一個.tool-versions因此您可以使用ASDF非常輕鬆地安裝正確的版本。
elixir 1.14.4
nodejs 19.8.1
然後asdf install 。
您還需要使用DATABASE_URL環境變量進行Postgres運行並進行配置。
最終使用一些虛擬數據設置數據庫並運行項目。
mix deps.get
mix ecto.reset
iex -S mix phx.server是否想談論磁鐵或建議功能?我們有官方的Discord服務器。
點擊加入我們的官方Discord服務器