O Magnetissimo é um aplicativo da Web auto-hospedado que indexa todos os sites de torrent populares e salva os links de ímãs ao seu banco de dados local.


Queremos explicar como executar o Magnetissimo em:
Docker compor
# 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
Se você vai acessar o Magnetissimo em um endereço além localhost , adicione PHX_HOST às suas variáveis de ambiente. Por exemplo, para acessá -lo em http://192.168.0.54:4000 :
- PHX_HOST=192.168.0.54
Ou para acessá -lo em 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
Desenvolvimento local
asdf install
mix deps.get
iex -S mix phx.server
Em seguida, visite: http: // localhost: 4000
Todos os terminais retornam informações formatadas JSON.
/search endpoint: http: // localhost: 4000/api/search/: search_term
A pesquisa retorna torrents que correspondem ao param search_term .
/latest endpoint: http: // localhost: 4000/API/mais recente
O mais recente retorna os 50 mais recentes torrents publicados.
Temos uma .tool-versions para que você possa usar o ASDF para instalar as versões certas com muita facilidade.
elixir 1.14.4
nodejs 19.8.1
Em seguida, asdf install .
Você também precisa ter o PostGres em execução e configurá -lo usando a variável de ambiente DATABASE_URL .
Finalmente, configure seu banco de dados com alguns dados fictícios e execute o projeto.
mix deps.get
mix ecto.reset
iex -S mix phx.serverQuer falar sobre Magnetissimo ou sugerir recursos? Temos um servidor oficial da discórdia.
Clique para ingressar no nosso servidor oficial de discórdia