gorush icon indicating copy to clipboard operation
gorush copied to clipboard

certificate file does not exist

Open xnathanh opened this issue 8 years ago • 7 comments

get this error when try to run on docker seems like didnt use my own config.yml

[root@localhost gpush]# ${PWD}
-bash: /Volumes/api/gpush: Is a directory
[root@localhost gpush]# docker container rm 9b1547fd11082be4bb627dfa0003b0a9c2cae5410ea3ff48145987b15dd187a9
9b1547fd11082be4bb627dfa0003b0a9c2cae5410ea3ff48145987b15dd187a9
[root@localhost gpush]# docker run --name gorush -v ${PWD}/config.yml:/config.yml -p 30010:8088 appleboy/gorush
Using config file: /config.yml
time="2017/12/20 - 07:00:34" level=fatal msg="certificate file does not exist" 
[root@localhost gpush]# pwd
/Volumes/api/gpush
[root@localhost gpush]# ls
config.yml

xnathanh avatar Dec 20 '17 07:12 xnathanh

Where is your certificate file?

appleboy avatar Dec 20 '17 07:12 appleboy

[root@localhost apns]# ls
aps_development.cer CertificateName.p12 cert.pem key.pem
[root@localhost apns]# pwd
/Volumes/api/apns
[root@localhost gpush]# docker container rm f37cdcaca108388c0f5c96dde293855f1dbc365808b7906fec48bf92347e1e63
f37cdcaca108388c0f5c96dde293855f1dbc365808b7906fec48bf92347e1e63
[root@localhost gpush]# docker run --name gorush  -p 30010:8088 -v /Volumes/api/gpush/config.yml:/config.yml appleboy/gorush
Using config file: /config.yml
time="2017/12/20 - 07:10:05" level=fatal msg="certificate file does not exist"

here is the config.yml:

core:
  enabled: true # enabale httpd server
  address: "" # ip address to bind (default: any)
  port: "8088" # ignore this port number if auto_tls is enabled (listen 443).
  worker_num: 0 # default worker number is runtime.NumCPU()
  queue_num: 0 # default queue number is 8192
  max_notification: 100
  sync: false # set true if you need get error message from fail push notification in API response.
  mode: "release"
  ssl: false
  cert_path: "/Volumes/api/apns/cert.pem"
  key_path: "/Volumes/api/apns/key.pem"
  http_proxy: "" # only working for FCM server
  pid:
    enabled: false
    path: "gorush.pid"
    override: true
  auto_tls:
    enabled: false # Automatically install TLS certificates from Let's Encrypt.
    folder: ".cache" # folder for storing TLS certificates
    host: "" # which domains the Let's Encrypt will attempt

grpc:
  enabled: true # enabale gRPC server
  port: 9000

api:
  push_uri: "/api/push"
  stat_go_uri: "/api/stat/go"
  stat_app_uri: "/api/stat/app"
  config_uri: "/api/config"
  sys_stat_uri: "/sys/stats"
  metric_uri: "/metrics"
  health_uri: "/healthz"

android:
  enabled: false
  apikey: "YOUR_API_KEY"
  max_retry: 0 # resend fail notification, default value zero is disabled

ios:
  enabled: true
  key_path: "/Volumes/api/apns/key.pem"
  password: "xxxx" # certificate password, default as empty string.
  production: false
  max_retry: 0 # resend fail notification, default value zero is disabled
  key_id: "xxxx" # KeyID from developer account (Certificates, Identifiers & Profiles -> Keys)
  team_id: "xxxx" # TeamID from developer account (View Account -> Membership)

log:
  format: "string" # string or json
  access_log: "stdout" # stdout: output to console, or define log path like "log/access_log"
  access_level: "debug"
  error_log: "stderr" # stderr: output to console, or define log path like "log/error_log"
  error_level: "error"
  hide_token: true

stat:
  engine: "memory" # support memory, redis, boltdb, buntdb or leveldb
  redis:
    addr: "localhost:6379"
    password: "xxxx"
    db: 15
  boltdb:
    path: "bolt.db"
    bucket: "gorush"
  buntdb:
    path: "bunt.db"
  leveldb:
    path: "level.db"

xnathanh avatar Dec 20 '17 07:12 xnathanh

docker run --name gorush  -p 30010:8088 \
  -v /Volumes/api/apns:/Volumes/api/apns \
  -v /Volumes/api/gpush/config.yml:/config.yml \
  appleboy/gorush

Try it.

appleboy avatar Dec 20 '17 08:12 appleboy

then i got error:

time="2017/12/20 - 08:08:21" level=error msg="Cert Error:failed to parse PKCS1 private key"

xnathanh avatar Dec 20 '17 08:12 xnathanh

This is not the gorush problem. Please see the document as below.

https://medium.com/@ankushaggarwal/generate-apns-certificate-for-ios-push-notifications-85e4a917d522

appleboy avatar Dec 20 '17 08:12 appleboy

thanks,got you ,gorush allow to use .p12,that's cool,is working now.

xnathanh avatar Dec 20 '17 08:12 xnathanh

@xnathanh Gorush also supported .p8 format.

appleboy avatar Dec 20 '17 08:12 appleboy