Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run it without docker #1

Closed
DirgaBrajamusti opened this issue Aug 16, 2023 · 13 comments
Closed

run it without docker #1

DirgaBrajamusti opened this issue Aug 16, 2023 · 13 comments

Comments

@DirgaBrajamusti
Copy link

can i run this without docker? if yes can you makes how to do it in readme? because i try the docker compose and it doesnt work for me

@divyam234
Copy link
Owner

divyam234 commented Aug 16, 2023

@DirgaBrajamusti you can run but it will be a hassle and only recommended for devs .What error are you facing can you elaborate and post compose logs.

@DirgaBrajamusti
Copy link
Author

DirgaBrajamusti commented Aug 16, 2023

docker compose logs without editing nginx depends on:
service "nginx" depends on undefined service server: invalid compose project

i edit docker compose to this:
`version: "3.8"

services:
api:
image: ghcr.io/divyam234/teldrive/server:latest
restart: always
container_name: server
volumes:
- ./sessions:/app/sessions
env_file: .env
ports:
- 8080

client:
image: ghcr.io/divyam234/teldrive/client:latest
restart: always
container_name: client
ports:
- 3000

nginx:
image: nginx:alpine
restart: always
container_name: nginx
volumes:
- ./nginx_nossl.conf:/etc/nginx/conf.d/default.conf
ports:
- 8008:8000
depends_on:
- api
- client
migrate:
image: arigaio/atlas:latest
command: >
migrate apply --url postgres://username:password@us-east-2.aws.neon.tech/neondb
volumes:
- ./database/migrations/:/migrations`

i can run it but when i access 8008 the respond is 502 bad gateway

also docker logs from teldrive-migrate-1 is this:
You have a checksum error in your migration directory. This happens if you manually create or edit a migration file. Please check your migration files and run 'atlas migrate hash' to re-hash the contents and resolve the error Error: checksum mismatch

@divyam234
Copy link
Owner

divyam234 commented Aug 16, 2023

@DirgaBrajamusti try to fetch latest code and docker images it should work now.In migration db url just add ?search_path=public at last to get migrations to work .I have added in readme which I missed earlier

@DirgaBrajamusti
Copy link
Author

DirgaBrajamusti commented Aug 16, 2023

docker compose now works and i can access the app but the migration still fail on me so i can't login. i use the latest commit
here is the logs from migrate:

2023-08-17 01:28:17 You have a checksum error in your migration directory.
2023-08-17 01:28:17 This happens if you manually create or edit a migration file.
2023-08-17 01:28:17 Please check your migration files and run
2023-08-17 01:28:17 
2023-08-17 01:28:17 'atlas migrate hash'
2023-08-17 01:28:17 
2023-08-17 01:28:17 to re-hash the contents and resolve the error
2023-08-17 01:28:17 
2023-08-17 01:28:17 Error: checksum mismatch

heres my docker compose file:

version: "3.8"

services:
  server:
    image: ghcr.io/divyam234/teldrive/server:latest
    restart: always
    container_name: server
    volumes:
      - ./sessions:/app/sessions
    env_file: .env
    ports:
      - 8080

  client:
    image: ghcr.io/divyam234/teldrive/client:latest
    restart: always
    container_name: client
    ports:
      - 3000

  nginx:
    image: nginx:alpine
    restart: always
    container_name: nginx
    volumes:
      - ./nginx_nossl.conf:/etc/nginx/conf.d/default.conf
    ports:
      - 8000:8000
    depends_on:
      - server
      - client
  migrate:
    image: arigaio/atlas:latest
    command: >
      migrate apply --url postgres://username:password@84.us-east-2.aws.neon.tech/neondb?search_path=public --allow-dirty 
    volumes:
      - ./database/migrations/:/migrations

@DirgaBrajamusti
Copy link
Author

i try to run migrate hash and then migrate apply now i can login but can't upload file. i don't know if this because broken migrate or something else
here is the log from server if you want to look at it

