-
Notifications
You must be signed in to change notification settings - Fork 4
/
devjournal
135 lines (90 loc) · 6.12 KB
/
devjournal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
========================================================
2017/09/03 takeshi:
Here is how redmine was installed on Ubuntu 14.04 Desktop for development:
export RAILS_ENV=development
apt-get install -y mysql-server
mysql -u root -p -e "CREATE DATABASE redmine_development CHARACTER SET utf8; CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'redmine'; GRANT ALL PRIVILEGES ON redmine_development.* TO 'redmine'@'localhost';"
cd src/git
git clone https://github.com/redmine/redmine
cd redmine
# redmine commit 6455e0431f04441a8833f100b35f8d9741292185
cp config/database.yml.example config/database.yml
sed -i 's/username: root/username: redmine/g' config/database.yml
sed -i 's/password: ""/password: redmine/g' config/database.yml
sudo -E apt-add-repository ppa:brightbox/ruby-ng
sudo apt-get update
sudo -E apt-get install -y ruby2.4 ruby2.4-dev
sudo apt-get install -y imagemagick
sudo apt-get install -y libmagickcore5
sudo apt-get install -y libmagickcore-dev
sudo apt-get install -y libmagickwand-dev
sudo -E gem install rmagick -v '2.16.0'
sudo -E gem install bundler
bundle install # input sudo password when asked.
bundle exec rake generate_secret_token
bundle exec rake db:migrate
REDMINE_LANG=en bundle exec rake redmine:load_default_data
sudo useradd redmine -U
sudo mkdir -p tmp tmp/pdf public/plugin_assets
sudo chown -R redmine:redmine files log tmp public/plugin_assets
sudo chmod -R 755 files log tmp public/plugin_assets
Then to start redmine:
sudo bundle exec rails server webrick -e development -b 0.0.0.0
After the above I accessed http://localhost:3000/ in the browser and set admin pass to 11111111.
===================================================================================
2017/09/03 takeshi:
To generate boilerplate code for the plugin, i did:
sudo -E bundle exec ruby bin/rails generate redmine_plugin redmine_rt
Then I needed to install redis-server:
sudo apt-get install -y redis-server
And add this to redmine_rt/Gemfile:
gem 'redis', '~> 3.0'
Then updated:
bundle
========================================================
2022/12/29 takeshi:
To write logs to STDOUT when using '-e production' set RAILS_LOG_TO_STDOUT.
This is necessary for example to check issues with zeitwerk when issues only happen in production mode but not in development mode.
Ex:
[root@lab225201-basix redmine]$ RAILS_LOG_TO_STDOUT=1 bundle exec rails server -e production -b 0.0.0.0
...ABRIDGED ...
I, [2022-12-29T15:41:44.985142 #2404616] INFO -- : Registered connection (Z2lkOi8vcmVkbWluZS1hcHAvVXNlci8x)
I, [2022-12-29T15:41:45.039131 #2404616] INFO -- : Channel is streaming from issue:2
I, [2022-12-29T15:41:46.381898 #2404616] INFO -- : [73b8e8a6-16cf-4380-b26b-1db51afcc44a] Started PUT "/issues/2/add_quick_notes" for 192.168.181.113 at 2022-12-29 15:41:46 +0900
F, [2022-12-29T15:41:46.391644 #2404616] FATAL -- : [73b8e8a6-16cf-4380-b26b-1db51afcc44a]
[73b8e8a6-16cf-4380-b26b-1db51afcc44a] AbstractController::ActionNotFound (The action 'add_quick_notes' could not be found for IssuesController
Did you mean? parse_sections
query_hidden_tags
due_date_distance_in_words
paginate):
========================================================
2022/12/29 takeshi:
Regarding #13, it seems it is not possible for a tab to set focus to itself.
So for now we are just opening tabs even if a tab with the url already exists.
========================================================
2022/12/30 takeshi:
Things attempted when trying to implement focus on existing tab for #13:
- According to docs (https://developer.mozilla.org/en-US/docs/Web/API/Window/focus), window.focus() might work if allowed by user configuration. So it is not usable as it is better to open tabs even if duplicated instead of not focusing at all.
- pass reference of current issue tab to the realtime tab with: BroadcastChannel.postMessage({window: window, ...}) so that realtime tab could try to do msg.window.focus().
This fails with:
issue_channel.js?1672351776:16 Uncaught DOMException: Failed to execute 'postMessage' on 'BroadcastChannel': #<Window> could not be cloned.
- use alert() to see if it force focus on the current window: it doesn't work
========================================================
2022/12/30 takeshi:
Sample curl command to popup issue:
curl -v -x '' -u YOUR_API_TOKEN:dummy -X POST -H 'Content-Type: application/json' http://0.0.0.0:3000/channels/user:admin/post_msg.json -d '{"command": "open_url", "data": {"url": "http://192.168.225.201:3000/issues/2"}}'
========================================================
2023/04/19 takeshi:
Regarding render_parent:
https://github.com/anteo/render-parent
https://www.redmine.org/boards/3/topics/33949
we used it in the past to generate javascript tags for issue view to open websocket connection.
So in app/views/issues/show.html.erb we would have our javascript and then a call to render_parent to render the original issue view.
However, it was reported (#20) that plugins Additionals and Additional Tags could not be used due to conflict with deface version 1.8.1 used by these plugins and the one used by redmine_base_deface (1.6.2).
So, I tried modifying redmine_base_deface/PluginGemfile with:
gem 'deface', '1.8.1'
but this caused our render_parent approch to stop working.
However, eventually I managed to make all the necessary changes using
app/overrides/issues/show.rb
and app/views/issues/show.html.erb was not needed anymore.
So I removed render_parent from Gemfile.