Jump to content

Search the Community

Showing results for tags 'traefik'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News & Announcements
    • BlockForums Announcements
    • Denarius Announcements
    • Kronos Wallet Announcements
    • The Crypto News Feed
  • Cryptocurrency Discussions
    • Cryptocurrencies
    • Altcoin Announcements
    • General Discussion
    • Tutorials & Help
  • Denarius Discussions
    • General Discussion
    • Tutorials & Help
    • Marketing & PR
    • Development
    • Mining & Staking
    • Trading & Exchanges
    • Marketplace
  • Programming & Design
    • Development QA
    • Design QA
  • Gaming
    • Bot Downloads & Discussion
    • Gaming Discussion
  • Classifieds
    • Buy Sell and Trade
  • Other Discussions
    • Element 115
    • The Lounge
    • Hardware & IoT
    • Tutorials & Guides
    • Domains & Hosting

Product Groups

There are no results to display.

Calendars

  • Community Calendar

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


BTC Address

Found 2 results

  1. In this example the idea is to run Iquidus Block Explorer with the daemon and traefik for reverse proxy all using a single docker-compose. Hopeful if anyone else tries this they come up with some better configs for the whole thing. I am going to use Ubuntu 20.04 as the example since its latest and greatest. We will be using Denarius docker daemon - https://github.com/buzzkillb/denariusDocker/tree/iquidus Iquidus D-Explorer - https://github.com/buzzkillb/D-explorer Iquidus Docker - https://github.com/buzzkillb/iquidusdocker Install Docker and Docker Compose #Install Docker sudo apt install docker.io sudo systemctl enable --now docker sudo usermod -aG docker SOMEUSERNAME docker --version #Install docker-compose sudo apt install docker-compose docker-compose version I would reboot at this step and make sure docker is still working. 20.04 has been a bit glitchy for me. If docker stops running, this fixed it. rm /etc/docker/daemon.json service docker restart systemctl status docker.service If you are using cloudflare, my traefik isn't setup correctly to use Cloudflare proxy and get the letsencrypt TLS certs once proxied. Will update once I get that config working. Make your .conf file in ~/.denarius/denarius.conf (switch this for your coin, the guide is tailored to Denarius, but should be an easy swap). denarius.conf (note daemon=0 for the docker daemon I built) - based on the docker hub image https://hub.docker.com/r/buzzkillb/denariusd iquidus branch/tag. rpcuser=rpcuser rpcpassword=aLongPasswordLikeThis rpcport=32369 port=33369 daemon=0 listen=1 server=1 txindex=1 rpcallowip=* At the your home folder clone the explorer. cd ~ git clone https://github.com/buzzkillb/iquidusdocker explorer cd explorer 2 things to change, go to your explorer folder inside explorer and switch logo.png to your coin logo, and edit settings.json to your coin. That's it. sample settings.json /* This file must be valid JSON. But comments are allowed Please edit settings.json, not settings.json.template */ { // name your instance! "title": "D-Explorer", "address": "https://explorer.example.com", // coin name "coin": "Denarius", // coin symbol "symbol": "D", // logo "logo": "/images/logo.png", // favicon "favicon": "public/favicon.ico", // Uses bootswatch themes (http://bootswatch.com/) // Valid options: // Cerulean, Cosmo, Cyborg, Darkly, Flatly, Journal, Lumen, Paper, // Readable, Sandstone, Simplex, Slate, Spacelab, Superhero, United, Yeti // theme (see /public/themes for available themes) "theme": "Cyborg", // port to listen for requests on. "port" : 3001, // database settings (MongoDB) "dbsettings": { "user": "", "password": "", "database": "explorerdb", "address": "mongodb", "port": 27017 }, //update script settings "update_timeout": 10, "check_timeout": 250, "block_parallel_tasks": 1, // wallet settings "use_rpc": true, "wallet": { "host": "denarius", "port": 32369, "username": "rpcuser", "password": "aLongPasswordLikeThis" }, // confirmations "confirmations": 10, // language settings "locale": "locale/en.json", // menu settings "display": { "api": true, "markets": true, "richlist": true, "twitter": true, "facebook": false, "googleplus": false, "youtube": false, "search": true, "movement": true, "network": true }, // index page (valid options for difficulty are POW, POS or Hybrid) "index": { "show_hashrate": true, // Show Market Cap in header "show_market_cap": false, // Show Market Cap in place of price box "show_market_cap_over_price": false, "difficulty": "Hybrid", "last_txs": 100, "txs_per_page": 10 }, // ensure links on API page are valid "api": { "blockindex": 1337, "blockhash": "000000000661c86bf89e652eb142093bd9123006f3085595dee183bfe1c24570", "txhash": "776684cfd496890268805a1d86d3fd00f4097c1dbffecc3acd79101c15216594", "address": "DABQj7yoQuvfxVVWMf2mqWhoHLDMUqUJsc" }, // market settings //supported markets: bittrex, poloniex, yobit, empoex, bleutrade, cryptopia, ccex //default market is loaded by default and determines last price in header "markets": { "coin": "D", "exchange": "BTC", "enabled": ["tradeogre"], "tradeogre_id": "BTC-D", "default": "tradeogre" }, // richlist/top100 settings "richlist": { "distribution": true, "received": true, "balance": true }, // movement page settings // min amount: show transactions greater than this value // low flag: greater than this value flagged yellow // high flag: greater than this value flagged red "movement": { "min_amount": 100, "low_flag": 1000, "high_flag": 5000 }, // twitter, facebook, googleplus, youtube "twitter": "denariuscoin", "facebook": "yourfacebookpage", "googleplus": "yourgooglepluspage", "youtube": "youryoutubechannel", //genesis "genesis_tx": "c6d8e8f56c25cac33567e571a3497bfc97f715140fcfe16d971333b38e4ee0f2", "genesis_block": "00000d5dbbda01621cfc16bbc1f9bf3264d641a5dbf0de89fd0182c2c4828fcd", //heavy (enable/disable additional heavy features) "heavy": false, //disable saving blocks & TXs via API during indexing. "lock_during_index": false, //amount of txs to index per address (stores latest n txs) "txcount": 100, "txcount_per_page": 50, //show total sent & received on address page (set false if PoS) "show_sent_received": true, // how to calculate current coin supply // COINBASE : total sent from coinbase (PoW) // GETINFO : retreive from getinfo api call (PoS) // HEAVY: retreive from heavys getsupply api call // BALANCES : total of all address balances // TXOUTSET : retreive from gettxoutsetinfo api call "supply": "GETINFO", // how to acquire network hashrate // getnetworkhashps: uses getnetworkhashps api call, returns in GH/s // netmhashps: uses getmininginfo.netmhashpsm returns in MH/s "nethash": "netmhashps", // nethash unitd: sets nethash API return units // valid options: "P" (PH/s), "T" (TH/s), "G" (GH/s), "M" (MH/s), "K" (KH/s) "nethash_units": "G", // Address labels // example : "JhbrvAmM7kNpwA6wD5KoAsbtikLWWMNPcM": {"label": "This is a burn address", "type":"danger", "url":"http://example.com"} // label (required) = test to display // type (optional) = class of label, valid types: default, primary, warning, danger, success // url (optional) = url to link to for more information "labels": { // "DDD6SzCwXSEcTPHmNwEQX6xbUs2Rf3svNX": {"label": "Cryptopia address", "type":"primary", "url":"http://disney.com"}, // "JSWVXHWeYNknPdG9uDrcBoZHztKMFCsndw": {"label": "Cryptsy"} } } Go back to the main explorer directory and edit docker-compose.yml version: "3" services: traefik: image: "traefik:v2.2" command: #- "--log.level=DEBUG" - "--api.insecure=true" #change to false in production - "--api.dashboard=true" #change to false in production - "--providers.docker.exposedbydefault=false" - "--entrypoints.web.address=:80" - "--entrypoints.websecure.address=:443" - "--certificatesresolvers.myresolver.acme.tlschallenge=true" #- "--certificatesresolvers.myresolver.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory" - "--certificatesresolvers.myresolver.acme.email=youremail@example.com" - "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json" ports: - "80:80" - "443:443" - "8080:8080" volumes: - "./letsencrypt:/letsencrypt" - "/var/run/docker.sock:/var/run/docker.sock:ro" restart: always denarius: image: buzzkillb/denariusd:iquidus volumes: - ~/.denarius:/data ports: - 33369:33369 - 32369:32369 restart: unless-stopped explorer: build: ./explorer stdin_open: true tty: true ports: - 3001:3001 links: - mongodb - denarius depends_on: - mongodb - denarius command: /bin/bash -c "service cron start && cd /opt/iquidus && npm start" labels: - "traefik.enable=true" - "traefik.http.routers.explorer.rule=Host(`explorer.example.com`)" - "traefik.http.routers.explorer.entrypoints=websecure" - "traefik.http.routers.explorer.tls.certresolver=myresolver" - "traefik.http.services.explorer.loadbalancer.server.port=3001" - "traefik.http.middlewares.explorer_redirect.redirectscheme.scheme=https" - "traefik.http.routers.explorer_insecure.rule=Host(`explorer.example.com`)" - "traefik.http.routers.explorer_insecure.entrypoints=web" - "traefik.http.routers.explorer_insecure.middlewares=explorer_redirect@docker" mongodb: image: mongo:latest container_name: "mongodb" environment: - MONGO_DATA_DIR=/data/db - MONGO_LOG_DIR=/dev/null volumes: - ./data/db:/data/db ports: - 27017:27017 command: mongod --bind_ip 0.0.0.0 --logpath=/dev/null --quiet --wiredTigerCacheSizeGB 2 restart: unless-stopped Now run docker-compose cd ~/explorer docker-compose up -d And that's about it. Check 127.0.0.1:3001 or your domain. Traefik reverse proxy will automatically pull in letsencrypt TLS certs for you, will also redirect http to https, and generally keep everything up. Traefik once setup is much more clean than using an Nginx reverse proxy. Plus the letsencrypt TLS certs are taken care of automagically so no more certbot cronjobs. This example also shows how to send traffic to port 3001. This block explorer runs heavy, so I doubt this will work on a typical single CPU, 2gb VPS. Anytime you make a change to settings.json, rebuild like this cd ~/explorer docker-compose down rerun docker-compose build docker-compose up -d Build this locally first in a VM, and check it works. Also 127.0.0.1:8080 is the traefik dashboard. I would turn this off in the main docker-compose.yml on the VPS/server itself once ready to setup. While waiting for the full sync, the whole thing starts to go wild using up memory. Quick bash script to restart every 30min to cut down on potential crashing. saveram.sh #!/bin/bash while true; do docker-compose down && docker-compose up -d sleep 1800 done Example site I am syncing before I move to a VPS and different domain. https://explorer.denarius.guide/
  2. I really like this guide I found so just rewriting pieces of it and adding some more stuff. Very good blog so check it out. https://tech.aufomm.com/2020/04/16/deploy-wordpress-with-docker-and-traefik-2/ Install Docker and docker-compose. Then we want to generate a hashed password for the traefik panel. sudo apt-get install apache2-utils then we get the user:hashedpassword like this htpasswd -nbB <USER> "<PASSWORD>" example for the above htpasswd -nbB admin "StrongPasswordHere" Copy somewhere to use for setting up traefik shortly. Start setting up the system. touch docker-compose.yml mkdir data mkdir data/configurations touch data/traefik.yml touch data/acme.json touch data/configurations/dynamic.yml chmod 600 data/acme.json ~/docker-compose.yml edit traefik.yourdomain to whatever subdomain you want to use to access the control panel like traefik.example.com version: '3.3' services: traefik: image: traefik:latest container_name: traefik restart: always security_opt: - no-new-privileges:true ports: - 80:80 - 443:443 volumes: - /etc/localtime:/etc/localtime:ro - /var/run/docker.sock:/var/run/docker.sock:ro - ./data/traefik.yml:/traefik.yml:ro - ./data/acme.json:/acme.json # Add folder with dynamic configuration yml - ./data/configurations:/configurations networks: - proxy labels: - "traefik.enable=true" - "traefik.docker.network=proxy" - "traefik.http.routers.traefik-secure.entrypoints=https" - "traefik.http.routers.traefik-secure.rule=Host(`traefik.yourdomain`)" - "traefik.http.routers.traefik-secure.middlewares=user-auth@file" - "traefik.http.routers.traefik-secure.service=api@internal" networks: proxy: external: true ~/data/traefik.yml update your email address below. api: dashboard: true entryPoints: http: address: ":80" http: redirections: entryPoint: to: https https: address: ":443" http: middlewares: - secureHeaders@file tls: certResolver: letsencrypt providers: docker: endpoint: "unix:///var/run/docker.sock" exposedByDefault: false file: filename: /configurations/dynamic.yml certificatesResolvers: letsencrypt: acme: email: admin@yourdomain storage: acme.json keyType: EC384 httpChallenge: entryPoint: http buypass: acme: email: admin@yourdomain storage: acme.json caServer: https://api.buypass.com/acme/directory keyType: EC256 httpChallenge: entryPoint: http ~/data/configurations/dynamic.yml in the users: line change to your user:hashedpassword copied earlier # Dynamic configuration http: middlewares: secureHeaders: headers: frameDeny: true sslRedirect: true browserXssFilter: true contentTypeNosniff: true forceSTSHeader: true stsIncludeSubdomains: true stsPreload: true stsSeconds: 31536000 user-auth: basicAuth: users: - "admin:$apr1$tm53ra6x$FntXd6jcvxYM/YH0P2hcc1" tls: options: default: cipherSuites: - TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 - TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 - TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305 - TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305 minVersion: VersionTLS12 Now make a directory like ~/blog or ~/wordpressblog or something where your wordpress data folder will be stored. I will use ~/blog since that's pretty simple to type. ~/blog/docker-compose.yml version: '3.7' services: db: image: mariadb container_name: wp-db volumes: - db-data:/var/lib/mysql networks: - default restart: always environment: MYSQL_ROOT_PASSWORD: supersecretpassword MYSQL_DATABASE: db MYSQL_USER: dbuser MYSQL_PASSWORD: dbpassword wordpress: depends_on: - db image: wordpress:latest container_name: wordpress environment: WORDPRESS_DB_HOST: db:3306 WORDPRESS_DB_NAME: db WORDPRESS_DB_USER: dbuser WORDPRESS_DB_PASSWORD: dbpassword volumes: - ./wp-data:/var/www/html networks: - proxy - default restart: always labels: - "traefik.enable=true" - "traefik.docker.network=proxy" - "traefik.http.routers.wordpress-secure.entrypoints=https" - "traefik.http.routers.wordpress-secure.rule=Host(`blog.yourdomain`)" # - "traefik.http.routers.wordpress-secure.service=wordpress-service" # - "traefik.http.services.wordpress-service.loadbalancer.server.port=80" volumes: db-data: name: wp-db-data networks: proxy: external: true Change the passwords and usernames to whatever you want. And also change blog.yourdomain to example -> blog.example.com The above will store your wordpress data folder in the same docker-compose.yml folder. The trick to adding a second wordpress is make another folder like ~/blog2 and stick the same docker-compose.yml in. Then modify the container names, user, passwords, the volumes: / db-data: / name to the new container name. And then modify this line per wordpress. - "traefik.http.routers.wordpress-blog2-secure.rule=Host(`blog2.example.com`)" Now to spin everything up. Go back to your ~/ directory and type docker-compose up -d We get a network error like this. docker-compose up -d ERROR: Network proxy declared as external, but could not be found. Please create the network manually using `docker network create proxy` and try again. Start the network. docker network create proxy Run docker-compose again to start traefik. docker-compose up -d Now try your traefik subdomain. Then spin up your docker-compose.yml in the blog folder. docker-compose up -d And that's it.
×
×
  • Create New...