Skip to content

Commit 8df0af2

Browse files
committed
Merge branch 'release/v2.1.0'
2 parents 1072916 + 4536796 commit 8df0af2

557 files changed

Lines changed: 24121 additions & 18854 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/docker-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Installing PHP
1414
uses: shivammathur/setup-php@master
1515
with:
16-
php-version: '8.1'
16+
php-version: '8.2'
1717
- name: Get Composer Cache Directory 2
1818
id: composer-cache
1919
run: |

.github/workflows/docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Installing PHP
1414
uses: shivammathur/setup-php@master
1515
with:
16-
php-version: '8.1'
16+
php-version: '8.2'
1717
- name: Get Composer Cache Directory 2
1818
id: composer-cache
1919
run: |

.github/workflows/phpunit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Installing PHP
1414
uses: shivammathur/setup-php@master
1515
with:
16-
php-version: '8.1'
16+
php-version: '8.2'
1717
- name: Get Composer Cache Directory 2
1818
id: composer-cache
1919
run: |
@@ -75,7 +75,7 @@ jobs:
7575
- name: Installing PHP
7676
uses: shivammathur/setup-php@master
7777
with:
78-
php-version: '8.1'
78+
php-version: '8.2'
7979
- name: Get Composer Cache Directory 2
8080
id: composer-cache
8181
run: |

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ composer.phar
1414
/.phpunit.result.cache
1515
/packages
1616
/.php_cs.cache
17+
./.php-cs-fixer.cache
18+
./*.cache

CONTRIBUTING.md

Lines changed: 0 additions & 45 deletions
This file was deleted.

Dockerfile

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
### Extensions
2-
FROM php:8.1-apache as extensions
2+
FROM php:8.2-apache as extensions
33

44
LABEL stage=intermediate
55

@@ -54,41 +54,48 @@ opcache.fast_shutdown=0\n\
5454
' >> /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini
5555

5656
### Composer
57-
FROM php:8.1-apache as api
57+
FROM php:8.2-apache as api
5858

5959
COPY --from=extensions /usr/local/etc/php/conf.d/docker-php-ext-bcmath.ini /usr/local/etc/php/conf.d/docker-php-ext-bcmath.ini
6060
COPY --from=extensions /usr/local/etc/php/conf.d/docker-php-ext-intl.ini /usr/local/etc/php/conf.d/docker-php-ext-intl.ini
61-
COPY --from=extensions /usr/local/lib/php/extensions/no-debug-non-zts-20210902/intl.so /usr/local/lib/php/extensions/no-debug-non-zts-20210902/intl.so
62-
COPY --from=extensions /usr/local/lib/php/extensions/no-debug-non-zts-20210902/bcmath.so /usr/local/lib/php/extensions/no-debug-non-zts-20210902/bcmath.so
61+
COPY --from=extensions /usr/local/lib/php/extensions/no-debug-non-zts-20220829/intl.so /usr/local/lib/php/extensions/no-debug-non-zts-20220829/intl.so
62+
COPY --from=extensions /usr/local/lib/php/extensions/no-debug-non-zts-20220829/bcmath.so /usr/local/lib/php/extensions/no-debug-non-zts-20220829/bcmath.so
6363

6464
LABEL stage=intermediate
6565

6666
WORKDIR /api
6767

6868
# install git
69-
RUN apt-get update && \
69+
RUN set -eux; \
70+
chown www-data:www-data /api; \
71+
apt-get update && \
7072
apt-get install -y zip unzip git
7173

72-
COPY composer.json composer.lock /api/
74+
COPY --chown=www-data:www-data composer.json composer.lock /api/
7375

74-
COPY --from=composer /usr/bin/composer /usr/bin/composer
76+
COPY --chmod=777 --from=composer /usr/bin/composer /usr/bin/composer
7577

76-
RUN /usr/bin/composer install --no-dev \
78+
USER www-data
79+
80+
RUN set -eux; \
81+
/usr/bin/composer install --no-dev \
7782
--ignore-platform-reqs \
7883
--no-ansi \
7984
--no-autoloader \
8085
--no-interaction \
8186
--no-scripts
8287

83-
COPY / /api
88+
COPY --chown=www-data:www-data / /api
8489

8590
RUN rm -rf storage/app/api/scunpacked-data
8691
RUN git clone https://github.com/StarCitizenWiki/scunpacked-data --branch=master --depth=1 storage/app/api/scunpacked-data
8792

8893
RUN /usr/bin/composer dump-autoload --optimize --classmap-authoritative
8994

9095
### Final Image
91-
FROM php:8.1-apache
96+
FROM php:8.2-apache
97+
98+
USER root
9299

93100
RUN apt-get update && \
94101
apt-get install -y --no-install-recommends \
@@ -99,27 +106,25 @@ RUN apt-get update && \
99106

100107
WORKDIR /var/www/html
101108

102-
COPY --from=api /api /var/www/html
109+
COPY --chown=www-data:www-data --from=api /api /var/www/html
103110
COPY ./docker/vhost.conf /etc/apache2/sites-available/000-default.conf
104-
COPY ./docker/start.sh /usr/local/bin/start
111+
COPY --chown=www-data:www-data --chmod=770 ./docker/start.sh /usr/local/bin/start
105112

106113
COPY --from=extensions /usr/local/etc/php/conf.d/*.ini /usr/local/etc/php/conf.d/
107-
COPY --from=extensions /usr/local/lib/php/extensions/no-debug-non-zts-20210902/*.so /usr/local/lib/php/extensions/no-debug-non-zts-20210902/
114+
COPY --from=extensions /usr/local/lib/php/extensions/no-debug-non-zts-20220829/*.so /usr/local/lib/php/extensions/no-debug-non-zts-20220829/
108115

109116
RUN sed -i -e "s/extension=zip.so/;extension=zip.so/" /usr/local/etc/php/conf.d/docker-php-ext-zip.ini && \
110117
echo 'memory_limit = 512M' >> /usr/local/etc/php/conf.d/docker-php-memlimit.ini && \
111118
echo 'max_execution_time = 60' >> /usr/local/etc/php/conf.d/docker-php-executiontime.ini
112119

113-
COPY ./docker/schedule.sh /usr/local/bin/schedule
120+
COPY --chown=www-data:www-data --chmod=770 ./docker/schedule.sh /usr/local/bin/schedule
114121

115-
RUN chown -R www-data:www-data /var/www/html; \
116-
chmod u+x /usr/local/bin/start; \
117-
chmod -R u+w /var/www/html/storage; \
118-
chmod -R g+w /var/www/html/storage; \
119-
chown www-data:www-data /usr/local/bin/schedule; \
120-
chmod +x /usr/local/bin/schedule; \
122+
RUN chmod -R u+w,g+w /var/www/html/storage; \
121123
a2enmod rewrite
122124

123-
USER root
125+
USER www-data
126+
127+
RUN php artisan storage:link; \
128+
php artisan optimize
124129

125130
CMD ["/usr/local/bin/start"]
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?php
2+
3+
namespace App\Console\Commands;
4+
5+
use Illuminate\Console\Command;
6+
use Illuminate\Database\Query\Builder;
7+
use Illuminate\Support\Facades\DB;
8+
9+
class CopyTranslationData extends Command
10+
{
11+
/**
12+
* The name and signature of the console command.
13+
*
14+
* @var string
15+
*/
16+
protected $signature = 'unpacked:copy-translations';
17+
18+
/**
19+
* The console command description.
20+
*
21+
* @var string
22+
*/
23+
protected $description = 'Copies german translations to the new sc_item_translations table.';
24+
25+
/**
26+
* Execute the console command.
27+
*
28+
* @return int
29+
*/
30+
public function handle(): int
31+
{
32+
DB::table('sc_item_translations')->insertUsing(
33+
['locale_code', 'item_uuid', 'translation', 'updated_at', 'created_at'],
34+
function (Builder $query) {
35+
$query->select([
36+
'star_citizen_unpacked_item_translations.locale_code',
37+
'star_citizen_unpacked_item_translations.item_uuid',
38+
'star_citizen_unpacked_item_translations.translation',
39+
'star_citizen_unpacked_item_translations.updated_at',
40+
'star_citizen_unpacked_item_translations.created_at'
41+
])
42+
->from('star_citizen_unpacked_item_translations')
43+
->where('star_citizen_unpacked_item_translations.locale_code', 'de_DE')
44+
->leftJoin(
45+
'sc_item_translations',
46+
'sc_item_translations.locale_code',
47+
'=',
48+
'star_citizen_unpacked_item_translations.locale_code'
49+
)
50+
->whereNull('sc_item_translations.item_uuid');
51+
}
52+
);
53+
54+
return Command::SUCCESS;
55+
}
56+
}