2023-08-17 01:28:36 [GIN] 2023/08/16 - 18:28:36 | 200 |   175.37278ms |      172.20.0.1 | GET      "/api/auth/session"
2023-08-17 01:28:36 [GIN] 2023/08/16 - 18:28:36 | 200 |  315.106783ms |      172.20.0.1 | GET      "/api/files?nextPageToken=&perPage=200&order=desc&path=%2F&sort=name&view=my-drive"
2023-08-17 01:28:52 [GIN] 2023/08/16 - 18:28:52 | 200 |        37.3µs |      172.20.0.1 | GET      "/api/auth/session"
2023-08-17 01:31:05 [GIN] 2023/08/16 - 18:31:05 | 500 |   316.90884ms |      172.20.0.1 | POST     "/api/auth/login"
2023-08-17 01:31:05 Error #01: failed to create or update user
2023-08-17 01:32:05 [GIN] 2023/08/16 - 18:32:05 | 200 |         3m12s |      172.20.0.1 | GET      "/api/auth/ws"
2023-08-17 01:32:05 2023/08/16 18:32:05 websocket: close 1006 (abnormal closure): unexpected EOF
2023-08-17 01:41:10 [GIN] 2023/08/16 - 18:41:10 | 200 |      27.701µs |      172.20.0.1 | GET      "/api/auth/session"
2023-08-17 01:41:35 [GIN] 2023/08/16 - 18:41:35 | 200 |   4.33655188s |      172.20.0.1 | POST     "/api/auth/login"
2023-08-17 01:41:35 2023/08/16 18:41:35 websocket: close 1001 (going away)
2023-08-17 01:41:35 [GIN] 2023/08/16 - 18:41:35 | 200 | 24.250754771s |      172.20.0.1 | GET      "/api/auth/ws"
2023-08-17 01:41:35 [GIN] 2023/08/16 - 18:41:35 | 200 |  140.214606ms |      172.20.0.1 | GET      "/api/auth/session"
2023-08-17 01:41:36 [GIN] 2023/08/16 - 18:41:36 | 200 |  563.303683ms |      172.20.0.1 | GET      "/api/files?nextPageToken=&perPage=200&order=desc&path=%2F&sort=name&view=my-drive"
2023-08-17 01:41:45 [GIN] 2023/08/16 - 18:41:45 | 200 |  316.883886ms |      172.20.0.1 | GET      "/api/files?nextPageToken=&perPage=200&order=desc&path=%2F&sort=name&view=my-drive"
2023-08-17 01:41:48 
2023-08-17 01:41:48 
2023-08-17 01:41:48 2023/08/16 18:41:48 [Recovery] 2023/08/16 - 18:41:48 panic recovered:
2023-08-17 01:41:48 runtime error: invalid memory address or nil pointer dereference
2023-08-17 01:41:48 /usr/local/go/src/runtime/panic.go:261 (0x44f7b7)
2023-08-17 01:41:48 /usr/local/go/src/runtime/signal_unix.go:861 (0x44f785)
2023-08-17 01:41:48 /app/services/upload.service.go:71 (0x135d18b)
2023-08-17 01:41:48 /app/routes/upload.go:34 (0x135ef45)
2023-08-17 01:41:48 /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x135eaae)
2023-08-17 01:41:48 /app/routes/middleware.go:34 (0x135ea9b)
2023-08-17 01:41:48 /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x1306f8a)
2023-08-17 01:41:48 /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/logger.go:172 (0x136f404)
2023-08-17 01:41:48 /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x1313e99)
2023-08-17 01:41:48 /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/recovery.go:102 (0x1313e87)
2023-08-17 01:41:48 /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x131303d)
2023-08-17 01:41:48 /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/logger.go:240 (0x131300c)
2023-08-17 01:41:48 /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x13120fa)
2023-08-17 01:41:48 /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620 (0x1311d8d)
2023-08-17 01:41:48 /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576 (0x13118bc)
2023-08-17 01:41:48 /usr/local/go/src/net/http/server.go:2938 (0x770a6d)
2023-08-17 01:41:48 /usr/local/go/src/net/http/server.go:2009 (0x76c953)
2023-08-17 01:41:48 /usr/local/go/src/runtime/asm_amd64.s:1650 (0x46b5e0)
2023-08-17 01:41:48 
2023-08-17 01:41:48 [GIN] 2023/08/16 - 18:41:48 | 500 |   65.704952ms |      172.20.0.1 | POST     "/api/uploads/a8c63b9953ee0412d7332deb49c28253f8816005?fileName=berkelana_data+%281%29.ipynb&partNo=1&totalparts=1"
2023-08-17 01:41:49 [GIN] 2023/08/16 - 18:41:49 | 200 |  313.621589ms |      172.20.0.1 | GET      "/api/files?nextPageToken=&perPage=200&order=desc&path=%2F&sort=name&view=my-drive"

