2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Growiの挙動まとめ

Last updated at Posted at 2019-11-08

バージョン

GROWI 3.2.7-RC

IP制限

80番ポート

apacheからリバースプロキシでやっているので、
vhosts.confに追加

<VirtualHost *:80>
    ServerName growi.example.com
    ProxyPass / http://growi.example.com:3000/
    ProxyPassReverse / http://growi.example.com:3000/
    <Location />
        Require all denied
        Require ip xxx.xxx.xxx.xxx
        Require ip xxx.xxx.xxx.xxx
    </Location>
</VirtualHost>

3000番ポート

nodeが動いているのでnodeで制限した。

参考:http://dotnsf.blog.jp/archives/1066182158.html

npm install express-ipfilter

※インストールするとなぜか他のモジュールが削除された。yarnするとなおった。

src/server/crowi/express-init.js

    , Config = crowi.model('Config')
    , User = crowi.model('User')
    , ipfilter = require('express-ipfilter').IpFilter  // 追加
    ;

  var ips = ['127.0.0.1', 'xxx.xxx.xxx.xxx'];  // 追加
  app.use(ipfilter(ips, {mode: 'allow'}));  // 追加

  const lngDetector = new i18nMiddleware.LanguageDetector();
  lngDetector.addDetector(i18nUserSettingDetector);
systemctl restart growi

nodeにapache経由でアクセスするとプロキシなのでIPがサーバのIPになっている。
それを利用して、サーバのIPのみ許可することでapache経由でのみアクセスできるようにした。

http://xxx.xxx.xxx.xxx:3000/
Forbiddenになる。

ログインしてない人に閲覧のみ許可する設定をした場合

公開範囲がpublicの記事がすべて閲覧可能になる。
※Anyone with the linkの記事はリンクを教えても見れなかった。

Anyone with the linkの挙動

上記にも書いたが、

  • ログインしてない人
    • 見れない
  • ログインしている人
    • トップページの一覧には無いが、直リンから見れる
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?