app/Console/Commands/PopulateData.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,8 @@ public function handle()
5656
$this->bar->advance();
5757

5858
if (!$this->option('skipScUnpacked')) {
59-
Artisan::call('unpacked:import-shop-items');
60-
Artisan::call('unpacked:import-char-armor');
61-
Artisan::call('unpacked:import-weapon-attachments');
62-
Artisan::call('unpacked:import-weapon-personal');
63-
Artisan::call('unpacked:import-ship-items');
64-
Artisan::call('unpacked:import-vehicles');
65-
Artisan::call('unpacked:import-clothing');
59+
Artisan::call('sc:import-items');
60+
Artisan::call('sc:import-shops');
6661
}
6762
$this->bar->finish();
6863

app/Console/Commands/Rsi/CommLink/Download/ReDownloadCommLinks.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function handle(): int
4646
[
4747
new ImportCommLinks(-1),
4848
]
49-
)->dispatch($skip);
49+
)->onQueue('redownload_comm_links')->dispatch($skip);
5050

5151
return 0;
5252
}

app/Console/Commands/Rsi/CommLink/Import/ImportCommLink.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Illuminate\Console\Command;
1010
use Illuminate\Database\Eloquent\ModelNotFoundException;
1111
use Illuminate\Support\Arr;
12+
use Illuminate\Support\Facades\Artisan;
1213
use Illuminate\Support\Facades\Storage;
1314

1415
class ImportCommLink extends Command
@@ -39,9 +40,10 @@ public function handle(): int
3940
try {
4041
$commLink = CommLink::query()->where('cig_id', $id)->firstOrFail();
4142
} catch (ModelNotFoundException $e) {
42-
$this->error('Comm-Link does not exist in DB.');
43-
44-
return 1;
43+
return Artisan::call('comm-links:download', [
44+
'id' => $id,
45+
'--import' => true
46+
]);
4547
}
4648

4749
if (count(Storage::disk('comm_links')->files($id)) === 0) {

0 commit comments

Comments
 (0)