@divyam234
Copy link
Owner

@DirgaBrajamusti Can you docker pull both images .Also make sure to make MULTI_CLIENT=false if you are not using bot clients.

truncate teldrive.files;
truncate teldrive.users;

Also you can clear tables on neon sql editor

@DirgaBrajamusti
Copy link
Author

Now the error is CHANNEL_INVALID, this is the respond from rose bot

User telegramname ID is 1*********.
The forwarded channel, this a channel, has an id of -1************.

i use the forwarded channel id right for CHANNEL_ID?
my .env

APP_ID=2
APP_HASH=8eb
CHANNEL_ID=-1************
JWT_SECRET=secret
DATABASE_URL=postgres://username:password@84.us-east-2.aws.neon.tech/neondb
MULTI_CLIENT=false
MULTI_TOKEN1=1816884349:***
MULTI_TOKEN2=1659583374:***
MULTI_TOKEN3=1403159233:***

server logs when after trying uploading files:

2023-08-17 02:09:36 [GIN] 2023/08/16 - 19:09:36 | 200 |    123.0022ms |      172.21.0.1 | GET      "/api/auth/session"
2023-08-17 02:09:37 [GIN] 2023/08/16 - 19:09:37 | 200 |  580.659196ms |      172.21.0.1 | GET      "/api/files?nextPageToken=&perPage=200&order=desc&path=%2F&sort=name&view=my-drive"
2023-08-17 02:09:38 [GIN] 2023/08/16 - 19:09:38 | 200 |  325.295562ms |      172.21.0.1 | GET      "/api/files?nextPageToken=&perPage=200&order=desc&path=%2F&sort=name&view=my-drive"
2023-08-17 02:09:40 2023-08-16T19:09:40.833Zinfoutils/tgclient.go:163started Client{"user": "DirgaBrajamusti"}
2023-08-17 02:09:40 [GIN] 2023/08/16 - 19:09:40 | 500 |   291.67659ms |      172.21.0.1 | POST     "/api/uploads/0d807fffa4cd028ce4d3f032f318771aa5c668fe?fileName=alist_backup_8_14_2023%2C+5_11_38+PM.json&partNo=1&totalparts=1"
2023-08-17 02:09:40 Error #01: failed to fetch channel: rpcDoRequest: rpc error code 400: CHANNEL_INVALID
2023-08-17 02:09:41 [GIN] 2023/08/16 - 19:09:41 | 200 |  323.514853ms |      172.21.0.1 | GET      "/api/files?nextPageToken=&perPage=200&order=desc&path=%2F&sort=name&view=my-drive"

@divyam234
Copy link
Owner

divyam234 commented Aug 16, 2023

@DirgaBrajamusti just remove -100 at the start.It should be 10 digits.You can use Rose bot also I have mentioned this in readme how to get channel id

@DirgaBrajamusti
Copy link
Author

removing -100, now it works. i'm gonna test this thanks
last question, why when i disable multi_client it works?

@divyam234
Copy link
Owner

divyam234 commented Aug 16, 2023

If you enable multi_client then you have to use bot tokens which is recommended to get faster downloaded speed. On single client your speed will be throttled to prevent flood errors.

@DirgaBrajamusti
Copy link
Author

get bot tokens and put the token in multi_token?

@divyam234
Copy link
Owner

yes make sure you give admin access to bots to make upload to work

@DirgaBrajamusti
Copy link
Author

i have them as admin. the upload still not work when multi_client is true

Untitled2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants