2022年12月28日 星期三

Docker embedded DNS

 1. 

在docker 1.10版本中,docker daemon實現了一個叫做embedded DNS server的東西,用來當你建立的容器滿足以下條件時:

  • 使用自定義網路;
  • 容器建立時候通過--name,--network-alias or --link提供了一個name;

https://philipzheng.gitbook.io/docker_practice/advanced_network/dns

https://www.796t.com/content/1549334006.html


2. Good

nameserver 127.0.0.11
options ndots:0

nslookup c2 127.0.0.11

https://zjuturtle.com/2017/11/22/docker-network/


3. office embeedded dns

https://docs.docker.com.zh.xy2401.com/v17.09/engine/userguide/networking/configure-dns/


4. Install dns

https://medium.com/nagoya-foundation/running-a-dns-server-in-docker-61cc2003e899

https://stackoverflow.com/questions/73227593/how-to-set-bind9-docker-container-as-dns-of-other-container

https://ithelp.ithome.com.tw/users/20067006/ironman/3369?page=3

2022年12月21日 星期三

CA container smll-ca

 https://hub.docker.com/r/smallstep/step-ca

vi usage

 https://dywang.csie.cyut.edu.tw/dywang/rhcsaNote/node23.html

nginx 變數與語法與範例

 # Map

http://shouce.jb51.net/nginx-doc/Text/3.18_map.html

https://www.astralweb.com.tw/how-to-set-map-on-nginx/


# 語法

https://blog.learn-or-die.com/zh-tw/nginx/

https://linuxhint.com/nginx-location-regex-examples/

# good

https://segmentfault.com/a/1190000013267839


# 認識 Header

CSP

https://medium.com/hannah-lin/content-security-policy-csp-%E5%B9%AB%E4%BD%A0%E7%B6%B2%E7%AB%99%E5%88%97%E7%99%BD%E5%90%8D%E5%96%AE%E5%90%A7-df38c990f63c


#Variable

https://www.javatpoint.com/nginx-variables

http://nginx.org/en/docs/varindex.html


#Log

https://www.digitalocean.com/community/tutorials/nginx-access-logs-error-logs



# Bug

# authentication 404 

https://nova.moe/grafana-basic-auth/

https://nginx.org/en/docs/http/ngx_http_auth_basic_module.html#auth_basic


#nginx 與 php-fpm 運作介紹與設定

https://tec.xenby.com/20-nginx-%E8%88%87-php-fpm-%E9%81%8B%E4%BD%9C%E4%BB%8B%E7%B4%B9%E8%88%87%E8%A8%AD%E5%AE%9A%E8%AC%9B%E8%A7%A3


# 重導範例 1

rewrite ^/welcome $the_scheme://$the_host redirect;

location = / {
return 404;
}


# 加入 Header 在 proxy_pass 範例

location / {
add_header Access-Control-Allow-Origin *;
                proxy_pass http://drive-nextcloud/;
proxy_read_timeout 600;

                add_header X-server-header "test" always;
                add_header Strict-Transport-Security "max-age=15552000; includeSubDomains" always;
                add_header X-Download-Options       "noopen"        always;
        }

https://stackoverflow.com/questions/14501047/how-to-add-a-response-header-on-nginx-when-using-proxy-pass

# nginx 可以學習

https://ithelp.ithome.com.tw/articles/10241034

https://ithelp.ithome.com.tw/articles/10280441



2022年12月15日 星期四

nextcloud onlyoffice

## nextcloud3 intro

https://nextcloud.com/blog/announcing-nextcloud-hub-3-brand-new-design-and-photos-2-0-with-editor-and-ai/

 

# nextcloud mismulus

https://ithelp.ithome.com.tw/articles/10297375?sc=iThelpR


# nextcloud apps

https://apps.nextcloud.com/


#nextcloud version

https://hub.docker.com/_/nextcloud/


# nextcloud install

https://www.asustor.com/zh-tw/online/College_topic?topic=273

https://ithelp.ithome.com.tw/articles/10240195


# nextcloud trust domain 

Trusted domains are used by Nextcloud to prevent Host Header Poisoning. You need to specify every domain at which your Nextcloud can be accessed. This means if you have Nextcloud installed at “192.168.0.29” and also want it to be accessible at “cloud.example.com” you’d need to modify the trusted_domains entry in your config/config.php. The initial config would look like the following: 'trusted_domains' => array ( 0 => '192.168.0.29', ), To add a new domain just add new entries by ap…

https://help.nextcloud.com/t/ubuntu-server-trusted-domains/80534

https://www.hacksplaining.com/prevention/host-header-poisoning

https://www.sjoerdlangkemper.nl/2017/09/13/attacks-on-host-header/

https://portswigger.net/web-security/host-header


# docker-onlyoffice-nextcloud/docker-compose.yml

https://github.com/ONLYOFFICE/docker-onlyoffice-nextcloud/blob/master/docker-compose.yml


# user basic auth

https://github.com/nextcloud/user_external#readme

https://github.com/nextcloud/user_external#readme

https://github.com/nextcloud/user_external/blob/master/lib/BasicAuth.php

https://stackoverflow.com/questions/42365264/nextcloud-external-login-for-users-in-another-database

https://www.digitalocean.com/community/tutorials/how-to-set-up-password-authentication-with-apache-on-ubuntu-14-04

https://github.com/nextcloud/desktop/issues/2046

https://github.com/nextcloud/user_external/tree/master/lib

https://help.nextcloud.com/t/issues-with-basic-auth-on-parent-directory/26112

https://help.nextcloud.com/t/issues-with-basic-auth-on-parent-directory/26112




###################################################

# only office

########################################################

setting: https://helpcenter.onlyoffice.com/gettingstarted/integration/Nextcloud.aspx


onlyoffice: https://github.com/ONLYOFFICE/DocumentServer


#fig:

https://api.onlyoffice.com/editors/nextcloud


# onlyoffice nextcloud setting or install

https://helpcenter.onlyoffice.com/gettingstarted/integration/Nextcloud.aspx

https://www.onlyoffice.com/office-for-nextcloud.aspx

https://hub.docker.com/r/onlyoffice/documentserver



#nx folder:

https://help.nextcloud.com/t/werent-there-files-directories-that-require-the-www-data-www-data-to-be-the-owner/66811


# nextcloud source code

https://github.com/nextcloud/server

https://github.com/ONLYOFFICE/DocumentServer/tags


# nextcloud https  and http mix

https://bayton.org/docs/nextcloud/nexcloud-behind-a-proxy-fixing-mixed-content-warnings-with-ssl/


#token

https://api.onlyoffice.com/editors/signature/


#test nextcloud

https://nx.armor.hinet.net/status.php


#nextcloud passwd

https://xenby.com/b/103-%E6%95%99%E5%AD%B8%E5%B0%8D%E7%B6%B2%E9%A0%81%E5%95%9F%E7%94%A8%E5%AF%86%E7%A2%BC%E9%A9%97%E8%AD%89-nginx


# onlyoffice jwt setting (try but no work)

https://help.nextcloud.com/t/onlyoffice-secret-key-issue/56464/12

https://helpcenter.onlyoffice.com/installation/docs-configure-jwt.aspx


# onlyoffice nginx proxy

https://github.com/ONLYOFFICE/document-server-proxy/tree/master/nginx

https://aarondevelops.com/nextcloud-onlyoffice/

https://www.jianshu.com/p/3f99d45fb4b8


#onlyoffice https self

https://linuxhandbook.com/nextcloud-onlyoffice/


#onlyoffice docker environment

https://helpcenter.onlyoffice.com/installation/groups-https-docker.aspx

https://helpcenter.onlyoffice.com/installation/docs-community-install-docker.aspx



# onlyoffice nginx https - tick [unreachable ]

https://github.com/ONLYOFFICE/docker-onlyoffice-nextcloud/issues/22

https://community.nethserver.org/t/onlyoffice-cannot-be-reached/20196/10

https://forum.onlyoffice.com/t/onlyoffice-cannot-be-reached-please-contact-admin/1199

https://help.nextcloud.com/t/nextcloud-18-onlyoffice-cannot-be-reached-please-contact-admin/80869

# mix content

https://github.com/ONLYOFFICE/onlyoffice-nextcloud/issues/81


# onlyoffice with nextcloud container

https://www.jianshu.com/p/fc3a2697e11d


#onlyoffce decative welcome page

https://forum.onlyoffice.com/t/hide-deactivate-welcome-page/566


# Onlyoffice License and function

https://github.com/ONLYOFFICE/docker-onlyoffice-nextcloud


# Onlyoffice nginx exampe

https://github.com/ONLYOFFICE/docker-onlyoffice-nextcloud/blob/66ef6e9ff93aba2066e298163f0c2673d4f98df8/nginx.conf#L91


2022年12月8日 星期四

rabbitmq add user

 1. user command line

  • rabbitmqctl add_user daniel daniel
  • rabbitmqctl set_user_tags daniel administrator
  • rabbitmqctl set_permissions -p / daniel ".*" ".*" ".*"

2. ref
https://stackoverflow.com/questions/40436425/how-do-i-create-or-add-a-user-to-rabbitmq
https://stackoverflow.com/questions/24639448/rabbitmq-set-permissions-syntax