tgdrive / teldrive

Telegram Drive
MIT License
1.72k stars 253 forks source link

Run 2 teldrive #280

Closed aiemassfiria closed 2 months ago

aiemassfiria commented 2 months ago

I try to run 2 teldrive example port 8080 standart and another 8888 but failed running for 8888. How? coz i want to create another channel

NiTr0gLiTcH commented 2 months ago

just switch channels in settings

btw you can use a sandbox or a docker container to run teldrive as many times as you want

aiemassfiria commented 2 months ago

I try running docker bit failed..can u share me example config yaml

Get Outlook for iOShttps://aka.ms/o0ukef


From: NiTr0gLiTcH @.> Sent: Thursday, June 27, 2024 6:16:52 PM To: divyam234/teldrive @.> Cc: aiemassfiria @.>; Author @.> Subject: Re: [divyam234/teldrive] Run 2 teldrive (Issue #280)

just switch channels in settings

btw you can use a sandbox or a docker container to run teldrive as many times as you want

— Reply to this email directly, view it on GitHubhttps://github.com/divyam234/teldrive/issues/280#issuecomment-2194311741, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AI2NZCM4VWIKYP2RRGIJTNTZJPRBJAVCNFSM6AAAAABJ7SMOMWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJUGMYTCNZUGE. You are receiving this because you authored the thread.Message ID: @.***>

iwconfig commented 2 months ago

I try running docker bit failed..can u share me example config yaml

https://github.com/divyam234/teldrive#deploy-using-docker-compose

vavtnen commented 2 months ago

teldrive --config=config1.toml run and teldrive --config=config2.toml run if you set your port in the config file or teldrive --port 8080 run and teldrive --port 8888 run

pinguim16 commented 2 months ago

Don't work -p

2024/06/29 05:41:44 goose: no migrations to run. current version: 20240615110350 panic: timeout

goroutine 1 [running]: github.com/divyam234/teldrive/internal/kv.NewBoltKV(0x0?) github.com/divyam234/teldrive/internal/kv/bolt.go:68 +0x1dc reflect.Value.call({0x1b54a00?, 0x2461e10?, 0x19466e06778?}, {0x1f5a250, 0x4}, {0xc0002b60f0, 0x1, 0x19421b6ae28?}) reflect/value.go:596 +0xca6 reflect.Value.Call({0x1b54a00?, 0x2461e10?, 0x7c2185?}, {0xc0002b60f0?, 0x1d08440?, 0xc00019c001?}) reflect/value.go:380 +0xb9 go.uber.org/dig.defaultInvoker({0x1b54a00?, 0x2461e10?, 0xc0002c01b0?}, {0xc0002b60f0?, 0x1?, 0x266d490?}) go.uber.org/dig@v1.17.1/container.go:238 +0x25 go.uber.org/dig.(constructorNode).Call(0xc0003180c0, {0x266d490, 0xc0006a6320}) go.uber.org/dig@v1.17.1/constructor.go:185 +0x34a go.uber.org/dig.paramSingle.Build({{0x0, 0x0}, 0x0, {0x26757a8, 0x1c89920}}, {0x266d490, 0xc0006a6320}) go.uber.org/dig@v1.17.1/param.go:287 +0x34a go.uber.org/dig.paramList.BuildList({{0x26757a8, 0x1bb5420}, {0xc0002c42e0, 0x2, 0x2}}, {0x266d490, 0xc0006a6320}) go.uber.org/dig@v1.17.1/param.go:150 +0xad go.uber.org/dig.(constructorNode).Call(0xc000318180, {0x266d490, 0xc0006a6320}) go.uber.org/dig@v1.17.1/constructor.go:155 +0x137 go.uber.org/dig.paramSingle.Build({{0x0, 0x0}, 0x0, {0x26757a8, 0x1d15860}}, {0x266d490, 0xc0006a6320}) go.uber.org/dig@v1.17.1/param.go:287 +0x34a go.uber.org/dig.paramList.BuildList({{0x26757a8, 0x1be9fc0}, {0xc000370480, 0x3, 0x3}}, {0x266d490, 0xc0006a6320}) go.uber.org/dig@v1.17.1/param.go:150 +0xad go.uber.org/dig.(constructorNode).Call(0xc0003183c0, {0x266d490, 0xc0006a6320}) go.uber.org/dig@v1.17.1/constructor.go:155 +0x137 go.uber.org/dig.paramSingle.Build({{0x0, 0x0}, 0x0, {0x26757a8, 0x1e70de0}}, {0x266d490, 0xc0006a6320}) go.uber.org/dig@v1.17.1/param.go:287 +0x34a go.uber.org/dig.paramList.BuildList({{0x26757a8, 0x1c244a0}, {0xc0002f2c80, 0x4, 0x4}}, {0x266d490, 0xc0006a6320}) go.uber.org/dig@v1.17.1/param.go:150 +0xad go.uber.org/dig.(constructorNode).Call(0xc000318600, {0x266d490, 0xc0006a6320}) go.uber.org/dig@v1.17.1/constructor.go:155 +0x137 go.uber.org/dig.paramSingle.Build({{0x0, 0x0}, 0x0, {0x26757a8, 0x1f163e0}}, {0x266d490, 0xc0006a6320}) go.uber.org/dig@v1.17.1/param.go:287 +0x34a go.uber.org/dig.paramList.BuildList({{0x26757a8, 0x1bea080}, {0xc0004b4150, 0x3, 0x3}}, {0x266d490, 0xc0006a6320}) go.uber.org/dig@v1.17.1/param.go:150 +0xad go.uber.org/dig.(Scope).Invoke(0xc0006a6320, {0x1bea080, 0x2461df8}, {0x0, 0x0, 0x352aee0?}) go.uber.org/dig@v1.17.1/invoke.go:122 +0x318 go.uber.org/dig.(Container).Invoke(0x20?, {0x1bea080?, 0x2461df8?}, {0x0?, 0xc0002c4ce0?, 0xc0003516d8?}) go.uber.org/dig@v1.17.1/invoke.go:82 +0x25 go.uber.org/fx.runInvoke({0x19466f9d008?, 0xc0000aa538?}, {{0x1bea080, 0x2461df8}, {0xc0002e28c0, 0x7, 0x8}}) go.uber.org/fx@v1.22.0/invoke.go:109 +0x153 go.uber.org/fx.(module).executeInvoke(0xc0006d0000, {{0x1bea080, 0x2461df8}, {0xc0002e28c0, 0x7, 0x8}}) go.uber.org/fx@v1.22.0/module.go:320 +0x145 go.uber.org/fx.(module).executeInvokes(0xc0006d0000) go.uber.org/fx@v1.22.0/module.go:306 +0xda go.uber.org/fx.New({0xc00041fb40, 0x6, 0x0?}) go.uber.org/fx@v1.22.0/app.go:517 +0x9fa github.com/divyam234/teldrive/cmd.runApplication(0xc0002545a0) github.com/divyam234/teldrive/cmd/run.go:121 +0x575 github.com/divyam234/teldrive/cmd.NewRun.func1(0xc0004b0700?, {0x1f5a1b4?, 0x4?, 0x1f5a1b8?}) github.com/divyam234/teldrive/cmd/run.go:43 +0x17 github.com/spf13/cobra.(Command).execute(0xc000265208, {0xc0000ba2a0, 0x6, 0x6}) github.com/spf13/cobra@v1.8.1/command.go:989 +0xab1 github.com/spf13/cobra.(Command).ExecuteC(0xc000264f08) github.com/spf13/cobra@v1.8.1/command.go:1117 +0x3ff github.com/spf13/cobra.(Command).Execute(...) github.com/spf13/cobra@v1.8.1/command.go:1041 github.com/spf13/cobra.(Command).ExecuteContext(0x264aff0?, {0x264b1b0?, 0xc0002c60c0?}) github.com/spf13/cobra@v1.8.1/command.go:1034 +0x47 main.main() ./main.go:15 +0x96

aiemassfiria commented 2 months ago

After several attempt trying to run using binary...i completely using docker now.

Completed guide 2 port using docker (Ubuntu 20.04): Port 8080 and 8888

sudo apt-get remove docker docker-engine docker.io containerd runc sudo apt-get update sudo apt-get install -y apt-transport-https ca-certificates curl gnupg lsb-release curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt-get update sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin

git clone https://github.com/divyam234/teldrive cd teldrive/ openssl rand -hex 32 <<get jwt secret

nano config.toml [db] data-source = "postgres://teldrive:secret@teldrive_db/teldrive"

[jwt] secret = ""

[tg] app-id = 12345678 app-hash = "4234789f89df89d798dfg7d"`

openssl rand -hex 32 <<get jwt secret nano config_8888.toml [db] data-source = "postgres://teldrive:secret@teldrive_db/teldrive"

[jwt] secret = ""

[tg] app-id = 12345678 app-hash = "4234789f89df89d798dfg7d"

touch session.db touch session_8888.db

nano docker-compose.yml version: "3.8"

services: server: image: ghcr.io/divyam234/teldrive restart: always container_name: teldrive volumes:

docker compose up -d

It will shared the database, but the uploaded file is depend on which rclone channel you mount